From 1cb2ca523c35c48e94d7060e0b5d55b535f2d666 Mon Sep 17 00:00:00 2001 From: d0k3 Date: Thu, 7 Dec 2017 02:54:12 +0100 Subject: [PATCH] Proper permission handling for the VRAM drive --- arm9/source/filesys/fsperm.c | 5 ++++- arm9/source/filesys/fsperm.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/arm9/source/filesys/fsperm.c b/arm9/source/filesys/fsperm.c index 21c81f8..dad27a8 100644 --- a/arm9/source/filesys/fsperm.c +++ b/arm9/source/filesys/fsperm.c @@ -62,6 +62,9 @@ bool CheckWritePermissions(const char* path) { } else if (drvtype & DRV_CART) { perm = PERM_CART; snprintf(area_name, 16, "gamecarts"); + } else if (drvtype & DRV_VRAM) { + perm = PERM_VRAM; + snprintf(area_name, 16, "vram0"); } else if (drvtype & DRV_XORPAD) { perm = PERM_XORPAD; snprintf(area_name, 16, "XORpads"); @@ -89,7 +92,7 @@ bool CheckWritePermissions(const char* path) { return true; // offer unlock if possible - if (!(perm & (PERM_CART|PERM_GAME|PERM_XORPAD))) { + if (!(perm & (PERM_VRAM|PERM_CART|PERM_GAME|PERM_XORPAD))) { // ask the user if (!ShowPrompt(true, "Writing to %s is locked!\nUnlock it now?", area_name)) return false; diff --git a/arm9/source/filesys/fsperm.h b/arm9/source/filesys/fsperm.h index 94452cb..b5cabb9 100644 --- a/arm9/source/filesys/fsperm.h +++ b/arm9/source/filesys/fsperm.h @@ -17,6 +17,7 @@ #define PERM_GAME (1UL<<11) // can't be enabled, placeholder #define PERM_XORPAD (1UL<<12) // can't be enabled, placeholder #define PERM_CART (1UL<<13) // can't be enabled, placeholder +#define PERM_VRAM (1UL<<14) // can't be enabled, placeholder #define PERM_BASE (PERM_SDCARD | PERM_IMAGE | PERM_RAMDRIVE | PERM_EMU_LVL0 | PERM_SYS_LVL0) // permission levels / colors