VOGONS


First post, by superfury

User metadata
Rank l33t++
Rank
l33t++

How does the IBM VGA BIOS actually detect if it needs to start with mode 7h instead of 3h? I think it could look at the 4 Switch Senses(by setting the Clock Select in the Misc Output Register to the bit number to test) and read the Input Status 0 register's bit 4(check it the bit with value 0x10(16) is set) to get all 4 switches, then execute mode 3 or 7 depending on the value returned?

I notice that Dosbox gives switches 0110 to indicate it's using a VGA? My emulation currently returns 0110 with color monitor (b/w emulation setting being disabled in the BIOS) and 0010 with b/w monitor(being either grayscale(simple b/w monitor, using the Black option), greenscale(MDA-style monitor) or brownscale(amber monitor). Is this correct?

What will cause the IBM VGA BIOS to actually start in mode 7h?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 1 of 4, by Jepael

User metadata
Rank Oldbie
Rank
Oldbie

Original IBM did not have any monitor ID bits, so it just takes a look if all RGB wires have enough load (monitor connected) or if there is not enough load (only one channel used for monochrome monitor). That monitor sense is available by reading 0x3c2 bit 4.

Reply 2 of 4, by superfury

User metadata
Rank l33t++
Rank
l33t++

What do those four channels actually need to report in a monochrome vs color monitor(Channel determined by Misc Output Register's Clock Select)? Or does it just give 1 with color monitors and 0 with b/w monitors(or essentially using code 1111(below threshold for all channels) for the four senses? What are those four switches connected to?

Edit: Just tested playing with the reported code (which is inversed when read though the input status 0 register):
- 0110 gets reported as 0110 by CheckIt Diagnostics and the Links golf program help software (which shows hardware information) reports it as Color VGA. Boots in color mode.
- 0010 changes nothing about the above reports. Also boots in color mode.
- 1111 makes it report as 0010 by CheckIt Diagnostics) and the Links golf program messes up (black text/no text printed on the screen, cursor in a strange location). It seems to boot in monochrome mode (mode 7h, as I only see black/white/bright and reversed colors on the screen).
0000 makes it boot in plain color mode as well. 1000 does as well. 0100 does as well. 1110 does as well.
- 0001 seems to do the same as 1111.
- 0111 seems to do the same as the other color modes.

So 0001 and 1111 do the same(monochrome with errors) and all others give normal color mode?

Both 0001 and 1111 seem to use monochrome mode(found out by switching to color mode when they're visible, then switching back before continuing testing), but make text output fail to a certain degree (only the hard disk BIOS and the CheckIt Diagnostics main menu seem to give output. The rest just generates black (text) on black(background). They both report as 0010 in CheckIt Diagnostics.

It seems that bit 0 determines color/mono(MDA '4-color' mode). It also seems that 0110 is correct for color VGA. Setting the mono mode also seems to mess up some output (most text mode output)?

Also, running the graphics tests messes up VRAM(vertical lines every first pixel horizontally of each character) during the monochrome monitor being set.

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 3 of 4, by superfury

User metadata
Rank l33t++
Rank
l33t++

With MDA '4-color' mode I meant it's black/gray/white/bright white colors(from the DAC, selected by the attribute controller registers 0-15).

I just tested each and every value of the switches (0-15) and I notice that each even (XXX0) values gets color modes/
Odd(XXX1) values get b/w modes, but the Turbo XT BIOS, part of the MS-DOS prompt(ltemm driver and mouse driver) and the CheckIt Diagnostics text screen tests(all of them while executing) give a black screen or black text on black background(in the case of the drivers and Links' diagnostics program included showing information about the hardware), as well as strange cursor behaviour(cursor is in strange places during the drivers and Links' diagnostics program).

This is a dump of all VGA registers and DAC/Attribute palettes during the boot part:

The attachment VGA_monochromeBIOS.zip is no longer available

Edit: Looking at the VRAM (which is about 10 seconds the BIOS running after screen initialisation), I notice that the VRAM isn't filled with characters or attributes? It's still the same as when it's initialized by the BIOS? (Font 0x20(space), Attribute 0x07(Gray on black) for all displayed characters)

So this is a problem in the BIOS not writing to VRAM correctly (Graphics Controller is at fault?)

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 4 of 4, by superfury

User metadata
Rank l33t++
Rank
l33t++

I do notice however, that the BIOS gives it's output on memory aperture 0 (A0000-BFFFF) instead of the aperture 2(B0000-B8000), which is set in the Misc Graphics Register.

Anyone knows anything about this? Does monochrome mode affect the memory aperture?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io