aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/DSi_SD.cpp11
-rw-r--r--src/DSi_SD.h4
2 files changed, 12 insertions, 3 deletions
diff --git a/src/DSi_SD.cpp b/src/DSi_SD.cpp
index 4a7fd2e..fed26b1 100644
--- a/src/DSi_SD.cpp
+++ b/src/DSi_SD.cpp
@@ -532,6 +532,11 @@ void DSi_MMCStorage::SendCMD(u8 cmd, u32 param)
case 18: // read multiple blocks
printf("READ_MULTIPLE_BLOCKS addr=%08X size=%08X\n", param, BlockSize);
RWAddress = param;
+ if (OCR & (1<<30))
+ {
+ RWAddress <<= 9;
+ BlockSize = 512;
+ }
RWCommand = 18;
Host->SendResponse(CSR, true);
ReadBlock(RWAddress);
@@ -563,6 +568,10 @@ void DSi_MMCStorage::SendACMD(u8 cmd, u32 param)
return;
case 41: // set operating conditions
+ // CHECKME:
+ // DSi boot2 sets this to 0x40100000 (hardcoded)
+ // then has two codepaths depending on whether bit30 did get set
+ // is it settable at all on the MMC?
OCR &= 0xBF000000;
OCR |= (param & 0x40FFFFFF);
Host->SendResponse(OCR, true);
@@ -588,7 +597,7 @@ void DSi_MMCStorage::ContinueTransfer()
RWAddress += BlockSize;
}
-void DSi_MMCStorage::ReadBlock(u32 addr)
+void DSi_MMCStorage::ReadBlock(u64 addr)
{
if (!File) return;
diff --git a/src/DSi_SD.h b/src/DSi_SD.h
index 57da7df..3c76872 100644
--- a/src/DSi_SD.h
+++ b/src/DSi_SD.h
@@ -120,12 +120,12 @@ private:
u8 SSR[64];
u32 BlockSize;
- u32 RWAddress;
+ u64 RWAddress;
u32 RWCommand;
void SetState(u32 state) { CSR &= ~(0xF << 9); CSR |= (state << 9); }
- void ReadBlock(u32 addr);
+ void ReadBlock(u64 addr);
};
#endif // DSI_SD_H