Reply 20 of 29, by GloriousCow
- Rank
- Oldbie
superfury wrote on Yesterday, 12:11:Also interesting to note is, that when I compare the values ending up in the BDA (from said MK_ENV call) when the switches are in inversed order on the graphics card, that the "monochrome" bits (switch 3 open and others closed) actually matches the VGA documented 0010b that's documented to appear there on VGA monochrome monitors (reported by grounding just the ID1 pin). Seeing as the VGA is supposed to be EGA-compatible, it looks like the EGA indeed flips the switch numbers (or wiring them inversed).
I showed you how they are reversed on the PCB just a few posts up. It was just a wiring convenience, I figured to wire them in order they'd have had to have flipped the 153 around compared to all of the other chips that face left, or have the wiring take a different, longer path. Looking at the PCB though, the DIP traces run on one of the inner layers and there would have been room between U15 and U6 to run them from the top which would have put them in order.
So who knows, really. IBM probably didn't care what order they were in as it would only ever confuse emulator authors decades later.
Another optimization that led to a quirk is that all the address lines coming off the ISA bus are passed through inverters and so for most of the address logic on the board, the addresses are inverted. So when chips like the graphics controllers and the sequencer get the A0 line to handle odd/even mode they actually get ~A0. To avoid reversing everything in VRAM they used 74LS258 multiplexers to generate the row and column addresses, which are just like 74LS257's but have inverted outputs.
But this means that the address lines to the BIOS ROM are inverted. It would have cost them an extra chip to invert these addresses back, so what they did is just reverse the contents of the ROM.
MartyPC: A cycle-accurate IBM PC/XT emulator | https://github.com/dbalsom/martypc