citra_qt: Add a game region column

This commit is contained in:
FearlessTobi 2018-05-01 19:57:01 +02:00
parent 9c65a45358
commit 36c4765054
5 changed files with 81 additions and 0 deletions

View file

@ -48,4 +48,20 @@ std::array<u16, 0x40> SMDH::GetShortTitle(Loader::SMDH::TitleLanguage language)
return titles[static_cast<int>(language)].short_title;
}
SMDH::GameRegion SMDH::GetRegion() const {
if (region_lockout == 0x7fffffff) {
return GameRegion::RegionFree;
}
constexpr u32 REGION_COUNT = 7;
u32 region = 0;
for (; region < REGION_COUNT; ++region) {
if (region_lockout & (1 << region)) {
return static_cast<GameRegion>(region);
}
}
return GameRegion::Invalid;
}
} // namespace Loader