Remove invalid IPL hashes (NTSC-U and NTSC-J use same IPL)

See https://bugs.dolphin-emu.org/issues/11467. We now only have
the hashes that have been confirmed on Redump.

For the reference, MAME's list of bad GameCube IPL dumps:
80b2ca6088/src/mame/drivers/gamecube.cpp (L152-L158)
This commit is contained in:
JosJuice 2019-03-24 13:58:17 +01:00
parent 0b3385ac1f
commit d42fa8f80e
1 changed files with 19 additions and 36 deletions

View File

@ -284,25 +284,12 @@ bool CBoot::LoadMapFromFilename()
// It does not initialize the hardware or anything else like BS1 does. // It does not initialize the hardware or anything else like BS1 does.
bool CBoot::Load_BS2(const std::string& boot_rom_filename) bool CBoot::Load_BS2(const std::string& boot_rom_filename)
{ {
// CRC32 hashes of the IPL file; including source where known // CRC32 hashes of the IPL file, obtained from Redump
// https://forums.dolphin-emu.org/Thread-unknown-hash-on-ipl-bin?pid=385344#pid385344 constexpr u32 NTSC_v1_0 = 0x6DAC1F2A;
constexpr u32 USA_v1_0 = 0x6D740AE7; constexpr u32 NTSC_v1_1 = 0xD5E6FEEA;
// https://forums.dolphin-emu.org/Thread-unknown-hash-on-ipl-bin?pid=385334#pid385334 constexpr u32 NTSC_v1_2 = 0x86573808;
constexpr u32 USA_v1_1 = 0xD5E6FEEA; constexpr u32 MPAL_v1_1 = 0x667D0B64; // Brazil
// https://forums.dolphin-emu.org/Thread-unknown-hash-on-ipl-bin?pid=385399#pid385399
constexpr u32 USA_v1_2 = 0x86573808;
// GameCubes sold in Brazil have this IPL. Same as USA v1.2 but localized
constexpr u32 BRA_v1_0 = 0x667D0B64;
// Redump
constexpr u32 JAP_v1_0 = 0x6DAC1F2A;
// https://bugs.dolphin-emu.org/issues/8936
constexpr u32 JAP_v1_1 = 0xD235E3F9;
constexpr u32 JAP_v1_2 = 0x8BDABBD4;
// Redump
constexpr u32 PAL_v1_0 = 0x4F319F43; constexpr u32 PAL_v1_0 = 0x4F319F43;
// https://forums.dolphin-emu.org/Thread-ipl-with-unknown-hash-dd8cab7c-problem-caused-by-my-pal-gamecube-bios?pid=435463#pid435463
constexpr u32 PAL_v1_1 = 0xDD8CAB7C;
// Redump
constexpr u32 PAL_v1_2 = 0xAD1B7F16; constexpr u32 PAL_v1_2 = 0xAD1B7F16;
// Load the whole ROM dump // Load the whole ROM dump
@ -313,36 +300,32 @@ bool CBoot::Load_BS2(const std::string& boot_rom_filename)
// Use zlibs crc32 implementation to compute the hash // Use zlibs crc32 implementation to compute the hash
u32 ipl_hash = crc32(0L, Z_NULL, 0); u32 ipl_hash = crc32(0L, Z_NULL, 0);
ipl_hash = crc32(ipl_hash, (const Bytef*)data.data(), (u32)data.size()); ipl_hash = crc32(ipl_hash, (const Bytef*)data.data(), (u32)data.size());
DiscIO::Region ipl_region; bool known_ipl = false;
bool pal_ipl = false;
switch (ipl_hash) switch (ipl_hash)
{ {
case USA_v1_0: case NTSC_v1_0:
case USA_v1_1: case NTSC_v1_1:
case USA_v1_2: case NTSC_v1_2:
case BRA_v1_0: case MPAL_v1_1:
ipl_region = DiscIO::Region::NTSC_U; known_ipl = true;
break;
case JAP_v1_0:
case JAP_v1_1:
case JAP_v1_2:
ipl_region = DiscIO::Region::NTSC_J;
break; break;
case PAL_v1_0: case PAL_v1_0:
case PAL_v1_1:
case PAL_v1_2: case PAL_v1_2:
ipl_region = DiscIO::Region::PAL; pal_ipl = true;
known_ipl = true;
break; break;
default: default:
PanicAlertT("IPL with unknown hash %x", ipl_hash); PanicAlertT("The IPL file is not a known good dump. (CRC32: %x)", ipl_hash);
ipl_region = DiscIO::Region::Unknown;
break; break;
} }
const DiscIO::Region boot_region = SConfig::GetInstance().m_region; const DiscIO::Region boot_region = SConfig::GetInstance().m_region;
if (ipl_region != DiscIO::Region::Unknown && boot_region != ipl_region) if (known_ipl && pal_ipl != (boot_region == DiscIO::Region::PAL))
{
PanicAlertT("%s IPL found in %s directory. The disc might not be recognized", PanicAlertT("%s IPL found in %s directory. The disc might not be recognized",
SConfig::GetDirectoryForRegion(ipl_region), pal_ipl ? "PAL" : "NTSC", SConfig::GetDirectoryForRegion(boot_region));
SConfig::GetDirectoryForRegion(boot_region)); }
// Run the descrambler over the encrypted section containing BS1/BS2 // Run the descrambler over the encrypted section containing BS1/BS2
ExpansionInterface::CEXIIPL::Descrambler((u8*)data.data() + 0x100, 0x1AFE00); ExpansionInterface::CEXIIPL::Descrambler((u8*)data.data() + 0x100, 0x1AFE00);