Fix config derp, change the logic of the NIM update patch to only be applied when booting with R
This commit is contained in:
parent
277d723992
commit
b74dda42a2
@ -297,8 +297,8 @@ void patchCode(u64 progId, u8 *code, u32 size)
|
|||||||
sizeof(blockAutoUpdatesPatch), 1
|
sizeof(blockAutoUpdatesPatch), 1
|
||||||
);
|
);
|
||||||
|
|
||||||
//Apply only if the updated NAND hasn't been booted
|
//Apply only if the user booted with R
|
||||||
if((BOOTCFG_NAND != 0) == (BOOTCFG_FIRM != 0 && CONFIG_USESYSFIRM))
|
if((BOOTCFG_NAND != 0) != (BOOTCFG_FIRM != 0))
|
||||||
{
|
{
|
||||||
static const u8 skipEshopUpdateCheckPattern[] = {
|
static const u8 skipEshopUpdateCheckPattern[] = {
|
||||||
0x30, 0xB5, 0xF1, 0xB0
|
0x30, 0xB5, 0xF1, 0xB0
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
#define BOOTCFG_FIRM BOOTCONFIG(3, 1)
|
#define BOOTCFG_FIRM BOOTCONFIG(3, 1)
|
||||||
#define BOOTCFG_SAFEMODE BOOTCONFIG(6, 1)
|
#define BOOTCFG_SAFEMODE BOOTCONFIG(6, 1)
|
||||||
#define CONFIG_NEWCPU MULTICONFIG(3)
|
#define CONFIG_NEWCPU MULTICONFIG(3)
|
||||||
#define CONFIG_USESYSFIRM CONFIG(1)
|
|
||||||
#define CONFIG_USELANGEMUANDCODE CONFIG(2)
|
#define CONFIG_USELANGEMUANDCODE CONFIG(2)
|
||||||
#define CONFIG_SHOWNAND CONFIG(3)
|
#define CONFIG_SHOWNAND CONFIG(3)
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ void writeConfig(ConfigurationStatus needConfig, u32 configTemp)
|
|||||||
{
|
{
|
||||||
/* If the configuration is different from previously, overwrite it.
|
/* If the configuration is different from previously, overwrite it.
|
||||||
Just the no-forcing flag being set is not enough */
|
Just the no-forcing flag being set is not enough */
|
||||||
if(needConfig == CREATE_CONFIGURATION || (configTemp & 0xFFFFFFEF) != configData.config)
|
if(needConfig == CREATE_CONFIGURATION || (configTemp & 0xFFFFFFDF) != configData.config)
|
||||||
{
|
{
|
||||||
if(needConfig == CREATE_CONFIGURATION)
|
if(needConfig == CREATE_CONFIGURATION)
|
||||||
{
|
{
|
||||||
@ -57,7 +57,7 @@ void writeConfig(ConfigurationStatus needConfig, u32 configTemp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Merge the new options and new boot configuration
|
//Merge the new options and new boot configuration
|
||||||
configData.config = (configData.config & 0xFFFFFFC0) | (configTemp & 0x3F);
|
configData.config = (configData.config & 0xFFFFFF80) | (configTemp & 0x7F);
|
||||||
|
|
||||||
if(!fileWrite(&configData, CONFIG_PATH, sizeof(CfgData)))
|
if(!fileWrite(&configData, CONFIG_PATH, sizeof(CfgData)))
|
||||||
error("Error writing the configuration file");
|
error("Error writing the configuration file");
|
||||||
|
@ -25,10 +25,10 @@
|
|||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
#define NCSD_MAGIC 0x4453434E
|
#define NCSD_MAGIC 0x4453434E
|
||||||
#define ROUND_TO_4MB(x) (((x) + 0x2000 - 1) & (~(0x2000 - 1)))
|
#define ROUND_TO_4MB(a) (((a) + 0x2000 - 1) & (~(0x2000 - 1)))
|
||||||
|
|
||||||
extern u32 emuOffset;
|
extern u32 emuOffset;
|
||||||
extern bool isN3DS;
|
extern bool isN3DS;
|
||||||
|
|
||||||
void locateEmuNand(u32 *emuHeader, FirmwareSource *emuNand);
|
void locateEmuNand(u32 *emuHeader, FirmwareSource *nandType);
|
||||||
void patchEmuNand(u8 *arm9Section, u32 arm9SectionSize, u8 *process9Offset, u32 process9Size, u32 emuHeader, u32 branchAdditive);
|
void patchEmuNand(u8 *arm9Section, u32 arm9SectionSize, u8 *process9Offset, u32 process9Size, u32 emuHeader, u32 branchAdditive);
|
Reference in New Issue
Block a user