diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index e57b9651cf098747901fec4cf916b295f8fe821f..b20553ef985de17debd8abceeafadbdb2d0cd33c 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -22,6 +22,10 @@ as release notes for end user on a Recalbox upgrade. - Add NetPlay support for cores libretro-gpsp and libretro-dosbox-pure ### Improvements +- Add script for support of Retroflag GPI Case 2 (at boot only) + - unset in-case pad when HDMI is connected + - audio switching between in-case and HDMI + - Switch to recalbox-next theme when docked - Add gamelist decoration on the right side: regions flags, genre & players - Add sort by playing time & sort by regions - Remove overscan option in frontend diff --git a/projects/recalbox-hardware/case/installers/gpi2/assets/S15gpi2 b/projects/recalbox-hardware/case/installers/gpi2/assets/S15gpi2 new file mode 100644 index 0000000000000000000000000000000000000000..413d5ef915c62f88559cc43ddcf1666c0c4b8d0b --- /dev/null +++ b/projects/recalbox-hardware/case/installers/gpi2/assets/S15gpi2 @@ -0,0 +1,115 @@ +#!/bin/bash +# +# Retroflag Gpi Case 2 dock management +# Take care of +# * unset in-case pad when HDMI connected +# * audio switching between in-case and HDMI +# * Manage different custom configuration for docked/undocked modes (theme, audio, shaders) + +CONFIG_FILE="/recalbox/system/hardware/case/installers/gpi2/assets/gpi2settings.conf" + +mount -o remount,rw / +# Create configuration file if not exist (more robust in case of user deletion) + +if [ ! -f "$CONFIG_FILE" ]; then + cat > "$CONFIG_FILE" < /sys/bus/usb/drivers/xpad/unbind + + # Set previous mode to HDMI for next restart + sed -i "s/^previousMode=.*/previousMode=\"hdmi\"/" "$CONFIG_FILE" + + else + # Load LCD settings + if [ "$previousMode" != "lcd" ]; then + + # Test to prevent overwriting default config in case of empty previous mode (first start) + if [ "$previousMode" = "hdmi" ]; then + # Save current setting as HDMI settings + saveHdmi + fi + + # Apply LCD Settings + recalbox_settings -command save -key emulationstation.theme.folder -value "$lcdTheme" + recalbox_settings -command save -key emulationstation.theme.carousel -value "$lcdThemeCarousel" + recalbox_settings -command save -key emulationstation.theme.transition -value "$lcdThemeTransition" + recalbox_settings -command save -key audio.device -value "$lcdAudio" + recalbox_settings -command save -key global.shaders -value "$lcdShaders" + recalbox_settings -command save -key global.shaderset -value "$lcdShaderSet" + else + # As LCD was already connected on previous boot, save the user settings in CONFIG_FILE + saveLcd + fi + + # Set previous mode to LCD for next restart + sed -i "s/^previousMode=.*/previousMode=\"lcd\"/" "$CONFIG_FILE" + fi +} + +# This fonction saves user LCD settings in CONFIG_FILE +saveLcd() { + sed -i "s/^lcdTheme=.*/lcdTheme=\"$(recalbox_settings -command load -key emulationstation.theme.folder)\"/" "$CONFIG_FILE" + sed -i "s/^lcdThemeCarousel=.*/lcdThemeCarousel=\"$(recalbox_settings -command load -key emulationstation.theme.carousel)\"/" "$CONFIG_FILE" + sed -i "s/^lcdThemeTransition=.*/lcdThemeTransition=\"$(recalbox_settings -command load -key emulationstation.theme.transition)\"/" "$CONFIG_FILE" + sed -i "s/^lcdAudio=.*/lcdAudio=\"$(recalbox_settings -command load -key audio.device)\"/" "$CONFIG_FILE" + sed -i "s#^lcdShaders=.*#lcdShaders=\"$(recalbox_settings -command load -key global.shaders)\"#" "$CONFIG_FILE" + sed -i "s/^lcdShaderSet=.*/lcdShaderSet=\"$(recalbox_settings -command load -key global.shaderset)\"/" "$CONFIG_FILE" +} + +# This fonction saves user LCD settings in CONFIG_FILE +saveHdmi() { + sed -i "s/^hdmiTheme=.*/hdmiTheme=\"$(recalbox_settings -command load -key emulationstation.theme.folder)\"/" "$CONFIG_FILE" + sed -i "s/^hdmiThemeCarousel=.*/hdmiThemeCarousel=\"$(recalbox_settings -command load -key emulationstation.theme.carousel)\"/" "$CONFIG_FILE" + sed -i "s/^hdmiThemeTransition=.*/hdmiThemeTransition=\"$(recalbox_settings -command load -key emulationstation.theme.transition)\"/" "$CONFIG_FILE" + sed -i "s/^hdmiAudio=.*/hdmiAudio=\"$(recalbox_settings -command load -key audio.device)\"/" "$CONFIG_FILE" + sed -i "s#^hdmiShaders=.*#hdmiShaders=\"$(recalbox_settings -command load -key global.shaders)\"#" "$CONFIG_FILE" + sed -i "s/^hdmiShaderSet=.*/hdmiShaderSet=\"$(recalbox_settings -command load -key global.shaderset)\"/" "$CONFIG_FILE" +} + +start \ No newline at end of file diff --git a/projects/recalbox-hardware/case/installers/gpi2/install.py b/projects/recalbox-hardware/case/installers/gpi2/install.py index b059e2886460c518d52baa53143499e4df6ba085..36629c6d734c7d3a171d02a89ff64f2070472789 100755 --- a/projects/recalbox-hardware/case/installers/gpi2/install.py +++ b/projects/recalbox-hardware/case/installers/gpi2/install.py @@ -95,6 +95,7 @@ class Install(InstallBase): self.BASE_SOURCE_FOLDER + 'assets/gpi2-retroarch.cfg': '/recalbox/share/.retroarch.cfg', self.BASE_SOURCE_FOLDER + 'assets/es_input.cfg': '/recalbox/share/system/.emulationstation/es_input.cfg', self.BASE_SOURCE_FOLDER + 'assets/gpi2.png': '/recalbox/system/resources/splash/logo-version.png', + self.BASE_SOURCE_FOLDER + 'assets/S15gpi2': '/etc/init.d/S15gpi2', } for source_file, dest_file in files.items(): installed_file = shutil.copy(source_file, dest_file)