From d7140543c55b463aaed14a6f4f0662644cdb3360 Mon Sep 17 00:00:00 2001 From: Arisotura Date: Fri, 23 Apr 2021 22:30:53 +0200 Subject: [PATCH] fix unlaunch 'battery low' error settings still don't survive a reset for some reason --- src/DSi_I2C.cpp | 7 ++++--- src/DSi_SD.cpp | 8 ++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/DSi_I2C.cpp b/src/DSi_I2C.cpp index 16ec1a8a..ad01a42c 100644 --- a/src/DSi_I2C.cpp +++ b/src/DSi_I2C.cpp @@ -79,14 +79,15 @@ void Start() u8 Read(bool last) { + //printf("BPTWL: read %02X -> %02X @ %08X\n", CurPos, Registers[CurPos], NDS::GetPC(1)); + u8 ret = Registers[CurPos++]; + if (last) { CurPos = -1; - return 0; } - //printf("BPTWL: read %02X -> %02X\n", CurPos, Registers[CurPos]); - return Registers[CurPos++]; + return ret; } void Write(u8 val, bool last) diff --git a/src/DSi_SD.cpp b/src/DSi_SD.cpp index aba477d4..c5ccc730 100644 --- a/src/DSi_SD.cpp +++ b/src/DSi_SD.cpp @@ -464,6 +464,10 @@ u16 DSi_SDHost::Read(u32 addr) case 0x102: return 0; case 0x104: return BlockLen32; case 0x108: return BlockCount32; + + // dunno + case 0x106: return 0; + case 0x10A: return 0; } printf("unknown %s read %08X @ %08X\n", SD_DESC, addr, NDS::GetPC(1)); @@ -626,6 +630,10 @@ void DSi_SDHost::Write(u32 addr, u16 val) case 0x102: return; case 0x104: BlockLen32 = val & 0x03FF; return; case 0x108: BlockCount32 = val; return; + + // dunno + case 0x106: return; + case 0x10A: return; } printf("unknown %s write %08X %04X\n", SD_DESC, addr, val);