aboutsummaryrefslogtreecommitdiff
path: root/ARM.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ARM.cpp')
-rw-r--r--ARM.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/ARM.cpp b/ARM.cpp
index 47d5ec9..2e51d86 100644
--- a/ARM.cpp
+++ b/ARM.cpp
@@ -1,31 +1,37 @@
-#include "ARM.h"
+#include <stdio.h>
#include "NDS.h"
+#include "ARM.h"
+#include "ARMInterpreter.h"
ARM::ARM(u32 num)
{
// well uh
Num = num;
+}
+
+ARM::~ARM()
+{
+ // dorp
+}
+void ARM::Reset()
+{
for (int i = 0; i < 16; i++)
R[i] = 0;
- ExceptionBase = num ? 0x00000000 : 0xFFFF0000;
+ ExceptionBase = Num ? 0x00000000 : 0xFFFF0000;
// zorp
JumpTo(ExceptionBase);
}
-ARM::~ARM()
-{
- // dorp
-}
-
void ARM::JumpTo(u32 addr)
{
// pipeline shit
// TODO: THUMB!!
+ if (addr&1) printf("!!! THUMB JUMP\n");
NextInstr = Read32(addr);
R[15] = addr+4;
@@ -43,7 +49,9 @@ s32 ARM::Execute(s32 cycles)
R[15] += 4;
// actually execute
- // er...
+ if ((CurInstr & 0xF0000000) != 0xE0000000) printf("well shit\n");
+ u32 icode = ((CurInstr >> 4) & 0xF) | ((CurInstr >> 16) & 0xFF0);
+ cycles -= ARMInterpreter::ARMInstrTable[icode](this);
}
return cycles;