CGA mode select register (3D8h) inaccuracy
Posted: Wed 02 Jan, 2019 4:30 pm
While playing with some display-related code I noted a couple of discrepancies between PCem v14 and the real hardware. Both have to do with CGA register 3D8h, specifically bit 3 (+VIDEO):
- If this bit is modified in mid-frame, on an IBM CGA board the change takes effect immediately (at the current beam position).
This is similar to how certain games modify the color select register (3D9h) for extended-palette tricks, as in California Games or Frogger. PCem emulates this behavior for 3D9h, but not for 3D8h as far as I can tell.
- If data is sent to the CRTC while this bit is set to 0 (video off), PCem seems to turn the video back on, as if it was set to 1.
I haven't ascertained exactly which CRTC registers trigger this behavior when written, but that doesn't happen on (IBM) CGA hardware, where there's no interdependence between the registers on the MC6845 and the CGA 'proper'.