VOGONS


First post, by Kordanor

User metadata
Rank Member
Rank
Member

I will come to my issue at the bottom, but first up want to summarize, so that the thread can also help other people with different sets of problems:

DOS has two display modes which show as 720x400, which is the Textmode, and 320x200, which is interpreted as 320x200

There is the "MODE"-Way to change the font size

You can make the font bigger and smaller by adding
this line to config.sys
DEVICE=C=\DOS\ANSI.SYS

and then you can use
MODE C,L
where C is columns and can be 40 or 80
and L is Lines and can be 25, 43 or 50

so if you type "MODE 40,25" then everything will show up huge.
However this neither changes the resolution, nor the frame rate.

You can use a driver to change the Mode

There are specific drivers, if your graphics card has any, which allow to set custom resolutions for DOS.
LGR is showing this on his Diamond Viper here: https://youtu.be/AEwXZPzm3es?t=205
Of course you would either need to be lucky with your card, or specifically look for a card which can do that. I am not aware of a "generic" driver for that.

You can use a tool called vga240

This tool was created by

TheGreatCodeholio wrote on 2017-12-17, 21:49:

This tool changes your resolution to 640x480 and also puts it to 60Hz.
You can get it by downloading it here:
https://github.com/joncampbell123/doslib/rele … 3204f18718290ef
Extract the file, then extract the file again.
Go to doslib directory->hw->vga->dos86s
and then copy that directory to your dosmachine. Start vga240 to get further instructions.
Initialize by typing vga240 /install
Once you reboot the computer the mode is unloaded again

Note
I have no idea what the other versions do and also what the other releases include. The latest release from 2020 got my antivirus active, which is why I don't post it here. The version I posted above worked without virus alert.

The last option can help for example to capture and display the screen on hdmi which only does 60Hz.
The issue I got is a different one. I'd like to "split" between 320x200 and 720x400 Text mode. And I am not quite sure whether there is any option in that tool or other version which can help, maybe @TheGreatCodeholio can shed some light on that.
The issue is that the recording program cannot differentiate between these two. Both resolutions arrive as 720x400 with 70Hz.
In order to properly capture 320x200 70Hz I need to downscale it to 320x200 and then capture it. And while that works, the tool will also downscale the 720x400 text mode. Which...well, becomes unreadable.

So I am wondering if there is an option to just change it slightly, adjust the resolution slightly (like add an extra line of pixels) or adjust the framerate to just 69Hz or something similar. Both would do, so that the recording tool can make the distinction. Ofc that means that the same change must not also apply on 320x200 games. Currently both are affected the same way.

I am also wondering if there aren't some more generic drivers which can maybe help.

Edit: In the Directly from vga240 I also found tmodeset. This allows to change pixelclock between 8 and 9. And with set setting the refresh rate to 78.731 and the resolution to 560x430. That's not a great option, as a TFT cant display it anymore. But it goes into the right direction at least. Unfortunately its also lost, once you re-enter text mode.

Reply 1 of 5, by clb

User metadata
Rank Member
Rank
Member

The DOS 40 columns CGA text mode (modes 00h and 01h) is actually a 320x200 display mode only on proper CGA display adapters.

On VGA adapters this CGA text mode is replaced with a 360x400 pixels video mode, not 320x200. This is because they added a 9th column of pixels between each character on the screen for increased readability, making the horizontal resolution 40*9=360 pixels instead of 40*8 pixels, and VGA adapters also double scan the video mode.

So capturing the 40 columns 360x400 text mode as 720x400@70hz should be lossless, and then in OBS or another video editing program, you can downscale it to 360x400 or 360x200 if so desired.

You could edit the CRTC registers directly to change the refresh rate to 69hz by adding a few extra scanlines of vblank or vsync into the video mode. But I am not sure if that will fix the root problem you describe. If you do want to try this out, check out the Tweak 1.6b tool, it allows an interactive way of playing around with the CRTC registers without having to write any code. So that way you would be able to figure out how your capture setup would treat such a mode.

(Assuming we get CRT Terminator out the door at some point, it will be able to capture the DOS CGA 40 columns mode as 360x400@70hz, 720x400@60hz, 720x400@70hz, 1440x800@60hz, 1440x800@70hz and many other fixed resolutions, like 1024x768, 1280x1024, 1440x1080 and 1600x1200)

Reply 2 of 5, by Jo22

User metadata
Rank l33t++
Rank
l33t++

I *think* I've got seen an utility that might be useful.
It's called 67hertz.com or something..

Edit: Found the site: https://www.uwe-sieber.de/util_e.html
It's for mode 12h, though. I'm sorry. 🙁

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 3 of 5, by Kordanor

User metadata
Rank Member
Rank
Member
clb wrote on 2023-03-08, 22:52:

You could edit the CRTC registers directly to change the refresh rate to 69hz by adding a few extra scanlines of vblank or vsync into the video mode. But I am not sure if that will fix the root problem you describe. If you do want to try this out, check out the Tweak 1.6b tool, it allows an interactive way of playing around with the CRTC registers without having to write any code. So that way you would be able to figure out how your capture setup would treat such a mode.

You got a link for that? Furthest I got was to find that it's by "Robert Schmidt", and I saw it referenced a few times on github. But didnt find an actual program to download.

Jo22 wrote on 2023-03-09, 01:42:
I *think* I've got seen an utility that might be useful. It's called 67hertz.com or something.. […]
Show full quote

I *think* I've got seen an utility that might be useful.
It's called 67hertz.com or something..

Edit: Found the site: https://www.uwe-sieber.de/util_e.html
It's for mode 12h, though. I'm sorry. 🙁

Just tested that, and yeah, its doing something differently.
Weird thing is, that it also changes how my CRT interpretes the VGA Signal. Instead of 720x400 it's now "User Mode" (and the monitor applies some other settings to display it). Capture card still sees it as 720x400 though.
From what I understand it shouldnt even influence this resolution in the first place.

Reply 4 of 5, by clb

User metadata
Rank Member
Rank
Member

Check out the test suite at LCD monitor VGA compatibility database , I recall Tweak is part of that.

What kind of artifact/issue are you seeing with your capture? Capturing the CGA 360x400 mode as 720x400 should be artifact free, it will horizontally have twice the pixels in the image, but still should line up ok?

Reply 5 of 5, by Kordanor

User metadata
Rank Member
Rank
Member

Thank you, will test!
I am not having any issue by the mode in itself.
In this case I mostly would like to have a distinguishable difference between the normal Textmode and the 320x200 resolution. So that it can be scaled automatically and you don't need to manually switch the method of scaling each time.
The best picture for 320x200 games I get when using reducing 720x400 to 320x200 and then upscaling. But you can imagine, that for text mode this will result in garbage.
If I could change the Frequency or resolution of textmode only without affecting 320x200 games, then that would be perfect.

Incidentally something like that might also circumvent the issue VisionRGB Capture with 640x480 capture, which doesnt work perfectly with 60Hz, but apparently does work with some other refresh rate.