diff --git a/CompatBot/EventHandlers/LogParsing/LogParser.LogSections.cs b/CompatBot/EventHandlers/LogParsing/LogParser.LogSections.cs index b8d4cdc3..f7db1e9a 100644 --- a/CompatBot/EventHandlers/LogParsing/LogParser.LogSections.cs +++ b/CompatBot/EventHandlers/LogParsing/LogParser.LogSections.cs @@ -180,6 +180,7 @@ internal partial class LogParser ["LDR: Path:"] = DigitalPathLdr(), ["LDR: Boot path:"] = BootPathInBodyLdr(), ["SYS: Game:"] = GamePathSys(), + ["SYS: Title was set from"] = TitleWasSet(), ["SYS: Path:"] = DigitalPathSys(), ["SYS: Boot path:"] = BootPathInBodySys(), ["Elf path:"] = ElfPath(), diff --git a/CompatBot/EventHandlers/LogParsing/LogParser.RegexPatterns.cs b/CompatBot/EventHandlers/LogParsing/LogParser.RegexPatterns.cs index 260390ab..c0cf8531 100644 --- a/CompatBot/EventHandlers/LogParsing/LogParser.RegexPatterns.cs +++ b/CompatBot/EventHandlers/LogParsing/LogParser.RegexPatterns.cs @@ -237,6 +237,8 @@ internal partial class LogParser [GeneratedRegex(@"Boot path: (?.*(?/dev_hdd0/game/(?[^/\r\n]+)).*|[^\r\n]*)\r?$", DefaultOptions)] private static partial Regex BootPathInBodyLdr(); [GeneratedRegex(@"Game: (?.*(?/dev_hdd0/game/(?[^/\r\n]+)).*|[^\r\n]*)\r?$", DefaultOptions)] + private static partial Regex TitleWasSet(); + [GeneratedRegex(@"Title was set from (?.+) to (?.+)\r?$", DefaultOptions)] private static partial Regex GamePathSys(); [GeneratedRegex(@"Path: (?.*(?/dev_hdd0/game/(?[^/\r\n]+)).*|[^\r\n]*)\r?$", DefaultOptions)] private static partial Regex DigitalPathSys(); diff --git a/CompatBot/Utils/ResultFormatters/LogParserResultFormatter.GeneralNotesSection.cs b/CompatBot/Utils/ResultFormatters/LogParserResultFormatter.GeneralNotesSection.cs index 7771653c..195572f9 100644 --- a/CompatBot/Utils/ResultFormatters/LogParserResultFormatter.GeneralNotesSection.cs +++ b/CompatBot/Utils/ResultFormatters/LogParserResultFormatter.GeneralNotesSection.cs @@ -651,7 +651,12 @@ internal static partial class LogParserResult else if (int.TryParse(match.Groups["verification_error_hex"].Value, NumberStyles.HexNumber, NumberFormatInfo.InvariantInfo, out var hexCode)) win32ErrorCodes.Add(hexCode); } - builder.AddField(sectionName, $"```\n{fatalError.Trim(EmbedPager.MaxFieldLength - 8)}\n```"); + var trimIdx = fatalError.IndexOf(" Called from"); + var errorTxt = fatalError; + if (trimIdx > -1) + errorTxt = fatalError[..trimIdx]; + errorTxt = errorTxt.Trim(EmbedPager.MaxFieldLength - 7); + builder.AddField(sectionName, $"```\n{errorTxt}```"); } } } diff --git a/CompatBot/Utils/ResultFormatters/LogParserResultFormatter.WeirdSettingsSection.cs b/CompatBot/Utils/ResultFormatters/LogParserResultFormatter.WeirdSettingsSection.cs index f856d201..aa8640c8 100644 --- a/CompatBot/Utils/ResultFormatters/LogParserResultFormatter.WeirdSettingsSection.cs +++ b/CompatBot/Utils/ResultFormatters/LogParserResultFormatter.WeirdSettingsSection.cs @@ -683,41 +683,49 @@ internal static partial class LogParserResult private static void CheckJojoSettings(string serial, LogParseState state, List notes, Dictionary ppuPatches, HashSet ppuHashes, List generalNotes) { + if (!AllStarBattleIds.Contains(serial) && serial is not ("BLJS10318" or "NPJB00753")) + return; + var items = state.CompletedCollection!; - if (AllStarBattleIds.Contains(serial) || serial is "BLJS10318" or "NPJB00753") + if (items["audio_buffering"] == EnabledMark && items["audio_buffer_duration"] != "20") + notes.Add("ℹ️ If you experience audio issues, set `Audio Buffer Duration` to `20ms`"); + else if (items["audio_buffering"] == DisabledMark) + notes.Add("ℹ️ If you experience audio issues, check `Enable Buffering` and set `Audio Buffer Duration` to `20ms`"); + + if (serial is "BLUS31405" or "BLJS10318" + && items["vblank_rate"] is string vbrStr + && int.TryParse(vbrStr, out var vbr)) { - if (items["audio_buffering"] == EnabledMark && items["audio_buffer_duration"] != "20") - notes.Add("ℹ️ If you experience audio issues, set `Audio Buffer Duration` to `20ms`"); - else if (items["audio_buffering"] == DisabledMark) - notes.Add("ℹ️ If you experience audio issues, check `Enable Buffering` and set `Audio Buffer Duration` to `20ms`"); - - if (serial is "BLUS31405" or "BLJS10318" - && items["vblank_rate"] is string vbrStr - && int.TryParse(vbrStr, out var vbr)) + if (ppuPatches.Count > 0) { - if (ppuPatches.Any()) - { - if (vbr == 60) - notes.Add("ℹ️ `VBlank Rate` is not set; FPS is limited to 30"); - else if (vbr == 120) - notes.Add("✅ Settings are set for the 60 FPS patch"); - else - notes.Add($"⚠️ Settings are configured for the {vbr / 2} FPS patch, which is unsupported"); - } + if (vbr is 60) + notes.Add("ℹ️ `VBlank Rate` is not set; FPS is limited to 30"); + else if (vbr is 120) + notes.Add("✅ Settings are set for the 60 FPS patch"); else - { - if (vbr > 60) - notes.Add("ℹ️ Unlocking FPS requires game patch"); - if (ppuHashes.Overlaps(KnownJojoPatches)) - generalNotes.Add($"ℹ️ This game has an FPS unlock patch"); - } + notes.Add($"⚠️ Settings are configured for the {vbr / 2} FPS patch, which is unsupported"); } + else + { + if (vbr > 60) + notes.Add("ℹ️ Unlocking FPS requires game patch"); + if (ppuHashes.Overlaps(KnownJojoPatches)) + generalNotes.Add("ℹ️ This game has an FPS unlock patch"); + } + } - if (serial == "BLUS31405" - && items["compat_database_path"] is string compatDbPath - && compatDbPath.Contains("JoJo ASB Emulator v.04") - && state.CompleteMultiValueCollection!["rap_file"].Any()) - generalNotes.Add("🤔 Very interesting version of the game you got there"); + if (serial == "BLUS31405" + && items["compat_database_path"] is string compatDbPath + && compatDbPath.Contains("JoJo ASB Emulator v.04") + && state.CompleteMultiValueCollection!["rap_file"] is {Length: >0}) + generalNotes.Add("🤔 Very interesting version of the game you got there"); + + if (serial is "BLJS10318" or "NPJB00753" + && items["title_was_set_from"] is {Length: >0} oldTitle + && items["title_was_set_to"] is {Length: >0} newTitle + && oldTitle != newTitle) + { + generalNotes.Add("⚠️ Unofficial translation modification is not supported"); } }