From e94a20877a96c23fc18460a136b161b536db9d9c Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Thu, 13 Mar 2025 06:36:43 +1000 Subject: [PATCH] Improve one of the Satellaview header heuristics (resolves #4268) --- .../filetype_detectors/SatellaviewFileTypeDetector.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/BizHawk.Emulation.Common/filetype_detectors/SatellaviewFileTypeDetector.cs b/src/BizHawk.Emulation.Common/filetype_detectors/SatellaviewFileTypeDetector.cs index 1d7d8cc1a2..9889579148 100644 --- a/src/BizHawk.Emulation.Common/filetype_detectors/SatellaviewFileTypeDetector.cs +++ b/src/BizHawk.Emulation.Common/filetype_detectors/SatellaviewFileTypeDetector.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Linq; using BizHawk.Common; using BizHawk.Common.IOExtensions; @@ -105,7 +106,9 @@ namespace BizHawk.Emulation.Common var corruption = 0; // "invalid" states were assigned a higher value if the wiki page was less vague - if (header.Title.Length is 0) corruption++; + static bool IsASCIIOrKana(char c) + => c is (>= ' ' and <= '~') or (>= 'ぁ' and <= 'ヿ') or (>= '!' and <= '○'); // doubt this matches SHIFT-JIS but it should cover all the kana which is what I expect in a title + if (!header.Title.Any(IsASCIIOrKana)) corruption++; if (header.IsSelfDestructing) {