From 7004485fccffd1f97bc8371649737d54425c1e8e Mon Sep 17 00:00:00 2001 From: mike855 Date: Mon, 27 Jan 2025 11:04:38 +0100 Subject: [PATCH] fix: user overlays not compatible with some case in handled mode 4/3 --- RELEASE-NOTES.md | 1 + .../generators/libretro/libretroGenerator.py | 63 ++++++++++--------- 2 files changed, 33 insertions(+), 31 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index e57b9651cf..3f8ed87a5f 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -45,6 +45,7 @@ as release notes for end user on a Recalbox upgrade. - Fix hidden and/or empty being shown after some user operations - Fix user selected ratio per game - Fix Supermodel config and configgen files (Thanks AxelR !) +- Fix user overlays prevents games from working on 4/3 screen (for handled cases with dock) ### Bumps - Bump retroarch to 1.19.1 diff --git a/projects/configgen/configgen/generators/libretro/libretroGenerator.py b/projects/configgen/configgen/generators/libretro/libretroGenerator.py index 017675767b..46b3779db4 100644 --- a/projects/configgen/configgen/generators/libretro/libretroGenerator.py +++ b/projects/configgen/configgen/generators/libretro/libretroGenerator.py @@ -68,37 +68,38 @@ class LibretroGenerator(Generator): # Overlays are applied only when we are not in wide core else: # User overlays - overlayFile = "{}/{}/.overlay.cfg".format(recalboxFiles.OVERLAYS, system.Name) - if os.path.isfile(overlayFile): - # System global configuration - configs.append(overlayFile) - else: - overlayFile = "{}/.overlay.cfg".format(recalboxFiles.OVERLAYS) - if os.path.isfile(overlayFile): - # All system global configuration - configs.append(overlayFile) - overlayFile = "{}/{}/{}.cfg".format(recalboxFiles.OVERLAYS, system.Name, romName) - if os.path.isfile(overlayFile): - # Rom file overlay - configs.append(overlayFile) - else: - overlayFile = "{}/{}/{}.cfg".format(recalboxFiles.OVERLAYS, system.Name, system.Name) - if os.path.isfile(overlayFile): - # System overlay - configs.append(overlayFile) - # No config applied - if len(configs) == 0: - # The recalbox overlays should be added only if - # global.recalboxoverlays=1 or system.recalboxoverlays activated - if system.RecalboxOverlays: - # ratio = we can activate when ratio is not 16/9 and 16/10 - if system.Ratio not in ["16/9", "16/10"]: - # screen resolution that can support overlays are over 1.5 ratio (as it is float > 1.51) - from configgen.utils.resolutions import ResolutionParser - resolution = ResolutionParser(system.VideoMode) - if resolution.ratio() > 1.51: - defaultOverlayFile = "{}/{}/{}.cfg".format(recalboxFiles.RECALBOX_OVERLAYS, system.Name, - system.Name) + + # ratio = we can activate when ratio is not 16/9 and 16/10 + if system.Ratio not in ["16/9", "16/10"]: + # screen resolution that can support overlays are over 1.5 ratio (as it is float > 1.51) + from configgen.utils.resolutions import ResolutionParser + resolution = ResolutionParser(system.VideoMode) + if resolution.ratio() > 1.51: + # User overlays + overlayFile = "{}/{}/.overlay.cfg".format(recalboxFiles.OVERLAYS, system.Name) + if os.path.isfile(overlayFile): + # System global configuration + configs.append(overlayFile) + else: + overlayFile = "{}/.overlay.cfg".format(recalboxFiles.OVERLAYS) + if os.path.isfile(overlayFile): + # All system global configuration + configs.append(overlayFile) + overlayFile = "{}/{}/{}.cfg".format(recalboxFiles.OVERLAYS, system.Name, romName) + if os.path.isfile(overlayFile): + # Rom file overlay + configs.append(overlayFile) + else: + overlayFile = "{}/{}/{}.cfg".format(recalboxFiles.OVERLAYS, system.Name, system.Name) + if os.path.isfile(overlayFile): + # System overlay + configs.append(overlayFile) + # No config applied + if len(configs) == 0: + # The recalbox overlays should be added only if + # global.recalboxoverlays=1 or system.recalboxoverlays activated + if system.RecalboxOverlays: + defaultOverlayFile = "{}/{}/{}.cfg".format(recalboxFiles.RECALBOX_OVERLAYS, system.Name, system.Name) if os.path.isfile(defaultOverlayFile): configs.append(defaultOverlayFile) -- GitLab