diff options
-rw-r--r-- | src/DSi.cpp | 10 | ||||
-rw-r--r-- | src/DSi.h | 2 | ||||
-rw-r--r-- | src/NDSCart.cpp | 3 |
3 files changed, 14 insertions, 1 deletions
diff --git a/src/DSi.cpp b/src/DSi.cpp index c1e87b9..db63440 100644 --- a/src/DSi.cpp +++ b/src/DSi.cpp @@ -159,7 +159,7 @@ void Reset() SCFG_Clock7 = 0x0187; SCFG_EXT[0] = 0x8307F100; SCFG_EXT[1] = 0x93FFFB06; - SCFG_MC = 0x0010;//0x0011; + SCFG_MC = 0x0010 | (~((u32)NDSCart::CartInserted)&1);//0x0011; SCFG_RST = 0; DSi_DSP::SetRstLine(false); @@ -248,6 +248,14 @@ void DoSavestate(Savestate* file) SDIO->DoSavestate(file); } +void SetCartInserted(bool inserted) +{ + if (inserted) + SCFG_MC &= ~1; + else + SCFG_MC |= 1; +} + void DecryptModcryptArea(u32 offset, u32 size, u8* iv) { AES_ctx ctx; @@ -59,6 +59,8 @@ void Reset(); void DoSavestate(Savestate* file); +void SetCartInserted(bool inserted); + void SetupDirectBoot(); void SoftReset(); diff --git a/src/NDSCart.cpp b/src/NDSCart.cpp index fe02cb1..a6e16df 100644 --- a/src/NDSCart.cpp +++ b/src/NDSCart.cpp @@ -1679,6 +1679,7 @@ bool LoadROM(const u8* romdata, u32 romlen) } CartInserted = true; + DSi::SetCartInserted(true); u32 irversion = 0; if ((gamecode & 0xFF) == 'I') @@ -1738,6 +1739,8 @@ void EjectCart() CartROMSize = 0; CartID = 0; + DSi::SetCartInserted(false); + // CHECKME: does an eject imply anything for the ROM/SPI transfer registers? } |