add some savestate checks

This commit is contained in:
13xforever
2025-08-18 20:35:37 +05:00
parent 8e3ca783d7
commit e1fea75c56
6 changed files with 41 additions and 16 deletions

View File

@@ -43,6 +43,7 @@ internal partial class LogParser
["SYS: Path"] = BootPathSys(),
["LDR: Path:"] = BootPathDigitalLdr(),
["SYS: Path:"] = BootPathDigitalSys(),
["SYS: Booting savestate"] = BootingFromSavestate(),
["custom config:"] = CustomConfigPath(),
["patch_log: Failed to load patch file"] = FailedPatchPath(),
["Undisputed"] = UfcModFlag(),
@@ -50,7 +51,6 @@ internal partial class LogParser
},
EndTrigger = ["Used configuration:"],
},
new()
{
Extractors = new()
@@ -90,7 +90,6 @@ internal partial class LogParser
},
EndTrigger = ["VFS:"],
},
new()
{
Extractors = new()
@@ -99,7 +98,6 @@ internal partial class LogParser
},
EndTrigger = ["Video:"],
},
new()
{
Extractors = new()
@@ -140,7 +138,6 @@ internal partial class LogParser
},
EndTrigger = ["Audio:"],
},
new() // Audio, Input/Output, System, Net, Miscellaneous
{
Extractors = new()
@@ -154,6 +151,10 @@ internal partial class LogParser
["Pad:"] = GamepadType(),
["Start Paused:"] = StartPausedSavestate(),
["Suspend Emulation Savestate Mode:"] = SuspendEmulationSavestate(),
["Compatible Savestate Mode:"] = CompatibleSavestate(),
["Automatically start games after boot:"] = AutoStartAfterBoot(),
["Always start after boot:"] = AlwaysStartAfterBoot(),
["Use native user interface:"] = NativeUIMode(),
@@ -161,7 +162,6 @@ internal partial class LogParser
},
EndTrigger = ["Log:"],
},
new()
{
Extractors = new()
@@ -171,7 +171,6 @@ internal partial class LogParser
EndTrigger = ["·"],
OnSectionEnd = MarkAsComplete,
},
new()
{
Extractors = new()

View File

@@ -208,6 +208,14 @@ internal partial class LogParser
private static partial Regex AudioTimeStretching();
[GeneratedRegex("Pad: (?<pad_handler>[^\r\n]*?)\r?$", DefaultOptions)]
private static partial Regex GamepadType();
[GeneratedRegex("Start Paused: (?<start_paused_savestate>[^\r\n]*?)\r?$", DefaultOptions)]
private static partial Regex StartPausedSavestate();
[GeneratedRegex("Suspend Emulation Savestate Mode: (?<suspend_emulation_savestate>[^\r\n]*?)\r?$", DefaultOptions)]
private static partial Regex SuspendEmulationSavestate();
[GeneratedRegex("Compatible Savestate Mode: (?<compatible_savestate>[^\r\n]*?)\r?$", DefaultOptions)]
private static partial Regex CompatibleSavestate();
[GeneratedRegex("Automatically start games after boot: (?<auto_start_on_boot>[^\r\n]*?)\r?$", DefaultOptions)]
private static partial Regex AutoStartAfterBoot();
[GeneratedRegex("Always start after boot: (?<always_start_on_boot>[^\r\n]*?)\r?$", DefaultOptions)]
@@ -370,4 +378,6 @@ internal partial class LogParser
DefaultOptions
)]
private static partial Regex SaveDataBeforeSegfault();
[GeneratedRegex(@"Booting savestate from gamelist per (?<booting_savestate>.+)...\r?$", DefaultOptions)]
private static partial Regex BootingFromSavestate();
}

View File

@@ -227,7 +227,7 @@ internal static partial class LogParserResult
{
if (colA.lines?.Count > 0 && colB.lines?.Count > 0)
{
var isCustomSettings = items["custom_config"] != null;
var isCustomSettings = items["custom_config"] is EnabledMark;
var colAToRemove = colA.lines.Count(l => l.EndsWith("N/A"));
var colBToRemove = colB.lines.Count(l => l.EndsWith("N/A"));
var linesToRemove = Math.Min(colAToRemove, colBToRemove);

View File

@@ -420,11 +420,11 @@ internal static partial class LogParserResult
discAsPkg |= items["ldr_game_serial"] is string ldrGameSerial && ldrGameSerial.StartsWith("NP", StringComparison.InvariantCultureIgnoreCase);
}
discAsPkg |= category == "HG" && !(items["serial"]?.StartsWith("NP", StringComparison.InvariantCultureIgnoreCase) ?? false);
discAsPkg |= category is "HG" && !(items["serial"]?.StartsWith("NP", StringComparison.InvariantCultureIgnoreCase) ?? false);
if (discInsideGame)
notes.Add($"❌ Disc game inside `{items["ldr_disc"]}`");
if (discAsPkg)
notes.Add($" Disc game installed as a PKG ");
notes.Add(" Disc game installed as a PKG ");
if (!string.IsNullOrEmpty(items["native_ui_input"]))
notes.Add("⚠️ Pad initialization problem detected; try disabling `Native UI`");
@@ -433,10 +433,13 @@ internal static partial class LogParserResult
else if (items["audio_backend_init_error"] is string audioBackend)
notes.Add($"⚠️ {audioBackend} initialization failed; make sure you have a working audio output device");
if (!string.IsNullOrEmpty(items["fw_missing_msg"])
|| !string.IsNullOrEmpty(items["fw_missing_something"]))
if (items["fw_missing_msg"] is not {Length: >0}
|| items["fw_missing_something"] is not {Length: >0})
notes.Add("❌ PS3 firmware is missing or corrupted");
if (items["booting_savestate"] is EnabledMark)
notes.Add(" Game was booted from a save state");
if (multiItems["game_mod"] is { Length: >0 } mods)
{
var mod = mods[0];

View File

@@ -552,12 +552,22 @@ internal static partial class LogParserResult
notes.Add($"⚠️ Please change `SPU Block Size` to `Safe/Mega`, currently `{spuBlockSize}` is unstable.");
}
if (items["auto_start_on_boot"] == DisabledMark)
notes.Add("❓ `Automatically start games after boot` is disabled");
else if (items["always_start_on_boot"] == DisabledMark)
notes.Add("❓ `Always start after boot` is disabled");
if (items["booting_savestate"] is DisabledMark)
{
if (items["auto_start_on_boot"] is DisabledMark)
notes.Add("❓ `Automatically start games after boot` is disabled");
else if (items["always_start_on_boot"] is DisabledMark)
notes.Add("❓ `Always start after boot` is disabled");
}
else
{
if (items["start_paused_savestate"] is EnabledMark)
notes.Add("❓ `Pause emulation after loading savestates` is disabled");
if (items["compatible_savestate"] is not EnabledMark)
notes.Add(" If you have weird compatibility issues after boot, try enabling `SPU-Compatible Savestate Mode`");
}
if (items["custom_config"] != null && notes.Any())
if (items["custom_config"] is EnabledMark && notes.Count > 0)
generalNotes.Add("⚠️ To change custom configuration, **Right-click on the game**, then `Configure`");
var notesContent = new StringBuilder();

View File

@@ -745,6 +745,9 @@ internal static partial class LogParserResult
if (items["game_update_version"] is string gameUpVer && gameUpVer.StartsWith("0"))
items["game_update_version"] = gameUpVer[1..];
items["custom_config"] = items["custom_config"] is { Length: > 0 } ? EnabledMark : DisabledMark;
items["booting_savestate"] = items["booting_savestate"] is {Length: >0} ? EnabledMark : DisabledMark;
if (multiItems["fatal_error"] is UniqueList<string> {Count: > 0} fatalErrors)
multiItems["fatal_error"] = new(fatalErrors.Select(str => str.Contains("'tex00'") ? str.Split('\n', 2)[0] : str), fatalErrors.Comparer);