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.