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

additional DataSpec imps

This commit is contained in:
Jack Andersen
2015-07-09 19:28:08 -10:00
parent fc6b61a63e
commit 043af55580
17 changed files with 547 additions and 374 deletions

View File

@@ -5,34 +5,41 @@ namespace Retro
LogVisor::LogModule LogModule("RetroDataSpec");
bool SpecBase::canExtract(const ExtractPassInfo& info)
bool SpecBase::canExtract(const ExtractPassInfo& info, std::vector<ExtractReport>& reps)
{
bool isWii;
std::unique_ptr<NOD::DiscBase> disc = NOD::OpenDiscFromImage(info.srcpath.c_str(), 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());
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;
if (isWii)
{
if (!memcmp(gameID, "R3ME01", 6))
return true;
if (!memcmp(gameID, "R3MP01", 6))
return true;
if (!memcmp(gameID, "R3IJ01", 6))
return true;
if (!memcmp(gameID, "R3M", 3))
valid = true;
else if (!memcmp(gameID, "R3IJ01", 6))
valid = true;
}
else
{
if (!memcmp(gameID, "GM8E01", 6))
return true;
if (!memcmp(gameID, "GM8", 3))
valid = true;
}
LogModule.report(LogVisor::Error, "%.6s (%s) is not supported", gameID, disc->getHeader().gameTitle);
return false;
if (!valid)
{
LogModule.report(LogVisor::Error, "%.6s (%s) is not supported", gameID, disc->getHeader().gameTitle);
return false;
}
if (isWii)
return checkFromWiiDisc(*(NOD::DiscWii*)disc.get(), info.extractArgs, reps);
else
return checkFromGCNDisc(*(NOD::DiscGCN*)disc.get(), info.extractArgs, reps);
}
void SpecBase::doExtract(const HECL::Database::Project& project, const ExtractPassInfo& info)