Allow coyping between image virtual <-> other virtual

This commit is contained in:
d0k3 2016-04-10 14:50:58 +02:00
parent c641da35f0
commit 393b764945
2 changed files with 7 additions and 4 deletions

View File

@ -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;
}

View File

@ -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;