Olivetti M19 internal video now supports RGB type selection.

This commit is contained in:
OBattler
2021-07-15 02:52:45 +02:00
parent f9a1971f48
commit fd1f741db9

View File

@@ -529,6 +529,8 @@ m19_vid_speed_changed(void *priv)
static void
m19_vid_init(m19_vid_t *vid)
{
device_context(&vid_pc2086_device);
/* int display_type; */
vid->mode = OLIVETTI_OGC_MODE;
@@ -540,23 +542,23 @@ m19_vid_init(m19_vid_t *vid)
loadfont_ex("roms/machines/m19/BIOS.BIN", 1, 90);
/* composite is not working yet */
vid->ogc.cga.composite = 0; // (display_type != CGA_RGB);
/* vid->ogc.cga.snow_enabled = device_get_config_int("snow_enabled"); */
vid->ogc.cga.revision = device_get_config_int("composite_type");
vid->ogc.cga.snow_enabled = device_get_config_int("snow_enabled");
vid->ogc.cga.vram = malloc(0x8000);
/* cga_comp_init(vid->ogc.cga.revision); */
/* vid->ogc.cga.rgb_type = device_get_config_int("rgb_type"); */
/* cga_palette = (vid->ogc.cga.rgb_type << 1); */
cga_palette = 0;
vid->ogc.cga.rgb_type = device_get_config_int("rgb_type");
cga_palette = (vid->ogc.cga.rgb_type << 1);
cgapal_rebuild();
ogc_mdaattr_rebuild();
/* color display */
/* if (device_get_config_int("rgb_type")==0 || device_get_config_int("rgb_type") == 4) */
vid->ogc.mono_display = 1;
/* else */
/* vid->ogc.mono_display = 1; */
if (device_get_config_int("rgb_type")==0 || device_get_config_int("rgb_type") == 4)
vid->ogc.mono_display = 0;
else
vid->ogc.mono_display = 1;
/* OGC emulation part end */
/* Plantronics emulation part begin*/
@@ -576,6 +578,8 @@ m19_vid_init(m19_vid_t *vid)
io_sethandler(0x03d0, 0x0010, m19_vid_in, NULL, NULL, m19_vid_out, NULL, NULL, vid);
vid->mode = OLIVETTI_OGC_MODE;
device_context_restore();
}
@@ -589,6 +593,37 @@ const device_t m24_kbd_device = {
{ NULL }, NULL, NULL
};
const device_config_t m19_vid_config[] =
{
{
/* Olivetti / ATT compatible displays */
"rgb_type", "RGB type", CONFIG_SELECTION, "", CGA_RGB, "", { 0 },
{
{
"Color", 0
},
{
"Green Monochrome", 1
},
{
"Amber Monochrome", 2
},
{
"Gray Monochrome", 3
},
{
""
}
}
},
{
"snow_enabled", "Snow emulation", CONFIG_BINARY, "", 1,
},
{
"", "", -1
}
};
const device_t m19_vid_device = {
"Olivetti M19 graphics card",
0, 0,
@@ -596,7 +631,7 @@ const device_t m19_vid_device = {
{ NULL },
m19_vid_speed_changed,
NULL,
NULL
m219_vid_config
};
const device_t *