Olivetti M19's video adapter has control register on port 3DBh instead of 3DEh, fixes #4739.

This commit is contained in:
OBattler
2024-08-30 07:52:55 +02:00
parent fe4ad0d4e1
commit 91cf90c63a
3 changed files with 12 additions and 4 deletions

View File

@@ -23,6 +23,7 @@
typedef struct ogc_t { typedef struct ogc_t {
cga_t cga; cga_t cga;
uint16_t ctrl_addr;
/* unused in OGC, required for M19 video card structure idiom */ /* unused in OGC, required for M19 video card structure idiom */
uint8_t ctrl_3dd; uint8_t ctrl_3dd;
uint8_t ctrl_3de; uint8_t ctrl_3de;

View File

@@ -2038,6 +2038,8 @@ m19_vid_init(m19_vid_t *vid)
vid->ogc.mono_display = 0; vid->ogc.mono_display = 0;
else else
vid->ogc.mono_display = 1; vid->ogc.mono_display = 1;
vid->ogc.ctrl_addr = 0x3db;
/* OGC emulation part end */ /* OGC emulation part end */
/* Plantronics emulation part begin*/ /* Plantronics emulation part begin*/

View File

@@ -97,11 +97,14 @@ ogc_out(uint16_t addr, uint8_t val, void *priv)
cga_out(addr, val, &ogc->cga); cga_out(addr, val, &ogc->cga);
break; break;
case 0x3db:
case 0x3de: case 0x3de:
if (addr == ogc->ctrl_addr) {
/* set control register */ /* set control register */
ogc->ctrl_3de = val; ogc->ctrl_3de = val;
/* select 1st or 2nd 16k vram block to be used */ /* select 1st or 2nd 16k vram block to be used */
ogc->base = (val & 0x08) ? 0x4000 : 0; ogc->base = (val & 0x08) ? 0x4000 : 0;
}
break; break;
default: default:
@@ -622,6 +625,8 @@ ogc_init(UNUSED(const device_t *info))
else else
ogc->mono_display = 1; ogc->mono_display = 1;
ogc->ctrl_addr = 0x3de;
return ogc; return ogc;
} }