Skip to content

Commit

Permalink
Update romSizeLimit to account for 480KB of (unmirrored) DSi WRAM
Browse files Browse the repository at this point in the history
  • Loading branch information
RocketRobz committed Aug 31, 2024
1 parent 363c3c7 commit fd29cfc
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions romsel_aktheme/arm9/source/perGameSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,8 @@ void perGameSettings (std::string filename) {
}
}

u32 romSizeLimit = (ms().consoleModel > 0 ? 0x1BC0000 : 0xBC0000);
u32 romSizeLimitTwl = (ms().consoleModel > 0 ? 0x1000000 : 0);
const u32 romSizeLimit = (ms().consoleModel > 0 ? 0x1BC0000 : 0xBC0000) + ((sys().dsiWramAccess() && !sys().dsiWramMirrored()) ? 0x78000 : 0);
const u32 romSizeLimitTwl = (ms().consoleModel > 0 ? 0x1000000 : 0);

extern bool dsiWareCompatibleB4DS(void);
bool showPerGameSettings = (bnrRomType[cursorPosOnScreen] == 0 && !isDSiWare[cursorPosOnScreen]);
Expand Down
4 changes: 2 additions & 2 deletions romsel_dsimenutheme/arm9/source/perGameSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,8 @@ void perGameSettings (std::string filename) {
}
}

u32 romSizeLimit = (ms().consoleModel > 0 ? 0x1BC0000 : 0xBC0000);
u32 romSizeLimitTwl = (ms().consoleModel > 0 ? 0x1000000 : 0);
const u32 romSizeLimit = (ms().consoleModel > 0 ? 0x1BC0000 : 0xBC0000) + ((sys().dsiWramAccess() && !sys().dsiWramMirrored()) ? 0x78000 : 0);
const u32 romSizeLimitTwl = (ms().consoleModel > 0 ? 0x1000000 : 0);

extern bool dsiWareCompatibleB4DS(void);
bool showPerGameSettings = (bnrRomType[CURPOS] == 0 && !isDSiWare[CURPOS]);
Expand Down
4 changes: 2 additions & 2 deletions romsel_r4theme/arm9/source/perGameSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,8 @@ void perGameSettings (std::string filename) {
}
}

u32 romSizeLimit = (ms().consoleModel > 0 ? 0x1BC0000 : 0xBC0000);
u32 romSizeLimitTwl = (ms().consoleModel > 0 ? 0x1000000 : 0);
const u32 romSizeLimit = (ms().consoleModel > 0 ? 0x1BC0000 : 0xBC0000) + ((sys().dsiWramAccess() && !sys().dsiWramMirrored()) ? 0x78000 : 0);
const u32 romSizeLimitTwl = (ms().consoleModel > 0 ? 0x1000000 : 0);

extern bool dsiWareCompatibleB4DS(void);
bool showPerGameSettings = (bnrRomType == 0 && !isDSiWare);
Expand Down
2 changes: 2 additions & 0 deletions universal/include/common/systemdetails.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class SystemDetails
};

bool dsiWramAccess() { return _dsiWramAccess; }
bool dsiWramMirrored() { return _dsiWramMirrored; }
bool arm7SCFGLocked() { return _arm7SCFGLocked; }
bool isRunFromSD() { return _isRunFromSD; }
bool isRegularDS() { return _isRegularDS; }
Expand All @@ -37,6 +38,7 @@ class SystemDetails

private:
bool _dsiWramAccess;
bool _dsiWramMirrored;
bool _arm7SCFGLocked;
bool _isRunFromSD;
bool _isRegularDS;
Expand Down
2 changes: 2 additions & 0 deletions universal/source/common/systemdetails.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ SystemDetails::SystemDetails()

_isRunFromSD = false;
_dsiWramAccess = false;
_dsiWramMirrored = false;
_arm7SCFGLocked = false;
_isRegularDS = true;
_isDSPhat = false;
Expand All @@ -49,6 +50,7 @@ SystemDetails::SystemDetails()
u32 wordBak = *(vu32*)0x03700000;
*(vu32*)0x03700000 = 0x414C5253;
_dsiWramAccess = *(vu32*)0x03700000 == 0x414C5253;
_dsiWramMirrored = (*(vu32*)0x03700000 == 0x414C5253 && *(vu32*)0x03708000 == 0x414C5253);
*(vu32*)0x03700000 = wordBak;
}

Expand Down

0 comments on commit fd29cfc

Please sign in to comment.