Fix windows, hopefully
This commit is contained in:
@@ -25,26 +25,6 @@ inline void CheckCompareInterrupt(MI& mi, Registers& regs) {
|
||||
}
|
||||
}
|
||||
|
||||
inline void Interpreter::disassembly(u32 instr) {
|
||||
size_t count;
|
||||
cs_insn *insn;
|
||||
|
||||
u8 code[4];
|
||||
memcpy(code, &instr, 4);
|
||||
|
||||
count = cs_disasm(handle, code, 4, regs.pc, 0, &insn);
|
||||
|
||||
if (count > 0) {
|
||||
size_t j;
|
||||
for (j = 0; j < count; j++) {
|
||||
fmt::print("0x{:016X}:\t{}\t\t{}\n", insn[j].address, insn[j].mnemonic, insn[j].op_str);
|
||||
}
|
||||
|
||||
cs_free(insn, count);
|
||||
} else
|
||||
printf("ERROR: Failed to disassemble given code!\n");
|
||||
}
|
||||
|
||||
void Interpreter::Step(Mem& mem) {
|
||||
regs.gpr[0] = 0;
|
||||
|
||||
|
||||
@@ -1,29 +1,20 @@
|
||||
#pragma once
|
||||
#include <core/registers/Registers.hpp>
|
||||
#include <Mem.hpp>
|
||||
#include <capstone/capstone.h>
|
||||
#include <vector>
|
||||
|
||||
namespace n64 {
|
||||
struct Interpreter {
|
||||
Interpreter() {
|
||||
if(cs_open(CS_ARCH_MIPS, CS_MODE_MIPS64, &handle) != CS_ERR_OK) {
|
||||
util::panic("Could not initialize capstone!\n");
|
||||
}
|
||||
Reset();
|
||||
}
|
||||
|
||||
~Interpreter() {
|
||||
cs_close(&handle);
|
||||
}
|
||||
~Interpreter() = default;
|
||||
void Reset();
|
||||
void Step(Mem&);
|
||||
Registers regs;
|
||||
private:
|
||||
u64 cop2Latch{};
|
||||
csh handle;
|
||||
|
||||
void disassembly(u32 instr);
|
||||
friend struct Cop1;
|
||||
|
||||
void cop2Decode(u32);
|
||||
|
||||
Reference in New Issue
Block a user