First post, by vladstamate
- Rank
- Oldbie
Hi all,
(this is related to emulating an original IBM EGA card with original IBM EGA ROM).
In my effort to add EGA emulation I am hitting a strange issue. No matter what position are the 4 switches on the EGA card are the IBM EGA ROM insists on setting the initial text mode as either 320x200 or 320x350 (depending on the switches position), which is mode 1, 40x25. I spent some time studying the ROM code (it comes in the EGA manual from IBM) and from what I can see it keys off what text mode to set based on the BIOS DATA entry 40h:87h which is specific to EGA. Specifically bit 1 says 1 if Monochrome monitor connected 0 otherwise. For me that is 1 and the ROM code checks against that then sets text mode 1
The executed code flow looks like this (this happens inside the EGA ROM and it is the last time the mode is being set):
TEST [0x487], 0x2
JE 0x1f; jump to next line, JE succeeds
CALL 0xfdf8
AND [0x410], 0xcf
OR [0x410], 0x10
MOV AX, 0x1
INT 0x10
What I want is the ROM to set mode 3 (80x25).
I traced the BIOS writes and nobody really writes value 2 at 40:87, or rather not intentional.
In the real world how would the EGA know what kind of monitor is connected beside the dip switch positions which the owner has access to?
YouTube channel: https://www.youtube.com/channel/UC7HbC_nq8t1S9l7qGYL0mTA
Collection: http://www.digiloguemuseum.com/index.html
Emulator: https://sites.google.com/site/capex86/
Raytracer: https://sites.google.com/site/opaqueraytracer/