From 6c2a256c8aed1fa81bc54826cadbe4cd7b39f4a8 Mon Sep 17 00:00:00 2001 From: Skyth <19259897+blueskythlikesclouds@users.noreply.github.com> Date: Fri, 13 Sep 2024 22:08:56 +0300 Subject: [PATCH] Control register calls. --- PowerRecomp/main.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/PowerRecomp/main.cpp b/PowerRecomp/main.cpp index e7b488b..3ddbbf3 100644 --- a/PowerRecomp/main.cpp +++ b/PowerRecomp/main.cpp @@ -168,7 +168,13 @@ int main() break; case PPC_INST_BCTR: + std::println(f, "\tctx.fn[ctx.ctr / 4](ctx, base);"); + std::println(f, "\treturn;"); + break; + case PPC_INST_BCTRL: + std::println(f, "\tctx.lr = 0x{:X};", base); + std::println(f, "\tctx.fn[ctx.ctr / 4](ctx, base);"); break; case PPC_INST_BDNZ: @@ -204,7 +210,7 @@ int main() case PPC_INST_BL: std::println(f, "\tctx.lr = 0x{:X};", base); - std::println(f, "\tctx.fn[0x{:X}](ctx, base);", base / 4); + std::println(f, "\tctx.fn[0x{:X}](ctx, base);", insn.operands[0] / 4); break; case PPC_INST_BLE: