aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/NDS.cpp70
1 files changed, 70 insertions, 0 deletions
diff --git a/src/NDS.cpp b/src/NDS.cpp
index f67cb84..de21eb6 100644
--- a/src/NDS.cpp
+++ b/src/NDS.cpp
@@ -2728,11 +2728,37 @@ u8 NDS::ARM9IORead8(u32 addr)
case 0x04000132: return KeyCnt[0] & 0xFF;
case 0x04000133: return KeyCnt[0] >> 8;
+ case 0x040001A0:
+ if (!(ExMemCnt[0] & (1<<11)))
+ return NDSCartSlot.GetSPICnt() & 0xFF;
+ return 0;
+ case 0x040001A1:
+ if (!(ExMemCnt[0] & (1<<11)))
+ return NDSCartSlot.GetSPICnt() >> 8;
+ return 0;
+
case 0x040001A2:
if (!(ExMemCnt[0] & (1<<11)))
return NDSCartSlot.ReadSPIData();
return 0;
+ case 0x040001A4:
+ if (!(ExMemCnt[0] & (1<<11)))
+ return NDSCartSlot.GetROMCnt() & 0xFF;
+ return 0;
+ case 0x040001A5:
+ if (!(ExMemCnt[0] & (1<<11)))
+ return (NDSCartSlot.GetROMCnt() >> 8) & 0xFF;
+ return 0;
+ case 0x040001A6:
+ if (!(ExMemCnt[0] & (1<<11)))
+ return (NDSCartSlot.GetROMCnt() >> 16) & 0xFF;
+ return 0;
+ case 0x040001A7:
+ if (!(ExMemCnt[0] & (1<<11)))
+ return NDSCartSlot.GetROMCnt() >> 24;
+ return 0;
+
case 0x040001A8:
if (!(ExMemCnt[0] & (1<<11)))
return NDSCartSlot.GetROMCommand(0);
@@ -2884,6 +2910,15 @@ u16 NDS::ARM9IORead16(u32 addr)
return NDSCartSlot.ReadSPIData();
return 0;
+ case 0x040001A4:
+ if (!(ExMemCnt[0] & (1<<11)))
+ return NDSCartSlot.GetROMCnt() & 0xFFFF;
+ return 0;
+ case 0x040001A6:
+ if (!(ExMemCnt[0] & (1<<11)))
+ return NDSCartSlot.GetROMCnt() >> 16;
+ return 0;
+
case 0x040001A8:
if (!(ExMemCnt[0] & (1<<11)))
return NDSCartSlot.GetROMCommand(0) |
@@ -3592,11 +3627,37 @@ u8 NDS::ARM7IORead8(u32 addr)
case 0x04000138: return RTC.Read() & 0xFF;
+ case 0x040001A0:
+ if (ExMemCnt[0] & (1<<11))
+ return NDSCartSlot.GetSPICnt() & 0xFF;
+ return 0;
+ case 0x040001A1:
+ if (ExMemCnt[0] & (1<<11))
+ return NDSCartSlot.GetSPICnt() >> 8;
+ return 0;
+
case 0x040001A2:
if (ExMemCnt[0] & (1<<11))
return NDSCartSlot.ReadSPIData();
return 0;
+ case 0x040001A4:
+ if (ExMemCnt[0] & (1<<11))
+ return NDSCartSlot.GetROMCnt() & 0xFF;
+ return 0;
+ case 0x040001A5:
+ if (ExMemCnt[0] & (1<<11))
+ return (NDSCartSlot.GetROMCnt() >> 8) & 0xFF;
+ return 0;
+ case 0x040001A6:
+ if (ExMemCnt[0] & (1<<11))
+ return (NDSCartSlot.GetROMCnt() >> 16) & 0xFF;
+ return 0;
+ case 0x040001A7:
+ if (ExMemCnt[0] & (1<<11))
+ return NDSCartSlot.GetROMCnt() >> 24;
+ return 0;
+
case 0x040001A8:
if (ExMemCnt[0] & (1<<11))
return NDSCartSlot.GetROMCommand(0);
@@ -3697,6 +3758,15 @@ u16 NDS::ARM7IORead16(u32 addr)
case 0x040001A0: if (ExMemCnt[0] & (1<<11)) return NDSCartSlot.GetSPICnt(); return 0;
case 0x040001A2: if (ExMemCnt[0] & (1<<11)) return NDSCartSlot.ReadSPIData(); return 0;
+ case 0x040001A4:
+ if (ExMemCnt[0] & (1<<11))
+ return NDSCartSlot.GetROMCnt() & 0xFFFF;
+ return 0;
+ case 0x040001A6:
+ if (ExMemCnt[0] & (1<<11))
+ return NDSCartSlot.GetROMCnt() >> 16;
+ return 0;
+
case 0x040001A8:
if (ExMemCnt[0] & (1<<11))
return NDSCartSlot.GetROMCommand(0) |