Correct 5:6 Pixel Aspect Ratio when scaling NTSC + half-step scaling in high-res/laced resolutions
We have spoken about this on Discord, this is mostly to have an issue we can refer to when talking about this (and to make it visible to other projects), like Amiberry. The issue filed there is https://github.com/BlitterStudio/amiberry/issues/1453
I am attempting to get resolution-independent integer scaling with proper aspect ratios for both NTSC and PAL with auto-crop on top implemented in all the major Amiga emulators, and have made a spreadsheet documenting the expected outputs here:
https://docs.google.com/spreadsheets/d/1FQaoLRBO0dzEZyIoL0clojZX-HEuFha0INdJTMhkNFM/
Additional context:
- https://amiga.vision/5x
- https://amiga.vision/sachs
Frode has made an initial implementation that we will test in the nightly dev builds for FS-UAE 5:
// scaling for low-res / non-interlaced, and half-integer scaling for high-res / interlaced
// graphics modes.
int max_x_iscale = area_w / (input_w / 2);
int max_y_iscale = area_h / (input_h / 2);
if (ntsc_aspect_ratio) {
// Account for ~ 6:5 pixel aspect ratio while having integer / half-integer scaling.
// This will effectively leave scale_x the same as scale_y when scale_y <= 3; scale_x
// will be one less then scale_y when scale_y <= 9, (etc).
scale_y = max_y_iscale;
scale_x = round(scale_y / 1.2);
// Looping here, while not the most efficient approach perhaps, might avoid some edge cases
// due to the relationship between scale_x and scale_y at different sizes.
while (scale_x > max_x_iscale) {
scale_y -= 1;
scale_x = round(scale_y / 1.2);
}
} else {
scale_y = max_y_iscale < max_x_iscale ? max_y_iscale : max_x_iscale;
scale_x = scale_y;
}
scale_x /= 2.0; // Correction for low-res in calculation while pixel doubling
scale_y /= 2.0;
output_w = input_w * scale_x;
output_h = input_h * scale_y;
https://github.com/FrodeSolheim/fs-uae/commit/28c1cd4d4cc493f872af3958851f5f505017a5ab contains support for NTSC aspect correction by default, and integer scaling (of low-res content) with approximations for NTSC aspect.