Fix windows, hopefully

This commit is contained in:
CocoSimone
2022-12-24 18:24:35 +01:00
parent 2ea4a88ae8
commit 2fad0d8b98
9 changed files with 7 additions and 46 deletions

View File

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

View File

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