Skip to content

Commit aaa0282

Browse files
committed
stuff
1 parent 77ed3a5 commit aaa0282

2 files changed

Lines changed: 20 additions & 5 deletions

File tree

src/DSi.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ void DSi::Reset()
147147
crc_full[0] = CRC32(ARM9iBIOS.data(), 0x10000);
148148
crc_full[1] = CRC32(ARM7iBIOS.data(), 0x10000);
149149

150-
bool bios9full = (crc_low[0] != ARM9iBIOSLowCRC32) || (crc_full[0] == ARM9iBIOSCRC32);
151-
bool bios7full = (crc_low[1] != ARM7iBIOSLowCRC32) || (crc_full[1] == ARM7iBIOSCRC32);
150+
bool bios9full = true; //(crc_low[0] != ARM9iBIOSLowCRC32) || (crc_full[0] == ARM9iBIOSCRC32);
151+
bool bios7full = true; //(crc_low[1] != ARM7iBIOSLowCRC32) || (crc_full[1] == ARM7iBIOSCRC32);
152152
FullBIOSBoot = bios9full && bios7full;
153153
Log(LogLevel::Debug, "DSi: full BIOS boot = %d\n", FullBIOSBoot);
154154

src/NDSCart.cpp

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ void NDSCartSlot::Key1_LoadKeyBuf(bool dsimode) noexcept
137137
{
138138
// load from ARM9 BIOS at 0x99A0
139139

140-
const u8* bios = dsi.ARM9iBIOS.data();
141-
memcpy(Key1_KeyBuf.data(), bios + 0x99A0, sizeof(Key1_KeyBuf));
140+
const u8* bios = dsi.ARM7iBIOS.data();
141+
memcpy(Key1_KeyBuf.data(), bios + 0xB688, sizeof(Key1_KeyBuf));
142142
Platform::Log(LogLevel::Debug, "NDSCart: Initialized Key1_KeyBuf from ARM9i BIOS\n");
143143
}
144144
}
@@ -163,9 +163,24 @@ void NDSCartSlot::Key1_LoadKeyBuf(bool dsimode) noexcept
163163

164164
void NDSCartSlot::Key1_InitKeycode(bool dsi, u32 idcode, u32 level, u32 mod) noexcept
165165
{
166+
Key1_LoadKeyBuf(dsi);
167+
u32 keycode[3] = {idcode, idcode>>1, idcode<<1};
168+
//Key1_ApplyKeycode(keycode, mod);
169+
u32 temp[2] = {0,0};
170+
171+
for (u32 i = 0; i <= 0x11; i++)
172+
{
173+
Key1_KeyBuf[i] ^= ByteSwap(keycode[0]);
174+
}
175+
for (u32 i = 0; i <= 0x410; i+=2)
176+
{
177+
Key1_Encrypt(temp);
178+
Key1_KeyBuf[i ] = temp[1];
179+
Key1_KeyBuf[i+1] = temp[0];
180+
}
181+
return;
166182
Key1_LoadKeyBuf(dsi);
167183

168-
u32 keycode[3] = {idcode, idcode>>1, idcode<<1};
169184
if (level >= 1) Key1_ApplyKeycode(keycode, mod);
170185
if (level >= 2) Key1_ApplyKeycode(keycode, mod);
171186
if (level >= 3)

0 commit comments

Comments
 (0)