First post, by Ant_222
This patch is currently abandoned. Having grown tired of keeping the patch in sync with the official SVN, I have decided to work on similar functionality in unofficial forks of DOSBox.
DOSBox forks containing the patch:
- Incompatible with munt's MT32 patch on the level of an automake script. Here is a fixed version by marooned_on_mars.
- Whereas the patch implements a single-threaded software-based scaler, it is inherently slow, with performance decreasing in quadratic proportion to the output resolution. To make the most out of it, compile the file src/gui/pixelscale.cpp with a sufficiently high optimization level. For GCC on my system (AMD A4-3400 APU) it is -O3, which is one level higher than the setting used in the default DOSBox configuration. Please, use the test program to determine your best compiler settings.
- If pixel-perfect correction is unsatisfactory, either because of a large aspect-ratio error or because of insufficient magnification, fall-back to a simpler scaling mode, such as nearest-neighbor. The secondary scaling mode and the exact criterium for the fallback may be specified in the config file.—lukeman3000
Other implementations of pixel-perfect scaling in DOSBox:
- DOSBox for pixel purists by bladeSk uses nearest-neighbor interpolation already available via the openglnb output mode confining the output to an area calculated to result in integer scaling with optional aspect-ratio correction. This fork also adds V-Sync on Windows Vista and later by emulating full-screen mode as a borderless window.
- Clint of sierrawallpaper.com applies pixel-perfect correction to his screenshots in exactly the same way as this patch does. Look for images marked ARC (for aspect-ratio corrected).
- No, MS-DOS games weren't widescreen: Tips on correcting aspect ratio, by Felipe Pepe.
- Nonblurry integer-ratio scaling by Marat Tanalin.
- Uploading the Windows binary and the diff patch. The algorithm now respects the aspect setting.
- This was required to play games whose native pixel aspect ratio is different from the one DOSBox assumes. Lure of the Temptress seems one of them.
- If there be a place for credits in DOSBox, then let me thank Peter Karpov, known on Reddit as inversed, for the idea of the heuristic algorithm for the calculation of optimal scaling factors.
- Fixed the patch. It had been generated incorrectly.
- Fixed an error in the source which prevented compiling with Direct-Draw support enabled.
- Fixed the patch. It was malformed.
- Added a missing curly bracket.
- Fixed a typo in code for DirectDraw output.
- Uploaded a win32 build with the alpha 4 patch.
- [2016-09-18] Uploaded the alpha 4 patch.
- [2016-09-19] Fixed the alpha 4 patch
- [2016-10-12] Uploaded the alpha 5 patch, which now extends the surface output type.
- [2016-10-12] Added missing DLLs to the binary archive.
- Uploaded the alpha 6 patch, which fixes a bug which broke the surface output type and has improved handling of the doubleheight and doublewidth flags.
- [2016-10-13] Uploaded the alpha 7 patch, which fixes errors with the blitting output mode.
- [2016-10-14] Uploaded the alpha 8 patch with performance improvements.
- [2016-11-04] Uploaded the alpha 9 patch with new defaults and minor tweaks.
- [2016-11-07] Alpha 10 is out. It fixes a typo which disabled the overlay output and corrects the upscaling of update rectangles.
- [2016-11-19] Fixed errors in alpha10 when compiling on Linux with newer versions of gcc.
- [2016-11-21] Added munt's MT32 patch fixed to be compatible with the pixel-perfect patch.
- [2017-01-28] Uploaded alpha 12, which fixes an error in the calculation of the "perfect" scale. Special thanks to KainXVIII for extensive testing.
- [2017-08-25] Releasing alpha 13, in which:
- the scaling algorithm is optimised and performs about 25-40% faster, depending on the CPU,
- different layouts of RGB data within 4-byte blocks are now taken into account,
- a rounding error fixed which sometimes caused incorrect scaling.
- [2017-09-01] Alpha 14: A better correction of the rounding error.
- [2017-11-04] Alpha 14 fixed for compatibility with revision 4063 (by Yesterplay80).
- [2018-04-19] Alpha 14 fixed for compatibility with revision 4095 (thanks to Yesterplay80).
- [2018-07-15] Alpha 14 fixed for compatibility with revision 4132 (fix by Yesterplay80).
- [2018-09-02] Alpha 14 fixed for compatibility with revision 4157.
- [2018-09-22] Alpha 14 fixed for compatibility with revision 4163, and an missing return reinstated (thanks to aaronp)
- [2019-01-07] Alpha 15 allocates intermediate memory globally rather than for each frame and restores compatibility after rev. 4178.
- [2019-01-19] Alpha 16 adds a hardware-accelerated mode for pixel-perfect scaling—openglpp.
- [2019-01-20] Alpha 17 fixes some unusual cases of aspect-ratio correction (e.g. the dial9 demo).
- [2019-01-21] Alpha 18 turns on V-Sync for OpenGL output.
- [2019-01-22] Alpha 19 adds an option to turn V-Sync on and off for OpenGL output.
- [2019-01-26] Alpha 20 adds an option to emulate fullscreen mode as a borderless window (thanks to bladeSk for the idea) [deleted because of a bug]
- [2019-01-30] Alpha 21 fixes the screen clearing bug in alpha 20.
- [2019-02-03] Alpha 21 fixed for compatibility with revision 4185.
- [2019-02-07] Alpha 22 fixed a bug (a function with a non-void return type not returning anything)—thanks to aaronp.
- [2019-02-02] Alpha 23 fixes another bug, this time in the handling of non-fixed resolutions—thanks again to aaronp.
- [2019-07-28] Incorporate revisions 4228-2449 into alpha 23. It now works with rev. 4253.
- [2019-07-28] Alpha 24 fixes a bug with non-integer scaling modes surfacenb and surfacenp.
I can't seem to find the code responsible for the stretching of the image to the display dimensions in full-screen mode, and neither do I see any invocations of SDL scaling functions. Where is does it happen?