diff --git a/Makefile b/Makefile index fcf5b48..6657cf9 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,9 @@ include $(DEVKITARM)/ds_rules # SPECS is the directory containing the important build and link files #--------------------------------------------------------------------------------- export TARGET := GodMode9 +ifeq ($(MODE),safe) + export TARGET := SafeMode9 +endif BUILD := build SOURCES := source source/fatfs source/nand source/abstraction DATA := data @@ -51,6 +54,10 @@ else ifeq ($(EXEC_METHOD),A9LH) LDFLAGS += --specs=../a9lh.specs endif +ifeq ($(MODE),safe) + CFLAGS += -DSAFEMODE +endif + LIBS := #--------------------------------------------------------------------------------- diff --git a/source/fs.c b/source/fs.c index 33b2626..3b97ed2 100644 --- a/source/fs.c +++ b/source/fs.c @@ -123,6 +123,10 @@ bool SetWritePermissions(u32 perm, bool add_perm) { } switch (perm) { + case PERM_BASE: + if (!ShowUnlockSequence(1, "You want to enable base\nwriting permissions.")) + return false; + break; case PERM_SDCARD: if (!ShowUnlockSequence(1, "You want to enable SD card\nwriting permissions.")) return false; @@ -138,6 +142,7 @@ bool SetWritePermissions(u32 perm, bool add_perm) { if (!ShowUnlockSequence(2, "You want to enable image\nwriting permissions.\nKeep backups, just in case.")) return false; break; + #ifndef SAFEMODE case PERM_SYSNAND: if (!ShowUnlockSequence(3, "!This is your only warning!\n \nYou want to enable SysNAND\nwriting permissions.\nThis enables you to do some\nreally dangerous stuff!\nHaving a SysNAND backup and\nNANDmod is recommended.")) return false; @@ -146,10 +151,6 @@ bool SetWritePermissions(u32 perm, bool add_perm) { if (!ShowUnlockSequence(4, "!Better be careful!\n \nYou want to enable memory\nwriting permissions.\nWriting to certain areas may\nlead to unexpected results.")) return false; break; - case PERM_BASE: - if (!ShowUnlockSequence(1, "You want to enable base\nwriting permissions.")) - return false; - break; case PERM_ALL: if (!ShowUnlockSequence(3, "!This is your only warning!\n \nYou want to enable ALL\nwriting permissions.\nThis enables you to do some\nreally dangerous stuff!\nHaving a SysNAND backup and\nNANDmod is recommended.")) return false; @@ -157,6 +158,17 @@ bool SetWritePermissions(u32 perm, bool add_perm) { default: return false; break; + #else + case PERM_ALL: + perm &= ~(PERM_SYSNAND|PERM_MEMORY); + if (!ShowUnlockSequence(2, "You want to enable EmuNAND &\nimage writing permissions.\nKeep backups, just in case.")) + return false; + break; + default: + ShowPrompt(false, "Can't unlock write permission.\nTry GodMode9 instead!"); + return false; + break; + #endif } write_permissions = add_perm ? write_permissions | perm : perm; diff --git a/source/godmode.c b/source/godmode.c index 18f1e8f..dde6ad2 100644 --- a/source/godmode.c +++ b/source/godmode.c @@ -104,7 +104,11 @@ void DrawUserInterface(const char* curr_path, DirEntry* curr_entry, DirStruct* c // bottom: inctruction block char instr[256]; snprintf(instr, 256, "%s%s\n%s%s%s%s%s%s", + #ifndef SAFEMODE "GodMode9 Explorer v", VERSION, // generic start part + #else + "SafeMode9 Explorer v", VERSION, // generic start part + #endif (*curr_path) ? ((clipboard->n_entries == 0) ? "L - MARK files (use with \x18\x19\x1A\x1B)\nX - DELETE / [+R] RENAME file(s)\nY - COPY file(s) / [+R] CREATE dir\n" : "L - MARK files (use with \x18\x19\x1A\x1B)\nX - DELETE / [+R] RENAME file(s)\nY - PASTE file(s) / [+R] CREATE dir\n") : ((GetWritePermissions() > PERM_BASE) ? "R+Y - Relock write permissions\nR+B - Unmount SD card\n" :