Add a square-pixel presentation option ([display] pixel_aspect)#80
Merged
Conversation
The presentation has always mapped the 570 woven scanlines of a standard field onto a 537-row 4:3 canvas, reproducing the non-square pixel aspect of a real CRT; a 320x256 PAL screen therefore spans about 640x482 window pixels rather than an exact 2x2. That is correct for a TV, but useless for pixel-exact side-by-side comparison with square-pixel emulators. Add [display] pixel_aspect = "tv" (default, unchanged) or "square": one host row per woven scanline, so a 320x256 screen occupies precisely 640x512 output pixels. The canvas height becomes a runtime value (video::present_height(), 537 or 570); the window, backing textures, status-bar layout, screenshots, and recordings all follow it. In the square TV-aperture view the 540-row cutout is centred between black bezel bands instead of being squashed. The mode is switchable three ways: the config field, a new "Pixel Aspect" menu item that toggles it live (rebuilding the main and tool window textures like a DPI change; refused while a video recording is running, since the encoder frame size is fixed at start), and a "Pixel aspect" row on the launcher's A/V & Emu tab. COPPERLINE_PIXEL_ASPECT overrides the config for one run, mirroring COPPERLINE_OVERSCAN. Default-mode output is byte-identical to the previous presentation (verified against KS2.05 boot screenshots in both overscan modes).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A user doing side-by-side video comparison with WinUAE noticed that a 320x256 screen does not present as an exact 2x2 (640x512). That is by design: Copperline presents the field with the non-square pixel aspect of a 4:3 CRT (the 570 woven scanlines map onto a 537-row canvas, so the vertical scale is ~1.88x while horizontal is exactly 2x). WinUAE's default presentation uses square pixels, hence the difference. The status bar is additive and takes nothing from the picture.
This adds an opt-in square-pixel presentation for pixel-exact comparisons:
[display] pixel_aspect = "tv"(default, byte-identical to today) or"square"(one host row per woven scanline; a 320x256 PAL screen occupies precisely 640x512 output pixels).COPPERLINE_PIXEL_ASPECT=tv|squareenv override for a single run, mirroringCOPPERLINE_OVERSCAN.Implementation: the fixed
PRESENT_HEIGHTconstant becomes a runtimevideo::present_height()(537 or 570). Screenshots and--dump-framesfollow the mode in full-overscan view (716x537 vs 716x570); the TV-aperture screenshot stays the 1:1 692x540 crop in both modes. In the square TV-aperture window view the 540-row cutout is centred between black bezel bands (the vertical counterpart of the existing side bands) instead of being squashed.Docs updated (configuration.md, ui.md, headless.md, example config) and the menu preview image regenerated.
Verification
cargo test: 1248 passed, 0 failed;cargo clippy/cargo fmt --checkclean.overscan = "tv"and"full"views.