The latest additions to the PC Emulation Book:

A reference for the BIOS Data Area
https://book.martypc.net/appendices/bios-data-area

IO port reference for common PC/XT/AT hardware
https://book.martypc.net/appendices/io-ports

A handy reference for CGA/EGA/VGA palettes

https://book.martypc.net/appendices/video/palettes

I've also started documenting the EGA register file, since I've been all up in the EGA recently.

https://book.martypc.net/appendices/video/ega-registers

An EGA-specific reference will be handy as if you've ever wanted to emulate an EGA you often find yourself sorting through VGA references and removing all the VGA specific bits.

#retrocomputing #emultion

BIOS Data Area - The PC Emulation Book

A comprehensive guide to emulating the original IBM PC and its hardware components

A new feature for my register-diagram-renderer thingie is color overrides - because that makes sense when your register defines colors!
There's very little information out there that is oriented toward emulating the EGA/VGA. Programming it, sure, but a lot of the how does it work bits are sort of left up to you to puzzle out. The existence of 64KB, 128KB and 256KB versions of the EGA really complicate things as well as that affects address handling.

There are two registers on the EGA called the Graphics Position Registers - these are used because there are two identical(?) graphics controller chips - and you need to tell each one of them which two planes of video memory they are assigned to, because they both get the same commands from that point forward and need to know which two bits they need to care about for doing graphicsy stuff.

Most clone EGAs combined these into one chip, and the graphics position registers don't really do anything.

But if you have an original IBM EGA - what happens if you just lie to them?

@gloriouscow presumably something moderately psychedelic?

@syllopsium All CPU writes go through the graphics controllers, which means that if you lie to them on purpose they will put data in the wrong planes.

I have recently acquired an original IBM EGA so I can try this sometime and see what it does.

@gloriouscow “ Most of the EGA CRTC registers are read-only,” — should that say “write-only”?
@joe yes, why do I always make that same mistake lol
@gloriouscow awesome. I went looking for some of this relatively recently and had trouble finding much info
@foone My priority has been to include anything that I find myself looking up!
@gloriouscow Out of curiosity, do you plan to cover more than just the original PC (e.g. XT, AT, etc.) and covers other video cards like Hercules Graphics card? I know it is a LOT of work.
@thebluewizard maybe eventually. Once I have good coverage of the former, or if other people start contributing.