Custom Video Modes Test Thread

Discussion about displays and related hardware including MiSTer filters and video settings.
ash2fpga
Posts: 237
Joined: Tue May 26, 2020 6:20 pm
Has thanked: 62 times
Been thanked: 28 times

Re: Custom Video Modes Test Thread

Unread post by ash2fpga »

aitotat wrote: Wed Jan 27, 2021 8:51 am Edit:
Same problem with NES core except scandoubler has no effect. I retested scandoubler on SNES core and it does have effect and i think it is because with scandoubler disabled it outputs 512x224 and with scandoubler enabled it outputs 256x448. The difference in horizontal resolution surely has some effect on the scaler. But shouldn't the core output 512x448 when scandoubler is enabled?
My findings with forced_scandoubler:
viewtopic.php?p=14619#p14619
aitotat
Posts: 29
Joined: Wed Sep 09, 2020 6:17 pm
Has thanked: 1 time
Been thanked: 3 times

Re: Custom Video Modes Test Thread

Unread post by aitotat »

I'm more convinced that the scaler applies some sort of horizontal filtering no matter what. I calculated custom resolutions for GBA core since the default just flickers few seconds and goes out of sync on my monitor. Here they are:

Code: Select all

video_mode=1440,90,140,250,1080,1,3,38,128208 ; 4:3
video_mode=960,22,148,150,720,3,5,28,57797 ; 4:3
video_mode=1440,48,32,80,960,1,3,30,113988 ; 3:2 (shares monitor settings with 1280x960 mode)
video_mode=960,50,146,110,640,1,4,25,50662 ; 3:2
It is very easy to do comparisons since there is Super Mario World also on GBA. And it happens to have the exact "shadow" scaling problem with all those modes, even with 3:2 aspect ratio modes that are native to GBA. I even tried to set 1:1 and 3:2 custom aspect ratios but no help from there. One setting does matter. Setting 2xresolution to anything else than off does help. Maybe because horizontal resolution changes like on SNES core with scandoubler. Scandoubler works with GBA core but i didn't notice any difference with or without.

But about those custom GBA resolutions. Use those hi-res versions if LCD effects are needed.
ash2fpga
Posts: 237
Joined: Tue May 26, 2020 6:20 pm
Has thanked: 62 times
Been thanked: 28 times

Re: Custom Video Modes Test Thread

Unread post by ash2fpga »

aitotat wrote: Thu Jan 28, 2021 7:54 am I'm more convinced that the scaler applies some sort of horizontal filtering no matter what.
That seems possible. See this example: viewtopic.php?p=8182#p8182
FoxbatStargazer
Top Contributor
Posts: 995
Joined: Thu Dec 10, 2020 5:44 pm
Has thanked: 309 times
Been thanked: 228 times

Re: Custom Video Modes Test Thread

Unread post by FoxbatStargazer »

So I'm still pretty sure that the letter shadows are interpolation artifacts, and if you align the core output to the perfect resolution, they will vanish while using "interpolation (sharp)". However I am finding that the GBA core is treating aspect ratio very wierdly, given that it should be spitting out perfectly square pixels. So far the only resolution that eliminates letter shadows in "interpolation (sharp)" filter is 480x480. Everything else I've tried so far is showing clear scaling artifacts, and anything other than "no interpolation" shows letter shadows (i.e. sign of interpolation.) I might try later to see if I can find any other working resolutions so we can figure out what is going on with the GBA core.

"No interpolation" also seems to eliminate letter shadows in all resolutions, however you will have distortion/shimmering if the resolution isn't perfectly aligned. Internal scaler is some kind of interpolation and I would ignore it for now, interpolation (sharp) should yield the best results if you do have to interpolate, and should be 100% clean (i.e. identical to "no interpolation") if the resolution is perfectly aligned with the core output.

It should be expected that 2x resolution cuts the letter shadows to half size in most cases because you've effectively doubled the core's output resolution that the scaler gets to work with. I.e. it has more data to deliver a more accurate interpolation if it has to interpolate.
FoxbatStargazer
Top Contributor
Posts: 995
Joined: Thu Dec 10, 2020 5:44 pm
Has thanked: 309 times
Been thanked: 228 times

Re: Custom Video Modes Test Thread

Unread post by FoxbatStargazer »

OK I think I figured it out?

The GBA core doesn't seem to respect integer scaling. Your horizontal resolution must be a multiple of the GBA's 240 horizontal resolution (480 if you want to use 2x resolution) because its going to fully fill it out, and this is the only way to avoid scaling artifacts. It does assume that your target is square pixels so you can make your vertical resolution basically whatever you want. (i.e. probably 4:3 to please a CRT monitor.) The framedoubler does effect scaling so I would turn that off when using vga_scaler.

Also note that interpolation (sharp) isn't as sharp as can be. It seems to merely do an integer upscale to 2x and then apply some amount of bilinear smoothing. So at high resolutions you may get some slight blur or artifacts, and I could see a bit of the letter shadow this way. If you're confident you got things lined up then using the no interpolation filter should avoid any shadow stuff and no distortion. Although it also seemed like 2x resolution at 960 wide also showed no difference between sharp interpolation and no interpolation. (I'm assuming because the 2x resolution bumps it up to 480 wide and then the sharp interpolation does a clean 2x integer scale to 960)

Also remember that CRTs (especially my crappy one) have masks/grilles to deal with. As you raise the resolution and look closely, you may spot a different kind of mild artifacts as the pixels do not line up perfectly with the mask/grille. Don't know of any fix for this besides move to an LCD, get a better CRT, or keep the resolution lower.
aitotat
Posts: 29
Joined: Wed Sep 09, 2020 6:17 pm
Has thanked: 1 time
Been thanked: 3 times

Re: Custom Video Modes Test Thread

Unread post by aitotat »

There is an excellent description about custom aspect ratios on other thread. But it didn't help here. I tested SMW on SNES core a bit more. It looks like there is also vertical scaling as well (and i do have vscale_mode=1). It can be only seen with forced_scandoubler=0 and it is harder to see. I think the red S shows it the best, at least on my monitor. Take a look just below the topmost black border of red S. Blinking with no interpolation filter helps to show it. I cannot see it with forced_scandoubler=1 (or it is too hard to notice).

I have a theory. Take a look at the picture on this post. I happen to use the same background picture, except on my monitor it looks crap in comparison. It must be because the scaler has 24-bit framebuffer but the Mister VGA can only output at 18-bit resolution. Maybe that is the reason with the "shadows" as well? Internal filter does something at 24-bit that is not properly converted to analog signal. Why the no interpolation filter does work fine? I don't know.

Here is a photo of the background picture on my monitor. For example, take a look how the red behaves: light, dark, light, dark, light, dark (shadow?)...
d909
Posts: 35
Joined: Sat Sep 12, 2020 3:21 am
Has thanked: 1 time
Been thanked: 10 times

Re: Custom Video Modes Test Thread

Unread post by d909 »

Sigismond0 wrote: Tue May 26, 2020 5:26 pm This video mode is the best I've found so far for displaying the menu with a VGA scaler. Very useful for anyone wanting to run scripts without HDMI, or who just want a wallpaper on CRT.

Code: Select all

[Menu]
video_mode=512,42,62,64,224,11,21,6,10689
vga_scaler=1
The 512x224 resolution gets the menu aspect ratio very close to where it is without VGA scaler on, and should get your H/V center and overscan just about perfect if you calibrated your TV using 240p test suite on SNES.
This video mode doesn't work properly on a lot of monitors. Anyone who's having problems might want to try this instead:
video_mode=512,31,48,73,224,10,3,23,10400
aitotat
Posts: 29
Joined: Wed Sep 09, 2020 6:17 pm
Has thanked: 1 time
Been thanked: 3 times

Re: Custom Video Modes Test Thread

Unread post by aitotat »

I found pretty much perfect custom resolution for ao486. This displays perfectly CGA/EGA and VGA graphics modes and with a little trick DOS text mode as well. This is not ideal for SVGA (800x600 and up) but i don't need those at all.

Anyway, here is 1280x1440:

Code: Select all

video_mode=1280,50,142,240,1440,1,3,56,179983
320x200, 640x200, 640x350 and 640x400 resolutions all multiplies to 1400 scanlines. 320x240 and 640x480 multiplies to 1440 scanlines. But what is more remarkable is that those that multiplies to 1400 scanlines use 70 Hz refresh rate and 1440 scanline modes just happen to use 60 Hz refresh rate. That means they use different settings preset on monitor so it is possible to adjust all those resolutions to full screen with correct 4:3 aspect ratio!

But there is one thing... Default VGA text mode uses 9x16 pixel font and that means 720x400 resolution. That width doesn't fit without scaling to 1280 pixels but the text mode resolution can be changed. Here is little utility i wrote about 10 years ago.
Just run vga350.com and "mode co80" after that (mode comes with DOS). I recommend to place them to autoexec.bat. Now text mode uses EGA 640x350 resolution and 8x14 font. There is also vga200.com if you want CGA look.

Here are some example pictures along with ao486 settings to use. Also filter must be set to no interpolation because otherwise the usual shadows are present with default filter. Forced_scandoubler should not matter but vscale_mode must be 1.

Also note that this mode is for CRTs only and it requires quite good VGA CRT monitor. 1440 scanlines are a lot for CRT.

Edit: What was i thinking? Of course 400 scanline mode does not scale properly to 1440 but 200 does to 1400 but only when forced_scandoubler=0.
User avatar
Newsdee
Top Contributor
Posts: 830
Joined: Mon May 25, 2020 1:07 am
Has thanked: 98 times
Been thanked: 209 times

Re: Custom Video Modes Test Thread

Unread post by Newsdee »

Does anybody have a config line for a 1720x1440 resolution?

I have a new 3440x1440 screen which can run two inputs at 1720x1440 side-by-side...
I can get my PC to use this resolution, but now I'm trying to do the same on MiSTer.

I guess that on 4:3 systems I would probably get only 1720x1290 (with black bars on top and bottom),
but it might be better than using my default config (1920x1080p) which gives me black bars on the side.
User avatar
mapf
Posts: 153
Joined: Mon Aug 31, 2020 8:05 pm
Has thanked: 58 times
Been thanked: 51 times

Re: Custom Video Modes Test Thread

Unread post by mapf »

Newsdee wrote: Thu Feb 11, 2021 12:13 pm Does anybody have a config line for a 1720x1440 resolution?
I use this site to calculate a linux X11 modeline: https://arachnoid.com/modelines/
The I convert it to the MiSTer format here: https://morf77.pythonanywhere.com/

But: 1720x1440 @ 60.00 Hz needs a pixel clock of 210 MHz and to my knowledge this will exeed the MiSTer hardware capabilities.
User avatar
Newsdee
Top Contributor
Posts: 830
Joined: Mon May 25, 2020 1:07 am
Has thanked: 98 times
Been thanked: 209 times

Re: Custom Video Modes Test Thread

Unread post by Newsdee »

It worked! Not too shabby!

Code: Select all

video_mode=1720,128,184,312,1440,1,3,46,209550
20210211_213954.jpg
20210211_213954.jpg (3.18 MiB) Viewed 9288 times
Bahn Yuki
Posts: 9
Joined: Sat Oct 17, 2020 2:39 am
Has thanked: 1 time
Been thanked: 1 time

Re: Custom Video Modes Test Thread

Unread post by Bahn Yuki »

Can you apply these custom aspect ratios with a super resolution 3840x240p@120hz? If so how would it look in the ini?
User avatar
mapf
Posts: 153
Joined: Mon Aug 31, 2020 8:05 pm
Has thanked: 58 times
Been thanked: 51 times

Re: Custom Video Modes Test Thread

Unread post by mapf »

Bahn Yuki wrote: Thu Feb 11, 2021 3:59 pm Can you apply these custom aspect ratios with a super resolution 3840x240p@120hz? If so how would it look in the ini?
I tried it like this:

Code: Select all

[SNES]
forced_scandoubler=0
vga_scaler=1
vsync_adjust=0
video_mode=1280,32,128,160,224,1,3,13,46270
custom_aspect_ratio_1=1280:224
Gives nice fullscreen with scanlines on my VGA CRT.
Attachments
2021-02-11 20.54.18.jpg
2021-02-11 20.54.18.jpg (3.9 MiB) Viewed 6622 times
nemesis
Posts: 3
Joined: Tue Mar 09, 2021 5:38 pm
Has thanked: 10 times

Re: Custom Video Modes Test Thread

Unread post by nemesis »

General question: can (false) video mode settings harm a CRT?
rodimus
Posts: 2
Joined: Thu Sep 29, 2022 6:41 pm

Re: Custom Video Modes Test Thread

Unread post by rodimus »

Does anyone have settings for 1080p 4:3 at 60hz and 50hz? I tried this one:
video_mode=1440,90,140,250,1080,1,3,38,128208 ; 4:3
but I'm getting pixel clumps on the right edge.
Post Reply