Added support for up to 4 emuNANDs (the "second emuNAND as default" toggle is now a multi option, and you can choose the emuNAND on startup by holding Up (1)/Right (2)/Down (3)/Left (4) when EmuNAND is being booted), added a B payload as the B button was freed
This commit is contained in:
@@ -345,15 +345,34 @@ void patchCode(u64 progId, u8 *code, u32 size)
|
||||
if(CONFIG_SHOWNAND)
|
||||
{
|
||||
static const u16 verPattern[] = u"Ver.";
|
||||
const u32 currentNand = BOOTCONFIG(0, 3);
|
||||
const u32 matchingFirm = BOOTCONFIG(2, 1) == (currentNand != 0);
|
||||
const u32 currentNand = BOOTCFG_NAND;
|
||||
const u32 matchingFirm = BOOTCFG_FIRM == (currentNand != 0);
|
||||
|
||||
u16 *verString;
|
||||
switch(currentNand)
|
||||
{
|
||||
case 1:
|
||||
verString = matchingFirm ? u" Emu" : u"EmuS";
|
||||
break;
|
||||
case 2:
|
||||
verString = matchingFirm ? u"Emu2" : u"Em2S";
|
||||
break;
|
||||
case 3:
|
||||
verString = matchingFirm ? u"Emu3" : u"Em3S";
|
||||
break;
|
||||
case 4:
|
||||
verString = matchingFirm ? u"Emu4" : u"Em4S";
|
||||
break;
|
||||
default:
|
||||
verString = matchingFirm ? u" Sys" : u"SysE";
|
||||
break;
|
||||
}
|
||||
|
||||
//Patch Ver. string
|
||||
patchMemory(code, size,
|
||||
verPattern,
|
||||
sizeof(verPattern) - sizeof(u16), 0,
|
||||
!currentNand ? ((matchingFirm) ? u" Sys" : u"SysE") :
|
||||
((currentNand == 1) ? (matchingFirm ? u" Emu" : u"EmuS") : ((matchingFirm) ? u"Emu2" : u"Em2S")),
|
||||
verString,
|
||||
sizeof(verPattern) - sizeof(u16), 1
|
||||
);
|
||||
}
|
||||
|
||||
@@ -4,16 +4,16 @@
|
||||
|
||||
#define PATH_MAX 255
|
||||
|
||||
#define CONFIG(a) (((info.config >> (a + 20)) & 1) != 0)
|
||||
#define MULTICONFIG(a) ((info.config >> (a * 2 + 6)) & 3)
|
||||
#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, 3)
|
||||
#define BOOTCFG_FIRM BOOTCONFIG(2, 1)
|
||||
#define BOOTCFG_SAFEMODE BOOTCONFIG(5, 1)
|
||||
#define CONFIG_NEWCPU MULTICONFIG(2)
|
||||
#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_USESYSFIRM CONFIG(1)
|
||||
#define CONFIG_USELANGEMUANDCODE CONFIG(3)
|
||||
#define CONFIG_SHOWNAND CONFIG(4)
|
||||
#define CONFIG_USELANGEMUANDCODE CONFIG(2)
|
||||
#define CONFIG_SHOWNAND CONFIG(3)
|
||||
|
||||
void patchCode(u64 progId, u8 *code, u32 size);
|
||||
Reference in New Issue
Block a user