Proper permission handling for the VRAM drive

This commit is contained in:
d0k3 2017-12-07 02:54:12 +01:00
parent 3dd8a4764e
commit 1cb2ca523c
2 changed files with 5 additions and 1 deletions

View File

@ -62,6 +62,9 @@ bool CheckWritePermissions(const char* path) {
} else if (drvtype & DRV_CART) { } else if (drvtype & DRV_CART) {
perm = PERM_CART; perm = PERM_CART;
snprintf(area_name, 16, "gamecarts"); snprintf(area_name, 16, "gamecarts");
} else if (drvtype & DRV_VRAM) {
perm = PERM_VRAM;
snprintf(area_name, 16, "vram0");
} else if (drvtype & DRV_XORPAD) { } else if (drvtype & DRV_XORPAD) {
perm = PERM_XORPAD; perm = PERM_XORPAD;
snprintf(area_name, 16, "XORpads"); snprintf(area_name, 16, "XORpads");
@ -89,7 +92,7 @@ bool CheckWritePermissions(const char* path) {
return true; return true;
// offer unlock if possible // 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 // ask the user
if (!ShowPrompt(true, "Writing to %s is locked!\nUnlock it now?", area_name)) if (!ShowPrompt(true, "Writing to %s is locked!\nUnlock it now?", area_name))
return false; return false;

View File

@ -17,6 +17,7 @@
#define PERM_GAME (1UL<<11) // can't be enabled, placeholder #define PERM_GAME (1UL<<11) // can't be enabled, placeholder
#define PERM_XORPAD (1UL<<12) // 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_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) #define PERM_BASE (PERM_SDCARD | PERM_IMAGE | PERM_RAMDRIVE | PERM_EMU_LVL0 | PERM_SYS_LVL0)
// permission levels / colors // permission levels / colors