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

@@ -22,9 +22,6 @@ jobs:
cmake \
-G Ninja \
-B build \
-DCAPSTONE_ARCHITECTURE_DEFAULT=OFF \
-DCAPSTONE_BUILD_TESTS=OFF \
-DCAPSTONE_MIPS_SUPPORT=ON \
-DCMAKE_BUILD_TYPE=Release \
-S src
ninja -j$(nproc) -C build
@@ -51,7 +48,7 @@ jobs:
vcpkg install nlohmann-json:x64-windows
- name: Build Gadolinium
run: |
cmake -B build -T clangcl -DCAPSTONE_ARCHITECTURE_DEFAULT=OFF -DCAPSTONE_BUILD_TESTS=OFF -DCAPSTONE_MIPS_SUPPORT=ON -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release -S src
cmake -B build -T clangcl -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release -S src
cmake --build build --config Release
- name: Collect artifacts
run: |

3
.gitmodules vendored
View File

@@ -1,6 +1,3 @@
[submodule "external/capstone"]
path = external/capstone
url = https://github.com/capstone-engine/capstone
[submodule "external/nativefiledialog-extended"]
path = external/nativefiledialog-extended
url = https://github.com/btzy/nativefiledialog-extended/

1
external/capstone vendored

Submodule external/capstone deleted from fee83fcc1a

View File

@@ -68,7 +68,6 @@ target_include_directories(parallel-rdp PUBLIC
../../src/backend/core/registers
parallel-rdp-standalone
..
../capstone/include
../../src/frontend
../../src/frontend/imgui
../../src/frontend/imgui/debugger

View File

@@ -79,7 +79,7 @@ public:
unsigned int num_extensions = 64;
if (!SDL_Vulkan_GetInstanceExtensions(g_Window, &num_extensions, extensions)) {
util::panic("SDL_Vulkan_GetInstanceExtensions failed: %s", SDL_GetError());
util::panic("SDL_Vulkan_GetInstanceExtensions failed: {}", SDL_GetError());
}
auto vec = std::vector<const char*>();

View File

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

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

View File

@@ -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",