libretro / melonDS

DS emulator, sorta
GNU General Public License v3.0
39 stars 40 forks source link

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

Open pickledish opened 1 year ago

pickledish commented 1 year ago

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 :)

pickledish commented 1 year ago

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