Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VGA sequencer emulation fix: when DOS programs write the sequencer index
register (port 0x3C4) most VGA/SVGA cards actually decode fewer bits than the 8-bit value given. This can be seen through casual poking or from the Hackipedia VGA register dumps I've posted online, where Sequencer registers will repeat through indexes 0-255 depending on how many bits are decoded by the hardware. Currently it is known that ET4000 cards decode only the lowest 3 bits, Trident TVGA cards decode the lowest 4 bits, and S3 cards decode the lowest 6 bits. This behavior means that "aliases" of common Sequencer registers exist that function exactly the same as the normal registers. The reason for this fix, is the 1993 demo "Spiral" by Dataction, which has a flawed Mode X implementation. It sets up VGA 256-color Mode X as normal, but instead of writing directly to the Map Mask Register (Sequencer index 0x02) it writes to an alias of the Map Mask Register (Sequencer index 0x12) that exists on older VGA hardware (standard VGA, ET4000, Trident) but not on newer VGA hardware (S3). This is why, when the demo is run on newer hardware, the Mode X graphics don't render properly. Adding the sequencer masking behavior allows the demo to render Mode X properly with machine=svga_et4000 and the graphics no longer look like a low resolution blurry mess.
- Loading branch information