Lay down initial JIT structure
This commit is contained in:
47
src/backend/core/JIT.cpp
Normal file
47
src/backend/core/JIT.cpp
Normal file
@@ -0,0 +1,47 @@
|
||||
#include <JIT.hpp>
|
||||
|
||||
namespace n64 {
|
||||
using namespace Xbyak;
|
||||
JIT::JIT() : CodeGenerator(0x80000) { }
|
||||
|
||||
void JIT::Reset() {
|
||||
reset();
|
||||
regs.Reset();
|
||||
mem.Reset();
|
||||
}
|
||||
|
||||
bool JIT::ShouldServiceInterrupt() {
|
||||
|
||||
}
|
||||
|
||||
void JIT::CheckCompareInterrupt() {
|
||||
|
||||
}
|
||||
|
||||
int JIT::Step() {
|
||||
CheckCompareInterrupt();
|
||||
|
||||
regs.prevDelaySlot = regs.delaySlot;
|
||||
regs.delaySlot = false;
|
||||
|
||||
u32 paddr = 0;
|
||||
if(!MapVAddr(regs, LOAD, regs.pc, paddr)) {
|
||||
HandleTLBException(regs, regs.pc);
|
||||
FireException(regs, GetTLBExceptionCode(regs.cop0.tlbError, LOAD), 0, false);
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32 instruction = mem.Read32(regs, paddr);
|
||||
|
||||
if(ShouldServiceInterrupt()) {
|
||||
FireException(regs, ExceptionCode::Interrupt, 0, false);
|
||||
return 0;
|
||||
}
|
||||
|
||||
regs.oldPC = regs.pc;
|
||||
regs.pc = regs.nextPC;
|
||||
regs.nextPC += 4;
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user