hey look, more crap

no MrRean this doesn't run NSMB yet
This commit is contained in:
StapleButter
2016-11-03 01:38:58 +01:00
parent 5b7ae6dab3
commit 3505ec993b
8 changed files with 180 additions and 2 deletions

50
ARM.cpp Normal file
View File

@ -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;
}