From f0b3754d45aa88fdf4ad89ef716c032fbae6a979 Mon Sep 17 00:00:00 2001 From: mjbudd77 Date: Fri, 23 Jul 2021 22:40:10 -0400 Subject: [PATCH] Bug fix for jump address line function in debugger. Logic change to only show address look ahead for addresses seen in operand part of assembly line. --- src/drivers/Qt/ConsoleDebugger.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/drivers/Qt/ConsoleDebugger.cpp b/src/drivers/Qt/ConsoleDebugger.cpp index c16f4ac3..cbde5a1b 100644 --- a/src/drivers/Qt/ConsoleDebugger.cpp +++ b/src/drivers/Qt/ConsoleDebugger.cpp @@ -3115,7 +3115,7 @@ int QAsmView::getAsmLineFromAddr(int addr) if ( asmEntry[line]->addr < addr ) { nextLine = line + 1; - if ( asmEntry[line]->addr > asmEntry[nextLine]->addr ) + if ( asmEntry[nextLine]->addr > addr ) { break; } @@ -3124,7 +3124,7 @@ int QAsmView::getAsmLineFromAddr(int addr) else if ( asmEntry[line]->addr > addr ) { nextLine = line - 1; - if ( asmEntry[line]->addr < asmEntry[nextLine]->addr ) + if ( asmEntry[nextLine]->addr < addr ) { break; } @@ -4883,10 +4883,10 @@ bool QAsmView::event(QEvent *event) asmEntry[line]->addr, asmEntry[line]->bank, asmEntry[line]->rom ); } - static_cast(fceuCustomToolTipShow( helpEvent, new asmLookAheadPopup(asmEntry[line]->addr, this) )); - //QToolTip::showText(helpEvent->globalPos(), tr(stmp), this ); - QToolTip::hideText(); - event->ignore(); + //static_cast(fceuCustomToolTipShow( helpEvent, new asmLookAheadPopup(asmEntry[line]->addr, this) )); + QToolTip::showText(helpEvent->globalPos(), tr(stmp), this ); + //QToolTip::hideText(); + //event->ignore(); } else if ( showOperandAddrDesc ) { @@ -5705,11 +5705,14 @@ void QAsmView::drawAsmLine( QPainter *painter, int x, int y, const char *txt ) // Opcode Area painter->setPen( opcodeColor ); - while ( (idrawText( x, y, tr(c) ); - i++; x += pxCharWidth; + while ( (idrawText( x, y, tr(c) ); + i++; x += pxCharWidth; + } } // Operand Area