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
This commit is contained in:
Pk11 2021-10-11 14:35:47 -05:00 committed by GitHub
parent 9e1c56fa2d
commit 8de40f23ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 7 deletions

View File

@ -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++) {

View File

@ -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 {