aboutsummaryrefslogtreecommitdiff
path: root/ARM.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ARM.cpp')
-rw-r--r--ARM.cpp50
1 files changed, 50 insertions, 0 deletions
diff --git a/ARM.cpp b/ARM.cpp
new file mode 100644
index 0000000..47d5ec9
--- /dev/null
+++ b/ARM.cpp
@@ -0,0 +1,50 @@
+#include "ARM.h"
+#include "NDS.h"
+
+
+ARM::ARM(u32 num)
+{
+ // well uh
+ Num = num;
+
+ for (int i = 0; i < 16; i++)
+ R[i] = 0;
+
+ ExceptionBase = num ? 0x00000000 : 0xFFFF0000;
+
+ // zorp
+ JumpTo(ExceptionBase);
+}
+
+ARM::~ARM()
+{
+ // dorp
+}
+
+void ARM::JumpTo(u32 addr)
+{
+ // pipeline shit
+
+ // TODO: THUMB!!
+
+ NextInstr = Read32(addr);
+ R[15] = addr+4;
+}
+
+s32 ARM::Execute(s32 cycles)
+{
+ while (cycles > 0)
+ {
+ // TODO THUM SHIT ASGAFDGSUHAJISGFYAUISAGY
+
+ // prefetch
+ CurInstr = NextInstr;
+ NextInstr = Read32(R[15]);
+ R[15] += 4;
+
+ // actually execute
+ // er...
+ }
+
+ return cycles;
+}