Skip to content
This repository has been archived by the owner on Nov 23, 2017. It is now read-only.

Commit

Permalink
Merge pull request 44670#90 from Steveice10/master
Browse files Browse the repository at this point in the history
Add 11.0.0 FIRM support.
  • Loading branch information
44670 authored Jun 17, 2016
2 parents c416aef + 81a01a7 commit fd8734d
Showing 1 changed file with 58 additions and 6 deletions.
64 changes: 58 additions & 6 deletions source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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 = {
Expand All @@ -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;
Expand All @@ -703,13 +751,17 @@ 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
{
if (firmVersion == SYSTEM_VERSION(9, 0, 0))
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
Expand Down

0 comments on commit fd8734d

Please sign in to comment.