diff --git a/src/ARM.cpp b/src/ARM.cpp index f15ce741..a2e00664 100644 --- a/src/ARM.cpp +++ b/src/ARM.cpp @@ -171,8 +171,9 @@ void ARM::JumpTo(u32 addr, bool restorecpsr) else addr &= ~0x1; } - if (addr == 0x0201764C) printf("capture test %d: R1=%08X\n", R[6], R[1]); - if (addr == 0x020175D8) printf("capture test %d: res=%08X\n", R[6], R[0]); + // aging cart debug crap + //if (addr == 0x0201764C) printf("capture test %d: R1=%08X\n", R[6], R[1]); + //if (addr == 0x020175D8) printf("capture test %d: res=%08X\n", R[6], R[0]); if (addr & 0x1) { diff --git a/src/NDSCart.cpp b/src/NDSCart.cpp index 29da046a..615390bd 100644 --- a/src/NDSCart.cpp +++ b/src/NDSCart.cpp @@ -268,7 +268,45 @@ void Write_Null(u8 val, bool islast) {} void Write_EEPROMTiny(u8 val, bool islast) { - // TODO + switch (CurCmd) + { + case 0x02: + case 0x0A: + if (DataPos < 1) + { + Addr = val; + Data = 0; + } + else + { + SRAM[(Addr & 0xFF) | ((CurCmd==0x0A)?0x100:0)] = val; + Addr++; + } + break; + + case 0x03: + case 0x0B: + if (DataPos < 1) + { + Addr = val; + Data = 0; + } + else + { + Data = SRAM[(Addr & 0xFF) | ((CurCmd==0x0B)?0x100:0)]; + Addr++; + } + break; + + case 0x9F: + Data = 0xFF; + break; + + default: + if (DataPos==0) + printf("unknown tiny EEPROM save command %02X\n", CurCmd); + break; + } } void Write_EEPROM(u8 val, bool islast)