mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-21 05:09:46 -06:00
well, adding shit. laying out the base for the interpreter. really dirty code.
This commit is contained in:
28
ARM.cpp
28
ARM.cpp
@ -1,19 +1,13 @@
|
||||
#include "ARM.h"
|
||||
#include <stdio.h>
|
||||
#include "NDS.h"
|
||||
#include "ARM.h"
|
||||
#include "ARMInterpreter.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()
|
||||
@ -21,11 +15,23 @@ ARM::~ARM()
|
||||
// dorp
|
||||
}
|
||||
|
||||
void ARM::Reset()
|
||||
{
|
||||
for (int i = 0; i < 16; i++)
|
||||
R[i] = 0;
|
||||
|
||||
ExceptionBase = Num ? 0x00000000 : 0xFFFF0000;
|
||||
|
||||
// zorp
|
||||
JumpTo(ExceptionBase);
|
||||
}
|
||||
|
||||
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;
|
||||
|
Reference in New Issue
Block a user