Skip to content

Commit f794a82

Browse files
Fix quickerNES string error handling
1 parent d0f94df commit f794a82

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/LibQuickNES.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,11 @@ public static void ThrowStringError(IntPtr p)
227227
{
228228
if (p == IntPtr.Zero)
229229
return;
230-
string s = Marshal.PtrToStringAnsi(p);
231-
if (s == "Unsupported mapper"
232-
|| s == "Not an iNES file" // Not worth making a new exception for the iNES error, they ultimately are the same problem
233-
|| s == " truncated file" // This is a garbage rom not worth anyone's time but at least NesHawk handles these better, and these occur before the core has a chance to assess an unsupported mapper
234-
)
230+
var s = Marshal.PtrToStringAnsi(p);
231+
if (s is "Unsupported mapper"
232+
or "Not an iNES file" // Not worth making a new exception for the iNES error, they ultimately are the same problem
233+
or "Malformed iNES file" // This is a garbage rom not worth anyone's time but at least NesHawk handles these better, and these occur before the core has a chance to assess an unsupported mapper
234+
or "Unsupported ROM size") // Similar to above
235235
{
236236
throw new Common.UnsupportedGameException(CoreNames.QuickNes + " unsupported mapper");
237237
}

0 commit comments

Comments
 (0)