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

@@ -11,6 +11,9 @@ bool Memory::mapCXI(NCSD& ncsd, NCCH& cxi) {
printf("Data address = %08X, size = %08X\n", cxi.data.address, cxi.data.size);
printf("Stack size: %08X\n", cxi.stackSize);
// Set autodetected 3DS region to one of the values allowed by the CXI's SMDH
region = cxi.region.value();
if (!isAligned(cxi.stackSize)) {
Helpers::warn("CXI has a suspicious stack size of %08X which is not a multiple of 4KB", cxi.stackSize);
}