libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
9.76k stars 1.77k forks source link

[Feature Request] hotkey for switching screen aspect Ratio #14495

Open schmurtzm opened 1 year ago

schmurtzm commented 1 year ago

Description

On many handheld consoles it could be very handy to be able to switch screen aspect ratio with an hotkey. It is justified by the fact that there are many different opionion on the subject : hardcore and purist retrogamers want to keep aspect ratio and others just want to uuse all the surface of the screen. We also see users who switch depending the game. The result is that many users want to switch the screen aspect ratio and it is not very handy through the menu. Some request example here, here

Expected behavior

Have a hotkey avaible to switch between the main differents aspects ratio. There are 3 settings available :

The idea is to switch between the 4 possibilities availble during run (without restart so we drop out "crop overscan" option). To illustrate :

image

Actual behavior

No hotkey available to switch between different screen values. To test one idfferent ratio you hate to go in RA menu : settings -> video -> sclaing -> keep aspect ratio

Thanks

Thank you so much for this great piece of software ! :)

mrgusth commented 1 year ago

This option would be very handy for sure! :D

schmurtzm commented 1 year ago

Hi, an example of implementation made by Eggs for the Miyoo Mini :

Change scaling options with the hotkeys set in the:
Settings > Input > Hotkeys > Fullscreen (Toggle)

.. -> Integer:OFF , Aspect:OFF -> Integer:OFF , Aspect:ON -> Integer:ON  , Aspect:OFF -> Integer:ON  , Aspect:ON -> ..

Only 8 lines in retroarch.c have been added:
--------------------------------------------- line:2953
#if defined(MIYOOMINI)
    settings->bools.video_dingux_ipu_keep_aspect = !settings->bools.video_dingux_ipu_keep_aspect;
    if (!settings->bools.video_dingux_ipu_keep_aspect) {
        settings->bools.video_scale_integer = !settings->bools.video_scale_integer;
    }
    video_driver_apply_state_changes();
#else
--------------------------------------------- line:3011
#endif
---------------------------------------------