aboutsummaryrefslogtreecommitdiff
path: root/src/ARM.h
diff options
context:
space:
mode:
authorRSDuck <rsduck@users.noreply.github.com>2020-05-09 00:45:05 +0200
committerRSDuck <rsduck@users.noreply.github.com>2020-05-09 00:45:05 +0200
commit0f53a34551d60964345debb1766f81ca4686eb17 (patch)
treec3d004adff258e1060e72076e829c99cd49b368c /src/ARM.h
parentbcc4b5c8dda5ec91127808a525e2b7dbda41a4f3 (diff)
rewrite JIT memory emulation
Diffstat (limited to 'src/ARM.h')
-rw-r--r--src/ARM.h24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/ARM.h b/src/ARM.h
index 4877956..f64b7fe 100644
--- a/src/ARM.h
+++ b/src/ARM.h
@@ -308,7 +308,7 @@ public:
void DataRead8(u32 addr, u32* val)
{
*val = NDS::ARM7Read8(addr);
- DataRegion = addr >> 20;
+ DataRegion = addr;
DataCycles = NDS::ARM7MemTimings[addr >> 15][0];
}
@@ -317,7 +317,7 @@ public:
addr &= ~1;
*val = NDS::ARM7Read16(addr);
- DataRegion = addr >> 20;
+ DataRegion = addr;
DataCycles = NDS::ARM7MemTimings[addr >> 15][0];
}
@@ -326,7 +326,7 @@ public:
addr &= ~3;
*val = NDS::ARM7Read32(addr);
- DataRegion = addr >> 20;
+ DataRegion = addr;
DataCycles = NDS::ARM7MemTimings[addr >> 15][2];
}
@@ -341,7 +341,7 @@ public:
void DataWrite8(u32 addr, u8 val)
{
NDS::ARM7Write8(addr, val);
- DataRegion = addr >> 20;
+ DataRegion = addr;
DataCycles = NDS::ARM7MemTimings[addr >> 15][0];
}
@@ -350,7 +350,7 @@ public:
addr &= ~1;
NDS::ARM7Write16(addr, val);
- DataRegion = addr >> 20;
+ DataRegion = addr;
DataCycles = NDS::ARM7MemTimings[addr >> 15][0];
}
@@ -359,7 +359,7 @@ public:
addr &= ~3;
NDS::ARM7Write32(addr, val);
- DataRegion = addr >> 20;
+ DataRegion = addr;
DataCycles = NDS::ARM7MemTimings[addr >> 15][2];
}
@@ -390,7 +390,7 @@ public:
s32 numC = NDS::ARM7MemTimings[CodeCycles][(CPSR&0x20)?0:2];
s32 numD = DataCycles;
- if ((DataRegion >> 4) == 0x02) // mainRAM
+ if ((DataRegion >> 24) == 0x02) // mainRAM
{
if (CodeRegion == 0x02)
Cycles -= numC + numD;
@@ -417,7 +417,7 @@ public:
s32 numC = NDS::ARM7MemTimings[CodeCycles][(CPSR&0x20)?0:2];
s32 numD = DataCycles;
- if ((DataRegion >> 4) == 0x02)
+ if ((DataRegion >> 24) == 0x02)
{
if (CodeRegion == 0x02)
Cycles -= numC + numD;
@@ -443,4 +443,12 @@ void T_UNK(ARM* cpu);
}
+namespace NDS
+{
+
+extern ARMv5* ARM9;
+extern ARMv4* ARM7;
+
+}
+
#endif // ARM_H