Skip to content

Commit

Permalink
Bug fix: Do not run GBA-related code in DSi mode
Browse files Browse the repository at this point in the history
  • Loading branch information
RocketRobz committed Oct 7, 2018
1 parent 634dc5d commit 8a9af49
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
20 changes: 14 additions & 6 deletions arm9/source/driveMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ void driveMenu (void) {
flashcardMountRan = false;
}

gbaFixedValue = *(u8*)(0x080000B2);
if (!isDSiMode() && isRegularDS) {
gbaFixedValue = *(u8*)(0x080000B2);
}

if (!dmTextPrinted) {
consoleInit(NULL, 1, BgType_Text4bpp, BgSize_T_256x256, 15, 0, false, true);
Expand Down Expand Up @@ -216,11 +218,17 @@ void driveMenu (void) {
pressed = keysDownRepeat();
held = keysHeld();
swiWaitForVBlank();

if ((REG_SCFG_MC != stored_SCFG_MC)
|| (*(u8*)(0x080000B2) != gbaFixedValue)) {
dmTextPrinted = false;
break;

if (!isDSiMode() && isRegularDS) {
if (*(u8*)(0x080000B2) != gbaFixedValue) {
dmTextPrinted = false;
break;
}
} else if (isDSiMode()) {
if (REG_SCFG_MC != stored_SCFG_MC) {
dmTextPrinted = false;
break;
}
}
} while (!(pressed & KEY_UP) && !(pressed & KEY_DOWN) && !(pressed & KEY_A) && !(held & KEY_R));

Expand Down
9 changes: 7 additions & 2 deletions arm9/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ int main(int argc, char **argv) {

int pathLen;
std::string filename;

bool yHeld = false;

snprintf(titleName, sizeof(titleName), "GodMode9i v%i.%i.%i", 1, 1, 0);

Expand Down Expand Up @@ -125,10 +127,13 @@ int main(int argc, char **argv) {
sysSetCartOwner (BUS_OWNER_ARM9); // Allow arm9 to access GBA ROM

if (isDSiMode()) {
scanKeys();
if (keysHeld() & KEY_Y) {
yHeld = true;
}
sdMounted = sdMount();
}
scanKeys();
if (!isDSiMode() || !(keysHeld() & KEY_Y)) {
if (!isDSiMode() || !yHeld) {
flashcardMounted = flashcardMount();
flashcardMountSkipped = false;
}
Expand Down

0 comments on commit 8a9af49

Please sign in to comment.