aboutsummaryrefslogtreecommitdiff
path: root/src/NDS.cpp
diff options
context:
space:
mode:
authorArisotura <thetotalworm@gmail.com>2024-01-17 18:50:08 +0100
committerArisotura <thetotalworm@gmail.com>2024-01-17 18:50:08 +0100
commitf4c8202b1a4a094680e9e84329bef88c2fc65885 (patch)
tree2fcd2baec55e1d0d51c48729db8483658ba9666a /src/NDS.cpp
parent740305cc25d7bebd40076d6588097cb4de2f4ef8 (diff)
add missing 8/16-bit reads to ROMCnt and ROM SPICnt
Diffstat (limited to 'src/NDS.cpp')
-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) |