ABXY Toggle: Added support to toggle between ABXY/BAXY (#1053)

* Supported emulators:
    * Cemu
    * Dolphin
    * melonDS
    * RetroArch
    * RMG
    * Ryujinx
* Switched melonDS (Standalone) to map to the Steam Deck layout by default
* Added Nintendo layout GameCube profile
This commit is contained in:
rawdatafeel 2024-03-06 07:01:16 -05:00 committed by GitHub
parent 705de2ab26
commit ff914e6707
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 224 additions and 45 deletions

View file

@ -10,8 +10,8 @@ Key_R=-1
Key_L=-1
Key_X=-1
Key_Y=-1
Joy_A=1
Joy_B=0
Joy_A=0
Joy_B=1
Joy_Select=6
Joy_Start=7
Joy_Right=258
@ -20,8 +20,8 @@ Joy_Up=257
Joy_Down=260
Joy_R=5
Joy_L=4
Joy_X=3
Joy_Y=2
Joy_X=2
Joy_Y=3
HKKey_Lid=16777222
HKKey_Mic=45
HKKey_Pause=16777238

View file

@ -0,0 +1,31 @@
[Profile]
Device = SDL/0/Steam Virtual Gamepad
Buttons/A = `Button E`
Buttons/B = `Button S`
Buttons/X = `Button N`
Buttons/Y = `Button W`
Buttons/Z = `Shoulder R`|Back
Buttons/Start = Start
Main Stick/Up = `Axis 1-`
Main Stick/Down = `Axis 1+`
Main Stick/Left = `Axis 0-`
Main Stick/Right = `Axis 0+`
Main Stick/Modifier = `Thumb L`
Main Stick/Modifier/Range = 50.
Main Stick/Calibration = 100.00 141.42 100.00 141.42 100.00 141.42 100.00 141.42
C-Stick/Up = `Axis 4-`
C-Stick/Down = `Axis 4+`
C-Stick/Left = `Axis 3-`
C-Stick/Right = `Axis 3+`
C-Stick/Modifier = `Thumb R`
C-Stick/Modifier/Range = 50.
C-Stick/Calibration = 100.00 141.42 100.00 141.42 100.00 141.42 100.00 141.42
Triggers/L = `Trigger L`
Triggers/R = `Trigger R`
Triggers/L-Analog = `Trigger L`
Triggers/R-Analog = `Trigger R`
D-Pad/Up = `Pad N`
D-Pad/Down = `Pad S`
D-Pad/Left = `Pad W`
D-Pad/Right = `Pad E`
Rumble/Motor = Strong

View file

@ -0,0 +1,4 @@
input_player1_btn_a = "0"
input_player1_btn_b = "8"
input_player1_btn_x = "1"
input_player1_btn_y = "9"

View file

@ -0,0 +1,4 @@
input_player1_btn_a = "0"
input_player1_btn_b = "8"
input_player1_btn_x = "1"
input_player1_btn_y = "9"

View file

@ -1,17 +0,0 @@
input_libretro_device_p1 = "1"
input_libretro_device_p2 = "1"
input_libretro_device_p3 = "1"
input_libretro_device_p4 = "1"
input_libretro_device_p5 = "1"
input_player1_analog_dpad_mode = "0"
input_player1_btn_l = "-1"
input_player1_btn_r = "-1"
input_player2_analog_dpad_mode = "0"
input_player3_analog_dpad_mode = "0"
input_player4_analog_dpad_mode = "0"
input_player5_analog_dpad_mode = "0"
input_remap_port_p1 = "0"
input_remap_port_p2 = "1"
input_remap_port_p3 = "2"
input_remap_port_p4 = "3"
input_remap_port_p5 = "4"

View file

@ -0,0 +1,4 @@
input_player1_btn_a = "0"
input_player1_btn_b = "8"
input_player1_btn_x = "1"
input_player1_btn_y = "9"

View file

@ -0,0 +1,4 @@
input_player1_btn_a = "0"
input_player1_btn_b = "8"
input_player1_btn_x = "1"
input_player1_btn_y = "9"

View file

@ -0,0 +1,4 @@
input_player1_btn_a = "0"
input_player1_btn_b = "8"
input_player1_btn_x = "1"
input_player1_btn_y = "9"

View file

@ -0,0 +1,4 @@
input_player1_btn_a = "0"
input_player1_btn_b = "8"
input_player1_btn_x = "1"
input_player1_btn_y = "9"

View file

@ -0,0 +1,4 @@
input_player1_btn_a = "0"
input_player1_btn_b = "8"
input_player1_btn_x = "1"
input_player1_btn_y = "9"

View file

@ -0,0 +1,4 @@
input_player1_btn_a = "0"
input_player1_btn_b = "8"
input_player1_btn_x = "1"
input_player1_btn_y = "9"

View file

@ -0,0 +1,4 @@
input_player1_btn_a = "0"
input_player1_btn_b = "8"
input_player1_btn_x = "1"
input_player1_btn_y = "9"

View file

@ -0,0 +1,4 @@
input_player1_btn_a = "0"
input_player1_btn_b = "8"
input_player1_btn_x = "1"
input_player1_btn_y = "9"

View file

@ -12,6 +12,7 @@ Cemu_functions () {
[configDir]="${HOME}/.config/Cemu"
[configFile]="${HOME}/.config/Cemu/settings.xml"
[shareDir]="${HOME}/.local/share/Cemu"
[controllerDir]="${HOME}/.config/Cemu/controllerProfiles"
)
# Cleanup older things
@ -26,13 +27,32 @@ Cemu_functions () {
# Set ABXY Style
setABXYstyle () {
echo "NYI"
sed -i '/<mapping>1<\/mapping>/{:a;N;/<\/button>/!ba;s/<button>1<\/button>/<button>0<\/button>/}' "${CemuNative[controllerDir]}/Deck-Gamepad-Gyro.xml"
sed -i '/<mapping>1<\/mapping>/{:a;N;/<\/button>/!ba;s/<button>1<\/button>/<button>0<\/button>/}' "${CemuNative[controllerDir]}/controller0.xml"
sed -i '/<mapping>2<\/mapping>/{:a;N;/<\/button>/!ba;s/<button>0<\/button>/<button>1<\/button>/}' "${CemuNative[controllerDir]}/Deck-Gamepad-Gyro.xml"
sed -i '/<mapping>2<\/mapping>/{:a;N;/<\/button>/!ba;s/<button>0<\/button>/<button>1<\/button>/}' "${CemuNative[controllerDir]}/controller0.xml"
sed -i '/<mapping>3<\/mapping>/{:a;N;/<\/button>/!ba;s/<button>3<\/button>/<button>2<\/button>/}' "${CemuNative[controllerDir]}/Deck-Gamepad-Gyro.xml"
sed -i '/<mapping>3<\/mapping>/{:a;N;/<\/button>/!ba;s/<button>3<\/button>/<button>2<\/button>/}' "${CemuNative[controllerDir]}/controller0.xml"
sed -i '/<mapping>4<\/mapping>/{:a;N;/<\/button>/!ba;s/<button>2<\/button>/<button>3<\/button>/}' "${CemuNative[controllerDir]}/Deck-Gamepad-Gyro.xml"
sed -i '/<mapping>4<\/mapping>/{:a;N;/<\/button>/!ba;s/<button>2<\/button>/<button>3<\/button>/}' "${CemuNative[controllerDir]}/controller0.xml"
}
setBAYXstyle () {
echo "NYI"
setBAXYstyle () {
sed -i '/<mapping>1<\/mapping>/{:a;N;/<\/button>/!ba;s/<button>0<\/button>/<button>1<\/button>/}' "${CemuNative[controllerDir]}/Deck-Gamepad-Gyro.xml"
sed -i '/<mapping>1<\/mapping>/{:a;N;/<\/button>/!ba;s/<button>0<\/button>/<button>1<\/button>/}' "${CemuNative[controllerDir]}/controller0.xml"
sed -i '/<mapping>2<\/mapping>/{:a;N;/<\/button>/!ba;s/<button>1<\/button>/<button>0<\/button>/}' "${CemuNative[controllerDir]}/Deck-Gamepad-Gyro.xml"
sed -i '/<mapping>2<\/mapping>/{:a;N;/<\/button>/!ba;s/<button>1<\/button>/<button>0<\/button>/}' "${CemuNative[controllerDir]}/controller0.xml"
sed -i '/<mapping>3<\/mapping>/{:a;N;/<\/button>/!ba;s/<button>2<\/button>/<button>3<\/button>/}' "${CemuNative[controllerDir]}/Deck-Gamepad-Gyro.xml"
sed -i '/<mapping>3<\/mapping>/{:a;N;/<\/button>/!ba;s/<button>2<\/button>/<button>3<\/button>/}' "${CemuNative[controllerDir]}/controller0.xml"
sed -i '/<mapping>4<\/mapping>/{:a;N;/<\/button>/!ba;s/<button>3<\/button>/<button>2<\/button>/}' "${CemuNative[controllerDir]}/Deck-Gamepad-Gyro.xml"
sed -i '/<mapping>4<\/mapping>/{:a;N;/<\/button>/!ba;s/<button>3<\/button>/<button>2<\/button>/}' "${CemuNative[controllerDir]}/controller0.xml"
}
# Migrate
migrate () {
echo "Begin Cemu migration"
@ -257,9 +277,12 @@ Cemu_functions () {
#rsync -r "${EMUDECKGIT}/configs/steam-input/cemu_controller_config.vdf" "${HOME}/.steam/steam/controller_base/templates/"
}
$function "$showProgress" # Call the above functions
}
# Cleanup older things
Cemu_cleanup () {
Cemu_functions "cleanup"
@ -358,4 +381,14 @@ Cemu_addSteamInputProfile () {
Cemu_setResolution(){
echo "NYI"
}
}
Cemu_setABXYstyle(){
Cemu_functions "setABXYstyle"
}
Cemu_setBAXYstyle(){
Cemu_functions "setBAXYstyle"
}

View file

@ -5,6 +5,7 @@ Dolphin_emuType="$emuDeckEmuTypeFlatpak"
Dolphin_emuPath="org.DolphinEmu.dolphin-emu"
Dolphin_configFile="$HOME/.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/Dolphin.ini"
Dolphin_configFileGFX="$HOME/.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/GFX.ini"
Dolphin_gamecubeFile="$HOME/.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/GCPadNew.ini"
Dolphin_releaseURL=""
#cleanupOlderThings
@ -33,34 +34,35 @@ Dolphin_cleanup(){
#Install
Dolphin_install(){
setMSG "${Dolphin_emuName}: Install"
echo ""
setMSG "${Dolphin_emuName}: Install"
echo ""
installEmuFP "${Dolphin_emuName}" "${Dolphin_emuPath}"
}
#ApplyInitialSettings
Dolphin_init(){
setMSG "${Dolphin_emuName}: Apply initial config"
echo ""
setMSG "${Dolphin_emuName}: Apply initial config"
echo ""
configEmuFP "${Dolphin_emuName}" "${Dolphin_emuPath}" "true"
Dolphin_setupStorage
Dolphin_setEmulationFolder
Dolphin_setupSaves
Dolphin_cleanup
Dolphin_setCustomizations
Dolphin_cleanup
Dolphin_setCustomizations
SRM_createParsers
#Dolphin_DynamicInputTextures
}
#update
Dolphin_update(){
setMSG "${Dolphin_emuName}: Apply configuration Update"
echo ""
setMSG "${Dolphin_emuName}: Apply configuration Update"
echo ""
configEmuFP "${Dolphin_emuName}" "${Dolphin_emuPath}"
Dolphin_setupStorage
Dolphin_setEmulationFolder
Dolphin_setupSaves
Dolphin_cleanup
Dolphin_cleanup
}
#ConfigurePaths
@ -140,11 +142,18 @@ Dolphin_uninstall(){
#setABXYstyle
Dolphin_setABXYstyle(){
echo "NYI"
sed -i '/^\[GCPad1\]/,/^\[/ s|Buttons/A = `Button S`|Buttons/A = `Button E`|' $Dolphin_gamecubeFile
sed -i '/^\[GCPad1\]/,/^\[/ s|Buttons/B = `Button N`|Buttons/B = `Button S`|' $Dolphin_gamecubeFile
sed -i '/^\[GCPad1\]/,/^\[/ s|Buttons/X = `Button E`|Buttons/X = `Button N`|' $Dolphin_gamecubeFile
sed -i '/^\[GCPad1\]/,/^\[/ s|Buttons/Y = `Button W`|Buttons/Y = `Button W`|' $Dolphin_gamecubeFile
}
Dolphin_setBAYXstyle(){
echo "NYI"
sed -i '/^\[GCPad1\]/,/^\[/ s|Buttons/A = `Button E`|Buttons/A = `Button S`|' $Dolphin_gamecubeFile
sed -i '/^\[GCPad1\]/,/^\[/ s|Buttons/B = `Button S`|Buttons/B = `Button N`|' $Dolphin_gamecubeFile
sed -i '/^\[GCPad1\]/,/^\[/ s|Buttons/X = `Button N`|Buttons/X = `Button E`|' $Dolphin_gamecubeFile
sed -i '/^\[GCPad1\]/,/^\[/ s|Buttons/Y = `Button W`|Buttons/Y = `Button W`|' $Dolphin_gamecubeFile
}
#Migrate

View file

@ -173,4 +173,36 @@ melonDS_setResolution(){
RetroArch_setConfigOverride "WindowWidth" $WindowWidth "$melonDS_configFile"
RetroArch_setConfigOverride "WindowHeight" $WindowHeight "$melonDS_configFile"
}
#setABXYstyle
melonDS_setABXYstyle(){
buttonA='Joy_A='
buttonB='Joy_B='
buttonX='Joy_X='
buttonY='Joy_Y='
changeLine "$buttonA" "$buttonA""0" "${melonDS_configFile}"
changeLine "$buttonB" "$buttonB""1" "${melonDS_configFile}"
changeLine "$buttonX" "$buttonX""2" "${melonDS_configFile}"
changeLine "$buttonY" "$buttonY""3" "${melonDS_configFile}"
}
melonDS_setBAYXstyle(){
buttonA='Joy_A='
buttonB='Joy_B='
buttonX='Joy_X='
buttonY='Joy_Y='
changeLine "$buttonA" "$buttonA""1" "${melonDS_configFile}"
changeLine "$buttonB" "$buttonB""0" "${melonDS_configFile}"
changeLine "$buttonX" "$buttonX""3" "${melonDS_configFile}"
changeLine "$buttonY" "$buttonY""2" "${melonDS_configFile}"
}

View file

@ -141,11 +141,6 @@ RMG_uninstall(){
flatpak uninstall "$RMG_emuPath" --user -y
}
#setABXYstyle
RMG_setABXYstyle(){
echo "NYI"
}
#Migrate
RMG_migrate(){
echo "NYI"
@ -192,4 +187,27 @@ RMG_finalize(){
RMG_setResolution(){
echo "NYI"
}
RMG_setABXYstyle(){
local header="[Rosalie's Mupen GUI - Input Plugin User Profile \"steamdeck\"]"
sed -i '/\[Rosalie'"'"'s Mupen GUI - Input Plugin User Profile "steamdeck"\]/,/^\[/ {
s/A_Name *= *"a"/A_Name = "b"/;
s/A_Data *= *"0"/A_Data = "1"/;
s/B_Name *= *"b"/B_Name = "a"/;
s/B_Data *= *"1"/B_Data = "0"/;
}' "$RMG_configFile"
}
RMG_setBAYXstyle(){
local header="[Rosalie's Mupen GUI - Input Plugin User Profile \"steamdeck\"]"
sed -i '/\[Rosalie'"'"'s Mupen GUI - Input Plugin User Profile "steamdeck"\]/,/^\[/ {
s/A_Name *= *"b"/A_Name = "a"/;
s/A_Data *= *"1"/A_Data = "0"/;
s/B_Name *= *"a"/B_Name = "b"/;
s/B_Data *= *"0"/B_Data = "1"/;
}' "$RMG_configFile"
}

View file

@ -19,6 +19,7 @@ RetroArch_ppssppURL="https://buildbot.libretro.com/assets/system/PPSSPP.zip"
RetroArch_autoconfigURL="https://buildbot.libretro.com/assets/frontend/autoconfig.zip"
RetroArch_overlaysURL="https://buildbot.libretro.com/assets/frontend/overlays.zip"
RetroArch_cheatsURL="https://buildbot.libretro.com/assets/frontend/cheats.zip"
RetroArch_remapsDir="$HOME/.var/app/org.libretro.RetroArch/config/retroarch/config/remaps"
#cleanupOlderThings
RetroArch_cleanup(){
@ -351,10 +352,28 @@ RetroArch_uninstall(){
#setABXYstyle
RetroArch_setABXYstyle(){
echo "NYI"
mv "$RetroArch_remapsDir/mGBA/mGBA.rmp.disabled" "$RetroArch_remapsDir/mGBA/mGBA.rmp"
mv "$RetroArch_remapsDir/Gambatte/Gambatte.rmp.disabled" "$RetroArch_remapsDir/Gambatte/Gambatte.rmp"
mv "$RetroArch_remapsDir/bsnes-hd beta/bsnes-hd beta.rmp.disabled" "$RetroArch_remapsDir/bsnes-hd beta/bsnes-hd beta.rmp"
mv "$RetroArch_remapsDir/melonDS DS/melonDS DS.rmp.disabled" "$RetroArch_remapsDir/melonDS DS/melonDS DS.rmp"
mv "$RetroArch_remapsDir/Mupen64Plus-Next/Mupen64Plus-Next.rmp.disabled" "$RetroArch_remapsDir/Mupen64Plus-Next/Mupen64Plus-Next.rmp"
mv "$RetroArch_remapsDir/SameBoy/SameBoy.rmp.disabled" "$RetroArch_remapsDir/SameBoy/SameBoy.rmp"
mv "$RetroArch_remapsDir/Snes9x/Snes9x.rmp.disabled" "$RetroArch_remapsDir/Snes9x/Snes9x.rmp"
mv "$RetroArch_remapsDir/Mesen/Mesen.rmp.disabled" "$RetroArch_remapsDir/Mesen/Mesen.rmp"
mv "$RetroArch_remapsDir/Nestopia/Nestopia.rmp.disabled" "$RetroArch_remapsDir/Nestopia/Nestopia.rmp"
mv "$RetroArch_remapsDir/Beetle VB/Beetle VB.rmp.disabled" "$RetroArch_remapsDir/Beetle VB/Beetle VB.rmp"
}
RetroArch_setBAYXstyle(){
echo "NYI"
mv "$RetroArch_remapsDir/mGBA/mGBA.rmp" "$RetroArch_remapsDir/mGBA/mGBA.rmp.disabled"
mv "$RetroArch_remapsDir/Gambatte/Gambatte.rmp" "$RetroArch_remapsDir/Gambatte/Gambatte.rmp.disabled"
mv "$RetroArch_remapsDir/bsnes-hd beta/bsnes-hd beta.rmp" "$RetroArch_remapsDir/bsnes-hd beta/bsnes-hd beta.rmp.disabled"
mv "$RetroArch_remapsDir/melonDS DS/melonDS DS.rmp" "$RetroArch_remapsDir/melonDS DS/melonDS DS.rmp.disabled"
mv "$RetroArch_remapsDir/Mupen64Plus-Next/Mupen64Plus-Next.rmp" "$RetroArch_remapsDir/Mupen64Plus-Next/Mupen64Plus-Next.rmp.disabled"
mv "$RetroArch_remapsDir/SameBoy/SameBoy.rmp" "$RetroArch_remapsDir/SameBoy/SameBoy.rmp.disabled"
mv "$RetroArch_remapsDir/Snes9x/Snes9x.rmp" "$RetroArch_remapsDir/Snes9x/Snes9x.rmp.disabled"
mv "$RetroArch_remapsDir/Mesen/Mesen.rmp" "$RetroArch_remapsDir/Mesen/Mesen.rmp.disabled"
mv "$RetroArch_remapsDir/Beetle VB/Beetle VB.rmp" mv "$RetroArch_remapsDir/Beetle VB/Beetle VB.rmp.disabled"
}
#Migrate

View file

@ -6,6 +6,8 @@ Ryujinx_emuType="$emuDeckEmuTypeBinary"
Ryujinx_emuPath="$HOME/Applications/publish"
Ryujinx_configFile="$HOME/.config/Ryujinx/Config.json"
# https://github.com/Ryujinx/Ryujinx/blob/master/Ryujinx.Ui.Common/Configuration/System/Language.cs#L3-L23
Ryujinx_controllerFile="$HOME/.config/Ryujinx/profiles/controller/Deck.json"
declare -A Ryujinx_languages
Ryujinx_languages=(
["ja"]="Japanese"
@ -206,12 +208,20 @@ Ryujinx_convertFromYuzu(){
#setABXYstyle
Ryujinx_setABXYstyle(){
echo "NYI"
sed -i 's/"button_x": "Y",/"button_x": "X",/' $Ryujinx_controllerFile
sed -i 's/"button_b": "A",/"button_b": "B",/' $Ryujinx_controllerFile
sed -i 's/"button_y": "X",/"button_y": "Y",/' $Ryujinx_controllerFile
sed -i 's/"button_a": "B"/"button_a": "A"/' $Ryujinx_controllerFile
}
Ryujinx_setBAYXstyle(){
echo "NYI"
sed -i 's/"button_x": "X",/"button_x": "Y",/' $Ryujinx_controllerFile
sed -i 's/"button_b": "B",/"button_b": "A",/' $Ryujinx_controllerFile
sed -i 's/"button_y": "Y",/"button_y": "X",/' $Ryujinx_controllerFile
sed -i 's/"button_a": "A"/"button_a": "B"/' $Ryujinx_controllerFile
}
#WideScreenOn
Ryujinx_wideScreenOn(){
echo "NYI"

View file

@ -1057,6 +1057,8 @@ function controllerLayout_ABXY(){
Cemu_setABXYstyle
Ryujinx_setABXYstyle
RetroArch_setABXYstyle
melonDS_setABXYstyle
RMG_setABXYstyle
}
function controllerLayout_BAYX(){
@ -1064,4 +1066,6 @@ function controllerLayout_BAYX(){
Cemu_setBAYXstyle
Ryujinx_setBAYXstyle
RetroArch_setBAYXstyle
melonDS_setBAYXstyle
RMG_setBAYXstyle
}