Skip to content
This repository has been archived by the owner on Jan 11, 2021. It is now read-only.

Commit

Permalink
11.4 support
Browse files Browse the repository at this point in the history
  • Loading branch information
44670 committed May 11, 2017
1 parent 078ea1d commit ae1c3fa
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 8 deletions.
25 changes: 23 additions & 2 deletions source/firmware.c
@@ -1,6 +1,5 @@
#include "main.h"


extern NTR_CONFIG *ntrConfig;
extern BOOTNTR_CONFIG *bnConfig;
extern u8 *tmpBuffer;
Expand Down Expand Up @@ -99,6 +98,17 @@ Result bnInitParamsByFirmware(void)
bnConfig->FSPatchAddr = 0x0010F024;
bnConfig->SMPatchAddr = 0x0010189C;
}
else if (kernelVersion == SYSTEM_VERSION(2, 54, 0))
{
// old3ds 11.4.0
ntrConfig->firmVersion = SYSTEM_VERSION(11, 4, 0);
ntrConfig->PMSvcRunAddr = 0x00103154;
ntrConfig->ControlMemoryPatchAddr1 = 0xDFF88514;
ntrConfig->ControlMemoryPatchAddr2 = 0xDFF88518;
bnConfig->SvcPatchAddr = 0xDFF82288;
bnConfig->FSPatchAddr = 0x0010F024;
bnConfig->SMPatchAddr = 0x0010189C;
}
else
goto unsupported;
}
Expand Down Expand Up @@ -218,6 +228,17 @@ Result bnInitParamsByFirmware(void)
bnConfig->FSPatchAddr = 0x0010F024;
bnConfig->SMPatchAddr = 0x0010189C;
}
else if (kernelVersion == SYSTEM_VERSION(2, 54, 0))
{
// new3ds 11.4
ntrConfig->firmVersion = SYSTEM_VERSION(11, 4, 0);
ntrConfig->PMSvcRunAddr = 0x00103150;
ntrConfig->ControlMemoryPatchAddr1 = 0xDFF8862C;
ntrConfig->ControlMemoryPatchAddr2 = 0xDFF88630;
bnConfig->SvcPatchAddr = 0xDFF8226C;
bnConfig->FSPatchAddr = 0x0010F024;
bnConfig->SMPatchAddr = 0x0010189C;
}
else
goto unsupported;
}
Expand All @@ -226,4 +247,4 @@ Result bnInitParamsByFirmware(void)
unsupported:
ntrConfig->firmVersion = 0;
return (RESULT_ERROR);
}
}
32 changes: 27 additions & 5 deletions source/kernel.c
Expand Up @@ -93,6 +93,15 @@ dbgKernelCacheInterface cacheInterface_NEW113 =
(void*)0XFFF20498
};

dbgKernelCacheInterface cacheInterface_NEW114 =
{
//for new 3ds 11.4
(void*)0xFFF27480,
(void*)0xFFF1E1DC,
(void*)0xFFF1DE84,
(void*)0xFFF20518
};

dbgKernelCacheInterface cacheInterface_Old90 =
{
//for old 3ds 9.0
Expand Down Expand Up @@ -141,10 +150,19 @@ dbgKernelCacheInterface cacheInterface_Old112 =
dbgKernelCacheInterface cacheInterface_Old113 =
{
//for old 3ds 11.3
(void*)0XFFF257D0,
(void*)0XFFF1D9DC,
(void*)0XFFF1D774,
(void*)0XFFF1FED4
(void*)0xFFF257D0,
(void*)0xFFF1D9DC,
(void*)0xFFF1D774,
(void*)0xFFF1FED4
};

dbgKernelCacheInterface cacheInterface_Old114 =
{
//for old 3ds 11.4
(void*)0xFFF25850,
(void*)0xFFF1DA5C,
(void*)0xFFF1D7F4,
(void*)0xFFF1FF54
};

void kernelCallback(void)
Expand Down Expand Up @@ -174,6 +192,8 @@ void kernelCallback(void)
cache = &cacheInterface_NEW112;
else if (firmVersion == SYSTEM_VERSION(11, 3, 0))
cache = &cacheInterface_NEW113;
else if (firmVersion == SYSTEM_VERSION(11, 4, 0))
cache = &cacheInterface_NEW114;
}
else
{
Expand All @@ -189,6 +209,8 @@ void kernelCallback(void)
cache = &cacheInterface_Old112;
else if (firmVersion == SYSTEM_VERSION(11, 3, 0))
cache = &cacheInterface_Old113;
else if (firmVersion == SYSTEM_VERSION(11, 4, 0))
cache = &cacheInterface_Old114;
}
*(int *)(svc_patch_addr + 8) = 0xE1A00000; //NOP
*(int *)(svc_patch_addr) = 0xE1A00000; //NOP
Expand All @@ -198,4 +220,4 @@ void kernelCallback(void)
cache->invalidateDataCache((void *)svc_patch_addr, 0x10);//
cache->flushInstructionCache((void *)(svc_patch_addr - 0xDFF80000 + 0xFFF00000), 0x10);//
}
}
}
2 changes: 1 addition & 1 deletion source/main.c
Expand Up @@ -564,7 +564,7 @@ int main() {
consoleInit(GFX_BOTTOM, NULL);


printf("BootNTR 3.1\n");
printf("BootNTR 3.2\n");
ntrConfig = &g_ntrConfig;
bnConfig = &g_bnConfig;
ret = bnBootNTR();
Expand Down

0 comments on commit ae1c3fa

Please sign in to comment.