From 23604f77af94481084d6672223881f048580229b Mon Sep 17 00:00:00 2001 From: icenine451 Date: Mon, 29 Jan 2024 10:46:27 -0500 Subject: [PATCH] Update presets engine to handle multiple target files Update all preset files to new syntax standard Update ABXY button swap internal preset name --- .../retrodeck/presets/citra_presets.cfg | 14 +++++------ .../retrodeck/presets/dolphin_presets.cfg | 4 +--- .../retrodeck/presets/duckstation_presets.cfg | 16 ++++++------- .../defaults/retrodeck/presets/example.txt | 8 +++---- .../defaults/retrodeck/presets/gb_presets.cfg | 24 +++++++++---------- .../retrodeck/presets/gba_presets.cfg | 24 +++++++++---------- .../retrodeck/presets/gbc_presets.cfg | 24 +++++++++---------- .../retrodeck/presets/genesis_presets.cfg | 12 ++++------ .../defaults/retrodeck/presets/gg_presets.cfg | 22 ++++++++--------- .../retrodeck/presets/n64_presets.cfg | 12 ++++------ .../retrodeck/presets/pcsx2_presets.cfg | 16 ++++++------- .../retrodeck/presets/ppsspp_presets.cfg | 7 +++--- .../retrodeck/presets/primehack_presets.cfg | 4 +--- .../retrodeck/presets/psx_ra_presets.cfg | 12 ++++------ .../retrodeck/presets/retroarch_presets.cfg | 14 +++++------ .../retrodeck/presets/snes_presets.cfg | 14 +++++------ .../retrodeck/presets/yuzu_presets.cfg | 14 +++++------ emu-configs/defaults/retrodeck/retrodeck.cfg | 2 +- functions/post_update.sh | 9 +++++++ functions/prepare_emulator.sh | 14 +++++------ functions/presets.sh | 24 +++++++------------ tools/configurator.sh | 2 +- 22 files changed, 132 insertions(+), 160 deletions(-) diff --git a/emu-configs/defaults/retrodeck/presets/citra_presets.cfg b/emu-configs/defaults/retrodeck/presets/citra_presets.cfg index 9211d5c0..05b0d7b0 100644 --- a/emu-configs/defaults/retrodeck/presets/citra_presets.cfg +++ b/emu-configs/defaults/retrodeck/presets/citra_presets.cfg @@ -1,9 +1,7 @@ config_file_format^citra -target_file^$citraconf -defaults_file^$emuconfigs/citra/qt-config.ini -change^ask_to_exit^confirmClose^true^UI -change^ask_to_exit^confirmClose\default^true^UI -change^nintendo_button_layout^profiles\1\button_a^button:1,engine:sdl,guid:030079f6de280000ff11000001000000,port:0^Controls -change^nintendo_button_layout^profiles\1\button_b^button:0,engine:sdl,guid:030079f6de280000ff11000001000000,port:0^Controls -change^nintendo_button_layout^profiles\1\button_x^button:3,engine:sdl,guid:030079f6de280000ff11000001000000,port:0^Controls -change^nintendo_button_layout^profiles\1\button_y^button:2,engine:sdl,guid:030079f6de280000ff11000001000000,port:0^Controls +change^ask_to_exit^confirmClose^true^UI^$citraconf^$emuconfigs/citra/qt-config.ini +change^ask_to_exit^confirmClose\default^true^UI^$citraconf^$emuconfigs/citra/qt-config.ini +change^abxy_button_swap^profiles\1\button_a^button:1,engine:sdl,guid:030079f6de280000ff11000001000000,port:0^Controls^$citraconf^$emuconfigs/citra/qt-config.ini +change^abxy_button_swap^profiles\1\button_b^button:0,engine:sdl,guid:030079f6de280000ff11000001000000,port:0^Controls^$citraconf^$emuconfigs/citra/qt-config.ini +change^abxy_button_swap^profiles\1\button_x^button:3,engine:sdl,guid:030079f6de280000ff11000001000000,port:0^Controls^$citraconf^$emuconfigs/citra/qt-config.ini +change^abxy_button_swap^profiles\1\button_y^button:2,engine:sdl,guid:030079f6de280000ff11000001000000,port:0^Controls^$citraconf^$emuconfigs/citra/qt-config.ini diff --git a/emu-configs/defaults/retrodeck/presets/dolphin_presets.cfg b/emu-configs/defaults/retrodeck/presets/dolphin_presets.cfg index 234012e9..0836e0ca 100644 --- a/emu-configs/defaults/retrodeck/presets/dolphin_presets.cfg +++ b/emu-configs/defaults/retrodeck/presets/dolphin_presets.cfg @@ -1,4 +1,2 @@ config_file_format^dolphin -target_file^$dolphinconf -defaults_file^$emuconfigs/dolphin/Dolphin.ini -change^ask_to_exit^ConfirmStop^True^Interface +change^ask_to_exit^ConfirmStop^True^Interface^$dolphinconf^$emuconfigs/dolphin/Dolphin.ini diff --git a/emu-configs/defaults/retrodeck/presets/duckstation_presets.cfg b/emu-configs/defaults/retrodeck/presets/duckstation_presets.cfg index 76c9f926..e4a2e66a 100644 --- a/emu-configs/defaults/retrodeck/presets/duckstation_presets.cfg +++ b/emu-configs/defaults/retrodeck/presets/duckstation_presets.cfg @@ -1,10 +1,8 @@ config_file_format^duckstation -target_file^$duckstationconf -defaults_file^$emuconfigs/duckstation/settings.ini -change^cheevos^Enabled^true^Cheevos -change^cheevos^Username^$cheevos_username^Cheevos -change^cheevos^Token^$cheevos_token^Cheevos -change^cheevos^LoginTimestamp^$cheevos_login_timestamp^Cheevos -change^cheevos_hardcore^ChallengeMode^true^Cheevos -change^savestate_auto_save^SaveStateOnExit^true^Main -change^ask_to_exit^ConfirmPowerOff^true^Main +change^cheevos^Enabled^true^Cheevos^$duckstationconf^$emuconfigs/duckstation/settings.ini +change^cheevos^Username^$cheevos_username^Cheevos^$duckstationconf^$emuconfigs/duckstation/settings.ini +change^cheevos^Token^$cheevos_token^Cheevos^$duckstationconf^$emuconfigs/duckstation/settings.ini +change^cheevos^LoginTimestamp^$cheevos_login_timestamp^Cheevos^$duckstationconf^$emuconfigs/duckstation/settings.ini +change^cheevos_hardcore^ChallengeMode^true^Cheevos^$duckstationconf^$emuconfigs/duckstation/settings.ini +change^savestate_auto_save^SaveStateOnExit^true^Main^$duckstationconf^$emuconfigs/duckstation/settings.ini +change^ask_to_exit^ConfirmPowerOff^true^Main^$duckstationconf^$emuconfigs/duckstation/settings.ini diff --git a/emu-configs/defaults/retrodeck/presets/example.txt b/emu-configs/defaults/retrodeck/presets/example.txt index 53d031a4..3d64330c 100644 --- a/emu-configs/defaults/retrodeck/presets/example.txt +++ b/emu-configs/defaults/retrodeck/presets/example.txt @@ -1,9 +1,7 @@ config_file_format^retroarch # This is the config file format, used in functions like get_setting_value and set_setting_value -target_file^$examplefile # This is the target file that should be updated. This will be the actively-used config file by whatever emulator is being set up. This can be a variable name as well! -defaults_file^$emuconfigs/retroarch/retroarch.cfg # This is the file that is referenced when presets are disabled. This should be the "shipped" config file for this emulator -change^cheevos^Enabled^true^Cheevos # This is a preset configuration line. The syntax is ^^^^ -change^borders^overlay_file^/var/config/retroarch/overlays/borders/snes.cfg # This is another preset configuration line, for the preset section called "borders" in retrodeck.cfg. Also, there is no defined "setting section" on this line - +change^cheevos^Enabled^true^Cheevos^$target_file^$defaults_file # This is a preset configuration line. The syntax is ^^^^^ +change^borders^overlay_file^/var/config/retroarch/overlays/borders/snes.cfg^^target_file^defaults_file # This is another preset configuration line, for the preset section called "borders" in retrodeck.cfg. Also, there is no defined "setting section" on this line, but there must be an empty field between ^^ +enable^abxy_button_swap^/var/config/retroarch/config/remaps/Snes9x/snes.rmp # This will remove the ".disabled" suffix from the target file, or add ".disabled" to the suffix of the target file if the preset is being disabled OTHER NOTES: - The name of the presets configuration file for any given system MUST be _presets.cfg diff --git a/emu-configs/defaults/retrodeck/presets/gb_presets.cfg b/emu-configs/defaults/retrodeck/presets/gb_presets.cfg index cc48e4c0..d754c374 100644 --- a/emu-configs/defaults/retrodeck/presets/gb_presets.cfg +++ b/emu-configs/defaults/retrodeck/presets/gb_presets.cfg @@ -1,14 +1,12 @@ config_file_format^retroarch -target_file^/var/config/retroarch/config/Gambatte/gb.cfg -defaults_file^$emuconfigs/retroarch/retroarch.cfg -change^borders^aspect_ratio_index^23 -change^borders^custom_viewport_height^576 -change^borders^custom_viewport_width^640 -change^borders^custom_viewport_x^320 -change^borders^custom_viewport_y^20 -change^borders^input_overlay^/var/config/retroarch/overlays/borders/pegasus/gb.cfg -change^borders^input_overlay_aspect_adjust_landscape^0.110000 -change^borders^input_overlay_enable^true -change^borders^input_overlay_scale_landscape^1.205000 -change^borders^input_overlay_y_offset_landscape^0.005000 -enable^nintendo_button_layout^/var/config/retroarch/config/remaps/Gambatte/gb.rmp +change^borders^aspect_ratio_index^23^^/var/config/retroarch/config/Gambatte/gb.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^custom_viewport_height^576^^/var/config/retroarch/config/Gambatte/gb.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^custom_viewport_width^640^^/var/config/retroarch/config/Gambatte/gb.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^custom_viewport_x^320^^/var/config/retroarch/config/Gambatte/gb.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^custom_viewport_y^20^^/var/config/retroarch/config/Gambatte/gb.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^input_overlay^/var/config/retroarch/overlays/borders/pegasus/gb.cfg^^/var/config/retroarch/config/Gambatte/gb.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^input_overlay_aspect_adjust_landscape^0.110000^^/var/config/retroarch/config/Gambatte/gb.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^input_overlay_enable^true^^/var/config/retroarch/config/Gambatte/gb.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^input_overlay_scale_landscape^1.205000^^/var/config/retroarch/config/Gambatte/gb.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^input_overlay_y_offset_landscape^0.005000^^/var/config/retroarch/config/Gambatte/gb.cfg^$emuconfigs/retroarch/retroarch.cfg +enable^abxy_button_swap^/var/config/retroarch/config/remaps/Gambatte/gb.rmp diff --git a/emu-configs/defaults/retrodeck/presets/gba_presets.cfg b/emu-configs/defaults/retrodeck/presets/gba_presets.cfg index 21787a86..b5a4fc03 100644 --- a/emu-configs/defaults/retrodeck/presets/gba_presets.cfg +++ b/emu-configs/defaults/retrodeck/presets/gba_presets.cfg @@ -1,14 +1,12 @@ config_file_format^retroarch -target_file^/var/config/retroarch/config/mGBA/gba.cfg -defaults_file^$emuconfigs/retroarch/retroarch.cfg -change^borders^aspect_ratio_index^23 -change^borders^custom_viewport_height^640 -change^borders^custom_viewport_width^960 -change^borders^custom_viewport_x^160 -change^borders^custom_viewport_y^0 -change^borders^input_overlay_enable^true -change^borders^input_overlay^/var/config/retroarch/overlays/borders/pegasus/gba.cfg -change^borders^input_overlay_aspect_adjust_landscape^0.110000 -change^borders^input_overlay_scale_landscape^1.2150000 -change^borders^input_overlay_y_offset_landscape^0.020000 -enable^nintendo_button_layout^/var/config/retroarch/config/remaps/Gambatte/gbc.rmp +change^borders^aspect_ratio_index^23^^/var/config/retroarch/config/mGBA/gba.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^custom_viewport_height^640^^/var/config/retroarch/config/mGBA/gba.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^custom_viewport_width^960^^/var/config/retroarch/config/mGBA/gba.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^custom_viewport_x^160^^/var/config/retroarch/config/mGBA/gba.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^custom_viewport_y^0^^/var/config/retroarch/config/mGBA/gba.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^input_overlay_enable^true^^/var/config/retroarch/config/mGBA/gba.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^input_overlay^/var/config/retroarch/overlays/borders/pegasus/gba.cfg^^/var/config/retroarch/config/mGBA/gba.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^input_overlay_aspect_adjust_landscape^0.110000^^/var/config/retroarch/config/mGBA/gba.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^input_overlay_scale_landscape^1.2150000^^/var/config/retroarch/config/mGBA/gba.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^input_overlay_y_offset_landscape^0.020000^^/var/config/retroarch/config/mGBA/gba.cfg^$emuconfigs/retroarch/retroarch.cfg +enable^abxy_button_swap^/var/config/retroarch/config/remaps/Gambatte/gbc.rmp diff --git a/emu-configs/defaults/retrodeck/presets/gbc_presets.cfg b/emu-configs/defaults/retrodeck/presets/gbc_presets.cfg index cd24b9e7..d6b2e107 100644 --- a/emu-configs/defaults/retrodeck/presets/gbc_presets.cfg +++ b/emu-configs/defaults/retrodeck/presets/gbc_presets.cfg @@ -1,14 +1,12 @@ config_file_format^retroarch -target_file^/var/config/retroarch/config/Gambatte/gbc.cfg -defaults_file^$emuconfigs/retroarch/retroarch.cfg -change^borders^aspect_ratio_index^23 -change^borders^custom_viewport_height^576 -change^borders^custom_viewport_width^640 -change^borders^custom_viewport_x^320 -change^borders^custom_viewport_y^20 -change^borders^input_overlay^/var/config/retroarch/overlays/borders/pegasus/gbc.cfg -change^borders^input_overlay_aspect_adjust_landscape^0.110000 -change^borders^input_overlay_enable^true -change^borders^input_overlay_scale_landscape^1.205000 -change^borders^input_overlay_y_offset_landscape^-0.040000 -enable^nintendo_button_layout^/var/config/retroarch/config/remaps/Gambatte/gbc.rmp +change^borders^aspect_ratio_index^23^^/var/config/retroarch/config/Gambatte/gbc.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^custom_viewport_height^576^^/var/config/retroarch/config/Gambatte/gbc.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^custom_viewport_width^640^^/var/config/retroarch/config/Gambatte/gbc.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^custom_viewport_x^320^^/var/config/retroarch/config/Gambatte/gbc.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^custom_viewport_y^20^^/var/config/retroarch/config/Gambatte/gbc.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^input_overlay^/var/config/retroarch/overlays/borders/pegasus/gbc.cfg^^/var/config/retroarch/config/Gambatte/gbc.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^input_overlay_aspect_adjust_landscape^0.110000^^/var/config/retroarch/config/Gambatte/gbc.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^input_overlay_enable^true^^/var/config/retroarch/config/Gambatte/gbc.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^input_overlay_scale_landscape^1.205000^^/var/config/retroarch/config/Gambatte/gbc.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^input_overlay_y_offset_landscape^-0.040000^^/var/config/retroarch/config/Gambatte/gbc.cfg^$emuconfigs/retroarch/retroarch.cfg +enable^abxy_button_swap^/var/config/retroarch/config/remaps/Gambatte/gbc.rmp diff --git a/emu-configs/defaults/retrodeck/presets/genesis_presets.cfg b/emu-configs/defaults/retrodeck/presets/genesis_presets.cfg index ef0fbc5b..c566decf 100644 --- a/emu-configs/defaults/retrodeck/presets/genesis_presets.cfg +++ b/emu-configs/defaults/retrodeck/presets/genesis_presets.cfg @@ -1,8 +1,6 @@ config_file_format^retroarch -target_file^/var/config/retroarch/config/Genesis Plus GX/genesis.cfg -defaults_file^$emuconfigs/retroarch/retroarch.cfg -change^borders^input_overlay^/var/config/retroarch/overlays/borders/pegasus/genesis.cfg -change^borders^input_overlay_aspect_adjust_landscape^0.100000 -change^borders^input_overlay_enable^true -change^borders^input_overlay_scale_landscape^1.040000 -change^widescreen^aspect_ratio_index^24 +change^borders^input_overlay^/var/config/retroarch/overlays/borders/pegasus/genesis.cfg^^/var/config/retroarch/config/Genesis Plus GX/genesis.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^input_overlay_aspect_adjust_landscape^0.100000^^/var/config/retroarch/config/Genesis Plus GX/genesis.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^input_overlay_enable^true^^/var/config/retroarch/config/Genesis Plus GX/genesis.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^input_overlay_scale_landscape^1.040000^^/var/config/retroarch/config/Genesis Plus GX/genesis.cfg^$emuconfigs/retroarch/retroarch.cfg +change^widescreen^aspect_ratio_index^24^^/var/config/retroarch/config/Genesis Plus GX/genesis.cfg^$emuconfigs/retroarch/retroarch.cfg diff --git a/emu-configs/defaults/retrodeck/presets/gg_presets.cfg b/emu-configs/defaults/retrodeck/presets/gg_presets.cfg index f6b8529a..2de18ce3 100644 --- a/emu-configs/defaults/retrodeck/presets/gg_presets.cfg +++ b/emu-configs/defaults/retrodeck/presets/gg_presets.cfg @@ -1,13 +1,11 @@ config_file_format^retroarch -target_file^/var/config/retroarch/config/Genesis Plus GX/gg.cfg -defaults_file^$emuconfigs/retroarch/retroarch.cfg -change^borders^aspect_ratio_index^23 -change^borders^custom_viewport_width^960 -change^borders^custom_viewport_height^720 -change^borders^custom_viewport_x^160 -change^borders^custom_viewport_y^24 -change^borders^input_overlay^/var/config/retroarch/overlays/borders/pegasus/gg.cfg -change^borders^input_overlay_aspect_adjust_landscape^0.110000 -change^borders^input_overlay_enable^true -change^borders^input_overlay_scale_landscape^1.350000 -change^borders^input_overlay_y_offset_landscape^0.020000 +change^borders^aspect_ratio_index^23^^/var/config/retroarch/config/Genesis Plus GX/gg.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^custom_viewport_width^960^^/var/config/retroarch/config/Genesis Plus GX/gg.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^custom_viewport_height^720^^/var/config/retroarch/config/Genesis Plus GX/gg.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^custom_viewport_x^160^^/var/config/retroarch/config/Genesis Plus GX/gg.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^custom_viewport_y^24^^/var/config/retroarch/config/Genesis Plus GX/gg.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^input_overlay^/var/config/retroarch/overlays/borders/pegasus/gg.cfg^^/var/config/retroarch/config/Genesis Plus GX/gg.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^input_overlay_aspect_adjust_landscape^0.110000^^/var/config/retroarch/config/Genesis Plus GX/gg.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^input_overlay_enable^true^^/var/config/retroarch/config/Genesis Plus GX/gg.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^input_overlay_scale_landscape^1.350000^^/var/config/retroarch/config/Genesis Plus GX/gg.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^input_overlay_y_offset_landscape^0.020000^^/var/config/retroarch/config/Genesis Plus GX/gg.cfg^$emuconfigs/retroarch/retroarch.cfg diff --git a/emu-configs/defaults/retrodeck/presets/n64_presets.cfg b/emu-configs/defaults/retrodeck/presets/n64_presets.cfg index 542aa841..8a92b041 100644 --- a/emu-configs/defaults/retrodeck/presets/n64_presets.cfg +++ b/emu-configs/defaults/retrodeck/presets/n64_presets.cfg @@ -1,8 +1,6 @@ config_file_format^retroarch -target_file^/var/config/retroarch/config/Mupen64Plus-Next/n64.cfg -defaults_file^$emuconfigs/retroarch/retroarch.cfg -change^borders^input_overlay^/var/config/retroarch/overlays/borders/pegasus/N64.cfg -change^borders^input_overlay_aspect_adjust_landscape^0.145000 -change^borders^input_overlay_enable^true -change^widescreen^aspect_ratio_index^24 -enable^nintendo_button_layout^/var/config/retroarch/config/remaps/Snes9x/snes.rmp +change^borders^input_overlay^/var/config/retroarch/overlays/borders/pegasus/N64.cfg^^/var/config/retroarch/config/Mupen64Plus-Next/n64.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^input_overlay_aspect_adjust_landscape^0.145000^^/var/config/retroarch/config/Mupen64Plus-Next/n64.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^input_overlay_enable^true^^/var/config/retroarch/config/Mupen64Plus-Next/n64.cfg^$emuconfigs/retroarch/retroarch.cfg +change^widescreen^aspect_ratio_index^24^^/var/config/retroarch/config/Mupen64Plus-Next/n64.cfg^$emuconfigs/retroarch/retroarch.cfg +enable^abxy_button_swap^/var/config/retroarch/config/remaps/Snes9x/snes.rmp diff --git a/emu-configs/defaults/retrodeck/presets/pcsx2_presets.cfg b/emu-configs/defaults/retrodeck/presets/pcsx2_presets.cfg index ba01d17c..134cd00d 100644 --- a/emu-configs/defaults/retrodeck/presets/pcsx2_presets.cfg +++ b/emu-configs/defaults/retrodeck/presets/pcsx2_presets.cfg @@ -1,10 +1,8 @@ config_file_format^pcsx2 -target_file^$pcsx2conf -defaults_file^$emuconfigs/PCSX2/PCSX2.ini -change^cheevos^Enabled^true^Achievements -change^cheevos^Username^$cheevos_username^Achievements -change^cheevos^Token^$cheevos_token^Achievements -change^cheevos^LoginTimestamp^$cheevos_login_timestamp^Achievements -change^cheevos_hardcore^ChallengeMode^true^Achievements -change^savestate_auto_save^SaveStateOnShutdown^true^EmuCore -change^ask_to_exit^ConfirmShutdown^true^UI +change^cheevos^Enabled^true^Achievements^$pcsx2conf^$emuconfigs/PCSX2/PCSX2.ini +change^cheevos^Username^$cheevos_username^Achievements^$pcsx2conf^$emuconfigs/PCSX2/PCSX2.ini +change^cheevos^Token^$cheevos_token^Achievements^$pcsx2conf^$emuconfigs/PCSX2/PCSX2.ini +change^cheevos^LoginTimestamp^$cheevos_login_timestamp^Achievements^$pcsx2conf^$emuconfigs/PCSX2/PCSX2.ini +change^cheevos_hardcore^ChallengeMode^true^Achievements^$pcsx2conf^$emuconfigs/PCSX2/PCSX2.ini +change^savestate_auto_save^SaveStateOnShutdown^true^EmuCore^$pcsx2conf^$emuconfigs/PCSX2/PCSX2.ini +change^ask_to_exit^ConfirmShutdown^true^UI^$pcsx2conf^$emuconfigs/PCSX2/PCSX2.ini diff --git a/emu-configs/defaults/retrodeck/presets/ppsspp_presets.cfg b/emu-configs/defaults/retrodeck/presets/ppsspp_presets.cfg index 90094d5e..061b6dee 100644 --- a/emu-configs/defaults/retrodeck/presets/ppsspp_presets.cfg +++ b/emu-configs/defaults/retrodeck/presets/ppsspp_presets.cfg @@ -1,4 +1,5 @@ config_file_format^ppsspp -target_file^$ppssppconf -defaults_file^$emuconfigs/PCSX2/PCSX2.ini -change^savestate_auto_load^AutoLoadSaveState^2^General +change^savestate_auto_load^AutoLoadSaveState^2^General^$ppssppconf^$emuconfigs/ppssppdl/ppsspp.ini +change^cheevos^AchievementsEnable^True^Achievements^$ppssppconf^$emuconfigs/ppssppdl/ppsspp.ini +change^cheevos^AchievementsUserName^Achievements^$cheevos_username^$ppssppconf^$emuconfigs/ppssppdl/ppsspp.ini +change^cheevos_hardcore^AchievementsChallengeMode^True^Achievements^$ppssppconf^$emuconfigs/ppssppdl/ppsspp.ini diff --git a/emu-configs/defaults/retrodeck/presets/primehack_presets.cfg b/emu-configs/defaults/retrodeck/presets/primehack_presets.cfg index 3abf4ba5..3eb75c36 100644 --- a/emu-configs/defaults/retrodeck/presets/primehack_presets.cfg +++ b/emu-configs/defaults/retrodeck/presets/primehack_presets.cfg @@ -1,4 +1,2 @@ config_file_format^primehack -target_file^$primehackconf -defaults_file^$emuconfigs/primehack/Dolphin.ini -change^ask_to_exit^ConfirmStop^True^Interface +change^ask_to_exit^ConfirmStop^True^Interface^$primehackconf^$emuconfigs/primehack/Dolphin.ini diff --git a/emu-configs/defaults/retrodeck/presets/psx_ra_presets.cfg b/emu-configs/defaults/retrodeck/presets/psx_ra_presets.cfg index f3aaa96d..f9cffa4f 100644 --- a/emu-configs/defaults/retrodeck/presets/psx_ra_presets.cfg +++ b/emu-configs/defaults/retrodeck/presets/psx_ra_presets.cfg @@ -1,8 +1,6 @@ config_file_format^retroarch -target_file^/var/config/retroarch/config/SwanStation/psx.cfg -defaults_file^$emuconfigs/retroarch/retroarch.cfg -change^borders^input_overlay^/var/config/retrodeck/overlays/borders/pegasus/psx.cfg -change^borders^input_overlay_aspect_adjust_landscape^0.120000 -change^borders^input_overlay_enable^true -change^borders^input_overlay_scale_landscape^1.040000 -change^widescreen^aspect_ratio_index^24 +change^borders^input_overlay^/var/config/retrodeck/overlays/borders/pegasus/psx.cfg^^/var/config/retroarch/config/SwanStation/psx.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^input_overlay_aspect_adjust_landscape^0.120000^^/var/config/retroarch/config/SwanStation/psx.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^input_overlay_enable^true^^/var/config/retroarch/config/SwanStation/psx.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^input_overlay_scale_landscape^1.040000^^/var/config/retroarch/config/SwanStation/psx.cfg^$emuconfigs/retroarch/retroarch.cfg +change^widescreen^aspect_ratio_index^24^^/var/config/retroarch/config/SwanStation/psx.cfg^$emuconfigs/retroarch/retroarch.cfg diff --git a/emu-configs/defaults/retrodeck/presets/retroarch_presets.cfg b/emu-configs/defaults/retrodeck/presets/retroarch_presets.cfg index 7a65546a..4d8c268e 100644 --- a/emu-configs/defaults/retrodeck/presets/retroarch_presets.cfg +++ b/emu-configs/defaults/retrodeck/presets/retroarch_presets.cfg @@ -1,9 +1,7 @@ config_file_format^retroarch-all -target_file^$raconf -defaults_file^$emuconfigs/retroarch/retroarch.cfg -change^cheevos^cheevos_enable^true -change^cheevos^cheevos_token^$cheevos_token -change^cheevos^cheevos_username^$cheevos_username -change^cheevos_hardcore^cheevos_hardcore_mode_enable^true -change^savestate_auto_load^savestate_auto_load^true -change^savestate_auto_save^savestate_auto_save^true +change^cheevos^cheevos_enable^true^^$raconf^$emuconfigs/retroarch/retroarch.cfg +change^cheevos^cheevos_token^$cheevos_token^^$raconf^$emuconfigs/retroarch/retroarch.cfg +change^cheevos^cheevos_username^$cheevos_username^^$raconf^$emuconfigs/retroarch/retroarch.cfg +change^cheevos_hardcore^cheevos_hardcore_mode_enable^true^^$raconf^$emuconfigs/retroarch/retroarch.cfg +change^savestate_auto_load^savestate_auto_load^true^^$raconf^$emuconfigs/retroarch/retroarch.cfg +change^savestate_auto_save^savestate_auto_save^true^^$raconf^$emuconfigs/retroarch/retroarch.cfg diff --git a/emu-configs/defaults/retrodeck/presets/snes_presets.cfg b/emu-configs/defaults/retrodeck/presets/snes_presets.cfg index 2d71ed98..06ce7b18 100644 --- a/emu-configs/defaults/retrodeck/presets/snes_presets.cfg +++ b/emu-configs/defaults/retrodeck/presets/snes_presets.cfg @@ -1,9 +1,7 @@ config_file_format^retroarch -target_file^/var/config/retroarch/config/Snes9x/snes.cfg -defaults_file^$emuconfigs/retroarch/retroarch.cfg -change^borders^input_overlay^/var/config/retroarch/overlays/borders/pegasus/snes87.cfg -change^borders^input_overlay_aspect_adjust_landscape^0.305000 -change^borders^input_overlay_scale_landscape^1.050000 -change^borders^input_overlay_enable^true -change^widescreen^aspect_ratio_index^24 -enable^nintendo_button_layout^/var/config/retroarch/config/remaps/Snes9x/snes.rmp +change^borders^input_overlay^/var/config/retroarch/overlays/borders/pegasus/snes87.cfg^^/var/config/retroarch/config/Snes9x/snes.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^input_overlay_aspect_adjust_landscape^0.305000^^/var/config/retroarch/config/Snes9x/snes.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^input_overlay_scale_landscape^1.050000^^/var/config/retroarch/config/Snes9x/snes.cfg^$emuconfigs/retroarch/retroarch.cfg +change^borders^input_overlay_enable^true^^/var/config/retroarch/config/Snes9x/snes.cfg^$emuconfigs/retroarch/retroarch.cfg +change^widescreen^aspect_ratio_index^24^^/var/config/retroarch/config/Snes9x/snes.cfg^$emuconfigs/retroarch/retroarch.cfg +enable^abxy_button_swap^/var/config/retroarch/config/remaps/Snes9x/snes.rmp diff --git a/emu-configs/defaults/retrodeck/presets/yuzu_presets.cfg b/emu-configs/defaults/retrodeck/presets/yuzu_presets.cfg index bfb46f5e..e03474f1 100644 --- a/emu-configs/defaults/retrodeck/presets/yuzu_presets.cfg +++ b/emu-configs/defaults/retrodeck/presets/yuzu_presets.cfg @@ -1,9 +1,7 @@ config_file_format^yuzu -target_file^$yuzuconf -defaults_file^$emuconfigs/yuzu/qt-config.ini -change^ask_to_exit^confirmClose^true^UI -change^ask_to_exit^confirmClose\default^true^UI -change^nintendo_button_layout^player_0_button_a^"engine:sdl,guid:03000000de280000ff11000001000000,port:0,button:0,pad:0"^Controls -change^nintendo_button_layout^player_0_button_b^"engine:sdl,guid:03000000de280000ff11000001000000,port:0,button:1,pad:0"^Controls -change^nintendo_button_layout^player_0_button_x^"engine:sdl,guid:03000000de280000ff11000001000000,port:0,button:2,pad:0"^Controls -change^nintendo_button_layout^player_0_button_y^"engine:sdl,guid:03000000de280000ff11000001000000,port:0,button:3,pad:0"^Controls +change^ask_to_exit^confirmClose^true^UI^$yuzuconf^$emuconfigs/yuzu/qt-config.ini +change^ask_to_exit^confirmClose\default^true^UI^$yuzuconf^$emuconfigs/yuzu/qt-config.ini +change^abxy_button_swap^player_0_button_a^"engine:sdl,guid:03000000de280000ff11000001000000,port:0,button:0,pad:0"^Controls^$yuzuconf^$emuconfigs/yuzu/qt-config.ini +change^abxy_button_swap^player_0_button_b^"engine:sdl,guid:03000000de280000ff11000001000000,port:0,button:1,pad:0"^Controls^$yuzuconf^$emuconfigs/yuzu/qt-config.ini +change^abxy_button_swap^player_0_button_x^"engine:sdl,guid:03000000de280000ff11000001000000,port:0,button:2,pad:0"^Controls^$yuzuconf^$emuconfigs/yuzu/qt-config.ini +change^abxy_button_swap^player_0_button_y^"engine:sdl,guid:03000000de280000ff11000001000000,port:0,button:3,pad:0"^Controls^$yuzuconf^$emuconfigs/yuzu/qt-config.ini diff --git a/emu-configs/defaults/retrodeck/retrodeck.cfg b/emu-configs/defaults/retrodeck/retrodeck.cfg index cf88db79..da64517f 100644 --- a/emu-configs/defaults/retrodeck/retrodeck.cfg +++ b/emu-configs/defaults/retrodeck/retrodeck.cfg @@ -54,7 +54,7 @@ n64=false psx_ra=false snes=false -[nintendo_button_layout] +[abxy_button_swap] citra=false gb=false gba=false diff --git a/functions/post_update.sh b/functions/post_update.sh index bf68a2c2..99b23dac 100644 --- a/functions/post_update.sh +++ b/functions/post_update.sh @@ -234,6 +234,15 @@ post_update() { emulationstation --home /var/config/emulationstation --create-system-dirs fi + if [[ $prev_version -le "080" ]]; then + # In version 0.8.0b, the following changes were made that required config file updates/reset or other changes to the filesystem: + # - Remove RetroDECK controller profile from existing template location TODO + # - Determine if Steam is installed via normal desktop application / Flatpak / SteamOS TODO + # - Install RetroDECK controller profile in desired location TODO + # - Change section name in retrodeck.cfg for ABXY button swap preset + sed -i 's^nintendo_button_layout^abxy_button_swap^' "$rd_conf" # This is a one-off sed statement as there are no functions for replacing section names + fi + # The following commands are run every time. if [[ -d "/var/data/dolphin-emu/Load/DynamicInputTextures" ]]; then # Refresh installed textures if they have been enabled diff --git a/functions/prepare_emulator.sh b/functions/prepare_emulator.sh index d7352d69..733a5116 100644 --- a/functions/prepare_emulator.sh +++ b/functions/prepare_emulator.sh @@ -132,11 +132,11 @@ prepare_emulator() { set_setting_value "$rd_conf" "n64" "$(get_setting_value "$rd_defaults" "n64" "retrodeck" "widescreen")" "retrodeck" "widescreen" set_setting_value "$rd_conf" "psx_ra" "$(get_setting_value "$rd_defaults" "psx_ra" "retrodeck" "widescreen")" "retrodeck" "widescreen" set_setting_value "$rd_conf" "snes" "$(get_setting_value "$rd_defaults" "snes" "retrodeck" "widescreen")" "retrodeck" "widescreen" - set_setting_value "$rd_conf" "gb" "$(get_setting_value "$rd_defaults" "gb" "retrodeck" "nintendo_button_layout")" "retrodeck" "nintendo_button_layout" - set_setting_value "$rd_conf" "gba" "$(get_setting_value "$rd_defaults" "gba" "retrodeck" "nintendo_button_layout")" "retrodeck" "nintendo_button_layout" - set_setting_value "$rd_conf" "gbc" "$(get_setting_value "$rd_defaults" "gbc" "retrodeck" "nintendo_button_layout")" "retrodeck" "nintendo_button_layout" - set_setting_value "$rd_conf" "n64" "$(get_setting_value "$rd_defaults" "gb" "retrodeck" "nintendo_button_layout")" "retrodeck" "nintendo_button_layout" - set_setting_value "$rd_conf" "snes" "$(get_setting_value "$rd_defaults" "gba" "retrodeck" "nintendo_button_layout")" "retrodeck" "nintendo_button_layout" + set_setting_value "$rd_conf" "gb" "$(get_setting_value "$rd_defaults" "gb" "retrodeck" "abxy_button_swap")" "retrodeck" "abxy_button_swap" + set_setting_value "$rd_conf" "gba" "$(get_setting_value "$rd_defaults" "gba" "retrodeck" "abxy_button_swap")" "retrodeck" "abxy_button_swap" + set_setting_value "$rd_conf" "gbc" "$(get_setting_value "$rd_defaults" "gbc" "retrodeck" "abxy_button_swap")" "retrodeck" "abxy_button_swap" + set_setting_value "$rd_conf" "n64" "$(get_setting_value "$rd_defaults" "gb" "retrodeck" "abxy_button_swap")" "retrodeck" "abxy_button_swap" + set_setting_value "$rd_conf" "snes" "$(get_setting_value "$rd_defaults" "gba" "retrodeck" "abxy_button_swap")" "retrodeck" "abxy_button_swap" set_setting_value "$rd_conf" "retroarch" "$(get_setting_value "$rd_defaults" "retroarch" "retrodeck" "savestate_auto_load")" "retrodeck" "savestate_auto_load" set_setting_value "$rd_conf" "retroarch" "$(get_setting_value "$rd_defaults" "retroarch" "retrodeck" "savestate_auto_save")" "retrodeck" "savestate_auto_save" fi @@ -215,7 +215,7 @@ prepare_emulator() { dir_prep "$texture_packs_folder/Citra" "/var/data/citra-emu/load/textures" # Reset default preset settings - set_setting_value "$rd_conf" "citra" "$(get_setting_value "$rd_defaults" "citra" "retrodeck" "nintendo_button_layout")" "retrodeck" "nintendo_button_layout" + set_setting_value "$rd_conf" "citra" "$(get_setting_value "$rd_defaults" "citra" "retrodeck" "abxy_button_swap")" "retrodeck" "abxy_button_swap" set_setting_value "$rd_conf" "citra" "$(get_setting_value "$rd_defaults" "citra" "retrodeck" "ask_to_exit")" "retrodeck" "ask_to_exit" fi if [[ "$action" == "postmove" ]]; then # Run only post-move commands @@ -650,7 +650,7 @@ prepare_emulator() { fi # Reset default preset settings - set_setting_value "$rd_conf" "yuzu" "$(get_setting_value "$rd_defaults" "yuzu" "retrodeck" "nintendo_button_layout")" "retrodeck" "nintendo_button_layout" + set_setting_value "$rd_conf" "yuzu" "$(get_setting_value "$rd_defaults" "yuzu" "retrodeck" "abxy_button_swap")" "retrodeck" "abxy_button_swap" set_setting_value "$rd_conf" "yuzu" "$(get_setting_value "$rd_defaults" "yuzu" "retrodeck" "ask_to_exit")" "retrodeck" "ask_to_exit" fi if [[ "$action" == "postmove" ]]; then # Run only post-move commands diff --git a/functions/presets.sh b/functions/presets.sh index 664b7893..a086928c 100644 --- a/functions/presets.sh +++ b/functions/presets.sh @@ -96,7 +96,7 @@ build_preset_config() { local read_system_name=$(get_setting_name "$system_line") if [[ "$read_system_name" == "$system_being_changed" ]]; then local read_system_enabled=$(get_setting_value "$rd_conf" "$read_system_name" "retrodeck" "$current_preset") - while IFS='^' read -r action read_preset read_setting_name new_setting_value section + while IFS='^' read -r action read_preset read_setting_name new_setting_value section target_file defaults_file do case "$action" in @@ -109,22 +109,16 @@ build_preset_config() { fi ;; - "target_file" ) - if [[ "$read_preset" = \$* ]]; then - eval read_preset=$read_preset - fi - local read_target_file="$read_preset" - ;; - - "defaults_file" ) - if [[ "$read_preset" = \$* ]]; then - eval read_preset=$read_preset - fi - local read_defaults_file="$read_preset" - ;; - "change" ) if [[ "$read_preset" == "$current_preset" ]]; then + if [[ "$target_file" = \$* ]]; then # Read current target file and resolve if it is a variable + declare -g "target_file=$target_file" + fi + local read_target_file="$target_file" + if [[ "$defaults_file" = \$* ]]; then #Read current defaults file and resolve if it is a variable + declare -g "defaults_file=$defaults_file" + fi + local read_defaults_file="$defaults_file" if [[ "$read_system_enabled" == "true" ]]; then if [[ "$new_setting_value" = \$* ]]; then eval new_setting_value=$new_setting_value diff --git a/tools/configurator.sh b/tools/configurator.sh index cebebeab..e781711d 100644 --- a/tools/configurator.sh +++ b/tools/configurator.sh @@ -242,7 +242,7 @@ configurator_global_presets_and_settings_dialog() { ;; "Swap A/B and X/Y Buttons" ) - change_preset_dialog "nintendo_button_layout" + change_preset_dialog "abxy_button_swap" configurator_global_presets_and_settings_dialog ;;