From 8de40f23ac2adfe448a872d1414ad5c9d96ee5de Mon Sep 17 00:00:00 2001 From: Pk11 Date: Mon, 11 Oct 2021 14:35:47 -0500 Subject: [PATCH] Fix freezing on boot on flashcard & getting GBA cart info (#110) * Only check if 3DS in DSi mode * Fix reading GBA cart info * Don't do & on the arrays for the GBA info I don't think it was breaking anything to do that? but it's not needed and I think it might be wrong somehow or other --- arm7/source/main.c | 10 ++++++---- arm9/source/dumpOperations.cpp | 6 +++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/arm7/source/main.c b/arm7/source/main.c index cc3e85c..7656b83 100644 --- a/arm7/source/main.c +++ b/arm7/source/main.c @@ -124,10 +124,12 @@ int main() { setPowerButtonCB(powerButtonCB); // Check for 3DS - u8 byteBak = i2cReadRegister(0x4A, 0x71); - i2cWriteRegister(0x4A, 0x71, 0xD2); - fifoSendValue32(FIFO_USER_05, i2cReadRegister(0x4A, 0x71)); - i2cWriteRegister(0x4A, 0x71, byteBak); + if(isDSiMode()) { + u8 byteBak = i2cReadRegister(0x4A, 0x71); + i2cWriteRegister(0x4A, 0x71, 0xD2); + fifoSendValue32(FIFO_USER_05, i2cReadRegister(0x4A, 0x71)); + i2cWriteRegister(0x4A, 0x71, byteBak); + } if (isDSiMode() /*|| ((REG_SCFG_EXT & BIT(17)) && (REG_SCFG_EXT & BIT(18)))*/) { /*for (int i = 0; i < 8; i++) { diff --git a/arm9/source/dumpOperations.cpp b/arm9/source/dumpOperations.cpp index 2d4355a..b784c1a 100644 --- a/arm9/source/dumpOperations.cpp +++ b/arm9/source/dumpOperations.cpp @@ -804,11 +804,11 @@ void gbaCartDump(void) { mkdir("fat:/gm9i/out", 0777); } char gbaHeaderGameTitle[13] = "\0"; - tonccpy((u8*)(0x080000A0), &gbaHeaderGameTitle, 12); + tonccpy(gbaHeaderGameTitle, (u8*)(0x080000A0), 12); char gbaHeaderGameCode[5] = "\0"; - tonccpy((u8*)(0x080000AC), &gbaHeaderGameCode, 4); + tonccpy(gbaHeaderGameCode, (u8*)(0x080000AC), 4); char gbaHeaderMakerCode[3] = "\0"; - tonccpy((u8*)(0x080000B0), &gbaHeaderMakerCode, 2); + tonccpy(gbaHeaderMakerCode, (u8*)(0x080000B0), 2); if (gbaHeaderGameTitle[0] == 0 || gbaHeaderGameTitle[0] == 0xFF) { sprintf(gbaHeaderGameTitle, "NO-TITLE"); } else {