From 7c898c3e4e8541741c5209fd17f1dec447b30bd7 Mon Sep 17 00:00:00 2001 From: Elad Ashkenazi <18193363+elad335@users.noreply.github.com> Date: Sat, 17 Aug 2024 12:25:14 +0300 Subject: [PATCH] SPU: Improve some logging --- rpcs3/Emu/Cell/PPUModule.cpp | 7 ++++--- rpcs3/Emu/Cell/RawSPUThread.cpp | 2 +- rpcs3/Emu/Cell/SPUCommonRecompiler.cpp | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/rpcs3/Emu/Cell/PPUModule.cpp b/rpcs3/Emu/Cell/PPUModule.cpp index 08bb36dc28..1a7eaf9394 100644 --- a/rpcs3/Emu/Cell/PPUModule.cpp +++ b/rpcs3/Emu/Cell/PPUModule.cpp @@ -1128,6 +1128,7 @@ static void ppu_check_patch_spu_images(const ppu_module& mod, const ppu_segment& { bool next = true; const u32 old_i = i; + u32 guid_start = umax, guid_end = umax; for (u32 search = i & -128, tries = 10; tries && search >= prev_bound; tries--, search = utils::sub_saturate(search, 128)) { @@ -1146,7 +1147,7 @@ static void ppu_check_patch_spu_images(const ppu_module& mod, const ppu_segment& continue; } - ppu_log.success("Found SPURS GUID Pattern at 0x%05x", search + seg.addr); + guid_start = search + seg.addr; i = search; next = false; break; @@ -1218,7 +1219,7 @@ static void ppu_check_patch_spu_images(const ppu_module& mod, const ppu_segment& { // SPURS GUID pattern end = it; - ppu_log.success("Found SPURS GUID Pattern for terminator at 0x%05x", end + seg.addr); + guid_end = end + seg.addr; break; } @@ -1252,7 +1253,7 @@ static void ppu_check_patch_spu_images(const ppu_module& mod, const ppu_segment& end = begin + std::min(end - begin, SPU_LS_SIZE - guessed_ls_addr); } - ppu_log.success("Found valid roaming SPU code at 0x%x..0x%x (guessed_ls_addr=0x%x)", seg.addr + begin, seg.addr + end, guessed_ls_addr); + ppu_log.success("Found valid roaming SPU code at 0x%x..0x%x (guessed_ls_addr=0x%x, GUID=0x%05x..0x%05x)", seg.addr + begin, seg.addr + end, guessed_ls_addr, guid_start, guid_end); if (!is_firmware && _main == &mod) { diff --git a/rpcs3/Emu/Cell/RawSPUThread.cpp b/rpcs3/Emu/Cell/RawSPUThread.cpp index 205578e827..91a1166eaa 100644 --- a/rpcs3/Emu/Cell/RawSPUThread.cpp +++ b/rpcs3/Emu/Cell/RawSPUThread.cpp @@ -405,7 +405,7 @@ void spu_load_exec(const spu_exec_object& elf) } else if (i % 4 == 0) { - to_log += '\n'; + fmt::append(to_log, "\n[%02u] ", i / 8); } else { diff --git a/rpcs3/Emu/Cell/SPUCommonRecompiler.cpp b/rpcs3/Emu/Cell/SPUCommonRecompiler.cpp index d6ee8b9f3b..77d74b6a8b 100644 --- a/rpcs3/Emu/Cell/SPUCommonRecompiler.cpp +++ b/rpcs3/Emu/Cell/SPUCommonRecompiler.cpp @@ -559,7 +559,7 @@ extern void utilize_spu_data_segment(u32 vaddr, const void* ls_data_vaddr, u32 s } else if (i % 4 == 0) { - to_log += '\n'; + fmt::append(to_log, "\n[%02u] ", i / 8); } else {