First post, by superfury
I'm trying to get the CGA emulation submode (simple responses to CGA registers while emulating the VGA to get 8088 MPH working) working without destroying the VGA emulation itself.
Currently writes to the CGA mode control register with bits 6&7 cleared enable the CGA emulation. When one/both of those bits are set, VGA is emulated normally. Enabled CGA emulation(on top of the VGA emulation) forces the renderer to render like it's using double scanning. This fixes some bugs in 8088 MPH(like the screen with 3D objects(pyramid, cube and donut) only using half the screen(bottom half junk copies of display), becoming full screen).
Writes/reads to any MDA/EGA/VGA register or address disable CGA emulation.
While CGA emulation is enabled:
- Writing to CRTC index D3 and up disables CGA emulation.
- Writing to CRTC index 8=2 when protected will set a flag(cleared with other values), so does index 4=1. When both flags are set, the offset register is forced to zero to supply one-line frames(to support 8088 MPH's Kefrens Bars effect).
- Disabling the lock on any CRTC registers (VGA Vertical Retrace End Register's Protect bit) also disables CGA emulation.
This works reasonably with 8088 MPH, but for some reason messes up VGA emulation (when initializing from the BIOS and including any OS loading). Anyone knows how to fix this(e.g. make it compatible with both CGA(partly) accesses(when programmed like a CGA) and normal VGA operation when programmed like a VGA)?
Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io