Do not read NDS cart info if Slot-1 flashcard is mounted

Fixes lockup when highlighting Slot-1 FAT
This commit is contained in:
RocketRobz 2022-01-02 23:16:20 -07:00
parent 248d0244f3
commit c7fefecdcc
4 changed files with 29 additions and 1 deletions

View File

@ -236,7 +236,7 @@ void driveMenu (void) {
if ((io_dldi_data->ioInterface.features & FEATURE_SLOT_GBA)
|| (isDSiMode() && !arm7SCFGLocked && !(REG_SCFG_MC & BIT(0)))) {
dmOperations.push_back(DriveMenuOperation::ndsCard);
if(romTitle[0] == 0) {
if(romTitle[0] == 0 && ((io_dldi_data->ioInterface.features & FEATURE_SLOT_GBA) || !flashcardMounted)) {
sNDSHeaderExt ndsHeader;
cardInit(&ndsHeader);
tonccpy(romTitle, ndsHeader.gameTitle, 12);

View File

@ -530,7 +530,33 @@ void ndsCardSaveRestore(const char *filename) {
}
void ndsCardDump(void) {
u16 pressed;
font->clear(false);
if ((io_dldi_data->ioInterface.features & FEATURE_SLOT_NDS) && flashcardMounted) {
font->print(0, 0, false, STR_FLASHCARD_WILL_UNMOUNT);
font->print(0, 3, false, STR_A_YES_B_NO);
font->update(false);
while (true) {
// Print time
font->print(-1, 0, true, RetTime(), Alignment::right, Palette::blackGreen);
font->update(true);
scanKeys();
pressed = keysDownRepeat();
swiWaitForVBlank();
if (pressed & KEY_A) {
font->clear(false);
flashcardUnmount();
break;
}
if (pressed & KEY_B) {
return;
}
}
}
font->print(0, 0, false, STR_LOADING);
font->update(false);

View File

@ -127,6 +127,7 @@ STRING(PRESS_B_TO_CANCEL, "Press \\B to cancel")
STRING(EOF_NO_RESULTS, "Reached end of file\nwith no results")
// Dumping
STRING(FLASHCARD_WILL_UNMOUNT, "Flashcard will be unmounted.\nIs this okay?")
STRING(DUMP_TO, "Dump \"%s\" to\n\"%s:/gm9i/out\"?")
STRING(DUMP_ALL, "All")
STRING(DUMP_ALL_TRIMMED, "All (Trimmed ROM)")

View File

@ -119,6 +119,7 @@ SEARCHING=Searching
PRESS_B_TO_CANCEL=Press \B to cancel
EOF_NO_RESULTS=Reached end of file\nwith no results
FLASHCARD_WILL_UNMOUNT=Flashcard will be unmounted.\nIs this okay?
DUMP_TO=Dump "%s" to\n"%s:/gm9i/out"?
DUMP_ALL=All
DUMP_ALL_TRIMMED=All (Trimmed ROM)