From 5b10ec720f2f2de4a60c00987603f3490520798e Mon Sep 17 00:00:00 2001 From: WilliamWsyHK Date: Wed, 1 Jan 2025 15:52:44 +0800 Subject: [PATCH 1/2] Also include hack for XC2 JP edition --- src/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IStorage.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IStorage.cs b/src/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IStorage.cs index 3d197ac19..165dbbf57 100644 --- a/src/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IStorage.cs +++ b/src/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IStorage.cs @@ -16,7 +16,8 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy _baseStorage = SharedRef.CreateMove(ref baseStorage); } - private const string Xc2TitleId = "0100e95004038000"; + private const string Xc2JpTitleId = "0100f3400332c000"; + private const string Xc2GlobalTitleId = "0100e95004038000"; [CommandCmif(0)] // Read(u64 offset, u64 length) -> buffer buffer @@ -39,7 +40,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy using var region = context.Memory.GetWritableRegion(bufferAddress, (int)bufferLen, true); Result result = _baseStorage.Get.Read((long)offset, new OutBuffer(region.Memory.Span), (long)size); - if (context.Device.DirtyHacks.IsEnabled(DirtyHack.Xc2MenuSoftlockFix) && TitleIDs.CurrentApplication.Value == Xc2TitleId) + if (context.Device.DirtyHacks.IsEnabled(DirtyHack.Xc2MenuSoftlockFix) && (TitleIDs.CurrentApplication.Value == Xc2JpTitleId || TitleIDs.CurrentApplication.Value == Xc2GlobalTitleId)) { // Add a load-bearing sleep to avoid XC2 softlock // https://web.archive.org/web/20240728045136/https://github.com/Ryujinx/Ryujinx/issues/2357 -- 2.47.1 From 22a749ea928912ad9ebb0b6488a3dd8b63d7e612 Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Wed, 1 Jan 2025 02:00:03 -0600 Subject: [PATCH 2/2] pattern matching + static property --- src/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IStorage.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IStorage.cs b/src/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IStorage.cs index 165dbbf57..ad4cccc44 100644 --- a/src/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IStorage.cs +++ b/src/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IStorage.cs @@ -15,9 +15,10 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy { _baseStorage = SharedRef.CreateMove(ref baseStorage); } - + private const string Xc2JpTitleId = "0100f3400332c000"; private const string Xc2GlobalTitleId = "0100e95004038000"; + private static bool IsXc2 => TitleIDs.CurrentApplication.Value.OrDefault() is Xc2GlobalTitleId or Xc2JpTitleId; [CommandCmif(0)] // Read(u64 offset, u64 length) -> buffer buffer @@ -40,7 +41,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy using var region = context.Memory.GetWritableRegion(bufferAddress, (int)bufferLen, true); Result result = _baseStorage.Get.Read((long)offset, new OutBuffer(region.Memory.Span), (long)size); - if (context.Device.DirtyHacks.IsEnabled(DirtyHack.Xc2MenuSoftlockFix) && (TitleIDs.CurrentApplication.Value == Xc2JpTitleId || TitleIDs.CurrentApplication.Value == Xc2GlobalTitleId)) + if (context.Device.DirtyHacks.IsEnabled(DirtyHack.Xc2MenuSoftlockFix) && IsXc2) { // Add a load-bearing sleep to avoid XC2 softlock // https://web.archive.org/web/20240728045136/https://github.com/Ryujinx/Ryujinx/issues/2357 -- 2.47.1