From d94bf01163b41f26acd97e8bbdaf779e59952277 Mon Sep 17 00:00:00 2001 From: joevt Date: Sat, 18 Apr 2026 06:36:54 -0700 Subject: [PATCH] debugger: More parsing bat changes. - For MPC601, ibat#l should be bat#. - For non-MPC601, ibat#l should be dbat#l for dbats. - Don't show info for invalid bats on MPC601. --- debugger/debugger.cpp | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/debugger/debugger.cpp b/debugger/debugger.cpp index 79100fc9..beb27c82 100644 --- a/debugger/debugger.cpp +++ b/debugger/debugger.cpp @@ -625,19 +625,29 @@ static void print_mmu_regs() for (int i = 0; i < 4 + (is_601 ? 0 : 4); i++) { PPC_BAT_entry *bat_entry = i < 4 ? ibat_array : dbat_array; bat_entry = &bat_entry[i & 3]; - printf(" %sbat%du : %08X ibat%dl : %08X ; range : %08X..%08X -> %08X..%08X access : %s%s protection : %s%s", + printf(" %sbat%du : %08X %sbat%dl : %08X", is_601 ? "" : i < 4 ? "i" : "d", i & 3, ppc_state.spr[528+i*2], - i & 3, ppc_state.spr[529+i*2], - bat_entry->bepi, bat_entry->bepi + ~bat_entry->hi_mask, - bat_entry->phys_hi, bat_entry->phys_hi + ~bat_entry->hi_mask, - bat_entry->access & 2 ? is_601 ? "Ks" : "Vs" : "__", - bat_entry->access & 1 ? is_601 ? "Ku" : "Vp" : "__", - bat_entry->prot & 2 ? "P" : "_", - bat_entry->prot & 1 ? "P" : "_" + is_601 ? "" : i < 4 ? "i" : "d", + i & 3, ppc_state.spr[529+i*2] ); - if (is_601) { - printf(" (%s)", bat_entry->valid ? "valid" : "invalid"); + if (!is_601 || bat_entry->valid) { + printf(" ; range : %08X..%08X -> %08X..%08X access : %s%s protection : %s%s", + bat_entry->bepi, bat_entry->bepi + ~bat_entry->hi_mask, + bat_entry->phys_hi, bat_entry->phys_hi + ~bat_entry->hi_mask, + bat_entry->access & 2 ? is_601 ? "Ks" : "Vs" : "__", + bat_entry->access & 1 ? is_601 ? "Ku" : "Vp" : "__", + bat_entry->prot & 2 ? "P" : "_", + bat_entry->prot & 1 ? "P" : "_" + ); + if (is_601) { + printf(" (%s)", "valid"); + } + } else { + printf(" ; range : %8s..%8s -> %8s..%8s access : %s%s protection : %s%s", + "", "", "", "", "__", "__", "_", "_" + ); + printf(" (%s)", "invalid"); } printf("\n"); }