After running the Update All MiSTer script (https://github.com/theypsilon/Update_All_MiSTer), I launched the Pac-Man and Space Invaders cores. In both cases, I noticed distortion on the graphics: specifically, on my TV set (HDTV 1920x1080) the pixels have inconsistent width. You can see it in the attached image: the top of the "3" is thicker than its bottom; the right side of the "0" is thicker than its left side.
Is there a setting that will give me more accurate pixel rendering?
Thank you.
Distored graphics on arcade cores?
-
- Posts: 2
- Joined: Wed Sep 15, 2021 11:21 pm
- Has thanked: 4 times
Distored graphics on arcade cores?
- Attachments
-
- Screen Shot 2021-09-15 at 4.25.34 PM.png (267.66 KiB) Viewed 2186 times
- pgimeno
- Top Contributor
- Posts: 709
- Joined: Thu Jun 11, 2020 9:44 am
- Has thanked: 277 times
- Been thanked: 226 times
Re: Distored graphics on arcade cores?
Try setting this in your MiSTer.ini: vscale_mode = 1
Converters I've written: Floppy DIM/FDI/FDD/HDM to D88, D88 to XDF, Tape SVI 318/328 CAS to WAV
-
- Top Contributor
- Posts: 1018
- Joined: Thu Dec 10, 2020 5:44 pm
- Has thanked: 315 times
- Been thanked: 238 times
Re: Distored graphics on arcade cores?
I'm getting this too, I think it has to do with rotation, which may have been changed yet again. As if it scales the horizontal output to your resolution first, then rotates, and scales again to vertical. Ideally it should just take the direct horizontal output and rotate that first before scaling. Normally sharp interpolation should sufficient clean up vscale_mode=0 but this might be why that isn't happening in that case.
Re: Distored graphics on arcade cores?
By default the MiSTer prioritises aspect ratio over even horizontal scaling. Some of the cores have options in the OSD menu for integer scaling, but if they don’t you can get it in using custom aspect ratio settings in the mister.ini file. Using vscale_mode=1 will get you integer vertical scaling, and from there the simplest way to get integer horizontal scaling is to set an aspect ratio of the core’s internal resolution, in space invaders’ case 224:256, for Pac-Man 224:288. This will make all the pixels square. Depending on the core, this might result in an aspect ratio that is way off what it should be. It’s also possible to make all of the pixels rectangular and consistently sized, which may get a closer aspect ratio, but it takes a bit more calculation.
For Space Invaders on a 1080p screen with vscale_mode=1, assuming the original aspect ratio was 3:4, the 256 pixel tall image will be scaled up 4x to 1024. The target horizontal resolution is 3/4 of this, 768. 224 goes into 768 a bit less than three and a half times, so you either want to scale up 3x and have a picture that’s too narrow, or 4x and have one that’s too wide. For a 3x horizontal scale, the final resolution will be 672x1024, which simplifies to 21:32. For a 4x hori scale, the resolution is 896x1024, which simplifies to 7:8.
A similar calculation can be done for Pac-Man. It’s got a higher vertical resolution so it’ll only fit 3x in 1080p, but its native resolution of 224x288 is pretty close to 3:4 so square pixels should look pretty reasonable.
I haven’t actually fired these games up and tried these out, not sure if there’s something in the rotation as foxbat suggests that would stop this from working.
Alternatively there are interpolation filters which smooth the irregularities when you’re not using integer scaling.
For Space Invaders on a 1080p screen with vscale_mode=1, assuming the original aspect ratio was 3:4, the 256 pixel tall image will be scaled up 4x to 1024. The target horizontal resolution is 3/4 of this, 768. 224 goes into 768 a bit less than three and a half times, so you either want to scale up 3x and have a picture that’s too narrow, or 4x and have one that’s too wide. For a 3x horizontal scale, the final resolution will be 672x1024, which simplifies to 21:32. For a 4x hori scale, the resolution is 896x1024, which simplifies to 7:8.
A similar calculation can be done for Pac-Man. It’s got a higher vertical resolution so it’ll only fit 3x in 1080p, but its native resolution of 224x288 is pretty close to 3:4 so square pixels should look pretty reasonable.
I haven’t actually fired these games up and tried these out, not sure if there’s something in the rotation as foxbat suggests that would stop this from working.
Alternatively there are interpolation filters which smooth the irregularities when you’re not using integer scaling.
Re: Distored graphics on arcade cores?
I tried the aspect ratios I gave for Space Invaders in my last post and they don’t work - inconsistent pixel sizes. I guess it’s something to do with the screen rotation. Or I stuffed up the calculations. I’ve been able to get square pixels by setting the custom aspect ratio to 256:224 and the orientation to horizontal, but setting 224:256 with vertical orientation, which I thought should be the same thing just turned 90 degrees, gives inconsistent size both vertically and horizontally. Dunno what’s going on, sorry.
Re: Distored graphics on arcade cores?
I played around some more, try adding this to your mister.ini:
[invaders]
vscale_mode=0
vscale_border=28
custom_aspect_ratio_1=7:8
custom_aspect_ratio_2=21:32
This is working for me, giving consistent 4x4 pixels with the first aspect ratio and 3x4 pixels with the second. Rather than using vscale_mode=1 to get integer scaling, which doesn’t seem to play well with screen rotation, it uses a border of 28 pixels above and below to limit the available pixels for display to an integer multiple of the core’s resolution (28 above + 1024 of game + 28 below = 1080), then uses the custom aspect ratio to get integer scaling horizontally.
[invaders]
vscale_mode=0
vscale_border=28
custom_aspect_ratio_1=7:8
custom_aspect_ratio_2=21:32
This is working for me, giving consistent 4x4 pixels with the first aspect ratio and 3x4 pixels with the second. Rather than using vscale_mode=1 to get integer scaling, which doesn’t seem to play well with screen rotation, it uses a border of 28 pixels above and below to limit the available pixels for display to an integer multiple of the core’s resolution (28 above + 1024 of game + 28 below = 1080), then uses the custom aspect ratio to get integer scaling horizontally.