Handle buffers via common.h file

This commit is contained in:
d0k3 2016-11-21 20:04:46 +01:00
parent 314ea7793d
commit b70761e6aa
5 changed files with 24 additions and 15 deletions

View File

@ -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;

View File

@ -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

View File

@ -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 };

View File

@ -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

View File

@ -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