Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

See earlier PRs #873

Merged
merged 3 commits into from
Oct 4, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 44 additions & 19 deletions functions/EmuScripts/emuDeckCitra.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash
#variables
Citra_emuName="Citra"
Citra_emuType="FlatPak"
Citra_emuPath="org.citra_emu.citra"
Citra_emuType="AppImage"
Citra_emuPath="citra_emu"
Citra_releaseURL=""
Citra_configFile="$HOME/.var/app/org.citra_emu.citra/config/citra-emu/qt-config.ini"
Citra_configFile="$HOME/.confid//citra-emu/qt-config.ini"
Efadd marked this conversation as resolved.
Show resolved Hide resolved

#cleanupOlderThings
Citra_finalize(){
Expand All @@ -15,7 +15,8 @@ Citra_finalize(){
Citra_install(){
setMSG "Installing $Citra_emuName"
installEmuFP "${Citra_emuName}" "${Citra_emuPath}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is installEmuFP still here?

flatpak override "${Citra_emuPath}" --filesystem=host --user
curl -L https://github.com/citra-emu/citra-web/releases/download/2.0/citra-setup-linux > citra-setup-linux && chmod +x citra-setup-linux && ./citra-setup-linux --accept-licenses --confirm-command install
rm citra-setup-linux
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The binupdate.sh needs to be updated also, so that emulator can be updated. Usually the _Install method is called from binupdate so this code should be modified to handle updates.

}

#ApplyInitialSettings
Expand All @@ -31,7 +32,7 @@ Citra_init(){
#update
Citra_update(){
setMSG "Updating $Citra_emuName settings."
configEmuFP "${Citra_emuName}" "${Citra_emuPath}"
cd $HOME/.citra && ./maintenancetool update
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above, binupdate doesn't call this method.

Citra_setupStorage
Citra_setEmulationFolder
Citra_setupSaves
Expand All @@ -48,35 +49,35 @@ Citra_setEmulationFolder(){

#Setup symlink for AES keys
mkdir -p "${biosPath}/citra/"
mkdir -p "$HOME/.var/app/org.citra_emu.citra/data/citra-emu/sysdata"
ln -sn "$HOME/.var/app/org.citra_emu.citra/data/citra-emu/sysdata" "${biosPath}/citra/keys"
mkdir -p "$HOME/.local/share/citra-emu/sysdata"
ln -sn "$HOME/.local/share/citra-emu/sysdata" "${biosPath}/citra/keys"
}

#SetupSaves
Citra_setupSaves(){
linkToSaveFolder citra saves "$HOME/.var/app/org.citra_emu.citra/data/citra-emu/sdmc"
linkToSaveFolder citra states "$HOME/.var/app/org.citra_emu.citra/data/citra-emu/states"
linkToSaveFolder citra saves "$HOME/.local/share/citra-emu/sdmc"
linkToSaveFolder citra states "$HOME/.local/share/citra-emu/states"
}


#SetupStorage
Citra_setupStorage(){

if [ ! -f "$storagePath/citra/nand" ] && [ -d "$HOME/.var/app/org.ctira_emu.citra/data/citra-emu/nand/" ]; then
if [ ! -f "$storagePath/citra/nand" ] && [ -d "$HOME/.local/share/citra-emu/nand/" ]; then

echo "citra nand does not exist in storagepath."
echo -e ""
setMSG "Moving Citra nand to the Emulation/storage folder"
echo -e ""

mv "$HOME/.var/app/org.ctira_emu.citra/data/citra-emu/nand/" $storagePath/citra/nand/
mv "$HOME/.var/app/org.ctira_emu.citra/data/citra-emu/sdmc/" $storagePath/citra/sdmc/
mv "$HOME/.local/share/citra-emu/nand/" $storagePath/citra/nand/
mv "$HOME/.local/share/citra-emu/sdmc/" $storagePath/citra/sdmc/

unlink "$HOME/.var/app/org.ctira_emu.citra/data/citra-emu/nand/"
unlink "$HOME/.var/app/org.ctira_emu.citra/data/citra-emu/sdmc/"
unlink "$HOME/.local/share/citra-emu/nand/"
unlink "$HOME/.local/share/citra-emu/sdmc/"

ln -ns "${storagePath}/citra/nand/" "$HOME/.var/app/org.ctira_emu.citra/data/citra-emu/nand/"
ln -ns "${storagePath}/citra/sdmc/" "$HOME/.var/app/org.ctira_emu.citra/data/citra-emu/sdmc/"
ln -ns "${storagePath}/citra/nand/" "$HOME/.local/share/citra-emu/nand/"
ln -ns "${storagePath}/citra/sdmc/" "$HOME/.local/share/citra-emu/sdmc/"
fi

}
Expand All @@ -85,14 +86,14 @@ Citra_setupStorage(){
#WipeSettings
Citra_wipe(){
setMSG "Wiping $Citra_emuName config directory. (factory reset)"
rm -rf "$HOME/.var/app/$Citra_emuPath"
rm -rf "$HOME/.config/citra-emu"
}


#Uninstall
Citra_uninstall(){
setMSG "Uninstalling $Citra_emuName."
flatpak uninstall "$Citra_emuPath" --user -y
cd ./citra && ./maintenancetool purge
Efadd marked this conversation as resolved.
Show resolved Hide resolved
}

#setABXYstyle
Expand All @@ -102,7 +103,31 @@ Citra_setABXYstyle(){

#Migrate
Citra_migrate(){
echo "NYI"
echo "Begin Citra Migration"
emu="Citra"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could also use Citra_emuName here.

migrationFlag="$HOME/.config/EmuDeck/.${emu}MigrationCompleted"
#check if we have a nomigrateflag for $emu
if [ ! -f "$migrationFlag" ]; then
#citra flatpak to appimage
#From -- > to
migrationTable=()
migrationTable+=("$HOME/.var/app/org.citra_emu.citra/data/citra-emu" "$HOME/.local/share/citra-emu")
migrationTable+=("$HOME/.var/app/org.citra_emu.citra/config/citra-emu" "$HOME/.config/citra-emu")

# migrateAndLinkConfig "$emu" "$migrationTable"
fi

#move data from hidden folders out to these folders in case the user already put stuff here.
origPath="$HOME/.var/app/"
Efadd marked this conversation as resolved.
Show resolved Hide resolved

citra_setupStorage

rsync -av "${origPath}citra/dump" "${storagePath}/citra/" && rm -rf "${origPath}citra/dump"
rsync -av "${origPath}citra/load" "${storagePath}/citra/" && rm -rf "${origPath}citra/load"
rsync -av "${origPath}citra/sdmc" "${storagePath}/citra/" && rm -rf "${origPath}citra/sdmc"
rsync -av "${origPath}citra/nand" "${storagePath}/citra/" && rm -rf "${origPath}citra/nand"
rsync -av "${origPath}citra/screenshots" "${storagePath}/citra/" && rm -rf "${origPath}citra/screenshots"
rsync -av "${origPath}citra/tas" "${storagePath}/citra/" && rm -rf "${origPath}citra/tas"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Below, Citra_IsInstalled should be updated:

migrationFlag="$HOME/.config/EmuDeck/.${Citra_emuName}MigrationCompleted"
if [ ! -f "$migrationFlag" ]; then
  isFpInstalled "$Citra_emuPath"
else
  if [ -e "$HOME/.config/citra-emu" ]; then
    echo "true"
  else
    echo "false
  fi
fi


#WideScreenOn
Expand Down