diff options
Diffstat (limited to 'src/ARM.h')
-rw-r--r-- | src/ARM.h | 32 |
1 files changed, 22 insertions, 10 deletions
@@ -144,6 +144,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 @@ -279,6 +287,8 @@ public: u8 MemTimings[0x100000][4]; u8* CurICacheLine; + + bool (*GetMemRegion)(u32 addr, bool write, NDS::MemRegion* region); }; class ARMv4 : public ARM @@ -286,6 +296,8 @@ class ARMv4 : public ARM public: ARMv4(); + void Reset(); + void FillPipeline(); void JumpTo(u32 addr, bool restorecpsr = false); @@ -297,17 +309,17 @@ public: 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; DataCycles = NDS::ARM7MemTimings[addr >> 15][0]; } @@ -316,7 +328,7 @@ public: { addr &= ~1; - *val = NDS::ARM7Read16(addr); + *val = BusRead16(addr); DataRegion = addr; DataCycles = NDS::ARM7MemTimings[addr >> 15][0]; } @@ -325,7 +337,7 @@ public: { addr &= ~3; - *val = NDS::ARM7Read32(addr); + *val = BusRead32(addr); DataRegion = addr; DataCycles = NDS::ARM7MemTimings[addr >> 15][2]; } @@ -334,13 +346,13 @@ public: { addr &= ~3; - *val = NDS::ARM7Read32(addr); + *val = BusRead32(addr); DataCycles += NDS::ARM7MemTimings[addr >> 15][3]; } void DataWrite8(u32 addr, u8 val) { - NDS::ARM7Write8(addr, val); + BusWrite8(addr, val); DataRegion = addr; DataCycles = NDS::ARM7MemTimings[addr >> 15][0]; } @@ -349,7 +361,7 @@ public: { addr &= ~1; - NDS::ARM7Write16(addr, val); + BusWrite16(addr, val); DataRegion = addr; DataCycles = NDS::ARM7MemTimings[addr >> 15][0]; } @@ -358,7 +370,7 @@ public: { addr &= ~3; - NDS::ARM7Write32(addr, val); + BusWrite32(addr, val); DataRegion = addr; DataCycles = NDS::ARM7MemTimings[addr >> 15][2]; } @@ -367,7 +379,7 @@ public: { addr &= ~3; - NDS::ARM7Write32(addr, val); + BusWrite32(addr, val); DataCycles += NDS::ARM7MemTimings[addr >> 15][3]; } |