Fix config derp, change the logic of the NIM update patch to only be applied when booting with R

This commit is contained in:
Aurora 2016-09-08 13:32:49 +02:00
parent 277d723992
commit b74dda42a2
4 changed files with 6 additions and 7 deletions

View File

@ -297,8 +297,8 @@ void patchCode(u64 progId, u8 *code, u32 size)
sizeof(blockAutoUpdatesPatch), 1
);
//Apply only if the updated NAND hasn't been booted
if((BOOTCFG_NAND != 0) == (BOOTCFG_FIRM != 0 && CONFIG_USESYSFIRM))
//Apply only if the user booted with R
if((BOOTCFG_NAND != 0) != (BOOTCFG_FIRM != 0))
{
static const u8 skipEshopUpdateCheckPattern[] = {
0x30, 0xB5, 0xF1, 0xB0

View File

@ -12,7 +12,6 @@
#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(2)
#define CONFIG_SHOWNAND CONFIG(3)

View File

@ -47,7 +47,7 @@ void writeConfig(ConfigurationStatus needConfig, u32 configTemp)
{
/* If the configuration is different from previously, overwrite it.
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)
{
@ -57,7 +57,7 @@ void writeConfig(ConfigurationStatus needConfig, u32 configTemp)
}
//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)))
error("Error writing the configuration file");

View File

@ -25,10 +25,10 @@
#include "types.h"
#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 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);