Switch to enums for the options
This commit is contained in:
@@ -28,7 +28,7 @@ static void patchMemory(u8 *start, u32 size, const void *pattern, u32 patSize, i
|
||||
|
||||
static int fileOpen(IFile *file, FS_ArchiveID archiveId, const char *path, int flags)
|
||||
{
|
||||
FS_Path filePath = {PATH_ASCII, strnlen(path, PATH_MAX) + 1, path},
|
||||
FS_Path filePath = {PATH_ASCII, strnlen(path, 255) + 1, path},
|
||||
archivePath = {PATH_EMPTY, 1, (u8 *)""};
|
||||
|
||||
return IFile_Open(file, archiveId, archivePath, filePath, flags);
|
||||
@@ -342,7 +342,7 @@ void patchCode(u64 progId, u8 *code, u32 size)
|
||||
case 0x0004001000027000LL: // KOR MSET
|
||||
case 0x0004001000028000LL: // TWN MSET
|
||||
{
|
||||
if(CONFIG_SHOWNAND)
|
||||
if(CONFIG(SHOWNAND))
|
||||
{
|
||||
static const u16 verPattern[] = u"Ver.";
|
||||
const u32 currentNand = BOOTCFG_NAND;
|
||||
@@ -397,7 +397,7 @@ void patchCode(u64 progId, u8 *code, u32 size)
|
||||
sizeof(stopCartUpdatesPatch), 2
|
||||
);
|
||||
|
||||
u32 cpuSetting = CONFIG_NEWCPU;
|
||||
u32 cpuSetting = MULTICONFIG(NEWCPU);
|
||||
|
||||
if(cpuSetting != 0)
|
||||
{
|
||||
@@ -498,7 +498,7 @@ void patchCode(u64 progId, u8 *code, u32 size)
|
||||
#ifdef DEV
|
||||
case 0x0004003000008A02LL: // ErrDisp
|
||||
{
|
||||
if(CONFIG_DEVOPTIONS == 0)
|
||||
if(MULTICONFIG(DEVOPTIONS) == 0)
|
||||
{
|
||||
static const u8 unitinfoCheckPattern1[] = {
|
||||
0x14, 0x00, 0xD0, 0xE5, 0xDB
|
||||
@@ -532,7 +532,7 @@ void patchCode(u64 progId, u8 *code, u32 size)
|
||||
#endif
|
||||
|
||||
default:
|
||||
if(CONFIG_USELANGEMUANDCODE)
|
||||
if(CONFIG(USELANGEMUANDCODE))
|
||||
{
|
||||
u32 tidHigh = (progId & 0xFFFFFFF000000000LL) >> 0x24;
|
||||
|
||||
|
||||
@@ -2,21 +2,38 @@
|
||||
|
||||
#include <3ds/types.h>
|
||||
|
||||
#define PATH_MAX 255
|
||||
|
||||
#define CONFIG(a) (((info.config >> (a + 21)) & 1) != 0)
|
||||
#define MULTICONFIG(a) ((info.config >> (a * 2 + 7)) & 3)
|
||||
#define BOOTCONFIG(a, b) ((info.config >> a) & b)
|
||||
|
||||
#define BOOTCFG_NAND BOOTCONFIG(0, 7)
|
||||
#define BOOTCFG_FIRM BOOTCONFIG(3, 1)
|
||||
#define BOOTCFG_SAFEMODE BOOTCONFIG(6, 1)
|
||||
#define CONFIG_NEWCPU MULTICONFIG(3)
|
||||
#define CONFIG_USELANGEMUANDCODE CONFIG(2)
|
||||
#define CONFIG_SHOWNAND CONFIG(3)
|
||||
#define BOOTCFG_NAND BOOTCONFIG(0, 7)
|
||||
#define BOOTCFG_FIRM BOOTCONFIG(3, 1)
|
||||
#define BOOTCFG_A9LH BOOTCONFIG(4, 1)
|
||||
#define BOOTCFG_NOFORCEFLAG BOOTCONFIG(5, 1)
|
||||
#define BOOTCFG_SAFEMODE BOOTCONFIG(6, 1)
|
||||
|
||||
enum multiOptions
|
||||
{
|
||||
DEFAULTEMU = 0,
|
||||
BRIGHTNESS,
|
||||
PIN,
|
||||
NEWCPU
|
||||
#ifdef DEV
|
||||
#define CONFIG_DEVOPTIONS MULTICONFIG(4)
|
||||
, DEVOPTIONS
|
||||
#endif
|
||||
};
|
||||
|
||||
enum singleOptions
|
||||
{
|
||||
AUTOBOOTSYS = 0,
|
||||
USESYSFIRM,
|
||||
USELANGEMUANDCODE,
|
||||
SHOWNAND,
|
||||
SHOWGBABOOT,
|
||||
PAYLOADSPLASH
|
||||
#ifdef DEV
|
||||
, PATCHACCESS
|
||||
#endif
|
||||
};
|
||||
|
||||
void patchCode(u64 progId, u8 *code, u32 size);
|
||||
Reference in New Issue
Block a user