About a year ago, Sega Master System dumping changed to include overscan. This allows much more accurate aspect ratio correction at the cost of black borders around the entire game.
I messed around and made a commented AVISynth script that takes the aspect ratio of the clip with overscan enabled, crops the clip to what it would be were the option not enabled, and then applies the aspect ratio to the resulting clip. This results in a clean clip with the same aspect ratio correction as if the clip did not have the overscan removed. It's worth noting that this means the resulting clip is
not 4:3, but is instead displayed with an accurate aspect ratio, although without the overscan being visible.
You can
download test file and script here, the file's about 4mb. Alternatively, here's the script by itself:
# Load Source
AVISource("sms_overscan.avi")
# New boolean value for SMS Current encoding package code (variables required for aspect correction)
SMS = true
hd = false
handheld = false
# Odd number scanline fix
last.height % 2 > 0 ? StackVertical(last, Crop(0, Height-1, 0, 0)) : 0
# Save clip dimensions for later
overscan_width = float(Last.Width)
overscan_height = float(Last.Height)
# Crop overscan
SMS ? Crop(13,27,-15,-25) : Last
# Changes to the waspect / haspect code
waspect = SMS ? Int(4 * overscan_height / last.height * 10000) : 4
haspect = SMS ? Int(3 * overscan_width / last.width * 10000) : 3
# Current encoding package code for aspect correction
height = hd ? 2160 : last.width > (last.height * waspect / haspect) ? (last.width * haspect / waspect) : last.height
width = handheld ? height * last.width / last.height : height * waspect / haspect
width = (width % 4 == 1) ? width + 3 : (width % 4 == 2) ? width + 2 : (width % 4 == 3) ? width + 1 : width
height = (height % 4 == 1) ? height + 3 : (height % 4 == 2) ? height + 2 : (height % 4 == 3) ? height + 1 : height
# Current encoding package code, slightly changed for testing output
hd ? PointResize(width, height) : handheld ? last : LanczosResize(width, height, taps=2)
I'm not experienced enough with the console to know if cropping is consistent between games (although it can easily be checked and altered) or if the encodes would be preferred
with the overscan included, as I'm not sure which is correct in terms of console accuracy, but if aspect ratio is the only contributing factor to enabling the overscan setting, then this might help deal with that.
Edit: Originally, there was an extra line (line 18) left in the script's download and in the code pasted here. It was commented out, but still present. I used it for testing and it should
not be used in the final script as it extended the cropping beyond what was needed to crop the overscan. It has since been removed from both locations.