From 6951493dc0c35a15d00da8df59371fc1faf833c0 Mon Sep 17 00:00:00 2001 From: Jonathan Campbell Date: Mon, 6 Oct 2025 00:19:47 -0700 Subject: [PATCH] Debugger: DOS MCBS command should indicate the segment immediately following the last MCB block in the chain --- CHANGELOG | 2 ++ src/debug/debug.cpp | 14 ++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 3208c822a..34de11fb5 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,6 @@ Next version + - Debugger: DOS MCBS command now also prints the segment immediately + following the last MCB block (joncampbell123). - Tseng ET3000/ET4000: Update Status register 3DAh behavior when emulating Tseng chipsets to reflect Tseng datasheet, and VGAKIT SVGA detection code expectations. Bit 7 is expected, as documented by Tseng, to be the inverse diff --git a/src/debug/debug.cpp b/src/debug/debug.cpp index 37773b3b1..970b3153e 100644 --- a/src/debug/debug.cpp +++ b/src/debug/debug.cpp @@ -4678,23 +4678,25 @@ static void LogMCBChain(uint16_t mcb_segment) { psp_seg_note = ""; } - DEBUG_ShowMsg(" %04X %12u %04X %-7s %s",mcb_segment,mcb.GetSize() << 4,mcb.GetPSPSeg(), psp_seg_note, filename); + DEBUG_ShowMsg(" %04X %12u %04X %-7s %s",mcb_segment,mcb.GetSize() << 4,mcb.GetPSPSeg(), psp_seg_note, filename); // print a message if dataAddr is within this MCB's memory range PhysPt mcbStartAddr = PhysMake(mcb_segment+1,0); PhysPt mcbEndAddr = PhysMake(mcb_segment+1+mcb.GetSize(),0); if (dataAddr >= mcbStartAddr && dataAddr < mcbEndAddr) { - DEBUG_ShowMsg(" (data addr %04hX:%04X is %u bytes past this MCB)",dataSeg,DOS_dataOfs,dataAddr - mcbStartAddr); + DEBUG_ShowMsg(" (data addr %04hX:%04X is %u bytes past this MCB)",dataSeg,DOS_dataOfs,dataAddr - mcbStartAddr); } // if we've just processed the last MCB in the chain, break out of the loop - if (mcb.GetType()==0x5a) { - break; - } - // else, move to the next MCB in the chain mcb_segment+=mcb.GetSize()+1; + if (mcb.GetType()==0x5a) + break; + + // else, move to the next MCB in the chain mcb.SetPt(mcb_segment); } + + DEBUG_ShowMsg(" %04X END OF CHAIN",mcb_segment); } #include "regionalloctracking.h"