Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAL50 resolutions are letterboxed #566

Open
thekovic opened this issue Jun 10, 2024 · 0 comments
Open

PAL50 resolutions are letterboxed #566

thekovic opened this issue Jun 10, 2024 · 0 comments
Labels
fixed-in-preview Fixed in the preview branch

Comments

@thekovic
Copy link
Contributor

thekovic commented Jun 10, 2024

Currently, the VI setup causes the following situation in PAL50 mode:
image
V_START is set to 95 (0x5F) and V_END is set to 569 (0x239), drawing a total of 474 lines. Y_SCALE is calculated with the same formula as NTSC mode which gives result of 1.205 (0x4cd). This has the effect of placing the frame roughly in the vertical center of the screen and drawing it with NTSC aspect ratio. This results in a squished image when actually displaying the frame on a TV because a PAL format video is still intended to be displayed in 4:3. PAL releases of Super Mario 64 or Mario Kart 64 display like this.
(NOTE: The actual resolution of the frame buffer does not affect this behaviour. A frame made from a 320x240 frame buffer and from a 320x288 are both letterboxed and equally squished when finally displayed on screen.)

As a fix, I set V_START to 45 (0x2D) and V_END to 621 (0x26D), drawing a total of 576 lines, per PAL spec. The formula to calculate Y_SCALE is modified to (1024 * (res.height) + 120) / 288. The result is a frame which covers the entire screen and displays properly on a TV. PAL releases of Ocarina of Time or Mario Party display like this.
image

Loosely related: I also played with V_VIDEO settings for NTSC. Currently, V_START is set to 37 (0x25) and V_END is set to 511 (0x1FF), drawing a total of 474 lines. This causes black lines at the top and bottom of the image.
image
One could choose to change this to V_START set to 35 (0x23) and V_END is set to 515 (0x203), drawing a total of 480 lines. This displays the image fully.
image
As far as I can tell, no commercial game does. There may be a good reason for skipping 6 lines that I don't know about and that I didn't come into in my testing. In case of such a reason, the "fixed" PAL configuration for V_VIDEO described above will need to be adjusted slightly.

@rasky rasky added the fixed-in-preview Fixed in the preview branch label Jun 10, 2024
@rasky rasky changed the title display_init doesn't handle the increased vertical resolution in PAL50 mode PAL50 resolutions are letterboxed Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed-in-preview Fixed in the preview branch
Projects
None yet
Development

No branches or pull requests

2 participants