diff --git a/src/backend/core/JIT.cpp b/src/backend/core/JIT.cpp index 62fcf11e..e5b20424 100644 --- a/src/backend/core/JIT.cpp +++ b/src/backend/core/JIT.cpp @@ -82,7 +82,7 @@ int JIT::Step() { code.push(code.rbp); code.mov(code.rbp, reinterpret_cast(this)); // Load context pointer - cs_insn *insn; + //cs_insn *insn; Util::trace("\tMIPS code (guest PC = 0x{:016X}):", blockPC); while (!instrInDelaySlot) { // CheckCompareInterrupt(); @@ -106,7 +106,7 @@ int JIT::Step() { const u32 instruction = mem.Read(regs, paddr); - u32 bswapped = bswap(instruction); + /*u32 bswapped = bswap(instruction); auto count = cs_disasm(disassemblerMips, reinterpret_cast(&bswapped), 4, blockPC, 0, &insn); if (count > 0) { @@ -116,7 +116,7 @@ int JIT::Step() { Util::trace("\t\tCould not disassemble 0x{:08X} due to error {}\n", instruction, (int)cs_errno(disassemblerMips)); } - /*if(ShouldServiceInterrupt()) { + if(ShouldServiceInterrupt()) { regs.cop0.FireException(ExceptionCode::Interrupt, 0, blockPC); return 1; }*/ @@ -150,23 +150,24 @@ int JIT::Step() { code.mov(code.rax, blockPC); code.mov(REG(qword, pc), code.rax); } + code.mov(code.rax, instructionsInBlock); code.pop(code.rbp); code.add(code.rsp, 8); code.ret(); code.setProtectModeRE(); - static auto blockInfoSize = 0; - blockInfoSize = code.getSize() - blockInfoSize; + //static auto blockInfoSize = 0; + //blockInfoSize = code.getSize() - blockInfoSize; - Util::trace("\tX86 code (block address = 0x{:016X}):", (uintptr_t)block); - auto count = cs_disasm(disassemblerX86, blockInfo, blockInfoSize, (uintptr_t)block, 0, &insn); - if (count > 0) { - for (size_t j = 0; j < count; j++) { - Util::trace("\t\t0x{:016X}:\t{}\t\t{}\n", insn[j].address, insn[j].mnemonic, insn[j].op_str); - } - - cs_free(insn, count); - } + //Util::trace("\tX86 code (block address = 0x{:016X}):", (uintptr_t)block); + //auto count = cs_disasm(disassemblerX86, blockInfo, blockInfoSize, (uintptr_t)block, 0, &insn); + //if (count > 0) { + // for (size_t j = 0; j < count; j++) { + // Util::trace("\t\t0x{:016X}:\t{}\t\t{}\n", insn[j].address, insn[j].mnemonic, insn[j].op_str); + // } + // + // cs_free(insn, count); + //} // const auto dump = code.getCode(); // Util::WriteFileBinary(dump, code.getSize(), "jit.dump"); // Util::panic(""); diff --git a/src/backend/core/registers/Cop1.hpp b/src/backend/core/registers/Cop1.hpp index 4b5135d2..d758d3a3 100644 --- a/src/backend/core/registers/Cop1.hpp +++ b/src/backend/core/registers/Cop1.hpp @@ -89,24 +89,24 @@ union FloatingPointReg { struct { s32 int32; s32 int32h; - } __attribute__((__packed__)); + }; struct { u32 uint32; u32 uint32h; - } __attribute__((__packed__)); + }; struct { s64 int64; - } __attribute__((__packed__)); + }; struct { u64 uint64; - } __attribute__((__packed__)); + }; struct { float float32; float float32h; - } __attribute__((__packed__)); + }; struct { double float64; - } __attribute__((__packed__)); + }; }; struct Interpreter; diff --git a/src/frontend/KaizenGui.cpp b/src/frontend/KaizenGui.cpp index 99667bcd..708b6304 100644 --- a/src/frontend/KaizenGui.cpp +++ b/src/frontend/KaizenGui.cpp @@ -38,8 +38,7 @@ void KaizenGui::FileDialog() { NFD::Guard guard; NFD::UniquePath path; static const std::vector filterItems = { - {"Nintendo 64 rom archive", "rar,RAR,tar,TAR,zip,ZIP,7z,7Z"}, - {"Nintendo 64 rom", "n64,z64,v64,N64,Z64,V64"} + {"Nintendo 64 rom or rom archive", "rar,RAR,tar,TAR,zip,ZIP,7z,7Z,n64,z64,v64,N64,Z64,V64"} }; auto result = NFD::OpenDialog(path, filterItems.data(), filterItems.size());