From 1ca83bc6291b61a1c3e220d6af53dce270102395 Mon Sep 17 00:00:00 2001 From: Eladash <18193363+elad335@users.noreply.github.com> Date: Mon, 18 Mar 2024 14:55:43 +0200 Subject: [PATCH] PPU DisAsm: Fixup conditional indirect branches disasm --- rpcs3/Emu/Cell/PPCDisAsm.h | 16 ++++++++++------ rpcs3/Emu/Cell/PPUDisAsm.cpp | 4 ++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/rpcs3/Emu/Cell/PPCDisAsm.h b/rpcs3/Emu/Cell/PPCDisAsm.h index 2035837735..4a5c747ba3 100644 --- a/rpcs3/Emu/Cell/PPCDisAsm.h +++ b/rpcs3/Emu/Cell/PPCDisAsm.h @@ -241,28 +241,32 @@ protected: { fmt::append(last_opcode, "%-*s cr%d,cr%d", PadOp(), op, cr0, cr1); } - void DisAsm_INT3(std::string_view op, const int i0, const int i1, const int i2) + void DisAsm_INT3(std::string_view op, s32 i0, s32 i1, s32 i2) { fmt::append(last_opcode, "%-*s %d,%d,%d", PadOp(), op, i0, i1, i2); } - void DisAsm_INT1(std::string_view op, const int i0) + void DisAsm_INT1(std::string_view op, s32 i0) { fmt::append(last_opcode, "%-*s %d", PadOp(), op, i0); } - void DisAsm_BRANCH(std::string_view op, const int pc) + void DisAsm_BRANCH(std::string_view op, s32 pc) { fmt::append(last_opcode, "%-*s 0x%x", PadOp(), op, DisAsmBranchTarget(pc)); } - void DisAsm_BRANCH_A(std::string_view op, const int pc) + void DisAsm_BRANCH_A(std::string_view op, s32 pc) { fmt::append(last_opcode, "%-*s 0x%x", PadOp(), op, pc); } - void DisAsm_B2_BRANCH(std::string_view op, u32 b0, u32 b1, const int pc) + void DisAsm_B2_BRANCH(std::string_view op, u32 b0, u32 b1, s32 pc) { fmt::append(last_opcode, "%-*s %d,%d,0x%x ", PadOp(), op, b0, b1, DisAsmBranchTarget(pc)); } - void DisAsm_CR_BRANCH(std::string_view op, u32 cr, const int pc) + void DisAsm_CR_BRANCH(std::string_view op, u32 cr, s32 pc) { fmt::append(last_opcode, "%-*s cr%d,0x%x ", PadOp(), op, cr, DisAsmBranchTarget(pc)); } + void DisAsm_CR_BRANCH_HINT(std::string_view op, u32 cr, u32 bh) + { + fmt::append(last_opcode, "%-*s cr%d,0x%x ", PadOp(), op, cr, bh); + } }; diff --git a/rpcs3/Emu/Cell/PPUDisAsm.cpp b/rpcs3/Emu/Cell/PPUDisAsm.cpp index d03fd9f394..9c9fa0e1fa 100644 --- a/rpcs3/Emu/Cell/PPUDisAsm.cpp +++ b/rpcs3/Emu/Cell/PPUDisAsm.cpp @@ -1488,7 +1488,7 @@ void PPUDisAsm::BCLR(ppu_opcode_t op) return; } - DisAsm_CR_BRANCH(final, bi / 4, bh); + DisAsm_CR_BRANCH_HINT(final, bi / 4, bh); } void PPUDisAsm::CRNOR(ppu_opcode_t op) @@ -1586,7 +1586,7 @@ void PPUDisAsm::BCCTR(ppu_opcode_t op) final += lk ? "ctrl"sv : "ctr"sv; if (sign) final += sign; - DisAsm_CR_BRANCH(final, bi / 4, bh); + DisAsm_CR_BRANCH_HINT(final, bi / 4, bh); } void PPUDisAsm::RLWIMI(ppu_opcode_t op)