Revise EGA/VGA CRTC CGA/Hercules bit remapping to map out only those bits rather than as an upper mask bound

This commit is contained in:
Jonathan Campbell 2025-04-17 21:11:12 -07:00
parent fd4631dec1
commit d43fd90a16
2 changed files with 9 additions and 8 deletions

View File

@ -1,4 +1,10 @@
Next
- Revise EGA/VGA emulation to treat the CRTC CGA/Hercules
CRTC bit remapping as bits to mask out, instead of defining
the upper limit of the memory mask. This makes the CGA mode
Engine page flipping test work. I initially had reservations
about whether or not real hardware did this, but, it would
make sense for hardware to do it that way. (joncampbell123)
- Updated SDL2 library to version 2.32.4 (maron2000)
- Fixed a build/install error due to using wildcards in Makefile.am, which is
not supported in GNU Automake. (maron2000)

View File

@ -366,14 +366,9 @@ void vga_write_p3d5(Bitu port,Bitu val,Bitu iolen) {
if (vga_render_on_demand) VGA_RenderOnDemandUpTo();
crtc(mode_control)=(uint8_t)val;
vga.tandy.line_mask = (~val) & 3u;
if ( vga.tandy.line_mask ) {
vga.tandy.line_shift = 13u;
vga.tandy.addr_mask = (1u << 13u) - 1u;
} else {
vga.tandy.addr_mask = ~0u;
vga.tandy.line_shift = 0;
}
vga.tandy.line_shift = vga.tandy.line_mask ? 13u : 0u;
vga.tandy.addr_mask = ~0u;
vga.tandy.addr_mask &= ~(vga.tandy.line_mask << 13u);
VGA_CheckAddrShift();
VGA_CheckScanLength();