diff --git a/src/vid_et4000.c b/src/vid_et4000.c index dbeb681..882da42 100644 --- a/src/vid_et4000.c +++ b/src/vid_et4000.c @@ -21,6 +21,18 @@ typedef struct et4000_t uint8_t banking; } et4000_t; +static uint8_t crtc_mask[0x40] = +{ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0x0f, 0xff, 0xff, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + void et4000_out(uint16_t addr, uint8_t val, void *p) { et4000_t *et4000 = (et4000_t *)p; @@ -32,7 +44,7 @@ void et4000_out(uint16_t addr, uint8_t val, void *p) addr ^= 0x60; // pclog("ET4000 out %04X %02X\n", addr, val); - + switch (addr) { case 0x3C6: case 0x3C7: case 0x3C8: case 0x3C9: @@ -51,6 +63,7 @@ void et4000_out(uint16_t addr, uint8_t val, void *p) case 0x3D5: if (svga->crtcreg <= 7 && svga->crtc[0x11] & 0x80) return; old = svga->crtc[svga->crtcreg]; + val &= crtc_mask[svga->crtcreg]; svga->crtc[svga->crtcreg] = val; if (old != val) {