Improve error message when a PE `.exe` is loaded (see #3042, #4300)

This commit is contained in:
YoshiRulz 2025-05-28 01:10:21 +10:00
parent f4a5b1fd1b
commit 8e3e16b888
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 7 additions and 1 deletions

View File

@ -465,7 +465,7 @@ namespace BizHawk.Client.Common
_ => rom.GameInfo.System,
};
Util.DebugWriteLine(rom.GameInfo.System);
Util.DebugWriteLine($"{nameof(RomLoader)}.{nameof(LoadOther)}: sysID is {rom.GameInfo.System}");
if (string.IsNullOrEmpty(rom.GameInfo.System))
{
@ -559,6 +559,12 @@ namespace BizHawk.Client.Common
game = gameBak;
nextEmulator = nextEmulatorBak;
break;
case VSystemID.Raw.PSX when ext is ".exe":
const string ERR_MSG_NOT_PSXEXE = "Got an .exe which is not in the PSX-EXE format!"
+ "\nIf you're trying to load a PE (Windows program), you need to load the unextracted disc image. See https://tasvideos.org/BizHawk/DOSBox for details." // sadly won't be clickable
+ "\n"; // extra blank line to separate from stacktrace below
if (!rom.FileData.AsSpan().StartsWith("PS-X EXE"u8)) throw new /*NoAvailableCoreException*/InvalidOperationException(ERR_MSG_NOT_PSXEXE);
break;
}
var cip = new CoreInventoryParameters(this)
{