diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5ef690cf..c04d84d5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: | diff --git a/.gitmodules b/.gitmodules index 924f0591..805592e4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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/ diff --git a/external/capstone b/external/capstone deleted file mode 160000 index fee83fcc..00000000 --- a/external/capstone +++ /dev/null @@ -1 +0,0 @@ -Subproject commit fee83fcc1ad096c22d4f2066ccb58ad1a76a9886 diff --git a/external/parallel-rdp/CMakeLists.txt b/external/parallel-rdp/CMakeLists.txt index c352c165..cae48e70 100644 --- a/external/parallel-rdp/CMakeLists.txt +++ b/external/parallel-rdp/CMakeLists.txt @@ -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 diff --git a/external/parallel-rdp/ParallelRDPWrapper.cpp b/external/parallel-rdp/ParallelRDPWrapper.cpp index 34a77bb1..3072685e 100644 --- a/external/parallel-rdp/ParallelRDPWrapper.cpp +++ b/external/parallel-rdp/ParallelRDPWrapper.cpp @@ -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(); diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2509bdf7..a9c99cbc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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) \ No newline at end of file +target_link_libraries(gadolinium PRIVATE discord-rpc SDL2::SDL2main SDL2::SDL2 nfd parallel-rdp fmt::fmt imgui nlohmann_json::nlohmann_json) \ No newline at end of file diff --git a/src/backend/core/Interpreter.cpp b/src/backend/core/Interpreter.cpp index ecc2bd67..cc7cc2cd 100644 --- a/src/backend/core/Interpreter.cpp +++ b/src/backend/core/Interpreter.cpp @@ -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; diff --git a/src/backend/core/Interpreter.hpp b/src/backend/core/Interpreter.hpp index c04bd2f1..34305818 100644 --- a/src/backend/core/Interpreter.hpp +++ b/src/backend/core/Interpreter.hpp @@ -1,29 +1,20 @@ #pragma once #include #include -#include #include 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); diff --git a/src/frontend/imgui/GameList.cpp b/src/frontend/imgui/GameList.cpp index b7dc50a4..4bf4cdea 100644 --- a/src/frontend/imgui/GameList.cpp +++ b/src/frontend/imgui/GameList.cpp @@ -48,7 +48,7 @@ GameList::GameList(const std::string& path) { if(!crcEntry.empty()) { if(crcEntry.get() == fmt::format("{:08X}", crc)) { found = true; - gamesList.push_back({ + gamesList.push_back(GameInfo{ item["name"].get(), item["region"].get(), 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",