Implement 3DS region auto-detect

This commit is contained in:
wheremyfoodat 2023-08-13 18:08:22 +03:00
parent b896d9a4aa
commit 408dbe75a0
6 changed files with 84 additions and 0 deletions

View file

@ -59,6 +59,9 @@ void Memory::reset() {
readTable[i + initialPage] = pointer;
writeTable[i + initialPage] = pointer;
}
// Later adjusted based on ROM header when possible
region = Regions::USA;
}
bool Memory::allocateMainThreadStack(u32 size) {
@ -472,3 +475,9 @@ u64 Memory::timeSince3DSEpoch() {
milliseconds ms = duration_cast<milliseconds>(seconds(rawTime + timezoneDifference + offset));
return ms.count();
}
Regions Memory::getConsoleRegion() {
// TODO: Let the user force the console region as they want
// For now we pick one based on the ROM header
return region;
}