Custom Video Modes Test Thread

Discussion about displays and related hardware including MiSTer filters and video settings.
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 noticed something wrong with the 512x448 mode (video_mode=512,16,48,32,448,0,3,49,18240). Left and right edges are "compressed" meaning the pixel width is not the same across the picture. It can be noticed easily on some side scrolling games. I've used this mode on NES and SNES cores and the problem is the same. I've tested the graphics mode on two monitors (Dell P992 and Nokia 920C non-trinitron model) and both show the problem. Well, perhaps it can be more easily seen with the Dell but maybe because that is what I've used so far and only did a quick test with the Nokia.
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 »

The 64:49 aspect ratio at 448p will give you 585x448.
User avatar
morf77
Posts: 63
Joined: Fri Aug 28, 2020 1:42 pm
Has thanked: 12 times
Been thanked: 24 times

Re: Custom Video Modes Test Thread

Unread post by morf77 »

aitotat wrote: Fri Jan 15, 2021 9:49 am I noticed something wrong with the 512x448 mode (video_mode=512,16,48,32,448,0,3,49,18240). Left and right edges are "compressed" meaning the pixel width is not the same across the picture. It can be noticed easily on some side scrolling games. I've used this mode on NES and SNES cores and the problem is the same. I've tested the graphics mode on two monitors (Dell P992 and Nokia 920C non-trinitron model) and both show the problem. Well, perhaps it can be more easily seen with the Dell but maybe because that is what I've used so far and only did a quick test with the Nokia.
The modeline I use on the NES core (since it uses 256x240 orginally):

Code: Select all

video_mode=512,16,48,64,480,1,3,13,19080
I haven't noticed the pixel compression issue on the SNES core with 512x448 video_mode. Is there a game I can easily detect this on (didn't notice it in UN Squadron but maybe I'm not seeing it)?
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 »

morf77 wrote: Fri Jan 15, 2021 4:58 pm Is there a game I can easily detect this on
It is very easy to test it with NES game Ducktales. Start Amazon stage and move so you see first two chests. Move to a position where the second chest is at the right side of the screen. The first one is then close to a screen center. On 512 modes i can easily see that the chest on the right edge is thinner than the one on the center.

I took three photos to show this:
This is from the 512x448 mode, next is the 512x480 mode and last with vga_scaler disabled where everything looks correct. I forgot to disable hq2x when i took those photos. It doesn't effect on the problem.
User avatar
morf77
Posts: 63
Joined: Fri Aug 28, 2020 1:42 pm
Has thanked: 12 times
Been thanked: 24 times

Re: Custom Video Modes Test Thread

Unread post by morf77 »

I'm seeing the same issue using the vga_scaler. I disable it on my NES core. Is there a reason why you would use the vga_scaler? vga_scaler off with custom video_mode seems to give correct pixels (using 512x480)

ps: I was for a long time confused by this vga_scaler setting, I assumed it was necessary to enable to allow custom video modes but it seems this is not the case. custom video_modes seem to work fine using just scandoubler. I think this should be made more clear on the wiki.
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 »

morf77 wrote: Sat Jan 16, 2021 1:54 pm I'm seeing the same issue using the vga_scaler. I disable it on my NES core. Is there a reason why you would use the vga_scaler? vga_scaler off with custom video_mode seems to give correct pixels (using 512x480)
No, the scaler is required for custom resolutions. If i disable scaler the core outputs the default resolution instead of custom one. My monitor settings defaults to 640x480 for NES and SNES cores and that is exactly what i'm trying to avoid so i wouldn't have to adjust screen settings every time i use cores displaying at actual 640x480 resolution.

I believe there is something wrong with those 512 mode parameters. I found a working one for 512x448. It is video_mode=512,36,51,84,448,24,6,47,21550. Unfortunately it isn't any better than the core default since this mode too uses 640x480 settings on my monitor.

But i did found something else. This is 512x512 mode and can be used with NES and SNES: video_mode=512,8,48,64,512,1,6,31,20544. This mode uses it's own settings on my monitor. I need to adjust screen height to maximum. This mode gives thin but nice natural scanlines and is definetly the best compromise so far.
calle81
Posts: 11
Joined: Sun May 24, 2020 9:35 pm
Has thanked: 3 times
Been thanked: 1 time

Re: Custom Video Modes Test Thread

Unread post by calle81 »

Hi, is there a video mode that can be used to flip tate games so one doesn't have to lay the a crt down in order to play DoDonPachi as an example?

I tried with:

[ddonpach]
vga_scaler=1
video_mode=320,48,32,80,240,3,6,26,154128

but that will only show a small part of the image.
calle81
Posts: 11
Joined: Sun May 24, 2020 9:35 pm
Has thanked: 3 times
Been thanked: 1 time

Re: Custom Video Modes Test Thread

Unread post by calle81 »

Stretched to 16:9 in the core settings that looks a lot better for some reason wit DoDonPachi. However there's a lot of horizontal lines. (screen tearing?)
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 »

Two new modes for NES and SNES. First one is 1024x960:

Code: Select all

video_mode=1024,30,100,190,960,1,3,30,80284
This mode has one problem. Is uses same settings as 1280x960 mode on my monitor. I'd rather save 1280x960 as an alternative to 320x240/640x480.

So again 1024 scanline mode comes to rescure:

Code: Select all

video_mode=1024,32,78,210,1024,1,3,38,86100
This mode is a good alternative to the 512x512 mode i posted earlier. 1024x1024 is very good if you don't want scanlines or if you prefer MiSTer scanlines instead.

Just in case here is how I've configured mister ini:

Code: Select all

vga_scaler=1
vscale_mode=1
vsync_adjust=2
Aspect ratio must be set to full from core settings. I also noticed that video filter must be set to no interpolation. With core default there will be some horizontal scaling artifacts for some reason.

Edit: Latest SNES core fixed the artifacts but i think there is still some scaling with scale filter - internal. Custom - No interpolation seems to give cleaner output.
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've been trying to figure out the scaling problem i have with the custom resolutions. I took some photos to show the problem. One of the photos is taken with scaler disabled and everything is correct. The rest are taken with video mode 4 (1280x1024@60Hz). Custom resolutions have exactly the same problem so i tried with one of the predefined modes just to make sure the problem is not with custom video mode parameters.

There are two jpg photos taken with video mode 4. The other has scale filter - internal. It is this one that shows the problems. The other video mode 4 photo has scale filter - no interpolation set. It doesn't have the problem. There is also one png picture where i marked some of the problems. They are basically shadows that always appear at the right side of those black text borders. This problem is not related to the SNES core. NES core has the same problem. I have not tested with other cores.

Are these "shadows" normal behavior of the scaler or what is wrong? I'm using Dell p992 monitor and Mister IO board v6.1.
FoxbatStargazer
Top Contributor
Posts: 1018
Joined: Thu Dec 10, 2020 5:44 pm
Has thanked: 315 times
Been thanked: 238 times

Re: Custom Video Modes Test Thread

Unread post by FoxbatStargazer »

Its normal, that's interpolation between the black letter and blue sky because you aren't running an integer scale on the horizontal axis. The fourth picture is nearest neighbor so you will see zero blurring, instead distortion or shimmer will be apparent when scrolling.
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 »

FoxbatStargazer wrote: Tue Jan 26, 2021 4:27 pm Its normal, that's interpolation between the black letter and blue sky because you aren't running an integer scale on the horizontal axis.
But that also happens when i'm using custom 512 or 1024 pixel wide video modes (with vscale_mode=1). This is what confuses me. If that is still correct, then everything is ok and i just need to use the the no interpolation filter for custom resolutions meant for VGA CRT.
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: Tue Jan 26, 2021 4:59 pm
FoxbatStargazer wrote: Tue Jan 26, 2021 4:27 pm Its normal, that's interpolation between the black letter and blue sky because you aren't running an integer scale on the horizontal axis.
But that also happens when i'm using custom 512 or 1024 pixel wide video modes (with vscale_mode=1). This is what confuses me. If that is still correct, then everything is ok and i just need to use the the no interpolation filter for custom resolutions meant for VGA CRT.
I think this is because of the aspect ratio being used.

For example, using resolution of 256x224, and aspect ratio of 64:49, you would not get integer scale on the horizontal axis. You would have to set custom aspect ratio of 56:49 (same as 8:7).

What you see with those settings could be display-dependent. You could need geometry controls to restore the correct aspect ratio.
FoxbatStargazer
Top Contributor
Posts: 1018
Joined: Thu Dec 10, 2020 5:44 pm
Has thanked: 315 times
Been thanked: 238 times

Re: Custom Video Modes Test Thread

Unread post by FoxbatStargazer »

Integer scaler settings only apply to the vertical axis. Setting your horizontal resolution to an integer multiple does not guarantee horizontal integer scaling. By default the NES core pushing 4:3 aspect ratio is still trying to map wide pixels to what it assumes is a square pixel resolution, and they don't align perfectly. The trick mentioned above is to set a custom aspect ratio that mathematically results in the NES output becoming square pixels. Its also possible to go for non-square integer scales like 5x4 using the custom aspect ratio (10/7 I think? in the case of NES)

Some kind of easy 1:1 Pixel Aspect Ratio scaling mode to use in all cores would be great, but we don't have anything like that at the moment.
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 »

No luck with custom aspect ratios on SNES core. It seems the 56:49 or 8:7 is the same as full screen and 64:49 is the same as original that are selectable from aspect ratio menu. I did test with many different custom aspect ratios on 1024x1024 and 1280x1024 graphics modes but never did the "shadows" go away.

Eventually i did find something that effects them. I had forced_scandoubler=1 but when i tried to set it to 0, things got better. The "shadows" were certainly less noticable. In fact i don't think i would have noticed them if scandoubler would have been disabled when i started testing custom resolutions. The shadows are still there. It can be easily tested by quickly switching between internal and no interpolation filter.

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?
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: 1018
Joined: Thu Dec 10, 2020 5:44 pm
Has thanked: 315 times
Been thanked: 238 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: 1018
Joined: Thu Dec 10, 2020 5:44 pm
Has thanked: 315 times
Been thanked: 238 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: 37
Joined: Sat Sep 12, 2020 3:21 am
Has thanked: 1 time
Been thanked: 13 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: 873
Joined: Mon May 25, 2020 1:07 am
Has thanked: 104 times
Been thanked: 239 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: 164
Joined: Mon Aug 31, 2020 8:05 pm
Has thanked: 58 times
Been thanked: 56 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: 873
Joined: Mon May 25, 2020 1:07 am
Has thanked: 104 times
Been thanked: 239 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 11483 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: 164
Joined: Mon Aug 31, 2020 8:05 pm
Has thanked: 58 times
Been thanked: 56 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 8817 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: 3
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