From b9398f1f3a13612a0bc3e64205cdb7eca3f48d4d Mon Sep 17 00:00:00 2001 From: mageven <62494521+mageven@users.noreply.github.com> Date: Sun, 30 Aug 2020 22:21:53 +0530 Subject: Allow launching with custom data directories (#1505) * Allow launching with custom data directories Don't load alternate keys when using custom directory * Address gdkchan's comments * Misc fixes to log levels Added more enabled log levels by default Moved successful config updation to Notice as 1. It's not a warning 2. Warnings could've been disabled by the config load and hence message would be lost --- ARMeilleure/Translation/PTC/Ptc.cs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'ARMeilleure') diff --git a/ARMeilleure/Translation/PTC/Ptc.cs b/ARMeilleure/Translation/PTC/Ptc.cs index ccb3f705..c6069d88 100644 --- a/ARMeilleure/Translation/PTC/Ptc.cs +++ b/ARMeilleure/Translation/PTC/Ptc.cs @@ -1,6 +1,7 @@ using ARMeilleure.CodeGen; using ARMeilleure.CodeGen.Unwinding; using ARMeilleure.Memory; +using Ryujinx.Common.Configuration; using Ryujinx.Common.Logging; using System; using System.Buffers.Binary; @@ -22,8 +23,6 @@ namespace ARMeilleure.Translation.PTC private const int InternalVersion = 1471; //! To be incremented manually for each change to the ARMeilleure project. - private const string BaseDir = "Ryujinx"; - private const string ActualDir = "0"; private const string BackupDir = "1"; @@ -49,8 +48,6 @@ namespace ARMeilleure.Translation.PTC private static readonly AutoResetEvent _loggerEvent; - private static readonly string _basePath; - private static readonly object _lock; private static bool _disposed; @@ -83,8 +80,6 @@ namespace ARMeilleure.Translation.PTC _loggerEvent = new AutoResetEvent(false); - _basePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), BaseDir); - _lock = new object(); _disposed = false; @@ -130,8 +125,8 @@ namespace ARMeilleure.Translation.PTC if (enabled) { - string workPathActual = Path.Combine(_basePath, "games", TitleIdText, "cache", "cpu", ActualDir); - string workPathBackup = Path.Combine(_basePath, "games", TitleIdText, "cache", "cpu", BackupDir); + string workPathActual = Path.Combine(AppDataManager.GamesDirPath, TitleIdText, "cache", "cpu", ActualDir); + string workPathBackup = Path.Combine(AppDataManager.GamesDirPath, TitleIdText, "cache", "cpu", BackupDir); if (!Directory.Exists(workPathActual)) { -- cgit v1.2.3