MiSTer Custom Aspect Ratios for Horizontal Integer Scaling

Community created YouTube tutorials, interviews and helpful online information guides.
User avatar
BlockABoots
Posts: 43
Joined: Wed May 27, 2020 8:21 pm
Has thanked: 7 times

Re: MiSTer Custom Aspect Ratios for Horizontal Integer Scaling

Unread post by BlockABoots »

BlockABoots wrote: Tue Feb 16, 2021 8:54 pm
atrac17 wrote: Tue Feb 16, 2021 5:49 am
BlockABoots wrote: Mon Feb 15, 2021 8:43 pm

But i am getting an image on the screen just that it isnt fill the height of the TV screen and leaves borders at the top and bottom.
It's dependent upon the displays scaler. For instance Sony 4k televisions need the displays aspect ratio to be set to Wide Mode Full Screen 1. If not, the screen doesn't fill the bezel vertically at all. On an LG, you would need to set your displays aspect ration to Original for all aspect ratios listed in the MiSTer OSD/.ini to work. I don't own a Samsung nor do I know anyone with one to play around with the settings. Again, your display may not be compatible; when I say that it doesn't mean that it can't resolve the resolution.
Yeah that maybe the case.

The TV does allow a Custom picture setting where i can increase and decrease the screen size vertically and horizontally so there is that option but im not sure weather that would mess up the scaling or not for scanlines etc
Ok ive actual got this to work now correctly and get a full display that fills the top and bottom of the screen with no borders.

Im not sure if this is a bug or what not but the issue seemed to have been me having the following set in the MiSter.ini file.....

video_mode_ntsc=8

setting it back to the default....

video_mode_ntsc=0

then fixes the issue and gives me a full screen when using your modelines!!!!

Im not sure why setting 'video_mode_ntsc' to '8' (1920x1080) rather than the default '0' would make a difference but it does for some reason!
Yim
Posts: 125
Joined: Mon Jan 18, 2021 11:51 pm
Has thanked: 3 times
Been thanked: 87 times

Re: MiSTer Custom Aspect Ratios for Horizontal Integer Scaling

Unread post by Yim »

I find all this modeline stuff confusing, but if you haven’t got borders running a 224 line game on a 2160 line TV then you haven’t got vertical integer scaling. Unless that’s not what you’re aiming for and you’re just looking for horizontal integers?

Anyway, the reason you get smaller borders on video mode 0 (720 lines) is that the source resolution (224 lines) fits nine and a bit times into the final resolution (2160 lines). 9x224=2016. If your mister is set to 1080p, then it’ll multiply the source by four (to 896), and the TV’s upscaler will double that to 1792 (8x source rather than 9). If the mister is set to 720p, it’ll triple the source to 672 lines, and the TV will triple that again up to 2016, giving you a 9x final multiple.
User avatar
BlockABoots
Posts: 43
Joined: Wed May 27, 2020 8:21 pm
Has thanked: 7 times

Re: MiSTer Custom Aspect Ratios for Horizontal Integer Scaling

Unread post by BlockABoots »

Yim wrote: Sun Feb 21, 2021 1:55 amAnyway, the reason you get smaller borders on video mode 0 (720 lines) is that the source resolution (224 lines) fits nine and a bit times into the final resolution (2160 lines). 9x224=2016.
No no you miss understood, I'm not talking about the universal video mode option in the mister in file I'm talking about the secondary video option a few lines lower where you can set a video mode for Pal and NTSC modes.

Having the NTSC line changed to anything other than the default setting overrides Atrac17's modelines, hence they won't work as intended
User avatar
BlockABoots
Posts: 43
Joined: Wed May 27, 2020 8:21 pm
Has thanked: 7 times

Re: MiSTer Custom Aspect Ratios for Horizontal Integer Scaling

Unread post by BlockABoots »

So what is actually different from the 5x mode and the 5x compatibility mode???. As I have notice whilst I get a full display when using the 5x mode on some games I get odd graphic artifacts.

An example is Cadillacs and Dinosaurs, on the attract sequence when the character bio screen appears with the chequered background scrolling vertically that seems to glitch for a few frames and then on the next scene with the Cadillac driving across the desert the clouds seem to glitch every few frames. On the 5x Compatibility mode I don't get these glitches what so ever!.

So I'm just wondering what is altered between the 2 modes?
Yim
Posts: 125
Joined: Mon Jan 18, 2021 11:51 pm
Has thanked: 3 times
Been thanked: 87 times

Re: MiSTer Custom Aspect Ratios for Horizontal Integer Scaling

Unread post by Yim »

Looks like 5x compatibility mode has a wider resolution, and a higher pixel clock as a result. The other one I think makes the mister output resolution the same as the upscaled core resolution, the compatibility includes a border on each side to match wide screen displays.

I’ve already said that I don’t really get all the video mode stuff, so maybe I should back out of this discussion, but I don’t really understand what atrac17’s mode lines are for. I mean, getting a nice picture, obviously, and it seems they’re helping a lot of people to do that, but like on the patreon there’s:
Your display will then scale the resolution in integer increments and fill the bezel vertically. Utilizing the custom aspect ratio settings the MiSTer can control the horizontal resolution being displayed.
Which I don’t understand how it can be true in the context of an 1120p signal to a 2160p TV - the only way that signal can be displayed at an integer multiple on that TV without cropping is if the integer is 1. To fill the screen without cropping is a ~1.93x multiple. If the TV’s upscaler links its vertical and horizontal scaling then it would mess up horizontal integer scaling as well. I don’t mean this as an attack on atrac17 - I think I’m missing something here, so I’d like to understand it.

If the goal is to get a nice picture that fills the screen, then it makes perfect sense to have the mister send as large an integer upscaled image as possible so that the inevitable distortion involved in filling the screen is minimised. If the goal is integer scaling, the only way to do it on a fixed resolution screen so far as I can tell is with borders filling the gap between the integer scaled image and the edge of the screen, and for that you want a mister output resolution that’s an integer divisor of the screen resolution, like 1080p or 720p.
Insert Disk Two
Posts: 192
Joined: Sun May 24, 2020 7:59 pm
Has thanked: 10 times
Been thanked: 23 times

Re: MiSTer Custom Aspect Ratios for Horizontal Integer Scaling

Unread post by Insert Disk Two »

Yim wrote: Sun Feb 21, 2021 12:27 pm
Your display will then scale the resolution in integer increments and fill the bezel vertically. Utilizing the custom aspect ratio settings the MiSTer can control the horizontal resolution being displayed.
Perfectly agree. Can someone explain this please?
User avatar
meauxdal
Posts: 124
Joined: Mon Nov 23, 2020 3:28 am
Location: atlanta
Has thanked: 32 times
Been thanked: 75 times
Contact:

Re: MiSTer Custom Aspect Ratios for Horizontal Integer Scaling

Unread post by meauxdal »

General idea behind atrac17's custom modelines is to provide a display with a native resolution MiSTer's scaler does not support (e.g. 4K) with as crisp an image as possible in order to maximize the results after processing by the display's internal scaler (as well as providing compatibility with e.g. scanlines and LCD effects). They are worth a shot - I've found they look a lot better than you might expect if your monitor can resolve the resolution properly.
User avatar
BlockABoots
Posts: 43
Joined: Wed May 27, 2020 8:21 pm
Has thanked: 7 times

Re: MiSTer Custom Aspect Ratios for Horizontal Integer Scaling

Unread post by BlockABoots »

Yeah im still unsure why 5x Mode gives me graphically glitches on the CPS1 games but the 5x Compatibility Mode does not
User avatar
atrac17
Core Developer
Posts: 161
Joined: Sun May 24, 2020 10:51 pm
Has thanked: 31 times
Been thanked: 379 times

Re: MiSTer Custom Aspect Ratios for Horizontal Integer Scaling

Unread post by atrac17 »

BlockABoots wrote: Mon Feb 22, 2021 7:26 pm Yeah im still unsure why 5x Mode gives me graphically glitches on the CPS1 games but the 5x Compatibility Mode does not
What .rbf date? You've screen capped and submitted to github? Or you can post it here and I'll take care of it.
mindscan
Posts: 2
Joined: Sun Feb 21, 2021 5:51 am

Re: MiSTer Custom Aspect Ratios for Horizontal Integer Scaling

Unread post by mindscan »

hi, is there any way to add a thin aspect ratio for TG16 with 5x? 3:2 is a little fat to my liking, i prefer square pixels with 5x on other cores, but theres only one for R-Type on TG16.
if so what would be the ratio exactly.
User avatar
meauxdal
Posts: 124
Joined: Mon Nov 23, 2020 3:28 am
Location: atlanta
Has thanked: 32 times
Been thanked: 75 times
Contact:

Re: MiSTer Custom Aspect Ratios for Horizontal Integer Scaling

Unread post by meauxdal »

Square pixels with R-Type on that core is 5:3 (already listed in the 5x .txt file). You need to uncomment the ratio and comment out another one, as you can only have 2 active per core.

Also, 3:2 isn't integer scaling for R-Type. That only works on games with the most common PCE resolution. With 1080p using vertical crop, 4:3 is horizontally integer scaled for R-Type with close to correct aspect, and 5:3 is square pixels.
User avatar
BlockABoots
Posts: 43
Joined: Wed May 27, 2020 8:21 pm
Has thanked: 7 times

Re: MiSTer Custom Aspect Ratios for Horizontal Integer Scaling

Unread post by BlockABoots »

atrac17 wrote: Mon Feb 22, 2021 9:09 pm
BlockABoots wrote: Mon Feb 22, 2021 7:26 pm Yeah im still unsure why 5x Mode gives me graphically glitches on the CPS1 games but the 5x Compatibility Mode does not
What .rbf date? You've screen capped and submitted to github? Or you can post it here and I'll take care of it.
It might be hard to to screen grab as the glitch only appears for a few frames, ill try and take a short video of it to capture the issue
User avatar
BlockABoots
Posts: 43
Joined: Wed May 27, 2020 8:21 pm
Has thanked: 7 times

Re: MiSTer Custom Aspect Ratios for Horizontal Integer Scaling

Unread post by BlockABoots »

atrac17 wrote: Mon Feb 22, 2021 9:09 pm
BlockABoots wrote: Mon Feb 22, 2021 7:26 pm Yeah im still unsure why 5x Mode gives me graphically glitches on the CPS1 games but the 5x Compatibility Mode does not
What .rbf date? You've screen capped and submitted to github? Or you can post it here and I'll take care of it.
Before taking the below video i use the Update_all script so i have the latest .rbf files for the CPS1 games.

I took 2 videos with my phone showing the odd graphically glitch when using CPS1_5x mode.

This is CPS1_5x mode......

https://youtu.be/WWIKDZMYIqY

and then CP1_5x_Compatability_Mode....

https://youtu.be/iEtlJi5QTU4

Also any idea why having the following set to anything other than default causes your modelines not to display correctly for CPS games (get borders top and bottom)....

; These parameters have the same format as video_mode.
; You need to supply both PAL and NTSC modes if you want vsync_adjust to switch between
; predefined modes as a base. This will reduce the range of pixel clock.
video_mode_ntsc=0
video_mode_pal=9
User avatar
BlockABoots
Posts: 43
Joined: Wed May 27, 2020 8:21 pm
Has thanked: 7 times

Re: MiSTer Custom Aspect Ratios for Horizontal Integer Scaling

Unread post by BlockABoots »

Any ideas why I get the above issues???
Yim
Posts: 125
Joined: Mon Jan 18, 2021 11:51 pm
Has thanked: 3 times
Been thanked: 87 times

Re: MiSTer Custom Aspect Ratios for Horizontal Integer Scaling

Unread post by Yim »

Are the glitches screen tearing from the display not synching properly to the signal? If so, then I’d guess compatibility mode is running at a pixel clock the display is compatible with and the other mode isn’t.

As for video_mode_ntsc and pal, I thought those settings would override the regular video_mode setting, meaning the custom video_mode setting isn’t applied if they’re set. When you say “anything other than default” is the default you’re referring to having them commented out? If so, then I think the reason you’re getting borders is that video_modes 0 and 9 are not integer multiples of the core resolution and you’ve got integer scaling turned on.

Could have this all wrong, though.
metalfacemark
Posts: 159
Joined: Mon Jan 04, 2021 12:04 pm
Has thanked: 14 times
Been thanked: 15 times

Re: MiSTer Custom Aspect Ratios for Horizontal Integer Scaling

Unread post by metalfacemark »

I wonder if someone could give some advise on Amiga resolutions - im using VGA to RGB Scart. If i leave things at default, NTSC cuts off the top of the screen and everything is sort of moved down so i cant see the bottom part of the screen. Pal looks better but it then has a squished image.

Any advice?
User avatar
limi
Top Contributor
Posts: 619
Joined: Sun May 24, 2020 6:53 pm
Has thanked: 135 times
Been thanked: 418 times

Re: MiSTer Custom Aspect Ratios for Horizontal Integer Scaling

Unread post by limi »

Try the vadjust file from MegaAGS and see if that helps?

https://github.com/Optiroc/AGSImager/tr ... ata/config
User avatar
limi
Top Contributor
Posts: 619
Joined: Sun May 24, 2020 6:53 pm
Has thanked: 135 times
Been thanked: 418 times

Re: MiSTer Custom Aspect Ratios for Horizontal Integer Scaling

Unread post by limi »

Also, we added integer scaling settings on a per-game basis for 700+ games, more info here.
metalfacemark
Posts: 159
Joined: Mon Jan 04, 2021 12:04 pm
Has thanked: 14 times
Been thanked: 15 times

Re: MiSTer Custom Aspect Ratios for Horizontal Integer Scaling

Unread post by metalfacemark »

limi wrote: Thu Mar 18, 2021 5:04 pm Try the vadjust file from MegaAGS and see if that helps?

https://github.com/Optiroc/AGSImager/tr ... ata/config
Thank you, may I ask where i put that file? Edit - i found it - its fixed it on my Oled, but same on the CRT, will just use that when i need to. Appreciate the advice!
User avatar
atrac17
Core Developer
Posts: 161
Joined: Sun May 24, 2020 10:51 pm
Has thanked: 31 times
Been thanked: 379 times

Re: MiSTer Custom Aspect Ratios for Horizontal Integer Scaling

Unread post by atrac17 »

BlockABoots wrote: Thu Feb 25, 2021 9:13 pm
atrac17 wrote: Mon Feb 22, 2021 9:09 pm
BlockABoots wrote: Mon Feb 22, 2021 7:26 pm Yeah im still unsure why 5x Mode gives me graphically glitches on the CPS1 games but the 5x Compatibility Mode does not
What .rbf date? You've screen capped and submitted to github? Or you can post it here and I'll take care of it.
Before taking the below video i use the Update_all script so i have the latest .rbf files for the CPS1 games.

I took 2 videos with my phone showing the odd graphically glitch when using CPS1_5x mode.

This is CPS1_5x mode......

https://youtu.be/WWIKDZMYIqY

and then CP1_5x_Compatability_Mode....

https://youtu.be/iEtlJi5QTU4

Also any idea why having the following set to anything other than default causes your modelines not to display correctly for CPS games (get borders top and bottom)....

; These parameters have the same format as video_mode.
; You need to supply both PAL and NTSC modes if you want vsync_adjust to switch between
; predefined modes as a base. This will reduce the range of pixel clock.
video_mode_ntsc=0
video_mode_pal=9
When you define a video_mode for NTSC and PAL they will supersede any settings you have that are custom and also ignore your normal video_mode as well.
pedroTFP
Posts: 36
Joined: Tue Mar 23, 2021 2:07 pm
Been thanked: 2 times

Re: MiSTer Custom Aspect Ratios for Horizontal Integer Scaling

Unread post by pedroTFP »

Thanks to atrac17 for the custom INI, I'm using it untouched except for "video_mode=8". My LCD is 1080p.
How can I change the scaling (3x; 4x; 5x...) in each core menu? Which is the setting?
FoxbatStargazer
Top Contributor
Posts: 994
Joined: Thu Dec 10, 2020 5:44 pm
Has thanked: 309 times
Been thanked: 228 times

Re: MiSTer Custom Aspect Ratios for Horizontal Integer Scaling

Unread post by FoxbatStargazer »

You cant' directly change it there. All you can do is adjust vscale_mode to control the granularity (0=free, 1=integer, 2=half-integer, etc.) and then it goes up to the highest magnification allowed by your resolution. For 1080p most cores will fill out to 1080p on vscale_mode=0, 4x resolution at 1, 4.5x resolution at 2, etc.

If you want 5x cut, you need to set vscale_mode=0 and be using 1080p video_mode (which you are.) Then in many cores there will be an option for 5x cut, sometimes it will be hidden under "border" settings. Most cores supporitng 5x mode also have options for horizontal integer scaling (HV Integer -/+)
pedroTFP
Posts: 36
Joined: Tue Mar 23, 2021 2:07 pm
Been thanked: 2 times

Re: MiSTer Custom Aspect Ratios for Horizontal Integer Scaling

Unread post by pedroTFP »

That's very clear.
Thanks a lot!
retro
Posts: 130
Joined: Fri Jun 04, 2021 5:19 am
Location: Kuala Lumpur, Malaysia
Has thanked: 44 times
Been thanked: 13 times

Re: MiSTer Custom Aspect Ratios for Horizontal Integer Scaling

Unread post by retro »

meauxdal wrote: Mon Feb 15, 2021 6:06 pm I think I finally cracked the Amiga code...

turrican21.png

cannon1.png

mega1.png

beast31.png

I think my problem was related to the "Adjust screen position" option, which apparently saves adjustments made to a file, minimig_vadjust.dat. I renamed that file in both the shared Amiga and main config folders and now the ratios I had tried previously appear to be working properly. Only tested with Video area by: Blank thus far, but both PAL and NTSC seem to be working OK in low res video modes.

tl;dr Don't touch "adjust screen position" unless you know exactly what you are doing!
Have you tested with Banshee?

When I set Video Area to Blank, the vertical scale of this particular game during gameplay doesn't seem right. The Player 2 portion of the HUD is cropped.

When I set Video Area to Blank+, the entire HUD is gone altogether and the gameplay area is stretched horizontally.
Kenzo
Posts: 21
Joined: Sun Jul 04, 2021 11:08 am
Has thanked: 18 times

Re: MiSTer Custom Aspect Ratios for Horizontal Integer Scaling

Unread post by Kenzo »

Would someone mind very quickly instructing me on how to use the AR calculator to get the desired output to put in the ini for my 1600x1200p screen? I would like to use custom AR for HV integer scaling on some of the arcade cores I use (CPS2/CPS1.5 etc)?
User avatar
morf77
Posts: 63
Joined: Fri Aug 28, 2020 1:42 pm
Has thanked: 12 times
Been thanked: 24 times

Re: MiSTer Custom Aspect Ratios for Horizontal Integer Scaling

Unread post by morf77 »

Most of it is self-explanatory.
Visible pixels is the horizontal resolution of the core.
Visible lines is the vertical resolution of the core.
Pixel clock in mhz is more difficult to find out for arcade cores but you could use references like https://pineight.com/mw/index.php?title=Dot_clock_rates though it isn't guaranteed that's the pixel clock the mister core is running at.

The output will include a 1200p custom_aspect_ratio line you can copy paste in your mister.ini for that specific arcade core tag. The arcade core name (you will need this for the tag in the ini) can be seen in the mister menu when the core is loaded, alternatively you can find the name in the MRA files.

Example for ghost 'n ghoblins in the mister.ini file (just an example, not claiming these values are correct or recommended):

Code: Select all

[gng]
custom_aspect_ratio_1=32:35      ; 256:224 @ 8.000, 4:5 PAR (1024:1120)
The info after ; is just commentary to denote the values used and the PAR it translates to - it can be left out of the ini.
Yim
Posts: 125
Joined: Mon Jan 18, 2021 11:51 pm
Has thanked: 3 times
Been thanked: 87 times

Re: MiSTer Custom Aspect Ratios for Horizontal Integer Scaling

Unread post by Yim »

Not actually what you’re asking but here’s how you calculate it for yourself, using CPS2 as an example:

The core’s resolution is 384x224, and the original display aspect ratio is 4:3. Your screen has a vertical resolution of 1200 lines, so the 224 lines will fit five times using 1120 of those lines. To get the original aspect ratio of 4:3 you divide that by three (373.3333) and multiply by four (1493.3333) for the horizontal resolution. Divide that by the core’s horizontal resolution of 384 and you get the horizontal multiple of 3.88889. That’s not an integer, so you’ll want to round to either 3 (much narrower) or 4 (slightly wider) and multiply the core resolution by that. 4x384=1536, so that’s your output resolution. So you should set the aspect ratio to 1536:1120, or if you simplify it 48:35. This is not exactly the 4:3 aspect ratio you’d get on an original cabinet but it’s as close as you’ll get with integer scaling on a 1600x1200 screen.
Kenzo
Posts: 21
Joined: Sun Jul 04, 2021 11:08 am
Has thanked: 18 times

Re: MiSTer Custom Aspect Ratios for Horizontal Integer Scaling

Unread post by Kenzo »

Do I keep vscale=1? Or does this override custom ratios at the bottom of the ini?

Thank you both so much.
Yim
Posts: 125
Joined: Mon Jan 18, 2021 11:51 pm
Has thanked: 3 times
Been thanked: 87 times

Re: MiSTer Custom Aspect Ratios for Horizontal Integer Scaling

Unread post by Yim »

Still need vscale=1, yeah. Without that it’ll fill the full height of the screen so you won’t get integer scaling. The custom aspect ratio doesn’t change the vertical scaling, only the horizontal.
Kenzo
Posts: 21
Joined: Sun Jul 04, 2021 11:08 am
Has thanked: 18 times

Re: MiSTer Custom Aspect Ratios for Horizontal Integer Scaling

Unread post by Kenzo »

Yim wrote: Sat Jul 10, 2021 10:38 am Still need vscale=1, yeah. Without that it’ll fill the full height of the screen so you won’t get integer scaling. The custom aspect ratio doesn’t change the vertical scaling, only the horizontal.
Thanks!

what is the difference between vscale=1 + custom AR for HV integer scaling and atrac17's modelines?
Post Reply