debugger: Fix disasm endian changes.

This commit is contained in:
joevt authored and dingusdev committed 2026-04-15 19:44:10 -07:00
1 parent ffade95fb9
commit 621150f2f4
1 file changed
+5 -7
+5 -7
View File
@@ -426,25 +426,23 @@ static void patch_mem(string& params) {
}
static uint32_t disasm(PPCDisasmContext &ctx) {
ctx.instr_code = READ_DWORD_BE_A(mmu_translate_imem(ctx.instr_addr));
cout << COUT08X << ctx.instr_addr;
cout << ": " << COUT08X << ctx.instr_code;
cout << " " << disassemble_single(&ctx) << setfill(' ') << right << dec;
#if SUPPORTS_MEMORY_CTRL_ENDIAN_MODE
bool needs_swap = false;
if (mem_ctrl_instance != nullptr)
needs_swap = mem_ctrl_instance->needs_swap_endian(false);
#endif
uint32_t phys_addr;
uint8_t* real_addr = mmu_translate_imem(ctx.instr_addr, &phys_addr);
uint8_t* real_addr = mmu_translate_imem(ctx.instr_addr);
ctx.instr_code =
#if SUPPORTS_MEMORY_CTRL_ENDIAN_MODE
needs_swap ? READ_DWORD_LE_A(real_addr) :
#endif
READ_DWORD_BE_A(real_addr);
cout << COUT08X << ctx.instr_addr;
cout << ": " << COUT08X << ctx.instr_code;
cout << " " << disassemble_single(&ctx) << setfill(' ') << right << dec;
return ctx.instr_addr;
}