diff --git a/source/common.h b/source/common.h index 7563d8c..65f9712 100644 --- a/source/common.h +++ b/source/common.h @@ -36,6 +36,27 @@ ((((u64) getle32(d+4))<<32) | ((u64) getle32(d))) #define align(v,a) \ (((v) % (a)) ? ((v) + (a) - ((v) % (a))) : (v)) + +// GodMode9 version +#define VERSION "0.7.4" + +// buffer area defines (in use by godmode.c) +#define DIR_BUFFER (0x21000000) +#define WORK_BUFFER ((u8*)0x21100000) +#define DIR_BUFFER_SIZE (0x100000) +#define WORK_BUFFER_SIZE (0x100000) +// buffer area defines (in use by fs.c) +#define MAIN_BUFFER ((u8*)0x21200000) +#define MAIN_BUFFER_SIZE (0x100000) // must be multiple of 0x200 +// buffer area defines (in use by nand.c) +#define NAND_BUFFER ((u8*)0x21300000) +#define NAND_BUFFER_SIZE (0x100000) // must be multiple of 0x200 +// buffer area defines (in use by sddata.c) +#define SDCRYPT_BUFFER ((u8*)0x21400000) +#define SDCRYPT_BUFFER_SIZE (0x100000) +// buffer area defines (in use by cia.c) +#define GAME_BUFFER ((u8*)0x21500000) +#define GAME_BUFFER_SIZE (0x100000) inline u32 strchrcount(const char* str, char symbol) { u32 count = 0; diff --git a/source/fs.c b/source/fs.c index d744be1..f1261a1 100644 --- a/source/fs.c +++ b/source/fs.c @@ -7,9 +7,6 @@ #include "sdmmc.h" #include "ff.h" -#define MAIN_BUFFER ((u8*)0x21200000) -#define MAIN_BUFFER_SIZE (0x100000) // must be multiple of 0x200 - #define NORM_FS 10 #define VIRT_FS 7 diff --git a/source/godmode.c b/source/godmode.c index 3e7afdf..43954fb 100644 --- a/source/godmode.c +++ b/source/godmode.c @@ -7,12 +7,8 @@ #include "virtual.h" #include "image.h" -#define VERSION "0.7.3" - #define N_PANES 2 -#define WORK_BUFFER ((u8*)0x21100000) - #define COLOR_TOP_BAR ((GetWritePermissions() & (PERM_A9LH&~PERM_SYSNAND)) ? COLOR_DARKRED : (GetWritePermissions() & PERM_SYSNAND) ? COLOR_RED : (GetWritePermissions() & PERM_MEMORY) ? COLOR_BRIGHTBLUE : (GetWritePermissions() & (PERM_EMUNAND|PERM_IMAGE)) ? COLOR_BRIGHTYELLOW : GetWritePermissions() ? COLOR_BRIGHTGREEN : COLOR_WHITE) #define COLOR_SIDE_BAR COLOR_DARKGREY #define COLOR_MARKED COLOR_TINTEDYELLOW @@ -522,9 +518,9 @@ u32 GodMode() { u32 exit_mode = GODMODE_EXIT_REBOOT; // reserve 480kB for DirStruct, 64kB for PaneData, just to be safe - static DirStruct* current_dir = (DirStruct*) 0x21000000; - static DirStruct* clipboard = (DirStruct*) 0x21078000; - static PaneData* panedata = (PaneData*) 0x210F0000; + static DirStruct* current_dir = (DirStruct*) (DIR_BUFFER + 0x00000); + static DirStruct* clipboard = (DirStruct*) (DIR_BUFFER + 0x78000); + static PaneData* panedata = (PaneData*) (DIR_BUFFER + 0xF0000); PaneData* pane = panedata; char current_path[256] = { 0x00 }; diff --git a/source/nand/nand.c b/source/nand/nand.c index 5ffe9f9..93c66c6 100644 --- a/source/nand/nand.c +++ b/source/nand/nand.c @@ -6,8 +6,6 @@ #include "nand.h" #include "image.h" -#define NAND_BUFFER ((u8*)0x21300000) -#define NAND_BUFFER_SIZE (0x100000) // must be multiple of 0x200 #define NAND_MIN_SECTORS ((GetUnitPlatform() == PLATFORM_N3DS) ? 0x26C000 : 0x1D7800) static u8 slot0x05KeyY[0x10] = { 0x00 }; // need to load this from FIRM0 / external file diff --git a/source/virtual/sddata.c b/source/virtual/sddata.c index 94ba797..ebca9a1 100644 --- a/source/virtual/sddata.c +++ b/source/virtual/sddata.c @@ -2,9 +2,6 @@ #include "aes.h" #include "sha.h" -#define SDCRYPT_BUFFER ((u8*)0x21400000) -#define SDCRYPT_BUFFER_SIZE (0x100000) - #define NUM_ALIAS_DRV 2 #define NUM_FILCRYPTINFO 16