Skip to content

Screen layout improvements - #2705

Open
JoJoKorok wants to merge 4 commits into
melonDS-emu:masterfrom
JoJoKorok:screen-layout-improvements
Open

JoJoKorok wants to merge 4 commits into
melonDS-emu:masterfrom
JoJoKorok:screen-layout-improvements

Conversation

@JoJoKorok

Copy link
Copy Markdown

Summary

This combines two related screen-layout improvements:

  • Incorporates the configurable hybrid-screen ratios from melonDS PR #2332;
  • Corrects the existing window aspect-ratio calculation so two-screen layouts can fill the available window, addressing melonDS issue #2695.

Credit and Authorship

The hybrid-ratio implementation was originally authored by
@KDOXG in melonDS PR #2332.
Their implementation remains a separate commit, with the original Git author attribution preserved.

Thanks also to @crashGG for testing the original implementation and providing substantial screen-layout feedback in the PR #2332 discussion.

Hybrid ratios

Adds View → Hybrid ratio with the following options:

  • 2:1
  • 3:1
  • 4:1
  • 5:1
  • 6:1
  • 7:1
  • 5:2
  • 7:3
  • 9:4

Hybrid ratios use a separate configuration value, so changing the hybrid ratio
does not modify the regular screen-gap setting. The selected ratio persists
after restarting melonDS.

Fill-window aspect ratio

The existing window aspect-ratio option previously calculated each DS
screen's aspect from the complete emulator panel. This did not account for the
portion of the panel allocated to each screen. For example, two vertically
stacked screens still produced side bars because each screen only occupies half
of the panel height.

The updated calculation accounts for:

  • vertical, horizontal, and natural layouts;
  • 0°, 90°, 180°, and 270° screen rotations;
  • the effective screen gap;
  • single-screen modes;
  • unusually narrow windows or large gaps.

The existing inverse screen transformation continues to handle touchscreen
coordinates after stretching.

This portion addresses melonDS issue #2695.

Usage

To stretch two vertically stacked screens:

  1. Select View → Screen layout → Vertical.
  2. Select View → Screen sizing → Even.
  3. Disable Force integer scaling.
  4. Select View → Aspect ratio → Top window.
  5. Select View → Aspect ratio → Bottom window.
  6. Maximize the window or enter fullscreen.

To configure the hybrid layout:

  1. Select View → Screen layout → Hybrid.
  2. Open View → Hybrid ratio.
  3. Select the desired ratio.

Testing

Tested on Windows using MSYS2 UCRT64, Qt 6, and GCC 15.2.

  • Full debug build completed successfully.
  • Portable build launched successfully.
  • Hybrid-ratio selection persisted after restarting.
  • Fill-window geometry was tested with:
    • vertical and horizontal layouts;
    • rotated layouts;
    • non-zero screen gaps;
    • single-screen modes.
  • Touch input remained aligned after stretching.
  • Both features were retested after the contribution-guideline naming cleanup.
  • git diff --check passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants