Rename "RyuFs" directory to "Ryujinx" and use the same savedata system the Switch uses (#801)

* Use savedata FS commands from LibHac

* Add EnsureSaveData. Use ApplicationControlProperty struct

* Add a function to migrate to the new directory layout

* LibHac update

* Change backup structure

* Don't create UI files in the save path

* Update RyuFs paths

* Add GetProgramIndexForAccessLog

Ryujinx only runs one program at a time, so always return values reflecting that

* Load control NCA when loading from an NSP

* Skip over UI stats when exiting

* Set TitleName and TitleId in more cases. Fix TitleID naming style

* Completely comment out GUI play stats code

* rebase

* Update LibHac

* Update LibHac

* Revert UI changes

* Do migration automatically at startup

* Rename RyuFs directory to Ryujinx

* Update RyuFs text

* Store savedata paths in the GUI

* Make "Open Save Directory" work

* Use a dummy NACP in EnsureSaveData if one is not loaded

* Remove manual migration button

* Respond to feedback

* Don't read the installer config to get a version string

* Delete nuget.config

* Exclude 'sdcard' and 'bis' during migration

Co-authored-by: Thog <thog@protonmail.com>
This commit is contained in:
Alex Barney 2020-01-05 04:49:44 -07:00 committed by Thog
parent e0e12b1672
commit 63b24b4af2
22 changed files with 877 additions and 384 deletions

View file

@ -1,22 +1,21 @@
using Gtk;
using JsonPrettyPrinterPlus;
using Ryujinx.Audio;
using Ryujinx.Common.Logging;
using Ryujinx.Configuration;
using Ryujinx.Graphics.Gal;
using Ryujinx.Graphics.Gal.OpenGL;
using Ryujinx.HLE.FileSystem;
using Ryujinx.Profiler;
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Text;
using System.Threading;
using Ryujinx.Configuration;
using System.Diagnostics;
using System.Threading.Tasks;
using Utf8Json;
using JsonPrettyPrinterPlus;
using Utf8Json.Resolvers;
using Ryujinx.HLE.FileSystem;
using GUI = Gtk.Builder.ObjectAttribute;
@ -74,6 +73,12 @@ namespace Ryujinx.Ui
_gameTable.ButtonReleaseEvent += Row_Clicked;
bool continueWithStartup = Migration.PromptIfMigrationNeededForStartup(this, out bool migrationNeeded);
if (!continueWithStartup)
{
End();
}
_renderer = new OglRenderer();
_audioOut = InitializeAudioEngine();
@ -81,6 +86,16 @@ namespace Ryujinx.Ui
// TODO: Initialization and dispose of HLE.Switch when starting/stoping emulation.
_device = InitializeSwitchInstance();
if (migrationNeeded)
{
bool migrationSuccessful = Migration.DoMigrationForStartup(this, _device);
if (!migrationSuccessful)
{
End();
}
}
_treeView = _gameTable;
ApplyTheme();
@ -198,7 +213,9 @@ namespace Ryujinx.Ui
_tableStore.Clear();
await Task.Run(() => ApplicationLibrary.LoadApplications(ConfigurationState.Instance.Ui.GameDirs, _device.System.KeySet, _device.System.State.DesiredTitleLanguage));
await Task.Run(() => ApplicationLibrary.LoadApplications(ConfigurationState.Instance.Ui.GameDirs,
_device.System.KeySet, _device.System.State.DesiredTitleLanguage, _device.System.FsClient,
_device.FileSystem));
_updatingGameTable = false;
}
@ -377,8 +394,8 @@ namespace Ryujinx.Ui
}
Profile.FinishProfiling();
_device.Dispose();
_audioOut.Dispose();
_device?.Dispose();
_audioOut?.Dispose();
Logger.Shutdown();
Environment.Exit(0);
}
@ -474,7 +491,7 @@ namespace Ryujinx.Ui
if (treeIter.UserData == IntPtr.Zero) return;
GameTableContextMenu contextMenu = new GameTableContextMenu(_tableStore, treeIter);
GameTableContextMenu contextMenu = new GameTableContextMenu(_tableStore, treeIter, _device.System.FsClient);
contextMenu.ShowAll();
contextMenu.PopupAtPointer(null);
}