aboutsummaryrefslogtreecommitdiff
path: root/src/NDSCart.cpp
diff options
context:
space:
mode:
authorArisotura <thetotalworm@gmail.com>2020-06-01 20:36:30 +0200
committerArisotura <thetotalworm@gmail.com>2020-06-01 20:36:30 +0200
commit43e045357f7d74eecff61b0c8af8068b31e963b3 (patch)
treee01071eeb88dd83adaeaa1c8eef9f4e545813e2b /src/NDSCart.cpp
parentd7b846619b7f1d392b7b5644ddf856290b44e7e1 (diff)
make it able to switch between DS and DSi modes
Diffstat (limited to 'src/NDSCart.cpp')
-rw-r--r--src/NDSCart.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/NDSCart.cpp b/src/NDSCart.cpp
index 9497d33..b326dd6 100644
--- a/src/NDSCart.cpp
+++ b/src/NDSCart.cpp
@@ -561,11 +561,18 @@ void Key1_ApplyKeycode(u32* keycode, u32 mod)
void Key1_InitKeycode(bool dsi, u32 idcode, u32 level, u32 mod)
{
- //memcpy(Key1_KeyBuf, &NDS::ARM7BIOS[0x30], 0x1048); // hax
- if (dsi)
- memcpy(Key1_KeyBuf, &DSi::ARM7Init[0x254], 0x1048); // hax
+ // TODO: source the key data from different possible places
+ if (NDS::ConsoleType == 1)
+ {
+ if (dsi)
+ memcpy(Key1_KeyBuf, &DSi::ARM7Init[0x254], 0x1048); // hax
+ else
+ memcpy(Key1_KeyBuf, &DSi::ITCMInit[0x4894], 0x1048); // hax
+ }
else
- memcpy(Key1_KeyBuf, &DSi::ITCMInit[0x4894], 0x1048); // hax
+ {
+ memcpy(Key1_KeyBuf, &NDS::ARM7BIOS[0x30], 0x1048); // hax
+ }
u32 keycode[3] = {idcode, idcode>>1, idcode<<1};
if (level >= 1) Key1_ApplyKeycode(keycode, mod);