Skip to content

Commit

Permalink
[libromdata] GameCube: Some SDK-generated disc images have a slightly…
Browse files Browse the repository at this point in the history
… different header.
  • Loading branch information
GerbilSoft committed Sep 14, 2022
1 parent 9f2ab7d commit 0126a28
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/libromdata/Console/GameCube.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1181,6 +1181,8 @@ int GameCube::isRomSupported_static(const DetectInfo *info)
// TODO: More comprehensive?
// TODO: Checksum at 0x0830. (For GCN, makeGCM always puts 0xAB0B here...)
static const uint32_t sdk_0x0000 = 0xFFFF0000; // BE32
// TODO: Some RVMs have extended headers at 0x0800, but not the 0x082C value.
static const uint32_t sdk_0x0820 = 0x0002F000; // BE32
static const uint32_t sdk_0x082C = 0x0000E006; // BE32
const uint32_t *const pData32 =
reinterpret_cast<const uint32_t*>(info->header.pData);
Expand All @@ -1190,7 +1192,9 @@ int GameCube::isRomSupported_static(const DetectInfo *info)
return (GameCubePrivate::DISC_SYSTEM_UNKNOWN | GameCubePrivate::DISC_FORMAT_SDK);
}

if (pData32[0x082C/4] == cpu_to_be32(sdk_0x082C)) {
if (pData32[0x082C/4] == cpu_to_be32(sdk_0x082C) ||
pData32[0x0820/4] == cpu_to_be32(sdk_0x0820))
{
// This is a valid GCN/Wii SDK disc image header.
return (GameCubePrivate::DISC_SYSTEM_UNKNOWN | GameCubePrivate::DISC_FORMAT_SDK);
}
Expand Down

0 comments on commit 0126a28

Please sign in to comment.