Fix windows, hopefully
This commit is contained in:
@@ -17,7 +17,6 @@ option(RAPIDJSON_BUILD_DOC "Build rapidjson documentation." OFF)
|
||||
option(RAPIDJSON_BUILD_EXAMPLES "Build rapidjson examples." OFF)
|
||||
option(RAPIDJSON_BUILD_TESTS "Build rapidjson perftests and unittests." OFF)
|
||||
|
||||
add_subdirectory(../external/capstone capstone)
|
||||
add_subdirectory(../external/parallel-rdp prdp)
|
||||
add_subdirectory(../external/imgui imgui)
|
||||
add_subdirectory(../external/nativefiledialog-extended nfd)
|
||||
@@ -49,7 +48,6 @@ target_include_directories(gadolinium PRIVATE
|
||||
../external/imgui/imgui
|
||||
../external/parallel-rdp/
|
||||
../external/nativefiledialog-extended/src/include
|
||||
../external/capstone/include
|
||||
../external/discord-rpc/include
|
||||
${SDL2_INCLUDE_DIR}
|
||||
)
|
||||
@@ -82,4 +80,4 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_link_libraries(gadolinium PRIVATE discord-rpc SDL2::SDL2main SDL2::SDL2 capstone-static nfd parallel-rdp fmt::fmt imgui nlohmann_json::nlohmann_json)
|
||||
target_link_libraries(gadolinium PRIVATE discord-rpc SDL2::SDL2main SDL2::SDL2 nfd parallel-rdp fmt::fmt imgui nlohmann_json::nlohmann_json)
|
||||
@@ -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);
|
||||
|
||||
@@ -48,7 +48,7 @@ GameList::GameList(const std::string& path) {
|
||||
if(!crcEntry.empty()) {
|
||||
if(crcEntry.get<std::string>() == fmt::format("{:08X}", crc)) {
|
||||
found = true;
|
||||
gamesList.push_back({
|
||||
gamesList.push_back(GameInfo{
|
||||
item["name"].get<std::string>(),
|
||||
item["region"].get<std::string>(),
|
||||
fmt::format("{:.2f} MiB", float(size) / 1024 / 1024),
|
||||
@@ -60,8 +60,8 @@ GameList::GameList(const std::string& path) {
|
||||
}
|
||||
|
||||
if(!found) {
|
||||
gamesList.push_back({
|
||||
p.path().stem(),
|
||||
gamesList.push_back(GameInfo{
|
||||
p.path().stem().string(),
|
||||
"Unknown",
|
||||
fmt::format("{:.2f} MiB", float(size) / 1024 / 1024),
|
||||
"Unknown",
|
||||
|
||||
Reference in New Issue
Block a user