From 8c516585174d3cc063228e118cce748e47859d3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nathana=C3=ABl=20DOIDI?= Date: Tue, 25 Oct 2016 23:12:05 +0200 Subject: [PATCH] A real support of last NFIRM thanks to @Aurora Wright --- Makefile | 4 ++-- source/firmware.c | 8 ++++---- source/kernel.c | 34 ++++++++++++++++++++++++++++------ source/main.h | 6 +++--- 4 files changed, 37 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 6b84ac7..8aaa94c 100644 --- a/Makefile +++ b/Makefile @@ -32,8 +32,8 @@ ROMFS := $(TOPDIR)/romfs/romfsBuilt ROMFS3DSX := $(TOPDIR)/romfs INCLUDES := $(SOURCES) include ICON := resources/icon.png -BANNER := $(TOPDIR)/resources/FONZD_banner.bnr -#BANNER := $(TOPDIR)/resources/PabloMK7_banner.bnr +#BANNER := $(TOPDIR)/resources/FONZD_banner.bnr +BANNER := $(TOPDIR)/resources/PabloMK7_banner.bnr CITRA_D := "C:/Users/Nath/Desktop/citra" #--------------------------------------------------------------------------------- diff --git a/source/firmware.c b/source/firmware.c index 3603c1e..55fad7a 100644 --- a/source/firmware.c +++ b/source/firmware.c @@ -1,10 +1,10 @@ #include "main.h" #include "config.h" -extern ntrConfig_t *ntrConfig; -extern bootNtrConfig_t *bnConfig; -extern u8 *tmpBuffer; -extern char *g_error; +extern ntrConfig_t *ntrConfig; +extern bootNtrConfig_t *bnConfig; +extern u8 *tmpBuffer; +extern char *g_error; Result bnInitParamsByFirmware(void) { diff --git a/source/kernel.c b/source/kernel.c index 806b879..69e1a09 100644 --- a/source/kernel.c +++ b/source/kernel.c @@ -1,10 +1,10 @@ #include "main.h" #include "config.h" -extern ntrConfig_t *ntrConfig; -extern bootNtrConfig_t *bnConfig; -extern u8 *tmpBuffer; -extern char *g_error; +extern ntrConfig_t *ntrConfig; +extern bootNtrConfig_t *bnConfig; +extern u8 *tmpBuffer; +extern char *g_error; typedef struct { @@ -77,6 +77,15 @@ dbgKernelCacheInterface cacheInterface_NEW111 = (void*)0xFFF202A8 }; +dbgKernelCacheInterface cacheInterface_NEW112 = +{ + //for new 3ds 11.2 + (void*)0xFFF26210, + (void*)0xFFF1DF8C, + (void*)0xFFF1DC34, + (void*)0xFFF202C8 +}; + dbgKernelCacheInterface cacheInterface_Old90 = { //for old 3ds 9.0 @@ -113,6 +122,15 @@ dbgKernelCacheInterface cacheInterface_Old111 = (void*)0xFFF1FCCC }; +dbgKernelCacheInterface cacheInterface_Old112 = +{ + //for old 3ds 11.2 + (void*)0xFFF255C8, + (void*)0xFFF1D7F4, + (void*)0xFFF1D58C, + (void*)0xFFF1FCEC +}; + void kernelCallback(void) { u32 svc_patch_addr = bnConfig->SvcPatchAddr; @@ -134,8 +152,10 @@ void kernelCallback(void) cache = &cacheInterface_NEW102; else if (firmVersion == SYSTEM_VERSION(11, 0, 0)) cache = &cacheInterface_NEW110; - else if (firmVersion == SYSTEM_VERSION(11, 1, 0) || firmVersion == SYSTEM_VERSION(11, 2, 0)) + else if (firmVersion == SYSTEM_VERSION(11, 1, 0)) cache = &cacheInterface_NEW111; + else if (firmVersion == SYSTEM_VERSION(11, 2, 0)) + cache = &cacheInterface_NEW112; } else { @@ -145,8 +165,10 @@ void kernelCallback(void) cache = &cacheInterface_Old96; else if (firmVersion == SYSTEM_VERSION(11, 0, 0)) cache = &cacheInterface_Old110; - else if (firmVersion == SYSTEM_VERSION(11, 1, 0) || firmVersion == SYSTEM_VERSION(11, 2, 0)) + else if (firmVersion == SYSTEM_VERSION(11, 1, 0)) cache = &cacheInterface_Old111; + else if (firmVersion == SYSTEM_VERSION(11, 2, 0)) + cache = &cacheInterface_Old112; } *(int *)(svc_patch_addr + 8) = 0xE1A00000; //NOP *(int *)(svc_patch_addr) = 0xE1A00000; //NOP diff --git a/source/main.h b/source/main.h index 73d4dea..3cf67ff 100644 --- a/source/main.h +++ b/source/main.h @@ -13,10 +13,10 @@ #include "mysvcs.h" #define APP_VERSION_MAJOR 2 -#define APP_VERSION_MINOR 2 +#define APP_VERSION_MINOR 3 #define TIMER 2 -#define CIA_VERSION "BootNTRSelector-FONZD-Banner.cia" -//#define CIA_VERSION "BootNTRSelector-PabloMK7-Banner.cia" +//#define CIA_VERSION "BootNTRSelector-FONZD-Banner.cia" +#define CIA_VERSION "BootNTRSelector-PabloMK7-Banner.cia" #define check_prim(result, err) if ((result) != 0) {g_primary_error = err; \ goto error; }