From 81a01a7d802c7fe54b34d5fd5c106b3dab9e162c Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Thu, 16 Jun 2016 22:50:31 -0700 Subject: [PATCH] Add 11.0.0 FIRM support. --- source/main.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 58 insertions(+), 6 deletions(-) diff --git a/source/main.c b/source/main.c index e784d2e..ea54055 100644 --- a/source/main.c +++ b/source/main.c @@ -223,6 +223,26 @@ void bnInitParamsByFirmware() { bnConfig->FSPatchAddr = 0x0010EFAC; bnConfig->SMPatchAddr = 0x0010189C; + ntrConfig->IoBasePad = 0xfffc6000; + ntrConfig->IoBaseLcd = 0xfffc8000; + ntrConfig->IoBasePdc = 0xfffc0000; + ntrConfig->KMMUHaxAddr = 0xfffbe000; + ntrConfig->KMMUHaxSize = 0x00010000; + ntrConfig->KProcessHandleDataOffset = 0xD4; + ntrConfig->KProcessPIDOffset = 0xB4; + ntrConfig->KProcessCodesetOffset = 0xB0; + } + if (kernelVersion == SYSTEM_VERSION(2, 51, 0)) { + // old3ds 11.0.0 + ntrConfig->firmVersion = SYSTEM_VERSION(11, 0, 0); + ntrConfig->PMSvcRunAddr = 0x00103154; + ntrConfig->ControlMemoryPatchAddr1 = 0xDFF88468; + ntrConfig->ControlMemoryPatchAddr2 = 0xDFF8846C; + + bnConfig->SvcPatchAddr = 0xDFF82288; + bnConfig->FSPatchAddr = 0x0010EED4; + bnConfig->SMPatchAddr = 0x0010189C; + ntrConfig->IoBasePad = 0xfffc6000; ntrConfig->IoBaseLcd = 0xfffc8000; ntrConfig->IoBasePdc = 0xfffc0000; @@ -306,6 +326,18 @@ void bnInitParamsByFirmware() { bnConfig->FSPatchAddr = 0x0010EED4; bnConfig->SMPatchAddr = 0x0010189C; } + + if (kernelVersion == SYSTEM_VERSION(2, 51, 0)) { + // new3ds 11.0 + ntrConfig->firmVersion = SYSTEM_VERSION(11, 0, 0); + ntrConfig->PMSvcRunAddr = 0x00103150; + ntrConfig->ControlMemoryPatchAddr1 = 0xDFF88598; + ntrConfig->ControlMemoryPatchAddr2 = 0xDFF8859C; + + bnConfig->SvcPatchAddr = 0xDFF8226C; + bnConfig->FSPatchAddr = 0x0010EED4; + bnConfig->SMPatchAddr = 0x0010189C; + } } bnConfig->requireKernelHax = 0; } @@ -667,12 +699,12 @@ dbgKernelCacheInterface cacheInterface_NEW102 = { (void*)0xFFF1FCE8 }; -dbgKernelCacheInterface cacheInterface_Old96 = { - //for old 3ds 9.6 - (void*)0xFFF24FF0, - (void*)0xFFF1CF98, - (void*)0xFFF1CD30, - (void*)0xFFF1F748 +dbgKernelCacheInterface cacheInterface_NEW110 = { + //for new 3ds 11.0 + (void*)0xFFF26174, + (void*)0xFFF1DEF0, + (void*)0xFFF1DB98, + (void*)0xFFF2022C }; dbgKernelCacheInterface cacheInterface_Old90 = { @@ -683,6 +715,22 @@ dbgKernelCacheInterface cacheInterface_Old90 = { (void*)0xFFF1F47C }; +dbgKernelCacheInterface cacheInterface_Old96 = { + //for old 3ds 9.6 + (void*)0xFFF24FF0, + (void*)0xFFF1CF98, + (void*)0xFFF1CD30, + (void*)0xFFF1F748 +}; + +dbgKernelCacheInterface cacheInterface_Old110 = { + //for old 3ds 11.0 + (void*)0xFFF2552C, + (void*)0xFFF1D758, + (void*)0xFFF1D4F0, + (void*)0xFFF1FC50 +}; + void kernelCallback() { u32 svc_patch_addr = g_bnConfig.SvcPatchAddr; vu32 i; @@ -703,6 +751,8 @@ void kernelCallback() { cache = &cacheInterface_NEW96; else if (firmVersion == SYSTEM_VERSION(10, 2, 0)) cache = &cacheInterface_NEW102; + else if (firmVersion == SYSTEM_VERSION(11, 0, 0)) + cache = &cacheInterface_NEW110; } else { @@ -710,6 +760,8 @@ void kernelCallback() { cache = &cacheInterface_Old90; else if (firmVersion == SYSTEM_VERSION(9, 6, 0)) cache = &cacheInterface_Old96; + else if (firmVersion == SYSTEM_VERSION(11, 0, 0)) + cache = &cacheInterface_Old110; } *(int *)(svc_patch_addr + 8) = 0xE1A00000; //NOP *(int *)(svc_patch_addr) = 0xE1A00000; //NOP