VGA Memory Access Is Complicated
This technical deep dive meticulously unravels the arcane complexities of VGA memory access, revealing how interdependent registers and woefully inadequate documentation have long bedeviled hardware implementers and emulators. The author champions the rare instances of clear, detailed documentation that explain individual bit functions over high-level usage, which deeply resonates with engineers passionate about understanding underlying hardware. It's a fascinating look at reverse-engineering ancient tech to uncover its true operational logic.
The Lowdown
The author delves into the surprisingly intricate world of VGA (and EGA) memory access, arguing that its perceived complexity doesn't stem from sophisticated hardware but from the interaction of its many components and, critically, a severe lack of detailed documentation. While VGA itself lacks a CPU or microcode, its internal structure across multiple chips (Graphics Controller, Sequencer, Attribute Controller, CRT Controller) creates a web of interdependencies that modern implementers often struggle to decipher due to historical documentation primarily aimed at end-users, not hardware designers.
- Early documentation, including IBM's own Technical References, focused on how to use VGA modes through high-level settings, not what individual bits actually do.
- This vagueness is exemplified by three separate 'OE' (Odd/Even) bits—SR4[2], GR5[4], and GR6[1]—which are usually set in unison for compatibility but have distinct, undocumented functions.
- IBM's documentation for these bits is unhelpful, often stating one bit 'follows' another without explaining the underlying mechanism.
- Compaq's EGA Technical Reference Guide emerges as a rare gem, clearly delineating the separate roles of these bits: SR4[2] for CPU write access, GR5[4] for CPU read access, and GR6[1] for CPU addressing.
- Further complexities arise with GR6[1]'s interaction with higher CPU address bits or the MSR[5] page select bit, which determine how the 128K VGA address range is utilized, a detail only found in later Matrox specifications.
- Crucially, completely separate CRTC (CRT Controller) bits also govern how VGA memory is accessed and displayed on screen, adding another layer of independent control.
Ultimately, the story highlights that while the VGA seems simple on the surface, its full and accurate implementation requires understanding the independent functions of numerous control bits across different components. The scarcity of documentation explaining these granular details has created a persistent challenge for anyone trying to emulate or develop for this foundational piece of PC hardware with perfect fidelity.