From 46ceeed10d68d54d791fa3844d8c92e98f337179 Mon Sep 17 00:00:00 2001 From: Elad Ashkenazi <18193363+elad335@users.noreply.github.com> Date: Wed, 14 Aug 2024 16:42:21 +0300 Subject: [PATCH] Debugger/PPU: Minor bugfix in CR register dump --- rpcs3/Emu/Cell/PPUThread.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/rpcs3/Emu/Cell/PPUThread.cpp b/rpcs3/Emu/Cell/PPUThread.cpp index b23c95bae1..2a97028f2f 100644 --- a/rpcs3/Emu/Cell/PPUThread.cpp +++ b/rpcs3/Emu/Cell/PPUThread.cpp @@ -1455,18 +1455,14 @@ void ppu_thread::dump_regs(std::string& ret, std::any& custom_data) const continue; } - if (usz index = dis_asm.last_opcode.rfind(",cr"); index < dis_asm.last_opcode.size() - 4) - { - const char result = dis_asm.last_opcode[index + 3]; + usz index = dis_asm.last_opcode.rfind(",cr"); - if (result >= '0' && result <= '7') - { - func_data->preferred_cr_field_index = result - '0'; - break; - } + if (index > dis_asm.last_opcode.size() - 4) + { + index = dis_asm.last_opcode.rfind(" cr"); } - if (usz index = dis_asm.last_opcode.rfind(" cr"); index < dis_asm.last_opcode.size() - 4) + if (index <= dis_asm.last_opcode.size() - 4) { const char result = dis_asm.last_opcode[index + 3];