VOGONS


First post, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

In a different thread, I raised the question of the way DOSBox displays the 2nd font table on a VGA display. This thread is about the underline attribute that becomes available when the video mode is switched to "mode mono" (video mode 07).

All hardware that supports the VGA specification (including vesa-compatible boards like those from Paradise, Tseng, etc.) support the underline attribute in video mode 07. The vgaonly option in DOSBox supports it correctly, as in the image below:

vgaonlyunderline.jpg

Unfortunately, none of the svga* or vesa* options support it, as shown here:

svga-nounderline.jpg

Some old text-based games from the original IBM PC era used the underline attribute when mode mono was on, so I hope this is something that might be worth patching or changing. Thanks again to everyone here for any help with this.

Reply 2 of 10, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

The reason I want to use a vesa* option in my custom build is that WordPerfect (which is what is shown here) can switch between text and graphic modes, including VESA graphics if available on the hardware (or emulated hardware).

So on my real hardware, I have WordPerfect running in text mode in mode mono with the underline attribute, but when I press the WordPerfect keystroke that switches WordPerfect into graphic mode, I can use VESA 1280X1024 graphics.

With vgaonly, I can only use 640x480 graphics, which is a very different and more limited experience.

I fully understand that DOSBox is designed for games, not applications, so this may never be changed in the distribution release. But if anyone is interested enough in the problem to suggest a way of patching the code that would add the underline attribute to the vesa* and svga* options, I would be very, very grateful. But I know that it may not be worth anyone's effort.

Reply 3 of 10, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Theres the commented out // combined 8/9-dot wide text mode 8bpp line drawing function in vga_draw.cpp. un-comment it and comment out the original 8bpp drawing function.

1+1=10

Reply 4 of 10, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie
h-a-l-9000 wrote:

Theres the commented out // combined 8/9-dot wide text mode 8bpp line drawing function in vga_draw.cpp. un-comment it and comment out the original 8bpp drawing function.

I'll try that as soon as I get back to my development system tonight. Thank you!

Reply 5 of 10, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie
h-a-l-9000 wrote:

Theres the commented out // combined 8/9-dot wide text mode 8bpp line drawing function in vga_draw.cpp. un-comment it and comment out the original 8bpp drawing function.

Before I mess everything up when I get back to my test machine tonight, could I ask if I've understood you correctly. I think I'm supposed to UNcomment the section that begins:

/*
static Bit8u * VGA_TEXT_Draw_Line_9(Bitu vidstart, Bitu line) {
Bits font_addr;
Bit8u * draw=(Bit8u *)TempLine;
bool underline=(Bitu)(vga.crtc.underline_location&0x1f)==line;

and that I'm supposed to comment out the section that begins:

static Bit8u * VGA_TEXT_Xlat16_Draw_Line_9(Bitu vidstart, Bitu line) {
Bits font_addr;
Bit16u * draw=(Bit16u *)TempLine;
bool underline=(Bitu)(vga.crtc.underline_location&0x1f)==line;

And IF that's correct, am I right in thinking that I also need to do something to change these lines of code earlier in the file:

if ((IS_VGA_ARCH) && (svgaCard==SVGA_None) && !(vga.seq.clocking_mode&0x01)) {
width*=9; /* 9 bit wide text font */
VGA_DrawLine=VGA_TEXT_Xlat16_Draw_Line_9;
bpp=16;
// VGA_DrawLine=VGA_TEXT_Draw_Line_9;
} else {

Without knowing anything about this, I can't tell whether I'm supposed to comment out the first "VGA_DrawLine=" line and UNcomment the second, or whether I'm supposed to move some strings from one place to another. Or am I mistaken in thinking that something needs to be changed here? Does the "if" statement in the first quoted line mean that this bit of code only applies to non-SVGA/VESA cards?

Apologies for making things more complicated. I'll be very grateful for any advice on this - and thanks again.

Reply 7 of 10, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

Here's a report, with thanks for your continuing help on this problem.

1. I edited the distribution source as I think you suggested. I commented out the block that begins:

static Bit8u * VGA_TEXT_Draw_Line(Bitu vidstart, Bitu line) {

and I uncommented the block that (in the original code) began:

static Bit8u * VGA_TEXT_Draw_Line_9(Bitu vidstart, Bitu line) {

and I removed the "_9" from the line so that the block would take the place of the newly-commented one. (At first I neglected to do that, and of course it wouldn't build.) The changed file is here in case anyone wants to look at it: http://dl.dropbox.com/u/271144/vga_draw.cpp

2. This version did display an underline, but it has two problems, which are illustrated in the screen shot below (made after I ran "mode mono" and then WordPerfect 5.1):

underline-problem.jpg

As you see, the window is truncated by 1/9th at the right. Also, the underline is broken, not continuous. If I remember correctly, IBM did some extra trick of adding a pixel to the underline, and presumably that trick, whatever it was, is used in the vgaonly option, as illustrated below:

underline-vgaonly.jpg

If the vesa* option could be made to act the way the vgaonly option does, then this issue would be completely solved.

I hope this report is useful. Thank you again for your help.[/url]

Reply 9 of 10, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

I finally see my mistake - I was working from the release 0.74 source code, not the current SVN version at http://source.dosbox.com/dosboxsvn.tgz.

The release source code has only one VGA_TEXT_Draw_Line function, so I did the best I could, which was obviously wrong. I really did your message carefully - but I was using the wrong (release) version of the code. The SVN file has exactly what you say it has.

Now that I have the file that I should have been using all along, I'll be able to test this.

My apologies for repeatedly wasting your time - I thought it was safer to work from the release source. Thank you. I'll report back later today.

Reply 10 of 10, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

As soon as I used the correct file, the underline appeared correctly. Thank you again. I'll certainly report any problems that might result, but it looks perfect now.

Unfortunately, this fix breaks @ripsaw8080's fix for the display of the 2nd font bank. So I'll go back to that thread and beg for further help...