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

Add support for arbitrary scaling ratios in hybrid display mode #192

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

pickledish
Copy link

Hello! New to this project but saw a small place I could make an improvement so wanted to take a stab.

Yesterday I found myself needing a few more options in the "hybrid ratio" section of the core options; in my specific case options like 4:1 or 3:2 would be nice to have since they'd result in both screens being integer-scaled on the 720p steam deck display (and also 1440p and 4k displays I believe).

Adding an option for 4:1 ratio was easy, just a new item in the menu, but 3:2 was much harder since the code assumes the "small screen" in a hybrid display is always ratio 1. Thus, this PR! I tried to add support (though please be nice if my C is terrible, haven't needed to try it since high school 😅)

Here are a few screenshots showing it works (zoom in to see those perfect pixels lol):

The 4:1 mode works perfectly, but I think I must've gotten something slightly wrong with the input part, since touch doesn't register in the 3:2 mode when the bottom screen is the small screen -- would love any input or help y'all can provide!

Thanks :)

Comment on lines -86 to +91
unsigned int touch_scale = screen_layout_data.displayed_layout == ScreenLayout::HybridBottom ? screen_layout_data.hybrid_ratio : 1;
unsigned int touch_scale = 1;
if (screen_layout_data.displayed_layout == ScreenLayout::HybridBottom) {
touch_scale = screen_layout_data.hybrid_ratio_large;
} else if (screen_layout_data.displayed_layout == ScreenLayout::HybridTop) {
touch_scale = screen_layout_data.hybrid_ratio_small;
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(see the PR description, this edit makes sense to me but must be wrong somehow. Before this edit, the touch registers but not where you touched, and after this edit the touch doesn't register at all)

@pickledish
Copy link
Author

Any way to get eyes on this? If the PR is too long to be desirable / no one can help with the small bug that remains, I can remove the 3:2 option and just add the 4:1 one, that would require only a few lines total to be changed and would still be an improvement

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.

1 participant