VGA Output, Scalers, and CRTs

deepthaw
Posts: 55
Joined: Wed May 27, 2020 3:45 am
Has thanked: 1 time
Been thanked: 10 times

Re: VGA Output, Scalers, and CRTs

Unread post by deepthaw »

d909 wrote: Tue Sep 15, 2020 3:17 am
deepthaw wrote: Tue Sep 15, 2020 3:09 am If my numbers are right, that’s 640x400 @ 60Hz, which is definitely not vga standard.
If that's the case, then I'd expect when I run a game the MiSTer tries to output a native 320x200 signal which is below the monitor's minimum 15khz, which is why I need to set Low-Res to 4x in the menus. This brings it up to the same 640x400 which my monitor is able to display.
VGA 320x200 was actually output as 640x400. The VGA card would doublescan the signal when sending it to the monitor. Same for 640x480/320x240.
d909
Posts: 35
Joined: Sat Sep 12, 2020 3:21 am
Has thanked: 1 time
Been thanked: 10 times

Re: VGA Output, Scalers, and CRTs

Unread post by d909 »

deepthaw wrote: Tue Sep 15, 2020 4:34 pm
thorr wrote: Tue Sep 15, 2020 4:31 am 640x400 was a very common resolution back then.
It was, but at 70Hz, not 60Hz. 60Hz drops the horizontal refresh to below 31Khz.
And that explains the mild stuttering I see.
Televicious
Posts: 93
Joined: Mon May 25, 2020 8:23 pm
Been thanked: 4 times

Re: VGA Output, Scalers, and CRTs

Unread post by Televicious »

thorr wrote: Tue Sep 15, 2020 4:37 am My CRT has been getting less and less reliable and finally won't show a picture anymore unfortunately. As a replacement, I have a 1280x1024 Dell flatscreen LCD monitor that has a VGA input. I have been playing with the settings and I got it to look like a real DOS machine. This might help those who still have working CRT monitors that want it to appear genuine even though it is scaling it. Here are the relevant Mister.INI settings:
vga_scaler=0
forced_scandoubler=1
direct_video=0
video_mode=4 <-- For CRT, I would suggest a 4:3 mode like video_mode=1 or a custom resolution of 1600x1200: video_mode=1600,64,192,304,1200,1,3,46
vscale_mode=0
fb_size=0
fb_terminal=1
vsync_adjust=1 (or 2 if it works - mine does)

And the trick that makes it look perfect is to set the Scale Filter to Custom and Scanlines (Soft).txt from within the Core on the System page of the menu. When launching Monkey Island 2, it looked a little soft/blurry, and I changed it to Scanlines (Sharp).txt and it looked pretty good. I went back to DOS and it still looked pretty good. So, I will keep it at Sharp. Edit: play with all the filters, there are some nice ones in there. Bottom line, using these custom scale filters fixes the wonky looking scaling especially with DOS text. My new favorite is Normal Upscaling - bilinearsharp_08. It looks great for games and text.

Hope this helps.
Video_mode is the scaled resolution though. When vga_scaler is 0 that video mode is bypassed and the core is displaying a raw video signal. I have all the same settings except forced scandoubler which I've tried with and without and it makes no difference. You can boot up in DOS terminal just fine like that screenshot shows, but as soon as Windows 3.11 or a game is executed the resolution changes and the screen is a static corrupted mess. This is on any VGA monitor CRT or LCD.
d909
Posts: 35
Joined: Sat Sep 12, 2020 3:21 am
Has thanked: 1 time
Been thanked: 10 times

Re: VGA Output, Scalers, and CRTs

Unread post by d909 »

Televicious wrote: Tue Sep 15, 2020 6:45 pm Video_mode is the scaled resolution though. When vga_scaler is 0 that video mode is bypassed and the core is displaying a raw video signal. I have all the same settings except forced scandoubler which I've tried with and without and it makes no difference. You can boot up in DOS terminal just fine like that screenshot shows, but as soon as Windows 3.11 or a game is executed the resolution changes and the screen is a static corrupted mess. This is on any VGA monitor CRT or LCD.
Did you set Low-Res to 4x in the ao486 menus (not the ini)? I needed to do that to make games work - though it was a sync problem, and not what you describe.

I haven't tried windows 3.11 - only Windows 95. Windows 95 works fine in 16 color mode, but I get a "static corrupted mess" if I set the color depth any higher. I understand this to be because I haven't installed the video driver.
Televicious
Posts: 93
Joined: Mon May 25, 2020 8:23 pm
Been thanked: 4 times

Re: VGA Output, Scalers, and CRTs

Unread post by Televicious »

Yea, tried with 4x mode, no difference. I guess in Windows 95 the video drivers must work for DOS mode? In plain DOS 6.22 resolution changes corrupt the screen. Also, in win 3.1 or 3.11 the video drivers don't really display up to spec, 640x480 can do 32 million colors, but 1024x768 is only 256 and 1280x1024 is either 16 color or doesn't work, I forget. I found the best mode for function is just 640x480 in the scaler. Everything works and most application and windows looks ok, but anything that doesn't scale well into that is super chunky looking. I'm primarily just trying to output on the CRT which is an OG VGA monitor that does 15k and 31k because it was made for use with Amiga 2000, but use the DELL LCD for testing. With that alone I used scaled 1280x1024. I'll upload a shot of what the screen turns to when res changes on unscaled mode.
Televicious
Posts: 93
Joined: Mon May 25, 2020 8:23 pm
Been thanked: 4 times

Re: VGA Output, Scalers, and CRTs

Unread post by Televicious »

20200915_133700.jpg
20200915_133700.jpg (4.3 MiB) Viewed 11248 times
I have the dell on scaled vid mode 4 and the crt on unscaled vga. If I run the dell unscaled it displays the same image.
d909
Posts: 35
Joined: Sat Sep 12, 2020 3:21 am
Has thanked: 1 time
Been thanked: 10 times

Re: VGA Output, Scalers, and CRTs

Unread post by d909 »

I am running Windows 95 - in other words, DOS 7.0. I did not install any video drivers. It doesn't seem likely that dos 7 vs 6.22 would be the problem, but it is a difference worth investigating perhaps? I know those Amiga monitors can do 15khz and 31khz, but are you absolutely certain they do 27khz? I have a couple sony pro monitors that also do 15 and 31 khz, but nothing in between. I WOULD expect the image to move around a bunch if it was a sync problem though.
d909
Posts: 35
Joined: Sat Sep 12, 2020 3:21 am
Has thanked: 1 time
Been thanked: 10 times

Re: VGA Output, Scalers, and CRTs

Unread post by d909 »

It seems worth noting that when I try to run win 95 in 256 or higher color mode, the corruption I get, which is vaguely similar to yours, only appears from the VGA port and not through the scaled HDMI... Similar to what you describe. So I guess definitely try win 95?

Edit: I tried DOS 6.22. Games still work. Guess that isn't it.
Televicious
Posts: 93
Joined: Mon May 25, 2020 8:23 pm
Been thanked: 4 times

Re: VGA Output, Scalers, and CRTs

Unread post by Televicious »

So I tried the 4x mode and set vsync to 60 instead of variable and now low res DOS games do work unscaled. Windows 3.1 and oregon trail deluxe however are still broken like this.
d909
Posts: 35
Joined: Sat Sep 12, 2020 3:21 am
Has thanked: 1 time
Been thanked: 10 times

Re: VGA Output, Scalers, and CRTs

Unread post by d909 »

IMG_0119.jpeg
IMG_0119.jpeg (4.17 MiB) Viewed 11244 times
This is running in DOS 6.22.
d909
Posts: 35
Joined: Sat Sep 12, 2020 3:21 am
Has thanked: 1 time
Been thanked: 10 times

Re: VGA Output, Scalers, and CRTs

Unread post by d909 »

Televicious wrote: Tue Sep 15, 2020 8:08 pm So I tried the 4x mode and set vsync to 60 instead of variable and now DOS games do work unscaled. Windows 3.1 however is still broken like this.
Oh, it never occurred to me to mess with that setting. I set it to variable, and it still works for me. But now at 31khz / 70hz, where its supposed to be! This seems to have largely if not entirely fixed my stuttering.
thorr
Top Contributor
Posts: 1100
Joined: Mon Jul 06, 2020 9:37 pm
Has thanked: 537 times
Been thanked: 252 times

Re: VGA Output, Scalers, and CRTs

Unread post by thorr »

Televicious wrote: Tue Sep 15, 2020 6:45 pm
thorr wrote: Tue Sep 15, 2020 4:37 am My CRT has been getting less and less reliable and finally won't show a picture anymore unfortunately. As a replacement, I have a 1280x1024 Dell flatscreen LCD monitor that has a VGA input. I have been playing with the settings and I got it to look like a real DOS machine. This might help those who still have working CRT monitors that want it to appear genuine even though it is scaling it. Here are the relevant Mister.INI settings:
vga_scaler=0 <-- Should be 1
forced_scandoubler=1
direct_video=0
video_mode=4 <-- For CRT, I would suggest a 4:3 mode like video_mode=1 or a custom resolution of 1600x1200: video_mode=1600,64,192,304,1200,1,3,46
vscale_mode=0
fb_size=0
fb_terminal=1
vsync_adjust=1 (or 2 if it works - mine does)

And the trick that makes it look perfect is to set the Scale Filter to Custom and Scanlines (Soft).txt from within the Core on the System page of the menu. When launching Monkey Island 2, it looked a little soft/blurry, and I changed it to Scanlines (Sharp).txt and it looked pretty good. I went back to DOS and it still looked pretty good. So, I will keep it at Sharp. Edit: play with all the filters, there are some nice ones in there. Bottom line, using these custom scale filters fixes the wonky looking scaling especially with DOS text. My new favorite is Normal Upscaling - bilinearsharp_08. It looks great for games and text.

Hope this helps.
Video_mode is the scaled resolution though. When vga_scaler is 0 that video mode is bypassed and the core is displaying a raw video signal. I have all the same settings except forced scandoubler which I've tried with and without and it makes no difference. You can boot up in DOS terminal just fine like that screenshot shows, but as soon as Windows 3.11 or a game is executed the resolution changes and the screen is a static corrupted mess. This is on any VGA monitor CRT or LCD.
Yeah, I forgot about that. Remember I am on an LCD now because my CRT died, so that vga_scaler setting is most likely not used in my case. It should be vga_scaler=1. I will go back and edit my post. The idea is to set it to one resolution and everything scales to that. Using the Scale Filter is what makes it look good instead of crappy. I know this is not what we ultimately want since CRT monitors should be able to display all the resolutions, but since it doesn't work with ao486, this is the next best thing in my opinion and it looks pretty good at least on my LCD. Wish I could try it on my CRT. Let me know how it goes...
Televicious
Posts: 93
Joined: Mon May 25, 2020 8:23 pm
Been thanked: 4 times

Re: VGA Output, Scalers, and CRTs

Unread post by Televicious »

Yea, still has some bugs. Any higher res dos games or windows 3.1 are still broken. Willy beamish is working great though. I just assumed the 4x didn't work for dos games as win 3.11 wasn't being affected. Games with trouble would be oregon trail deluxe, duke nukem in vesa modes, SC2000. pretty much anything that is actual 640x480 and higher.
HMPoweredMan
Posts: 38
Joined: Fri Sep 11, 2020 7:37 pm
Been thanked: 2 times

Re: VGA Output, Scalers, and CRTs

Unread post by HMPoweredMan »

640x400 also doesnt work, but this is great so far. I'm using all your settings. vga_scaler is 0.

I too have the jittering though. Also strangely everything was tinted very green. Luckily I can compensate mostly with monitor settings for now.

If I could get rid of the jittering I'd be totally satisfied for now. All things considered it is WAY better than going through the scaler. It feels more responsive as well.
HMPoweredMan
Posts: 38
Joined: Fri Sep 11, 2020 7:37 pm
Been thanked: 2 times

Re: VGA Output, Scalers, and CRTs

Unread post by HMPoweredMan »

Turns out the green tint was due to the sync on green switch on the IO board. With that off, everything is great.

vga_scaler 0 is all I have set but in the core menu I do have the 4x option. Not sure if that's the cause of jittering or my monitor. I suspect the former.
A00D5569-0C5D-4377-A05E-A1C65DFCAF9D.jpeg
A00D5569-0C5D-4377-A05E-A1C65DFCAF9D.jpeg (452.71 KiB) Viewed 9243 times
User avatar
bootsector
Posts: 162
Joined: Sun May 24, 2020 6:58 pm
Has thanked: 4 times
Been thanked: 30 times

Re: VGA Output, Scalers, and CRTs

Unread post by bootsector »

Looking forward to native VGA output through IO board VGA connection on this core! It doesn't make sense to use scaler through VGA and the results are sub-optmal here with my CRT VGA monitor.
HMPoweredMan
Posts: 38
Joined: Fri Sep 11, 2020 7:37 pm
Been thanked: 2 times

Re: VGA Output, Scalers, and CRTs

Unread post by HMPoweredMan »

I don't think Sorgelig has plans to. Without understanding the technical hurdles I hope he reconsiders. This is an open source project though so maybe someone else can step in here since he's focusing on other great stuff like cd rom drive implementation.

https://github.com/MiSTer-devel/ao486_MiSTer/issues/6
User avatar
bootsector
Posts: 162
Joined: Sun May 24, 2020 6:58 pm
Has thanked: 4 times
Been thanked: 30 times

Re: VGA Output, Scalers, and CRTs

Unread post by bootsector »

HMPoweredMan wrote: Mon Sep 28, 2020 9:43 pm I don't think Sorgelig has plans to. Without understanding the technical hurdles I hope he reconsiders. This is an open source project though so maybe someone else can step in here since he's focusing on other great stuff like cd rom drive implementation.

https://github.com/MiSTer-devel/ao486_MiSTer/issues/6
Sorg is for sure not against implementing native VGA output via IO board. It's not just on his priority list. But if any FPGA developer comes up with a good solution for that, I'm pretty sure it will be merged in. I can't wait to enjoy native VGA outpur on my CRT monitor! :mrgreen:
HMPoweredMan
Posts: 38
Joined: Fri Sep 11, 2020 7:37 pm
Been thanked: 2 times

Re: VGA Output, Scalers, and CRTs

Unread post by HMPoweredMan »

You can have native resolutions for the most part.

While using VGA scaler set the video to 4x and the sync to variable. Save those settings to the default in the menu.

Now go to ini settings and set vga_scaler to 0

It works in most cases for me but because of the hsysnc it's a bit jittery but still far better than the janky scaler.

Need those chunky scanlines!
akeley
Top Contributor
Posts: 1303
Joined: Mon May 25, 2020 7:54 pm
Has thanked: 416 times
Been thanked: 399 times

Re: VGA Output, Scalers, and CRTs

Unread post by akeley »

bootsector wrote: Wed Sep 30, 2020 8:44 am Sorg is for sure not against implementing native VGA output via IO board. It's not just on his priority list. But if any FPGA developer comes up with a good solution for that, I'm pretty sure it will be merged in. I can't wait to enjoy native VGA outpur on my CRT monitor! :mrgreen:
For me it's still unclear if he's just not interested (which is understandable) or it just can't be done because of a technical issue.

I hope for the latter and that it will be eventually resolved. If it was it'd be my most used core, because maintaining an old PC with all the necessary slowdown shenanigans is a bit of a pain. Sometimes I wish there was a bounty list somewhere...
User avatar
bootsector
Posts: 162
Joined: Sun May 24, 2020 6:58 pm
Has thanked: 4 times
Been thanked: 30 times

Re: VGA Output, Scalers, and CRTs

Unread post by bootsector »

HMPoweredMan wrote: Wed Sep 30, 2020 1:35 pm You can have native resolutions for the most part.

While using VGA scaler set the video to 4x and the sync to variable. Save those settings to the default in the menu.

Now go to ini settings and set vga_scaler to 0

It works in most cases for me but because of the hsysnc it's a bit jittery but still far better than the janky scaler.

Need those chunky scanlines!
You're right! Aside of the jitter, it's pretty decent already! Hope this gets improved! Thanks for the tip!
thorr
Top Contributor
Posts: 1100
Joined: Mon Jul 06, 2020 9:37 pm
Has thanked: 537 times
Been thanked: 252 times

Re: VGA Output, Scalers, and CRTs

Unread post by thorr »

I think I may have found a solution. My CRT monitor is currently not working so I can't confirm 100% but it is working on my VGA connected flat panel monitor. I am able to have native resolutions without jitter or sync problems and it looks correct to my eyes. I am not using the scaler.

The trick is to set direct_video=0 for the ao486 core and don't turn on the scaler.

(main top section of Mister.ini)
vga_scaler=0
direct_video=1

[ao486]
direct_video=0

I can set Low-Res to Native and it works. On 4x the picture is sharper looking. On Native it looks more analog. Again this is on my flat panel. Somebody please try it on their CRT and confirm that it works and that you can display different resolutions. All I know is when I launch different games, I have to auto-adjust my monitor to get it to line up which leads me to believe that is changing resolutions. I have black bars on the top and bottom of my 5:4 display as I should with 4:3 resolutions.

Admittedly I am not exactly sure what direct_video is doing when using a VGA adapter, but I think and hope this will work for CRT users. I am planning to try to fix my CRT monitor. I think the flyback transformer needs replacing and I am hoping I can use any pin compatible one I find on ebay. I don't know if it needs to be specifically made for my monitor or not.
HMPoweredMan
Posts: 38
Joined: Fri Sep 11, 2020 7:37 pm
Been thanked: 2 times

Re: VGA Output, Scalers, and CRTs

Unread post by HMPoweredMan »

direct_video = 0 is my default option.
Your LCD monitor can probably just handle the off-spec hsync without jitter. I assume it has display lag and has some sort of internal analog to digital conversion that corrects it.
thorr
Top Contributor
Posts: 1100
Joined: Mon Jul 06, 2020 9:37 pm
Has thanked: 537 times
Been thanked: 252 times

Re: VGA Output, Scalers, and CRTs

Unread post by thorr »

Thanks for trying. Normally with a CRT you want direct_video=1 so you get the native timings. direct_video=0 re-times the signal a bit but seems to keep the same resolution (I assume). This could add a little lag, not sure. One thing I noticed is that Donkey Kong the arcade game is rotated as it should be with direct_video=0 and not with 1. Perhaps this has to do with my fb settings since a whole frame would have to be drawn in order to know how to rotate it to be upright. Maybe my settings are different than yours.

Here are my main defaults:
forced_scandoubler=1 ; set to 1 to run scandoubler on VGA output always (depends on core).
ypbpr=0 ; set to 1 for YPbPr on VGA output.
composite_sync=1 ; set to 1 for composite sync on HSync signal of VGA output.
vga_scaler=0 ; set to 1 to connect VGA to scaler output.
hdmi_limited=2 ; 1 - use limited (16..235) color range over HDMI
; 2 - use limited (16..255) color range over HDMI, for VGA converters.
direct_video=1 ; 1 - enable core video timing over HDMI, use only with VGA converters.
fb_size=0 ; 0 - automatic, 1 - full size, 2 - 1/2 of resolution, 4 - 1/4 of resolution.
fb_terminal=1 ; 1 - enabled (default), 0 - disabled
video_mode=4 ; 1280x1024x60
vsync_adjust=2 ; Set to 2 for low latency mode (single buffer).

[ao486]
direct_video=0

Edit: to be clear, I am using the HDMI output with a VGA converter, not the Analog VGA IO board.
Televicious
Posts: 93
Joined: Mon May 25, 2020 8:23 pm
Been thanked: 4 times

Re: VGA Output, Scalers, and CRTs

Unread post by Televicious »

Is it working with windows 3.11 or oregon trail deluxe?
Post Reply