VOGONS


First post, by jal

User metadata
Rank Oldbie
Rank
Oldbie

In INT10_LoadFont() (int10_memory.cpp), after writing the font to plane 2, the following line of code enables all memory planes:

IO_Write(0x3c5,0xf);	//Enable all planes

I think this is wrong, as only the first two planes should be enabled (so the value should be 0x3). DOSbox itself doesn't seem to have a problem with it, but when testing the code on Bochs, the screen was slightly garbled. Haven't checked the behaviour on a real PC yet.

JAL

Reply 2 of 7, by jal

User metadata
Rank Oldbie
Rank
Oldbie
wd wrote:

the screen was slightly garbled

Compared to what? Real system or bochs bios only? (vgabios/elpin?)
Do you have some small sample of this problem?

I have tried exclusively in Bochs, see attached pictures. However, I'm pretty sure that only enabling planes 0 and 1 is actually correct, as those are the only planes written to (0 = characters, 1 = attributes). It is possible however, that enabling all planes works for VGA as well, depending on how the odd/even chaining is rigged up in hardware.

JAL

Attachments

  • normal.png
    Filename
    normal.png
    File size
    18.04 KiB
    Views
    1121 views
    File comment
    Bochs, normal screen (planes 0 and 1 enabled)
    File license
    Fair use/fair dealing exception
  • garbled.png
    Filename
    garbled.png
    File size
    18.82 KiB
    Views
    1121 views
    File comment
    Bochs, garbled screen (all planes enabled)
    File license
    Fair use/fair dealing exception

Reply 3 of 7, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Well the bios is quite "destructive" with the font functions, so it could actually
be correct that it (real vga bios) doesn't care about setting/restoring the
correct plane setting.
Got to look up how some other bioses handle this...

Reply 5 of 7, by jal

User metadata
Rank Oldbie
Rank
Oldbie
wd wrote:
ibm vga stuff: […]
Show full quote

ibm vga stuff:

seg001:123A                 mov     dx, 3C4h
seg001:123D mov ax, 302h
seg001:1240 out dx, ax

So 3 it seems for those.

It is what I expected, as it makes sense that only planes 0 and 1 are enabled, since these are chained. Allowing access to 3 and 4 (where the character definitions reside) doesn't make too much sense.

JAL

Reply 7 of 7, by jal

User metadata
Rank Oldbie
Rank
Oldbie
wd wrote:

Well they could have saved/restored the values, too, but guess they
assumed strict default-textmode thus used those fixed values.
S3 does the same btw.

Ok, so Dosbox should do the same then I guess.

JAL