Renamed variables.

Corrected description for hack.
Log information is now output via debug level.
merge-requests/117/head
Vova 2025-08-27 21:37:09 +10:00
parent fded53f3b8
commit c49b49ba6e
7 changed files with 23 additions and 21 deletions

View File

@ -11,7 +11,7 @@ namespace Ryujinx.Common.Configuration
Xc2MenuSoftlockFix = 1, Xc2MenuSoftlockFix = 1,
// ShaderTranslationDelay = 2 // ShaderTranslationDelay = 2
NifmServiceDisableIsAnyInternetRequestAccepted = 3, NifmServiceDisableIsAnyInternetRequestAccepted = 3,
TMNT_SRFix = 4 TmntSrCutsceneCrashFix = 4
} }
public readonly struct EnabledDirtyHack(DirtyHack hack, int value) public readonly struct EnabledDirtyHack(DirtyHack hack, int value)

View File

@ -50,8 +50,8 @@ namespace Ryujinx.HLE.HOS.Services.Nv
}; };
private const string TMNT_SRTitleId = "0100fe701475a000"; private const string TmntSrTitleId = "0100fe701475a000";
private static bool IsTMNT_SR => TitleIDs.CurrentApplication.Value.OrDefault() is TMNT_SRTitleId; private static bool IsTmntSr => TitleIDs.CurrentApplication.Value.OrDefault() is TmntSrTitleId;
public static IdDictionary DeviceFileIdRegistry = new(); public static IdDictionary DeviceFileIdRegistry = new();
@ -254,15 +254,17 @@ namespace Ryujinx.HLE.HOS.Services.Nv
int fd = context.RequestData.ReadInt32(); int fd = context.RequestData.ReadInt32();
NvIoctl ioctlCommand = context.RequestData.ReadStruct<NvIoctl>(); NvIoctl ioctlCommand = context.RequestData.ReadStruct<NvIoctl>();
if (context.Device.DirtyHacks.IsEnabled(DirtyHack.TMNT_SRFix) && IsTMNT_SR) if (context.Device.DirtyHacks.IsEnabled(DirtyHack.TmntSrCutsceneCrashFix) && IsTmntSr)
{ {
// Fix emulator crash before splash screen for // This fixes an emulator crash before the cutscene for
// TMNT Shredder's Revenges // TMNT Shredder's Revenge.
//
// NOTE: Delay of 50ms is a stable value. Trying to reduce latency will crash when going to intro cutscene
if ((ioctlCommand.Type == NvIoctl.NvGpuAsMagic && (ioctlCommand.Number == 0x05 || ioctlCommand.Number == 0x06))) if ((ioctlCommand.Type == NvIoctl.NvGpuAsMagic && (ioctlCommand.Number == 0x05 || ioctlCommand.Number == 0x06)))
{ {
System.Threading.Thread.Sleep(50); System.Threading.Thread.Sleep(50);
Logger.Notice.Print(LogClass.ServiceNv, $"Type_{ioctlCommand.Type}, Command_{ioctlCommand.Number} Delay!"); Logger.Debug?.Print(LogClass.ServiceNv, $"Type_{ioctlCommand.Type}, Command_{ioctlCommand.Number} Delay!");
} }
} }

View File

@ -166,7 +166,7 @@ namespace Ryujinx.Ava.Systems.Configuration
DirtyHacks hacks = new(cff.DirtyHacks ?? []); DirtyHacks hacks = new(cff.DirtyHacks ?? []);
Hacks.Xc2MenuSoftlockFix.Value = hacks.IsEnabled(DirtyHack.Xc2MenuSoftlockFix); Hacks.Xc2MenuSoftlockFix.Value = hacks.IsEnabled(DirtyHack.Xc2MenuSoftlockFix);
Hacks.TMNT_SRFix.Value = hacks.IsEnabled(DirtyHack.TMNT_SRFix); Hacks.TmntSrCutsceneCrashFix.Value = hacks.IsEnabled(DirtyHack.TmntSrCutsceneCrashFix);
} }

View File

@ -743,7 +743,7 @@ namespace Ryujinx.Ava.Systems.Configuration
public ReactiveObject<bool> Xc2MenuSoftlockFix { get; private set; } public ReactiveObject<bool> Xc2MenuSoftlockFix { get; private set; }
public ReactiveObject<bool> TMNT_SRFix { get; private set; } public ReactiveObject<bool> TmntSrCutsceneCrashFix { get; private set; }
public ReactiveObject<bool> DisableNifmIsAnyInternetRequestAccepted { get; private set; } public ReactiveObject<bool> DisableNifmIsAnyInternetRequestAccepted { get; private set; }
@ -754,8 +754,8 @@ namespace Ryujinx.Ava.Systems.Configuration
Xc2MenuSoftlockFix.Event += HackChanged; Xc2MenuSoftlockFix.Event += HackChanged;
DisableNifmIsAnyInternetRequestAccepted = new ReactiveObject<bool>(); DisableNifmIsAnyInternetRequestAccepted = new ReactiveObject<bool>();
DisableNifmIsAnyInternetRequestAccepted.Event += HackChanged; DisableNifmIsAnyInternetRequestAccepted.Event += HackChanged;
TMNT_SRFix = new ReactiveObject<bool>(); TmntSrCutsceneCrashFix = new ReactiveObject<bool>();
TMNT_SRFix.Event += HackChanged; TmntSrCutsceneCrashFix.Event += HackChanged;
} }
private void HackChanged(object sender, ReactiveEventArgs<bool> rxe) private void HackChanged(object sender, ReactiveEventArgs<bool> rxe)
@ -789,8 +789,8 @@ namespace Ryujinx.Ava.Systems.Configuration
if (DisableNifmIsAnyInternetRequestAccepted) if (DisableNifmIsAnyInternetRequestAccepted)
Apply(DirtyHack.NifmServiceDisableIsAnyInternetRequestAccepted); Apply(DirtyHack.NifmServiceDisableIsAnyInternetRequestAccepted);
if (TMNT_SRFix) if (TmntSrCutsceneCrashFix)
Apply(DirtyHack.TMNT_SRFix); Apply(DirtyHack.TmntSrCutsceneCrashFix);
return enabledHacks.ToArray(); return enabledHacks.ToArray();

View File

@ -17,7 +17,7 @@ namespace Ryujinx.Ava.UI.ViewModels
[ObservableProperty] private bool _xc2MenuSoftlockFix = ConfigurationState.Instance.Hacks.Xc2MenuSoftlockFix; [ObservableProperty] private bool _xc2MenuSoftlockFix = ConfigurationState.Instance.Hacks.Xc2MenuSoftlockFix;
[ObservableProperty] private bool _nifmDisableIsAnyInternetRequestAccepted = ConfigurationState.Instance.Hacks.DisableNifmIsAnyInternetRequestAccepted; [ObservableProperty] private bool _nifmDisableIsAnyInternetRequestAccepted = ConfigurationState.Instance.Hacks.DisableNifmIsAnyInternetRequestAccepted;
[ObservableProperty] private bool _TMNT_SRFix = ConfigurationState.Instance.Hacks.TMNT_SRFix; [ObservableProperty] private bool _TmntSrCutsceneCrashFix = ConfigurationState.Instance.Hacks.TmntSrCutsceneCrashFix;
public static string Xc2MenuFixTooltip { get; } = Lambda.String(sb => public static string Xc2MenuFixTooltip { get; } = Lambda.String(sb =>
{ {
sb.AppendLine( sb.AppendLine(
@ -40,14 +40,14 @@ namespace Ryujinx.Ava.UI.ViewModels
sb.Append("Lets DOOM 2016 go in game."); sb.Append("Lets DOOM 2016 go in game.");
}); });
public static string TMNT_SRFixTooltip { get; } = Lambda.String(sb => public static string TmntSrCutsceneCrashFixTooltip { get; } = Lambda.String(sb =>
{ {
sb.AppendLine( sb.AppendLine(
"This fix adds an extra 50 ms to some Ioctl service calls. This prevents the game from crashing when the cutscene starts.") "This hack adds a 50ms delay to NvGpuAsMagic NvIoctl calls. This prevents the game from crashing when the cutscene starts.")
.AppendLine(); .AppendLine();
sb.Append( sb.Append(
"Just give the game some time to properly interact with guest memory"); "This simply just gives the game some time to properly interact with guest memory");
}); });
} }
} }

View File

@ -856,7 +856,7 @@ namespace Ryujinx.Ava.UI.ViewModels
config.Hacks.Xc2MenuSoftlockFix.Value = DirtyHacks.Xc2MenuSoftlockFix; config.Hacks.Xc2MenuSoftlockFix.Value = DirtyHacks.Xc2MenuSoftlockFix;
config.Hacks.DisableNifmIsAnyInternetRequestAccepted.Value = config.Hacks.DisableNifmIsAnyInternetRequestAccepted.Value =
DirtyHacks.NifmDisableIsAnyInternetRequestAccepted; DirtyHacks.NifmDisableIsAnyInternetRequestAccepted;
config.Hacks.TMNT_SRFix.Value = DirtyHacks.TMNT_SRFix; config.Hacks.TmntSrCutsceneCrashFix.Value = DirtyHacks.TmntSrCutsceneCrashFix;
config.ToFileFormat().SaveConfig(Program.ConfigurationPath); config.ToFileFormat().SaveConfig(Program.ConfigurationPath);

View File

@ -60,13 +60,13 @@
Margin="0,10,0,0" Margin="0,10,0,0"
Orientation="Horizontal" Orientation="Horizontal"
HorizontalAlignment="Center" HorizontalAlignment="Center"
ToolTip.Tip="{Binding DirtyHacks.TMNT_SRFixTooltip}"> ToolTip.Tip="{Binding DirtyHacks.TmntSrCutsceneCrashFixTooltip}">
<CheckBox <CheckBox
Margin="0" Margin="0"
IsChecked="{Binding DirtyHacks.TMNT_SRFix}"/> IsChecked="{Binding DirtyHacks.TmntSrCutsceneCrashFix}"/>
<TextBlock <TextBlock
VerticalAlignment="Center" VerticalAlignment="Center"
Text="TMNT Shredder's Revenges Fix" /> Text="TMNT Shredder's Revenge Fix" />
</StackPanel> </StackPanel>
<Separator/> <Separator/>
</StackPanel> </StackPanel>