BIOS: Add support for loading PS2 BIOSes

This commit is contained in:
Albert Liu
2020-12-25 07:33:33 -08:00
parent 4db29f9399
commit 0e2276fc7a
4 changed files with 9 additions and 6 deletions

View File

@ -101,9 +101,11 @@ std::optional<Image> LoadImageFromFile(const char* filename)
const u32 size = static_cast<u32>(std::ftell(fp.get()));
std::fseek(fp.get(), 0, SEEK_SET);
if (size != BIOS_SIZE)
// Apparently some PS1/PS2 BIOS revisions found on the PS3 are neither 512KB nor 4MB, so just check within this range
if (size < BIOS_SIZE || size > BIOS_SIZE_PS2)
{
Log_ErrorPrintf("BIOS image '%s' mismatch, expecting %u bytes, got %u bytes", filename, BIOS_SIZE, size);
Log_ErrorPrintf("BIOS image '%s' mismatch, expecting between %u and %u bytes, got %u bytes", filename, BIOS_SIZE,
BIOS_SIZE_PS2, size);
return std::nullopt;
}