Switch to enums for the options

This commit is contained in:
Aurora
2016-09-11 19:17:56 +02:00
parent 63160a22a6
commit da0adeb39e
9 changed files with 85 additions and 59 deletions

View File

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