From 84664a6ded536573ce2f20a551531453511357af Mon Sep 17 00:00:00 2001 From: StapleButter Date: Mon, 10 Apr 2017 20:56:22 +0200 Subject: [PATCH] =?UTF-8?q?bypass=20first=20save=20command=20byte=20when?= =?UTF-8?q?=20it's=20zero.=20for=20Pok=C3=A9mon=20games.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/NDSCart.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/NDSCart.cpp b/src/NDSCart.cpp index 68c6fe7c..69102b50 100644 --- a/src/NDSCart.cpp +++ b/src/NDSCart.cpp @@ -471,6 +471,13 @@ void Write(u8 val, u32 hold) switch (CurCmd) { + case 0x00: + // Pokémon carts have an IR transceiver thing, and send this + // to bypass it and access SRAM. + // TODO: design better + CurCmd = val; + break; + case 0x02: case 0x03: case 0x0A: @@ -495,8 +502,8 @@ void Write(u8 val, u32 hold) break; default: - //if (DataPos==0) - // printf("unknown save SPI command %02X %08X\n", CurCmd); + if (DataPos==0) + printf("unknown save SPI command %02X %08X\n", CurCmd); break; }