VOGONS


First post, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

This question has nothing to do with games, so I understand that it will be of absolutely no interest to the developers.

Has anyone written a patch that will let DOSBox start up with a 50 (or maybe 43) line screen, but using the same 9x16-pixel VGA-style font that DOSBox normally uses? Some applications will happily work in that kind of mode, and it would be nice to be able to have it, now that most monitors offer enough room for it.

DOSBox already supports VESA text modes that use a slightly smaller font in a 43-line screen. These are very good to have. But if someone has done something that makes it possible to use the 9x16 font in more than 25 lines, and can supply it as a patch, I would be very grateful to have it.

Again, I fully understand that this would only be for custom builds, not for SVN. Thanks for any help.

Reply 1 of 18, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Look at int10_modes.cpp:

There are lines like

{ 0x055  ,M_TEXT   ,1056,400, 132,25, 8, 16, 1 ,0xB8000 ,0x2000, 192, 449, 132,400, 0   },

0x55 is the video mode,
1056,400 is the resolution in pixels,
132,25 in characters,
8,16 is the character bitmap size,
1 is the number of display pages that fit in the 32kB buffer,
0xB8000 is the memory address (always this value for color text modes),
192 and 449 are the horizontal and vertical total values (hor. must be a bit larger than 132 here and vert. larger than 400),
132 and 400 at the end are display end values, must match the horizontal resolution in characters and vertical in pixels here),
0 is for special flags like vertical line doubling.

You could add something like

{ 0x056  ,M_TEXT   ,640,1056, 80,66, 8, 16, 1 ,0xB8000 ,0x3000, 100, 1100, 80,1056, 0   },

which would be a 80x66 characters screen at mode 56h.

1+1=10

Reply 2 of 18, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie
h-a-l-9000 wrote:
You could add something like […]
Show full quote

You could add something like

{ 0x056  ,M_TEXT   ,640,1056, 80,66, 8, 16, 1 ,0xB8000 ,0x3000, 100, 1100, 80,1056, 0   },

which would be a 80x66 characters screen at mode 56h.

Thank you, @h-a-l-9000. That is exactly what I was looking for.

At the risk of outlasting my welcome, I hope it's OK to ask one more question. I've stared at int10_modes.cpp and I can't see how to set a specific mode as the startup default mode. When I try this tonight, I will see whether the command MODE COLS=80 LINES=66 switches into this mode - perhaps you have an idea already if this will work?

Thank you again!

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

User metadata
Rank DOSBox Author
Rank
DOSBox Author

INT10_SetVideoMode at the end of int10.cpp

1+1=10

Reply 4 of 18, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

<slap on forehead> Of course! Thank you!

Reply 5 of 18, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

You might also want to reinforce the custom text mode as default by changing the CLS command in shell_cmds.cpp to use it instead of mode 3. (e.g. reg_ax=0x0056;)

Reply 6 of 18, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie
ripsaw8080 wrote:

You might also want to reinforce the custom text mode as default by changing the CLS command in shell_cmds.cpp to use it instead of mode 3. (e.g. reg_ax=0x0056;)

Thank you for that also. Will test this out tonight (US time).

Reply 7 of 18, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

Thank you again for these suggestions.

Unfortunately, when I made these three changes, DOSBox starts up with a blank screen of the usual size. When I made only the two changes suggested by @h-a-l-9000, and not the change to CLS_CMD suggested by @TeaRex, then DOSBox started up with the blank screen, but the CLS command restored the normal screen.

I also tried adding only the first change from @h-a-l-9000 - only adding the 0x0056 video mode, not making it the default. I then started up and tried running the VMODE utility to set the video mode. VMODE 56 didn't produce any change in the screen size. (VMODE 54 and 55 worked correctly.)

The one part of the string that @h-a-l-9000 didn't explain in his post is the number 0x3000 - which is in a column headed "plength" in the code. Is it possible the problem is there? Everything else looks right. Here is @h-a-l-9000's string:

{ 0x056  ,M_TEXT   ,640,1056, 80,66, 8, 16, 1 ,0xB8000 ,0x3000, 100, 1100, 80,1056, 0   }, 

Thanks again for all your trouble over this.

Reply 8 of 18, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Actually, it was I that suggested changing the CLS command, and of course that was predicated on the custom text mode working. 😒

The 66-line mode parameters seem fine, but there may be some trick to it that hal will figure out. This custom mode works for me:

{ 0x056  ,M_TEXT   ,720 ,800, 80 ,50 ,9, 16, 1, 0xB8000 ,0x2000, 100, 800, 80 ,800, 0   },

It is a 50-line mode that specifies the 9x16 font, as you originally requested. Note that to actually get the 9 dot font you will have to use machine=vgaonly or make some modifications to enable it in other VGA machine types.

WordPerfect appears to work OK with this mode when started with the F2 command line parameter.

Reply 9 of 18, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie
ripsaw8080 wrote:
The 66-line mode parameters seem fine, but there may be some trick to it that hal will figure out. This custom mode works for me […]
Show full quote

The 66-line mode parameters seem fine, but there may be some trick to it that hal will figure out. This custom mode works for me:

{ 0x056  ,M_TEXT   ,720 ,800, 80 ,50 ,9, 16, 1, 0xB8000 ,0x2000, 100, 800, 80 ,800, 0   },

It is a 50-line mode that specifies the 9x16 font, as you originally requested. Note that to actually get the 9 dot font you will have to use machine=vgaonly or make some modifications to enable it in other VGA machine types.

First, my apologies for the mistake about the name - I've got a lot of patches by @TeaRex in my project and a few nerve pathways got crossed. At this point, I'm grateful to a lot of people for their help with this project...

This message is a great help. With @ripsaw8080's version of the mode plugged in, it works perfectly. Thanks to many people's help, I already had the 9x16 font working in vesa_oldvbe mode, and these patches make it work perfectly in 50-line mode.

I'm going to keep experimenting with @h-a-l-9000's 66-line mode, because it seems to me that it ought to work if @ripsaw8080's similar mode works. Probably this is a case of user-stupidity on my part, and I'll report back if I found out what went wrong.

Thanks again to both of you for your very generous help.

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

User metadata
Rank DOSBox Author
Rank
DOSBox Author

You probably put it in the wrong list. There are several for the different machine types. It was meant for ModeList_VGA.

1+1=10

Reply 11 of 18, by emendelson

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

You probably put it in the wrong list. There are several for the different machine types. It was meant for ModeList_VGA.

This is really baffling. I added both @h-a-l-9000's new line and @ripsaw8080's new line to the block headed "VideoModeBlock ModeList_VGA[]={"

These are the lines I added:

/* added by ripsaw8080 */
{ 0x056 ,M_TEXT ,720, 800, 80, 50, 9, 16, 1 ,0xB8000 ,0x2000, 100, 800, 80, 800, 0 },
/* end added by ripsaw8080 */

/* added by h-a-l-9000 */
{ 0x057 ,M_TEXT ,640,1056, 80, 66, 8, 16, 1 ,0xB8000 ,0x3000, 100, 1100,80,1056, 0 },
/* end added by h-a-l-9000 */

When I run VMODE 56 (for @ripsaw8080's line), the output is normal.

When I run VMODE 57 (for @h-a-l-9000's line, which I've renumbered because I added another line as 56), nothing I type appears on screen, and there is no output from "dir" etc. Probably this is happening because of other patches that I've added, and I should try it on otherwise clean SVN code before wasting anyone's time about this. I will try to check this tonight on clean SVN code.

Reply 12 of 18, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

I've tried the 66-line mode on current source, and something not obvious prevents it from working. Maybe more than 1024 lines is an issue?

Reply 13 of 18, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Maybe try 0x4000 instead of 0x3000. It's the size of the screen in bytes aligned to 2^x.
80*66*2=2940h, 4000h being the closest.

1+1=10

Reply 14 of 18, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

aaah SCALER_MAXHEIGHT.

1+1=10

Reply 15 of 18, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

I actually tried 0x4000 instead of 0x3000, just as a wild guess, before you suggested it, but it didn't help.

Ahh - now I see your message about SCALER_MAXHEIGHT - but (I know this is an ignorant question) - I don't have any idea of what to do about it, or where to find it. Is it a setting that (in the existing code) limits the screen size to a number below the number needed for 66 lines? If so, where should I change it?

Thanks again for bearing with me...

Reply 16 of 18, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

No editor that can do 'find in files'? 😉

It's in render_scalers.h and must be large enough that the mode can be displayed.

1+1=10

Reply 17 of 18, by emendelson

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

No editor that can do 'find in files'? ;)

It's in render_scalers.h and must be large enough that the mode can be displayed.

<slap on forehead again>Ah - yes, I bought a computer because it could find things for me. Your point is very well taken...!

Thank you - will experiment tonight....

Reply 18 of 18, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

@h-a-l-9000's instruction to change SCALER_MAXHEIGHT was, of course, exactly right. When I changed it from 1024 to 1056, the 66-line text mode worked perfectly.

Following the examples that @h-a-l-9000 and @ripsaw8080 offered, I added three video modes, all in 9-dot style; one of them is a 43-line mode that uses the standard font. (There is already a 43-line mode, but it uses a smaller font.)

/* added by emendelson - 43-line mode */
{ 0x056 ,M_TEXT ,720, 688, 80, 43, 9, 16, 1 ,0xB8000 ,0x2000, 100, 688, 80, 688, 0 },
/* added by ripsaw8080 - 50 lines */
{ 0x057 ,M_TEXT ,720, 800, 80, 50, 9, 16, 1 ,0xB8000 ,0x2000, 100, 800, 80, 800, 0 },
/* added by h-a-l-9000 changed 640,1056 to 720,1056; 8,16 changed to 9,16 */
{ 0x058 ,M_TEXT ,720,1056, 80, 66, 9, 16, 1 ,0xB8000 ,0x3000, 100, 1100,80,1056, 0 },

I don't know if all the numbers in the 43-line mode are correct, but it seems to work. I modified the 66-line mode to use the 9-dot font, and I hope the numbers are correct there also.

So, many thanks again to @h-a-l-9000 and @ripsaw8000 and @ykhwong for showing me how to do this. I'll be posting the revised version of my DOSBox-based projects that run WordPerfect for DOS under 64-bit Windows and under OS X in the next few days.