From 1846a712659ed31357e8ae795055dace0bdd951d Mon Sep 17 00:00:00 2001 From: Arisotura Date: Sun, 25 Apr 2021 00:48:02 +0200 Subject: Cart refactor (#1073) complete cart-interface refactor, will make this code a lot easier to deal with --- src/DSi_SD.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/DSi_SD.cpp') diff --git a/src/DSi_SD.cpp b/src/DSi_SD.cpp index aba477d..01b6442 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); @@ -847,8 +855,7 @@ void DSi_MMCStorage::SendCMD(u8 cmd, u32 param) } RWCommand = 18; Host->SendResponse(CSR, true); - ReadBlock(RWAddress); - RWAddress += BlockSize; + RWAddress += ReadBlock(RWAddress); SetState(0x05); return; @@ -862,8 +869,7 @@ void DSi_MMCStorage::SendCMD(u8 cmd, u32 param) } RWCommand = 25; Host->SendResponse(CSR, true); - WriteBlock(RWAddress); - RWAddress += BlockSize; + RWAddress += WriteBlock(RWAddress); SetState(0x04); return; -- cgit v1.2.3