Integer scaling giving unexpected results for Genesis How to fix?

So if I use integer scaling on a screen that is 1280 x 960 I should get full screen horizontally on Genesis games (320 x 224) but with small bars on the top and bottom because 320x4 goes evenly into 1280 but 224 x 4 would have small bars top and bottom. This is important to not get vertical bandy shader effects. I don’t get expected result in RA if I set integer scaling ON, overscan crop OFF and aspect to core provided. Instead it shrinks the whole image with a border all around, that is wrong the sides should have no border in X direction. If I set integer off it is correct horizontally but stretches vertical to fill the 224 into 960 (4.28x) messing up scanline shaders. Why is it doing this and how do I get true 4x integer scaling both directions?

In RetroArch Settings > Video > Scaling besides Integer Scale = ON, there are also Integer Scale Axis = Y and Integer Scale Scaling = Underscale. I quickly tested this by a windowed mode to get fixed 1280x960 size to see how it fits. BTW you can display stats with F4 (I think this is the default shortcut, if not look in input hotkey settings). This is how it looks for me with those above settings:

Edit: Just in case you do play in windowed mode stretched to fill the screen. In that case it is possible that the operating systems windows bar takes some space and the entire game window is smaller, because of aspect ratio. If that is the case, try playing in fullscreen.

Edit 2: Or maybe check your core settings. I assume you play with Genesis Plus GX core. In example look if Borders = OFF is set to off in Video settings for the core, Aspect Ratio = 4:3 in RetroArch Video settings and Core-Provided Aspect Ratio = Auto in Core Video settings. Worth exploring those too.

Edit 3: Another note is, that games can have different resolution modes. And depending on the region it can differ too. According to https://www.gametechwiki.com/w/index.php/Sega_Mega_Drive/Genesis, these are the resolutions supported by the system: 256×224, 256×448, 320×224, 320×448, (PAL and NTSC). Maybe try different game, if you didn’t have (I assume you have, so sorry in advance to mention that).

Core provided assumes in this case the real aspect ratio, since Genesis pixels are not 1:1.

You can have whatever aspect you want by changing the general RA Video->Scaling->Aspect Ratio settings, regardless of core settings.

genesis plus gx only does integer scaling if you set the borders to full (how does nobody here seem to realize this?)

I don’t see that on my end.

Aspect ratio is not the same as integer scale. At 4:3 aspect Genesis is not integer scaled because the vertical resolution is not 240. That would only work if Genesis was 320 x 240. A 4:3 forced aspect setting gives a slightly stretched vertical which plays havoc with CRT shaders. A true integer scale gives a slightly less vertical height than 4:3.

Yes, it works different here in the Retroarch context. Setting Integer Scale to on and Aspect Ratio to “core provided” means: Correct on the X axis (i.e. horizontally) if the core demands it.

So in this case, the image is shrunk in the X direction.

To get true integer scaling (resulting in what people typically refer to as pixel perfect output), you will have to switch the RA aspect ratio setting or check the core options itself. The newest Genesis Plus GX for example allows setting aspect to “uncorrected”.

RetroArch scales the Y axis according to your integer (or not) settings, then scales the X axis according to your aspect ratio settings.

In the case of Genesis/MD, integer plus “core provided” will make the Y axis smaller (or bigger, if you choose overscale) and then stretch the X axis to make the image 4:3 based on that Y scale.