2022-08-06 03:44:31 -04:00
#!/bin/bash
#variables
Dolphin_emuName = "Dolphin"
Dolphin_emuType = "FlatPak"
Dolphin_emuPath = "org.DolphinEmu.dolphin-emu"
2023-11-11 12:24:23 -05:00
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 "
2022-08-06 03:44:31 -04:00
Dolphin_releaseURL = ""
#cleanupOlderThings
Dolphin_cleanup( ) {
2022-09-29 02:13:14 -04:00
#backup old Dolphin input profiles, if the user wants to keep them
#wii
2022-09-29 02:48:50 -04:00
mv " $HOME /.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/Profiles/Wiimote/SD-GyroAccelTouch.ini " " $HOME /.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/Profiles/Wiimote/SD-GyroAccelTouch.ini.old "
mv " $HOME /.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/Profiles/Wiimote/SD-PkmBtlRev.ini " " $HOME /.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/Profiles/Wiimote/SD-PkmBtlRev.ini.old "
mv " $HOME /.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/Profiles/Wiimote/SD-Touch+Joy.ini " " $HOME /.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/Profiles/Wiimote/SD-Touch+Joy.ini.old "
mv " $HOME /.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/Profiles/Wiimote/SD-xbox.ini " " $HOME /.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/Profiles/Wiimote/SD-xbox.ini.old "
mv " $HOME /.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/Profiles/Wiimote/stdxbox.ini " " $HOME /.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/Profiles/Wiimote/stdxbox.ini.old "
mv " $HOME /.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/Profiles/Wiimote/steamxb2.ini " " $HOME /.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/Profiles/Wiimote/steamxb2.ini.old "
mv " $HOME /.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/Profiles/Wiimote/steamxb3.ini " " $HOME /.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/Profiles/Wiimote/steamxb3.ini.old "
mv " $HOME /.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/Profiles/Wiimote/steamxb4.ini " " $HOME /.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/Profiles/Wiimote/steamxb4.ini.old "
mv " $HOME /.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/Profiles/Wiimote/stock with mouse.ini " " $HOME /.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/Profiles/Wiimote/stock with mouse.ini.old "
mv " $HOME /.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/Profiles/Wiimote/stock.ini " " $HOME /.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/Profiles/Wiimote/stock.ini.old "
mv " $HOME /.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/Profiles/Wiimote/wiigalaxy.ini " " $HOME /.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/Profiles/Wiimote/wiigalaxy.ini.old "
2022-09-29 02:13:14 -04:00
#GC
2022-09-29 02:48:50 -04:00
mv " $HOME /.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/Profiles/GCPad/base.ini " " $HOME /.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/Profiles/GCPad/base.ini.old "
mv " $HOME /.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/Profiles/GCPad/steam1.ini " " $HOME /.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/Profiles/GCPad/steam1.ini.old "
2023-11-11 12:24:23 -05:00
mv " $HOME /.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/Profiles/GCPad/steam2.ini " " $HOME /.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/Profiles/GCPad/steam2.ini.old "
2022-09-29 02:48:50 -04:00
mv " $HOME /.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/Profiles/GCPad/steam3.ini " " $HOME /.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/Profiles/GCPad/steam3.ini.old "
mv " $HOME /.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/Profiles/GCPad/steam4.ini " " $HOME /.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/Profiles/GCPad/steam4.ini.old "
2022-10-19 16:03:05 -04:00
echo "Old EmuDeck profiles, if they existed backed up to .bak"
2022-08-06 03:44:31 -04:00
}
#Install
Dolphin_install( ) {
setMSG " ${ Dolphin_emuName } : Install "
echo ""
2023-11-11 12:24:23 -05:00
installEmuFP " ${ Dolphin_emuName } " " ${ Dolphin_emuPath } "
flatpak override " ${ Dolphin_emuPath } " --filesystem= host --user
2022-08-06 03:44:31 -04:00
}
#ApplyInitialSettings
Dolphin_init( ) {
setMSG " ${ Dolphin_emuName } : Apply initial config "
echo ""
configEmuFP " ${ Dolphin_emuName } " " ${ Dolphin_emuPath } " "true"
Dolphin_setupStorage
Dolphin_setEmulationFolder
Dolphin_setupSaves
2023-09-05 04:51:16 -04:00
Dolphin_cleanup
Dolphin_setCustomizations
#Dolphin_DynamicInputTextures
2022-08-06 03:44:31 -04:00
}
#update
Dolphin_update( ) {
setMSG " ${ Dolphin_emuName } : Apply configuration Update "
echo ""
configEmuFP " ${ Dolphin_emuName } " " ${ Dolphin_emuPath } "
Dolphin_setupStorage
Dolphin_setEmulationFolder
Dolphin_setupSaves
2022-09-29 02:13:14 -04:00
Dolphin_cleanup
2022-08-06 03:44:31 -04:00
}
#ConfigurePaths
Dolphin_setEmulationFolder( ) {
setMSG " ${ Dolphin_emuName } : Configure Emulation folder "
echo ""
2022-09-29 02:13:14 -04:00
local configFile = " $HOME /.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/Dolphin.ini "
2022-08-06 03:44:31 -04:00
gameDirOpt1 = 'ISOPath0 = '
gameDirOpt1Setting = 'ISOPath0 = ' " ${ romsPath } /gc "
gameDirOpt2 = 'ISOPath1 = '
gameDirOpt2Setting = 'ISOPath1 = ' " ${ romsPath } /wii "
sed -i " / ${ gameDirOpt1 } /c\\ ${ gameDirOpt1Setting } " " $configFile "
sed -i " / ${ gameDirOpt2 } /c\\ ${ gameDirOpt2Setting } " " $configFile "
}
#SetupSaves
Dolphin_setupSaves( ) {
setMSG " ${ Dolphin_emuName } : setup Saves folder "
echo ""
2022-10-19 15:32:29 -04:00
unlink " $savesPath /dolphin/states "
2022-08-06 03:44:31 -04:00
linkToSaveFolder dolphin GC " $HOME /.var/app/org.DolphinEmu.dolphin-emu/data/dolphin-emu/GC "
linkToSaveFolder dolphin Wii " $HOME /.var/app/org.DolphinEmu.dolphin-emu/data/dolphin-emu/Wii "
2022-10-19 15:32:29 -04:00
linkToSaveFolder dolphin StateSaves " $HOME /.var/app/org.DolphinEmu.dolphin-emu/data/dolphin-emu/StateSaves "
2022-08-06 03:44:31 -04:00
}
#SetupStorage
Dolphin_setupStorage( ) {
echo "NYI" #TBD
}
#WipeSettings
Dolphin_wipe( ) {
rm -rf " $HOME /.var/app/ $Dolphin_emuPath "
# prob not cause roms are here
}
#Uninstall
Dolphin_uninstall( ) {
flatpak uninstall " $Dolphin_emuPath " --user -y
}
#setABXYstyle
Dolphin_setABXYstyle( ) {
2023-11-11 12:24:23 -05:00
echo "NYI"
2022-08-06 03:44:31 -04:00
}
#Migrate
Dolphin_migrate( ) {
2023-11-11 12:24:23 -05:00
echo "NYI"
2022-08-06 03:44:31 -04:00
}
#WideScreenOn
Dolphin_wideScreenOn( ) {
setMSG " ${ Dolphin_emuName } : Widescreen On "
echo ""
configFile = " $HOME /.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/GFX.ini "
wideScreenHack = 'wideScreenHack = '
wideScreenHackSetting = 'wideScreenHack = True'
aspectRatio = 'AspectRatio = '
aspectRatioSetting = 'AspectRatio = 1'
sed -i " / ${ wideScreenHack } /c\\ ${ wideScreenHackSetting } " " $configFile "
sed -i " / ${ aspectRatio } /c\\ ${ aspectRatioSetting } " " $configFile "
}
#WideScreenOff
Dolphin_wideScreenOff( ) {
setMSG " ${ Dolphin_emuName } : Widescreen Off "
echo ""
2022-09-29 02:13:14 -04:00
local configFile = " $HOME /.var/app/org.DolphinEmu.dolphin-emu/config/dolphin-emu/GFX.ini "
2022-08-06 03:44:31 -04:00
wideScreenHack = 'wideScreenHack = '
wideScreenHackSetting = 'wideScreenHack = False'
aspectRatio = 'AspectRatio = '
aspectRatioSetting = 'AspectRatio = 0'
sed -i " / ${ wideScreenHack } /c\\ ${ wideScreenHackSetting } " " $configFile "
sed -i " / ${ aspectRatio } /c\\ ${ aspectRatioSetting } " " $configFile "
}
#BezelOn
Dolphin_bezelOn( ) {
echo "NYI"
}
#BezelOff
Dolphin_bezelOff( ) {
echo "NYI"
}
2022-10-05 01:22:26 -04:00
Dolphin_IsInstalled( ) {
2023-06-02 10:06:52 -04:00
isFpInstalled " $Dolphin_emuPath "
2022-10-05 01:22:26 -04:00
}
Dolphin_resetConfig( ) {
Dolphin_init & >/dev/null && echo "true" || echo "false"
}
2022-08-06 03:44:31 -04:00
#finalExec - Extra stuff
Dolphin_finalize( ) {
echo "NYI"
}
2023-03-30 13:06:37 -04:00
Dolphin_DynamicInputTextures( ) {
local DIT_releaseURL = " $( getLatestReleaseURLGH "Venomalia/UniversalDynamicInput" "7z" ) "
2023-11-11 12:24:23 -05:00
2023-03-30 13:06:37 -04:00
if [ [ ! -e " $storagePath /dolphin/Load " ] ] ; then
mkdir -p " $storagePath /dolphin/Load "
ln -s " $HOME /.var/app/org.DolphinEmu.dolphin-emu/data/dolphin-emu/Load/ " " $storagePath /dolphin/Load/ "
fi
2023-11-11 12:24:23 -05:00
if safeDownload "UniversalDynamicInput" " $DIT_releaseURL " " $HOME /.var/app/org.DolphinEmu.dolphin-emu/data/dolphin-emu/Load/DynamicInputTextures.7z " "false" ; then
7z " $storagePath /dolphin/Load/DynamicInputTextures.7z " -o" $storagePath /dolphin/Load/ " && rm -rf " $storagePath /Dolphin/Load/DynamicInputTextures.7z "
2023-03-30 13:06:37 -04:00
else
return 1
fi
2023-09-05 04:51:16 -04:00
}
Dolphin_setCustomizations( ) {
2023-11-30 16:39:36 -05:00
if [ " $arDolphin " = = 169 ] ; then
2023-09-05 04:51:16 -04:00
Dolphin_wideScreenOn
else
Dolphin_wideScreenOff
fi
2023-11-11 12:24:23 -05:00
}
Dolphin_setResolution( ) {
case $dolphinResolution in
"720P" ) multiplier = 2; ;
"1080P" ) multiplier = 3; ;
"1440P" ) multiplier = 4; ;
"4K" ) multiplier = 6; ;
*) echo "Error" ; exit 1; ;
esac
RetroArch_setConfigOverride "InternalResolution" $multiplier " $Dolphin_configFileGFX "
2023-03-30 13:06:37 -04:00
}