VOGONS


First post, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

VGA hardware can load a 512-character font instead of the standard 256-character screen font. DOSBox emulates this feature, but it isn't a complete emulation. In real hardware, the upper 256 characters display with normal intensity; under DOSBox, the upper 256 characters display with the bold attribute turned on, which means that some characters on screen display in bold while others (sometimes in the same word) are displayed with normal intensity.

I understand this may never be fixed in the distribution version of DOSBox, because it doesn't have any effect on DOS games. But I wonder if anyone has written (or knows how to write) a patch that fixes the problem so that I could use it in my custom build. I will be very grateful for any help.

To illustrate the problem, here is a screen shot of a 512-character font being used under DOSBox:

dosbox.jpg

And here's the same setup under VirtualPC, which correctly emulates this VGA feature:

virtualpc.jpg

If anyone has a patch that fixes this, I'll be grateful.

Reply 1 of 29, by ykhwong

User metadata
Rank Oldbie
Rank
Oldbie
emendelson wrote:

I understand this may never be fixed in the distribution version of DOSBox, because it doesn't have any effect on DOS games.

Some games that use such characters might be affected. Font data is listed in src/ints/int10_memory.cpp. Something can differ depending on codepages.

Reply 2 of 29, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

Then perhaps this can be fixed in the distribution release, because DOSbox currently does not reproduce the behavior of the actual VGA hardware, which does NOT use the bold attribute when displaying any upper-256 characters.

Reply 3 of 29, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

looks indeed a bit odd.
Worth investigating I think.Although I doubt it depends on the fonts themselves.

Water flows down the stream
How to ask questions the smart way!

Reply 4 of 29, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

The issue appears to relate to the font map select register of the VGA sequencer. When it is set so that bit 3 of the attribute indicates "use 2nd font table", then perhaps bit 3 no longer indicates foreground color intensity.

Although the attached patch appears to work in this particular case, it is a hack and may be incorrect or not cover all aspects of the feature. I'm sure h-a-l-9000 will have better ideas on how to handle it properly.

Edit: simplified the changes.

Attachments

  • Filename
    map_select.diff
    File size
    763 Bytes
    Downloads
    159 downloads
    File license
    Fair use/fair dealing exception

Reply 6 of 29, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

vgaonly and loading a video bios doesn't change it. The experiment patch I posted is only on the svga_* text drawing; with vgaonly the 2nd font table characters still display in intense foreground colors because vgaonly has a separate text drawing routine, but it could be changed as well.

Reply 7 of 29, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

Thank you for that patch! I'll apply it when I get to my development machine tonight. Meanwhile, is there any hope that there might be a version of the patch for the vesa_* options because I use the vesa 1.2 option for this system?

@TeaRex, if you're reading this, is the patch likely to work with your revised vga font setup, which is one reason I prefer to work with your project instead of the default?

Reply 8 of 29, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

It should work with all vga machine types except vgaonly, and that could be added if needed.

Changing the font patterns in int10_memory.cpp shouldn't make any difference.

Edit: revised patch to work for vgaonly as well.

Attachments

  • Filename
    map_select_2.diff
    File size
    1.53 KiB
    Downloads
    225 downloads
    File license
    Fair use/fair dealing exception

Reply 9 of 29, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

@ripsaw8080 - Your patch seems to work perfectly here. I had to apply it by hand, because the version of the source that I'm using (generously provided by @TeaRex from his own project) had different line numbers, but I seem to have got it right, because the 2nd font bank is displayed with normal intensity.

Incidentally, I applied your changes also to the commented-out part of the code that @h-a-l-9000 told me to uncomment (if I understand his posting correctly). Once I've sorted out the answer to a question I asked in the thread about the underline attribute, I'll test that also. It looks as if your patch and his suggestion might solve all the minor glitches I've been experiencing with text display.

Thank you again for this. This community is extraordinarily generous.

Reply 11 of 29, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Only testing bit 2 of vga.seq.character_map_select to enable/disable the foreground intensity of the attribute may not cover all possible conditions. I based it on observations of how WP 5.1+ changed the register when 512-character mode is turned on and off in its setup. It may be good enough for supporting WordPerfect, which I believe is the goal; but as I mentioned in my first comment, I figured that hal could implement the feature properly in the official source.

Reply 12 of 29, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie
ripsaw8080 wrote:

It may be good enough for supporting WordPerfect, which I believe is the goal.

Yes, it's certainly working well with WordPerfect - and that's what this setup is for. I'm very glad to have it.

Reply 13 of 29, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

May I ask your help once again? In another thread, @h-a-l-9000 provided a fix for the missing underline attribute in vesa* and svga* modes. This fix breaks your patch for the 2nd font bank, because your patch applies to a part of the code that is now commented out. I tried applying your changes to the new code, but only one of the two changes can be fit in, and it doesn't seem to help.

If you're willing to look at this, I've posted the underline-fix code here:

http://dl.dropbox.com/u/271144/vga_draw.cpp

The only change from the SVN source is the commenting out of one function and the uncommenting of another.

I realize that you've done far more than anyone has the right to hope for about this already. Thanks again for all your help.

Reply 14 of 29, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

the IBM conditions seem pretty simple to check. Of course how did we call those registers in dosbox 😀

Water flows down the stream
How to ask questions the smart way!

Reply 17 of 29, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

If you went by the changes to VGA_TEXT_Xlat16_Draw_Line() for vgaonly, you probably would have had less trouble applying the same changes to the commented-out text drawing routine because the code is similar. Anyway, the attached patch against current source should suit your needs.

I had to figure out how to achieve "mode mono" in WP 5.1+ because it's not obvious. I made small a program to set the DOS console into mode 7, then ran WP with the /F2 command line to preserve the mode, and finally changed the text display type to "auto selected" in setup (I had it set to 16-color at first and it was setting mode 3 regardless of the other stuff I did).

Attachments

Reply 18 of 29, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

Again - thanks, and thanks for your patience with a beginner. As soon as I get back to my development machine I'll apply the patch, and also study the vgaonly code in the hope of learning something for myself, instead of asking other people to tell me. (It would be a lot more efficient and would save other people a lot of time.)

About getting WordPerfect to run in mode mono - the simplest way is to install FreeDos and use the command mode mono. Or, as you say, use any other utility that can set video mode 7. Exactly as you said, you had to use the /f2 command-line switch (I wonder why it's "f2", by the way) because you had specified a 16-color text font in WP. But you won't need the /f2 switch if no text font is specified.

There's more about WordPerfect and mode mono here:

http://www.columbia.edu/~em36/wpdos/textmode.html#modemono

Thanks again. I'll report back on my results with your patch later tonight.

Reply 19 of 29, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

Thank you again @ripsaw8080. Your .diff file let me build an executable that includes the underline under mode mono in vesa* mode and the correct display of 512-character fonts. I'm very grateful for the trouble you went to for this.