diff --git a/source/fs.c b/source/fs.c index 0dea843..d1ba651 100644 --- a/source/fs.c +++ b/source/fs.c @@ -42,8 +42,7 @@ bool InitExtFS() { } void DeinitExtFS() { - MountImage(NULL); - for (u32 i = NORM_FS; i > 0; i--) { + for (u32 i = NORM_FS - 1; i > 0; i--) { if (fs_mounted[i]) { char fsname[8]; snprintf(fsname, 7, "%lu:", i); @@ -79,7 +78,8 @@ bool CheckWritePermissions(const char* path) { if (pdrv < 0) { if (GetVirtualSource(path)) // this is a hack, but okay for now pdrv = (GetVirtualSource(path) == VRT_MEMORY) ? 10 : - (GetVirtualSource(path) == VRT_SYSNAND) ? 1 : 4; + (GetVirtualSource(path) == VRT_SYSNAND) ? 1 : + (GetVirtualSource(path) == VRT_EMUNAND) ? 4 : 7; else return false; } @@ -100,7 +100,7 @@ bool CheckWritePermissions(const char* path) { return SetWritePermissions(1); return false; } else if (pdrv >= 10) { - ShowPrompt(false, "Writing to memory is forbidden!"); + ShowPrompt(false, "Writing to memory is not allowed!"); return false; } diff --git a/source/godmode.c b/source/godmode.c index 2f80ee4..daba6f7 100644 --- a/source/godmode.c +++ b/source/godmode.c @@ -291,6 +291,7 @@ u32 GodMode() { if ((GetUnitPlatform() == PLATFORM_N3DS) && !CheckSlot0x05Crypto()) { if (!ShowPrompt(true, "Warning: slot0x05 crypto fail!\nCould not set up slot0x05keyY.\nContinue?")) { DeinitExtFS(); + MountImage(NULL); DeinitSDCardFS(); return exit_mode; } @@ -367,6 +368,7 @@ u32 GodMode() { } } else if (switched && (pad_state & BUTTON_B)) { // unmount SD card DeinitExtFS(); + MountImage(NULL); DeinitSDCardFS(); clipboard->n_entries = 0; memset(panedata, 0x00, N_PANES * sizeof(PaneData)); @@ -531,6 +533,7 @@ u32 GodMode() { } DeinitExtFS(); + MountImage(NULL); DeinitSDCardFS(); return exit_mode;