aboutsummaryrefslogtreecommitdiff
path: root/ARM.cpp
diff options
context:
space:
mode:
authorStapleButter <thetotalworm@gmail.com>2016-11-03 01:38:58 +0100
committerStapleButter <thetotalworm@gmail.com>2016-11-03 01:38:58 +0100
commit3505ec993b0d700800f77c667078e2c552a38b34 (patch)
tree35ffbbe7657e6c1b70197d4450e57f1cafa8ba4e /ARM.cpp
parent5b7ae6dab3fa260903d9348bdac7add6a81b7336 (diff)
hey look, more crap
no MrRean this doesn't run NSMB yet
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;
+}