metaforce/DataSpec/SpecBase.cpp

74 lines
1.9 KiB
C++
Raw Normal View History

2015-07-01 16:50:39 -07:00
#include "SpecBase.hpp"
namespace Retro
{
2015-07-16 17:01:05 -07:00
bool SpecBase::canExtract(HECL::Database::Project& project,
const ExtractPassInfo& info, std::vector<ExtractReport>& reps)
2015-07-01 16:50:39 -07:00
{
2015-07-02 13:41:40 -07:00
bool isWii;
2015-07-15 18:57:34 -07:00
m_disc = NOD::OpenDiscFromImage(info.srcpath.c_str(), isWii);
if (!m_disc)
2015-07-02 13:41:40 -07:00
return false;
2015-07-15 18:57:34 -07:00
const char* gameID = m_disc->getHeader().gameID;
2015-07-02 13:41:40 -07:00
2015-07-12 11:07:58 -07:00
bool standalone = true;
2015-07-15 18:57:34 -07:00
if (isWii && !memcmp(gameID, "R3M", 3))
standalone = false;
2015-07-01 16:50:39 -07:00
2015-07-13 18:07:15 -07:00
if (standalone && !checkStandaloneID(gameID))
2015-07-09 22:28:08 -07:00
return false;
2015-07-15 18:57:34 -07:00
char region = m_disc->getHeader().gameID[3];
static const HECL::SystemString regNONE = _S("");
static const HECL::SystemString regE = _S("NTSC");
static const HECL::SystemString regJ = _S("NTSC-J");
static const HECL::SystemString regP = _S("PAL");
const HECL::SystemString* regstr = &regNONE;
2015-07-12 11:07:58 -07:00
switch (region)
{
case 'E':
regstr = &regE;
break;
case 'J':
regstr = &regJ;
break;
case 'P':
regstr = &regP;
break;
}
if (standalone)
2015-07-16 17:01:05 -07:00
return checkFromStandaloneDisc(project, *m_disc.get(), *regstr, info.extractArgs, reps);
2015-07-09 22:28:08 -07:00
else
2015-07-16 17:01:05 -07:00
return checkFromTrilogyDisc(project, *m_disc.get(), *regstr, info.extractArgs, reps);
2015-07-01 16:50:39 -07:00
}
2015-07-16 17:01:05 -07:00
void SpecBase::doExtract(HECL::Database::Project& project, const ExtractPassInfo&)
2015-07-01 16:50:39 -07:00
{
2015-07-16 17:01:05 -07:00
extractFromDisc(project, *m_disc.get());
2015-07-01 16:50:39 -07:00
}
2015-07-05 18:33:06 -07:00
bool SpecBase::canCook(const HECL::Database::Project& project, const CookTaskInfo& info)
2015-07-01 16:50:39 -07:00
{
}
void SpecBase::doCook(const HECL::Database::Project& project, const CookTaskInfo& info)
{
}
2015-07-05 18:33:06 -07:00
bool SpecBase::canPackage(const HECL::Database::Project& project, const PackagePassInfo& info)
2015-07-01 16:50:39 -07:00
{
}
void SpecBase::gatherDependencies(const HECL::Database::Project& project, const PackagePassInfo& info,
std::unordered_set<HECL::ProjectPath>& implicitsOut)
{
}
void SpecBase::doPackage(const HECL::Database::Project& project, const PackagePassInfo& info)
{
}
}