Get rid of the PIN on/off toggle and add an Off status to the multi option, change the config layout to allow for more multi options, add macros for all options

This commit is contained in:
Aurora
2016-09-04 13:40:46 +02:00
parent 97ae8d2d44
commit 2b4e97bec5
9 changed files with 54 additions and 34 deletions

View File

@@ -95,7 +95,7 @@ static void loadCFWInfo(void)
svcGetCFWInfo(&info);
IFile file;
if(BOOTCONFIG(5, 1) && R_SUCCEEDED(fileOpen(&file, ARCHIVE_SDMC, "/", FS_OPEN_READ))) //Init SD card if SAFE_MODE is being booted
if(BOOTCFG_SAFEMODE && R_SUCCEEDED(fileOpen(&file, ARCHIVE_SDMC, "/", FS_OPEN_READ))) //Init SD card if SAFE_MODE is being booted
IFile_Close(&file);
infoLoaded = true;
@@ -360,7 +360,7 @@ void patchCode(u64 progId, u8 *code, u32 size)
);
//Apply only if the updated NAND hasn't been booted
if((BOOTCONFIG(0, 3) != 0) == (BOOTCONFIG(2, 1) && CONFIG(1)))
if((BOOTCFG_NAND != 0) == (BOOTCFG_FIRM != 0 && CONFIG_USESYSFIRM))
{
static const u8 skipEshopUpdateCheckPattern[] = {
0x30, 0xB5, 0xF1, 0xB0
@@ -404,7 +404,7 @@ void patchCode(u64 progId, u8 *code, u32 size)
case 0x0004001000027000LL: // KOR MSET
case 0x0004001000028000LL: // TWN MSET
{
if(CONFIG(4))
if(CONFIG_SHOWNAND)
{
static const u16 verPattern[] = u"Ver.";
const u32 currentNand = BOOTCONFIG(0, 3);
@@ -440,7 +440,7 @@ void patchCode(u64 progId, u8 *code, u32 size)
sizeof(stopCartUpdatesPatch), 2
);
u32 cpuSetting = MULTICONFIG(2);
u32 cpuSetting = CONFIG_NEWCPU;
if(cpuSetting)
{
@@ -539,7 +539,7 @@ void patchCode(u64 progId, u8 *code, u32 size)
}
default:
if(CONFIG(3))
if(CONFIG_USELANGEMUANDCODE)
{
u32 tidHigh = (progId & 0xFFFFFFF000000000LL) >> 0x24;

View File

@@ -4,8 +4,16 @@
#define PATH_MAX 255
#define CONFIG(a) (((info.config >> (a + 16)) & 1) != 0)
#define CONFIG(a) (((info.config >> (a + 20)) & 1) != 0)
#define MULTICONFIG(a) ((info.config >> (a * 2 + 6)) & 3)
#define BOOTCONFIG(a, b) ((info.config >> a) & b)
#define BOOTCFG_NAND BOOTCONFIG(0, 3)
#define BOOTCFG_FIRM BOOTCONFIG(2, 1)
#define BOOTCFG_SAFEMODE BOOTCONFIG(5, 1)
#define CONFIG_NEWCPU MULTICONFIG(2)
#define CONFIG_USESYSFIRM CONFIG(1)
#define CONFIG_USELANGEMUANDCODE CONFIG(3)
#define CONFIG_SHOWNAND CONFIG(4)
void patchCode(u64 progId, u8 *code, u32 size);