mirror of
https://github.com/d0k3/GodMode9.git
synced 2025-06-26 13:42:47 +00:00
Proper permission handling for the VRAM drive
This commit is contained in:
parent
3dd8a4764e
commit
1cb2ca523c
@ -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;
|
||||||
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user