2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 03:47:43 +00:00

fixed standalone game detection

This commit is contained in:
Jack Andersen
2015-07-13 15:07:15 -10:00
parent 31f77497fd
commit 91f5236109
5 changed files with 29 additions and 21 deletions

View File

@@ -10,35 +10,18 @@ bool SpecBase::canExtract(const ExtractPassInfo& info, std::vector<ExtractReport
bool isWii;
std::unique_ptr<NOD::DiscBase> disc = NOD::OpenDiscFromImage(info.srcpath.c_str(), isWii);
if (!disc)
{
LogModule.report(LogVisor::Error, _S("'%s' not a valid Nintendo disc image"), info.srcpath.c_str());
return false;
}
const char* gameID = disc->getHeader().gameID;
bool valid = false;
bool standalone = true;
if (isWii)
{
if (!memcmp(gameID, "R3M", 3))
{
valid = true;
standalone = false;
}
else if (!memcmp(gameID, "R3IJ01", 6))
valid = true;
}
else
{
if (!memcmp(gameID, "GM8", 3))
valid = true;
}
if (!valid)
{
LogModule.report(LogVisor::Error, "%.6s (%s) is not supported", gameID, disc->getHeader().gameTitle);
if (standalone && !checkStandaloneID(gameID))
return false;
}
char region = disc->getHeader().gameID[3];
static const HECL::SystemString regNONE = _S("");