diff --git a/source/main.cpp b/source/main.cpp index e5a9cd1..29b541c 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -228,11 +228,11 @@ int restore(Flashcart *cart) { for (uint32_t i = 0; i < length; i += chunk_size) { if (!compareBuf(orig_flashrom + i, curr_flashrom + i, chunk_size)) { - iprintf("fail"); + iprintf("\nfail"); goto exit; } } - iprintf("ok"); + iprintf("\nok"); exit: iprintf("\nDone\n\n"); @@ -339,10 +339,9 @@ int main(void) { #ifndef NDSI_MODE if (support_restore) { iprintf(" Restore flash\n"); - iprintf(" Return\n"); - } else { - iprintf(" Exit\n"); + iprintf(" Change cartridge\n"); } + iprintf(" Return\n"); #else iprintf(" Exit\n"); #endif @@ -357,20 +356,30 @@ int main(void) { } #ifndef NDSI_MODE - if (support_restore && (keys & KEY_X)) { - restore(cart); - break; - } - if (keys & KEY_B) { - if (!support_restore) { + if (support_restore) { + if (keys & KEY_X) { + restore(cart); + break; + } + if (keys & KEY_Y) { cart->shutdown(); - return 0; + do { + reset(); + } while(!cart->initialize()); + goto flash_menu; + } + if (keys & KEY_B) { + if (waitConfirmLostDump()) { + cart->shutdown(); + goto select_cart; + } + goto flash_menu; } - if (waitConfirmLostDump()) { + } else { + if (keys & KEY_B) { cart->shutdown(); - goto select_cart; + goto flash_menu; } - goto flash_menu; } #else if (keys & KEY_B) { diff --git a/source/nds_platform.cpp b/source/nds_platform.cpp index 3e70e78..9c5ce86 100644 --- a/source/nds_platform.cpp +++ b/source/nds_platform.cpp @@ -150,6 +150,8 @@ void reset() { iprintf("then reinsert the cartridge.\n\n"); waitPressA(); + + ntrcard::state.status = ntrcard::Status::RAW; #endif ntrcard::sendCommand(dummyCommand, 0x2000, NULL, 32);