aboutsummaryrefslogtreecommitdiff
path: root/src/ARM.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ARM.h')
-rw-r--r--src/ARM.h32
1 files changed, 22 insertions, 10 deletions
diff --git a/src/ARM.h b/src/ARM.h
index b9f5d89..e0832e2 100644
--- a/src/ARM.h
+++ b/src/ARM.h
@@ -132,6 +132,14 @@ public:
NDS::MemRegion CodeMem;
static u32 ConditionTable[16];
+
+protected:
+ u8 (*BusRead8)(u32 addr);
+ u16 (*BusRead16)(u32 addr);
+ u32 (*BusRead32)(u32 addr);
+ void (*BusWrite8)(u32 addr, u8 val);
+ void (*BusWrite16)(u32 addr, u16 val);
+ void (*BusWrite32)(u32 addr, u32 val);
};
class ARMv5 : public ARM
@@ -259,6 +267,8 @@ public:
s32 RegionCodeCycles;
u8* CurICacheLine;
+
+ bool (*GetMemRegion)(u32 addr, bool write, NDS::MemRegion* region);
};
class ARMv4 : public ARM
@@ -266,23 +276,25 @@ class ARMv4 : public ARM
public:
ARMv4();
+ void Reset();
+
void JumpTo(u32 addr, bool restorecpsr = false);
void Execute();
u16 CodeRead16(u32 addr)
{
- return NDS::ARM7Read16(addr);
+ return BusRead16(addr);
}
u32 CodeRead32(u32 addr)
{
- return NDS::ARM7Read32(addr);
+ return BusRead32(addr);
}
void DataRead8(u32 addr, u32* val)
{
- *val = NDS::ARM7Read8(addr);
+ *val = BusRead8(addr);
DataRegion = addr >> 24;
DataCycles = NDS::ARM7MemTimings[DataRegion][0];
}
@@ -291,7 +303,7 @@ public:
{
addr &= ~1;
- *val = NDS::ARM7Read16(addr);
+ *val = BusRead16(addr);
DataRegion = addr >> 24;
DataCycles = NDS::ARM7MemTimings[DataRegion][0];
}
@@ -300,7 +312,7 @@ public:
{
addr &= ~3;
- *val = NDS::ARM7Read32(addr);
+ *val = BusRead32(addr);
DataRegion = addr >> 24;
DataCycles = NDS::ARM7MemTimings[DataRegion][2];
}
@@ -309,13 +321,13 @@ public:
{
addr &= ~3;
- *val = NDS::ARM7Read32(addr);
+ *val = BusRead32(addr);
DataCycles += NDS::ARM7MemTimings[DataRegion][3];
}
void DataWrite8(u32 addr, u8 val)
{
- NDS::ARM7Write8(addr, val);
+ BusWrite8(addr, val);
DataRegion = addr >> 24;
DataCycles = NDS::ARM7MemTimings[DataRegion][0];
}
@@ -324,7 +336,7 @@ public:
{
addr &= ~1;
- NDS::ARM7Write16(addr, val);
+ BusWrite16(addr, val);
DataRegion = addr >> 24;
DataCycles = NDS::ARM7MemTimings[DataRegion][0];
}
@@ -333,7 +345,7 @@ public:
{
addr &= ~3;
- NDS::ARM7Write32(addr, val);
+ BusWrite32(addr, val);
DataRegion = addr >> 24;
DataCycles = NDS::ARM7MemTimings[DataRegion][2];
}
@@ -342,7 +354,7 @@ public:
{
addr &= ~3;
- NDS::ARM7Write32(addr, val);
+ BusWrite32(addr, val);
DataCycles += NDS::ARM7MemTimings[DataRegion][3];
}