Merge pull request #232 from mjbudd77/master
Qt Symbolic Debug Improvements and Hex Editor RAM Freeze Feature
This commit is contained in:
commit
21b209c2d6
|
@ -902,31 +902,31 @@ int FCEU_DisableAllCheats(){
|
|||
return count;
|
||||
}
|
||||
|
||||
inline int FCEUI_FindCheatMapByte(uint16 address)
|
||||
int FCEUI_FindCheatMapByte(uint16 address)
|
||||
{
|
||||
return cheatMap[address / 8] >> (address % 8) & 1;
|
||||
}
|
||||
|
||||
inline void FCEUI_SetCheatMapByte(uint16 address, bool cheat)
|
||||
void FCEUI_SetCheatMapByte(uint16 address, bool cheat)
|
||||
{
|
||||
cheat ? cheatMap[address / 8] |= (1 << address % 8) : cheatMap[address / 8] ^= (1 << address % 8);
|
||||
}
|
||||
|
||||
inline void FCEUI_CreateCheatMap()
|
||||
void FCEUI_CreateCheatMap(void)
|
||||
{
|
||||
if (!cheatMap)
|
||||
cheatMap = (unsigned char*)malloc(CHEATMAP_SIZE);
|
||||
FCEUI_RefreshCheatMap();
|
||||
}
|
||||
|
||||
inline void FCEUI_RefreshCheatMap()
|
||||
void FCEUI_RefreshCheatMap(void)
|
||||
{
|
||||
memset(cheatMap, 0, CHEATMAP_SIZE);
|
||||
for (uint32 i = 0; i < numsubcheats; ++i)
|
||||
FCEUI_SetCheatMapByte(SubCheats[i].addr, true);
|
||||
}
|
||||
|
||||
inline void FCEUI_ReleaseCheatMap()
|
||||
void FCEUI_ReleaseCheatMap(void)
|
||||
{
|
||||
if (cheatMap)
|
||||
{
|
||||
|
|
|
@ -18,9 +18,10 @@ typedef unsigned char _8BYTECHEATMAP;
|
|||
|
||||
extern int FCEUI_FindCheatMapByte(uint16 address);
|
||||
extern void FCEUI_SetCheatMapByte(uint16 address, bool cheat);
|
||||
extern void FCEUI_CreateCheatMap();
|
||||
extern void FCEUI_RefreshCheatMap();
|
||||
extern void FCEUI_ReleaseCheatMap();
|
||||
extern void FCEUI_CreateCheatMap(void);
|
||||
extern void FCEUI_RefreshCheatMap(void);
|
||||
extern void FCEUI_ReleaseCheatMap(void);
|
||||
extern unsigned int FrozenAddressCount;
|
||||
|
||||
int FCEU_CheatGetByte(uint32 A);
|
||||
void FCEU_CheatSetByte(uint32 A, uint8 V);
|
||||
|
|
|
@ -975,6 +975,7 @@ void ConsoleDebugger::openDebugSymbolEditWindow( int addr )
|
|||
sym->name = nameEntry->text().toStdString();
|
||||
sym->comment = commentEntry->text().toStdString();
|
||||
}
|
||||
sym->trimTrailingSpaces();
|
||||
asmView->updateAssemblyView();
|
||||
fceuWrapperUnLock();
|
||||
}
|
||||
|
@ -1971,14 +1972,19 @@ void QAsmView::updateAssemblyView(void)
|
|||
const char *c;
|
||||
char stmp[256];
|
||||
//printf("Debug symbol Found at $%04X \n", dbgSym->ofs );
|
||||
d = new dbg_asm_entry_t();
|
||||
|
||||
*d = *a;
|
||||
d->type = dbg_asm_entry_t::SYMBOL_NAME;
|
||||
d->text.assign( dbgSym->name );
|
||||
d->line = asmEntry.size();
|
||||
|
||||
asmEntry.push_back(d);
|
||||
if ( dbgSym->name.size() > 0 )
|
||||
{
|
||||
d = new dbg_asm_entry_t();
|
||||
|
||||
*d = *a;
|
||||
d->type = dbg_asm_entry_t::SYMBOL_NAME;
|
||||
d->text.assign( dbgSym->name );
|
||||
d->text.append( ":");
|
||||
d->line = asmEntry.size();
|
||||
|
||||
asmEntry.push_back(d);
|
||||
}
|
||||
|
||||
i=0; j=0;
|
||||
c = dbgSym->comment.c_str();
|
||||
|
@ -3072,6 +3078,12 @@ void QAsmView::mousePressEvent(QMouseEvent * event)
|
|||
|
||||
line = lineOffset + c.y();
|
||||
|
||||
selAddrLine = -1;
|
||||
selAddrChar = 0;
|
||||
selAddrWidth = 0;
|
||||
selAddrValue = -1;
|
||||
selAddrText[0] = 0;
|
||||
|
||||
if ( line < asmEntry.size() )
|
||||
{
|
||||
int i,j, addr = -1, addrTextLoc = -1, selChar;
|
||||
|
@ -3080,55 +3092,88 @@ void QAsmView::mousePressEvent(QMouseEvent * event)
|
|||
|
||||
selChar = c.x();
|
||||
|
||||
if ( selChar < (int)asmEntry[line]->text.size() )
|
||||
if ( asmEntry[line]->type == dbg_asm_entry_t::ASM_TEXT )
|
||||
{
|
||||
i = selChar;
|
||||
|
||||
if ( isxdigit( asmEntry[line]->text[i] ) )
|
||||
if ( selChar < (int)asmEntry[line]->text.size() )
|
||||
{
|
||||
addrClicked = 1;
|
||||
addrTextLoc = i;
|
||||
i = selChar;
|
||||
|
||||
while ( isxdigit( asmEntry[line]->text[i] ) )
|
||||
if ( isxdigit( asmEntry[line]->text[i] ) )
|
||||
{
|
||||
addrClicked = 1;
|
||||
addrTextLoc = i;
|
||||
i--;
|
||||
}
|
||||
if ( asmEntry[line]->text[i] == '$' || asmEntry[line]->text[i] == ':' )
|
||||
{
|
||||
i--;
|
||||
}
|
||||
else
|
||||
{
|
||||
addrClicked = 0;
|
||||
}
|
||||
if ( asmEntry[line]->text[i] == '#' )
|
||||
{
|
||||
addrClicked = 0;
|
||||
}
|
||||
if ( addrClicked )
|
||||
{
|
||||
j=0; i = addrTextLoc;
|
||||
|
||||
|
||||
while ( isxdigit( asmEntry[line]->text[i] ) )
|
||||
{
|
||||
stmp[j] = asmEntry[line]->text[i]; i++; j++;
|
||||
addrTextLoc = i;
|
||||
i--;
|
||||
}
|
||||
stmp[j] = 0;
|
||||
if ( asmEntry[line]->text[i] == '$' || asmEntry[line]->text[i] == ':' )
|
||||
{
|
||||
i--;
|
||||
}
|
||||
else
|
||||
{
|
||||
addrClicked = 0;
|
||||
}
|
||||
if ( asmEntry[line]->text[i] == '#' )
|
||||
{
|
||||
addrClicked = 0;
|
||||
}
|
||||
if ( addrClicked )
|
||||
{
|
||||
j=0; i = addrTextLoc;
|
||||
|
||||
while ( isxdigit( asmEntry[line]->text[i] ) )
|
||||
{
|
||||
stmp[j] = asmEntry[line]->text[i]; i++; j++;
|
||||
}
|
||||
stmp[j] = 0;
|
||||
|
||||
//printf("Addr: '%s'\n", stmp );
|
||||
//printf("Addr: '%s'\n", stmp );
|
||||
|
||||
addr = strtol( stmp, NULL, 16 );
|
||||
addr = strtol( stmp, NULL, 16 );
|
||||
|
||||
selAddrLine = line;
|
||||
selAddrChar = addrTextLoc;
|
||||
selAddrWidth = j;
|
||||
selAddrValue = addr;
|
||||
strcpy( selAddrText, stmp );
|
||||
selAddrLine = line;
|
||||
selAddrChar = addrTextLoc;
|
||||
selAddrWidth = j;
|
||||
selAddrValue = addr;
|
||||
strcpy( selAddrText, stmp );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( asmEntry[line]->type == dbg_asm_entry_t::SYMBOL_NAME )
|
||||
{
|
||||
selAddrLine = line;
|
||||
selAddrChar = 0;
|
||||
selAddrValue = addr = asmEntry[line]->addr;
|
||||
|
||||
if ( asmEntry[line]->text.size() > 0 )
|
||||
{
|
||||
selAddrWidth = asmEntry[line]->text.size()-1;
|
||||
}
|
||||
else
|
||||
{
|
||||
selAddrWidth = 0;
|
||||
}
|
||||
if ( selAddrWidth > (int)sizeof(selAddrText) )
|
||||
{
|
||||
selAddrWidth = sizeof(selAddrText);
|
||||
}
|
||||
strncpy( selAddrText, asmEntry[line]->text.c_str(), selAddrWidth );
|
||||
selAddrText[ sizeof(selAddrText)-1 ] = 0;
|
||||
}
|
||||
|
||||
if ( addr < 0 )
|
||||
{
|
||||
addr = asmEntry[line]->addr;
|
||||
selAddrLine = line;
|
||||
selAddrChar = 4;
|
||||
selAddrWidth = 4;
|
||||
selAddrValue = addr;
|
||||
sprintf( selAddrText, "%04X", addr );
|
||||
}
|
||||
//printf("Line: '%s'\n", asmEntry[line]->text.c_str() );
|
||||
|
||||
if ( addr >= 0 )
|
||||
|
@ -3265,8 +3310,9 @@ void QAsmView::paintEvent(QPaintEvent *event)
|
|||
|
||||
if ( (selAddrLine == l) )
|
||||
{ // Highlight ASM line for selected address.
|
||||
if ( (selAddr == selAddrValue) && (asmEntry[l]->type == dbg_asm_entry_t::ASM_TEXT) &&
|
||||
( asmEntry[l]->text.compare( selAddrChar, selAddrWidth, selAddrText ) == 0 ) )
|
||||
if ( (selAddr == selAddrValue) &&
|
||||
(asmEntry[l]->text.size() >= (selAddrChar + selAddrWidth) ) &&
|
||||
( asmEntry[l]->text.compare( selAddrChar, selAddrWidth, selAddrText ) == 0 ) )
|
||||
{
|
||||
int ax;
|
||||
|
||||
|
|
|
@ -149,7 +149,7 @@ class QAsmView : public QWidget
|
|||
int selAddrChar;
|
||||
int selAddrWidth;
|
||||
int selAddrValue;
|
||||
char selAddrText[16];
|
||||
char selAddrText[128];
|
||||
|
||||
dbg_asm_entry_t *asmPC;
|
||||
std::vector <dbg_asm_entry_t*> asmEntry;
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#include "Qt/keyscan.h"
|
||||
#include "Qt/fceuWrapper.h"
|
||||
#include "Qt/HexEditor.h"
|
||||
#include "Qt/CheatsConf.h"
|
||||
#include "Qt/SymbolicDebug.h"
|
||||
#include "Qt/ConsoleDebugger.h"
|
||||
#include "Qt/ConsoleUtilities.h"
|
||||
|
@ -734,6 +735,8 @@ HexEditorDialog_t::HexEditorDialog_t(QWidget *parent)
|
|||
|
||||
populateBookmarkMenu();
|
||||
|
||||
FCEUI_CreateCheatMap();
|
||||
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
HexEditorDialog_t::~HexEditorDialog_t(void)
|
||||
|
@ -1107,6 +1110,7 @@ void HexEditorDialog_t::openDebugSymbolEditWindow( int addr )
|
|||
sym->name = nameEntry->text().toStdString();
|
||||
sym->comment = commentEntry->text().toStdString();
|
||||
}
|
||||
sym->trimTrailingSpaces();
|
||||
//fceuWrapperLock();
|
||||
updateAllDebuggerWindows();
|
||||
//fceuWrapperUnLock();
|
||||
|
@ -1216,6 +1220,11 @@ QHexEdit::QHexEdit(QWidget *parent)
|
|||
total_instructions_lp = 0;
|
||||
pxLineXScroll = 0;
|
||||
|
||||
frzRamAddr = -1;
|
||||
frzRamVal = 0;
|
||||
frzRamMode = 0;
|
||||
frzIdx = 0;
|
||||
|
||||
highLightColor[ 0].setRgb( 0x00, 0x00, 0x00 );
|
||||
highLightColor[ 1].setRgb( 0x35, 0x40, 0x00 );
|
||||
highLightColor[ 2].setRgb( 0x18, 0x52, 0x18 );
|
||||
|
@ -1535,7 +1544,7 @@ int QHexEdit::convPixToAddr( QPoint p )
|
|||
//----------------------------------------------------------------------------
|
||||
void QHexEdit::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
printf("Hex Window Key Press: 0x%x \n", event->key() );
|
||||
//printf("Hex Window Key Press: 0x%x \n", event->key() );
|
||||
|
||||
if (event->matches(QKeySequence::MoveToNextChar))
|
||||
{
|
||||
|
@ -1666,10 +1675,15 @@ void QHexEdit::keyPressEvent(QKeyEvent *event)
|
|||
}
|
||||
else if (Qt::ControlModifier == event->modifiers())
|
||||
{
|
||||
if ( event->key() == Qt::Key_A )
|
||||
{
|
||||
openGotoAddrDialog();
|
||||
}
|
||||
if ( event->key() == Qt::Key_A )
|
||||
{
|
||||
openGotoAddrDialog();
|
||||
}
|
||||
else if ( event->key() == Qt::Key_F )
|
||||
{
|
||||
frzRamAddr = ctxAddr = cursorAddr;
|
||||
frzRamToggle();
|
||||
}
|
||||
}
|
||||
else if (event->key() == Qt::Key_Tab && (cursorPosX < 32) )
|
||||
{ // switch from hex to ascii edit
|
||||
|
@ -1745,8 +1759,7 @@ void QHexEdit::keyPressEvent(QKeyEvent *event)
|
|||
//----------------------------------------------------------------------------
|
||||
void QHexEdit::keyReleaseEvent(QKeyEvent *event)
|
||||
{
|
||||
printf("Hex Window Key Release: 0x%x \n", event->key() );
|
||||
//assignHotkey( event );
|
||||
//printf("Hex Window Key Release: 0x%x \n", event->key() );
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
void QHexEdit::mousePressEvent(QMouseEvent * event)
|
||||
|
@ -1771,6 +1784,11 @@ void QHexEdit::contextMenuEvent(QContextMenuEvent *event)
|
|||
int addr;
|
||||
char stmp[128];
|
||||
|
||||
QPoint c = convPixToCursor( event->pos() );
|
||||
cursorPosX = c.x();
|
||||
cursorPosY = c.y();
|
||||
resetCursor();
|
||||
|
||||
ctxAddr = addr = convPixToAddr( event->pos() );
|
||||
//printf("contextMenuEvent\n");
|
||||
|
||||
|
@ -1778,10 +1796,33 @@ void QHexEdit::contextMenuEvent(QContextMenuEvent *event)
|
|||
{
|
||||
case MODE_NES_RAM:
|
||||
{
|
||||
QMenu *subMenu;
|
||||
|
||||
act = new QAction(tr("Add Symbolic Debug Name"), &menu);
|
||||
menu.addAction(act);
|
||||
connect( act, SIGNAL(triggered(void)), this, SLOT(addDebugSym(void)) );
|
||||
|
||||
subMenu = menu.addMenu(tr("Freeze/Unfreeze Address"));
|
||||
|
||||
act = new QAction(tr("Toggle State"), &menu);
|
||||
act->setShortcut( QKeySequence(tr("Ctrl+F")));
|
||||
subMenu->addAction(act);
|
||||
connect( act, SIGNAL(triggered(void)), this, SLOT(frzRamToggle(void)) );
|
||||
|
||||
act = new QAction(tr("Freeze"), &menu);
|
||||
subMenu->addAction(act);
|
||||
connect( act, SIGNAL(triggered(void)), this, SLOT(frzRamSet(void)) );
|
||||
|
||||
act = new QAction(tr("Unfreeze"), &menu);
|
||||
subMenu->addAction(act);
|
||||
connect( act, SIGNAL(triggered(void)), this, SLOT(frzRamUnset(void)) );
|
||||
|
||||
subMenu->addSeparator();
|
||||
|
||||
act = new QAction(tr("Unfreeze All"), &menu);
|
||||
subMenu->addAction(act);
|
||||
connect( act, SIGNAL(triggered(void)), this, SLOT(frzRamUnsetAll(void)) );
|
||||
|
||||
sprintf( stmp, "Add Read Breakpoint for Address $%04X", addr );
|
||||
act = new QAction(tr(stmp), &menu);
|
||||
menu.addAction(act);
|
||||
|
@ -1891,6 +1932,160 @@ void QHexEdit::addBookMarkCB(void)
|
|||
}
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
static int RamFreezeCB(char *name, uint32 a, uint8 v, int compare,int s,int type, void *data)
|
||||
{
|
||||
return ((QHexEdit*)data)->FreezeRam( name, a, v, compare, s, type );
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
int QHexEdit::FreezeRam( const char *name, uint32_t a, uint8_t v, int c, int s, int type )
|
||||
{
|
||||
|
||||
//if ( c >= 0 )
|
||||
//{
|
||||
// printf("$%04X?%02X:%02X %i: %s\n", a, c, v, s, name );
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// printf("$%04X:%02X %i: %s\n", a, v, s, name );
|
||||
//}
|
||||
|
||||
if ( a == frzRamAddr )
|
||||
{
|
||||
switch ( frzRamMode )
|
||||
{
|
||||
case 0: // Toggle
|
||||
|
||||
if ( s )
|
||||
{
|
||||
FCEUI_DelCheat( frzIdx );
|
||||
frzRamAddr = -1;
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
case 1: // Freeze
|
||||
|
||||
if ( s )
|
||||
{
|
||||
// Already Set so there is nothing further to do
|
||||
frzRamAddr = -1;
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
case 2: // Unfreeze
|
||||
if ( s )
|
||||
{
|
||||
FCEUI_DelCheat( frzIdx );
|
||||
}
|
||||
break;
|
||||
default:
|
||||
case 3: // Unfreeze All Handled Below
|
||||
// Nothing to do
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( frzRamMode == 3 )
|
||||
{
|
||||
if ( s )
|
||||
{
|
||||
FCEUI_DelCheat( frzIdx );
|
||||
}
|
||||
}
|
||||
|
||||
frzIdx++;
|
||||
|
||||
return 1;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
bool QHexEdit::frzRamAddrValid( int addr )
|
||||
{
|
||||
if ( addr < 0 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( (addr < 0x2000) || ( (addr >= 0x6000) && (addr <= 0x7FFF) ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
void QHexEdit::frzRamSet(void)
|
||||
{
|
||||
frzIdx = 0;
|
||||
frzRamMode = 1;
|
||||
frzRamAddr = ctxAddr;
|
||||
|
||||
if ( !frzRamAddrValid( frzRamAddr ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
fceuWrapperLock();
|
||||
FCEUI_ListCheats( RamFreezeCB, this);
|
||||
|
||||
if ( (frzRamAddr >= 0) && (FrozenAddressCount < 256) )
|
||||
{
|
||||
FCEUI_AddCheat("", frzRamAddr, GetMem(frzRamAddr), -1, 1);
|
||||
}
|
||||
updateCheatDialog();
|
||||
fceuWrapperUnLock();
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
void QHexEdit::frzRamUnset(void)
|
||||
{
|
||||
frzIdx = 0;
|
||||
frzRamMode = 2;
|
||||
frzRamAddr = ctxAddr;
|
||||
|
||||
if ( !frzRamAddrValid( frzRamAddr ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
fceuWrapperLock();
|
||||
FCEUI_ListCheats( RamFreezeCB, this);
|
||||
updateCheatDialog();
|
||||
fceuWrapperUnLock();
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
void QHexEdit::frzRamUnsetAll(void)
|
||||
{
|
||||
frzIdx = 0;
|
||||
frzRamMode = 3;
|
||||
frzRamAddr = ctxAddr;
|
||||
|
||||
if ( !frzRamAddrValid( frzRamAddr ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
fceuWrapperLock();
|
||||
FCEUI_ListCheats( RamFreezeCB, this);
|
||||
updateCheatDialog();
|
||||
fceuWrapperUnLock();
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
void QHexEdit::frzRamToggle(void)
|
||||
{
|
||||
frzIdx = 0;
|
||||
frzRamMode = 0;
|
||||
frzRamAddr = ctxAddr;
|
||||
|
||||
if ( !frzRamAddrValid( frzRamAddr ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
fceuWrapperLock();
|
||||
FCEUI_ListCheats( RamFreezeCB, this);
|
||||
|
||||
if ( (frzRamAddr >= 0) && (FrozenAddressCount < 256) )
|
||||
{
|
||||
FCEUI_AddCheat("", frzRamAddr, GetMem(frzRamAddr), -1, 1);
|
||||
}
|
||||
updateCheatDialog();
|
||||
fceuWrapperUnLock();
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
void QHexEdit::addDebugSym(void)
|
||||
{
|
||||
parent->openDebugSymbolEditWindow( ctxAddr );
|
||||
|
@ -2238,6 +2433,7 @@ void QHexEdit::paintEvent(QPaintEvent *event)
|
|||
int c, cx, cy, ca;
|
||||
char txt[32], asciiTxt[4];
|
||||
QPainter painter(this);
|
||||
QColor white("white"), black("black"), blue("blue");
|
||||
|
||||
painter.setFont(font);
|
||||
w = event->rect().width();
|
||||
|
@ -2371,6 +2567,39 @@ void QHexEdit::paintEvent(QPaintEvent *event)
|
|||
painter.setPen( romFgColor );
|
||||
}
|
||||
}
|
||||
else if ( viewMode == MODE_NES_RAM )
|
||||
{
|
||||
if ( FCEUI_FindCheatMapByte( addr ) )
|
||||
{
|
||||
if ( reverseVideo )
|
||||
{
|
||||
painter.setPen( white );
|
||||
painter.fillRect( x - (0.5*pxCharWidth) , y-pxLineSpacing+pxLineLead, 3*pxCharWidth, pxLineSpacing, blue );
|
||||
painter.fillRect( pxHexAscii + (col*pxCharWidth) - pxLineXScroll, y-pxLineSpacing+pxLineLead, pxCharWidth, pxLineSpacing, blue );
|
||||
}
|
||||
else
|
||||
{
|
||||
painter.setPen( blue );
|
||||
}
|
||||
}
|
||||
else if ( actvHighlightEnable && (mb.buf[addr].actv > 0) )
|
||||
{
|
||||
if ( reverseVideo )
|
||||
{
|
||||
painter.setPen( rvActvTextColor[ mb.buf[addr].actv ] );
|
||||
painter.fillRect( x - (0.5*pxCharWidth) , y-pxLineSpacing+pxLineLead, 3*pxCharWidth, pxLineSpacing, highLightColor[ mb.buf[addr].actv ] );
|
||||
painter.fillRect( pxHexAscii + (col*pxCharWidth) - pxLineXScroll, y-pxLineSpacing+pxLineLead, pxCharWidth, pxLineSpacing, highLightColor[ mb.buf[addr].actv ] );
|
||||
}
|
||||
else
|
||||
{
|
||||
painter.setPen( highLightColor[ mb.buf[addr].actv ] );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
painter.setPen( this->palette().color(QPalette::WindowText));
|
||||
}
|
||||
}
|
||||
else if ( actvHighlightEnable && (mb.buf[addr].actv > 0) )
|
||||
{
|
||||
if ( reverseVideo )
|
||||
|
|
|
@ -116,6 +116,7 @@ class QHexEdit : public QWidget
|
|||
void openGotoAddrDialog(void);
|
||||
int checkMemActivity(void);
|
||||
int getAddr(void){ return cursorAddr; };
|
||||
int FreezeRam( const char *name, uint32_t a, uint8_t v, int c, int s, int type );
|
||||
|
||||
enum {
|
||||
MODE_NES_RAM = 0,
|
||||
|
@ -136,6 +137,7 @@ class QHexEdit : public QWidget
|
|||
void resetCursor(void);
|
||||
QPoint convPixToCursor( QPoint p );
|
||||
int convPixToAddr( QPoint p );
|
||||
bool frzRamAddrValid( int addr );
|
||||
|
||||
QFont font;
|
||||
|
||||
|
@ -179,6 +181,10 @@ class QHexEdit : public QWidget
|
|||
int editMask;
|
||||
int jumpToRomValue;
|
||||
int ctxAddr;
|
||||
int frzRamAddr;
|
||||
int frzRamVal;
|
||||
int frzRamMode;
|
||||
int frzIdx;
|
||||
|
||||
bool cursorBlink;
|
||||
bool reverseVideo;
|
||||
|
@ -193,6 +199,10 @@ class QHexEdit : public QWidget
|
|||
void addRamExecuteBP(void);
|
||||
void addPpuReadBP(void);
|
||||
void addPpuWriteBP(void);
|
||||
void frzRamSet(void);
|
||||
void frzRamUnset(void);
|
||||
void frzRamToggle(void);
|
||||
void frzRamUnsetAll(void);
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -267,11 +267,11 @@ void MoviePlayDialog_t::updateMovieText(void)
|
|||
|
||||
if (info.emu_version_used < 20000 )
|
||||
{
|
||||
sprintf( stmp, "FCEU %u.%02u.%02d%s", info.emu_version_used/10000, (info.emu_version_used/100)%100, (info.emu_version_used)%100, info.emu_version_used < 9813 ? " (blip)" : "");
|
||||
sprintf( stmp, "FCEU %u.%02u.%02u%s", info.emu_version_used/10000, (info.emu_version_used/100)%100, (info.emu_version_used)%100, info.emu_version_used < 9813 ? " (blip)" : "");
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf( stmp, "FCEUX %u.%02u.%02d", info.emu_version_used/10000, (info.emu_version_used/100)%100, (info.emu_version_used)%100);
|
||||
sprintf( stmp, "FCEUX %u.%02u.%02u", info.emu_version_used/10000, (info.emu_version_used/100)%100, (info.emu_version_used)%100);
|
||||
}
|
||||
emuUsedLbl->setText( tr(stmp) );
|
||||
|
||||
|
|
|
@ -642,7 +642,8 @@ static int replaceSymbols( int flags, int addr, char *str )
|
|||
}
|
||||
else
|
||||
{
|
||||
sprintf( str, "%04X", addr );
|
||||
//sprintf( str, "%04X", addr );
|
||||
str[0] = 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -733,7 +734,7 @@ int DisassembleWithDebug(int addr, uint8_t *opcode, int flags, char *str )
|
|||
if ( flags )
|
||||
{
|
||||
replaceSymbols( flags, tmp, stmp );
|
||||
sprintf(str,"%s ($%02X,X) @ $%s = #$%02X", chr,opcode[1],stmp,GetMem(tmp));
|
||||
sprintf(str,"%s ($%02X,X) @ $%04X %s = #$%02X", chr,opcode[1],tmp,stmp,GetMem(tmp));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -769,7 +770,7 @@ int DisassembleWithDebug(int addr, uint8_t *opcode, int flags, char *str )
|
|||
if ( flags )
|
||||
{
|
||||
replaceSymbols( flags, opcode[1], stmp );
|
||||
sprintf(str,"%s $%s = #$%02X", chr,stmp,GetMem(opcode[1]));
|
||||
sprintf(str,"%s $%02X %s = #$%02X", chr,opcode[1],stmp,GetMem(opcode[1]));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -823,7 +824,7 @@ int DisassembleWithDebug(int addr, uint8_t *opcode, int flags, char *str )
|
|||
if ( flags )
|
||||
{
|
||||
replaceSymbols( flags, tmp, stmp );
|
||||
sprintf(str,"%s $%s = #$%02X", chr,stmp,GetMem(tmp));
|
||||
sprintf(str,"%s $%04X %s = #$%02X", chr,tmp,stmp,GetMem(tmp));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -846,7 +847,7 @@ int DisassembleWithDebug(int addr, uint8_t *opcode, int flags, char *str )
|
|||
if ( flags )
|
||||
{
|
||||
replaceSymbols( flags, tmp, stmp );
|
||||
sprintf(str,"%s $%s", chr,stmp);
|
||||
sprintf(str,"%s $%04X %s", chr,tmp,stmp);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -869,7 +870,7 @@ int DisassembleWithDebug(int addr, uint8_t *opcode, int flags, char *str )
|
|||
if ( flags )
|
||||
{
|
||||
replaceSymbols( flags, tmp, stmp );
|
||||
sprintf(str,"%s ($%02X),Y @ $%s = #$%02X", chr,opcode[1],stmp,GetMem(tmp));
|
||||
sprintf(str,"%s ($%02X),Y @ $%04X %s = #$%02X", chr,opcode[1],tmp,stmp,GetMem(tmp));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -901,7 +902,7 @@ int DisassembleWithDebug(int addr, uint8_t *opcode, int flags, char *str )
|
|||
if ( flags )
|
||||
{
|
||||
replaceSymbols( flags, tmp, stmp );
|
||||
sprintf(str,"%s $%02X,X @ $%s = #$%02X", chr,opcode[1],stmp,GetMem(tmp));
|
||||
sprintf(str,"%s $%02X,X @ $%04X %s = #$%02X", chr,opcode[1],tmp,stmp,GetMem(tmp));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -926,7 +927,7 @@ int DisassembleWithDebug(int addr, uint8_t *opcode, int flags, char *str )
|
|||
if ( flags )
|
||||
{
|
||||
replaceSymbols( flags, tmp2, stmp );
|
||||
sprintf(str,"%s $%04X,Y @ $%s = #$%02X", chr,tmp,stmp,GetMem(tmp2));
|
||||
sprintf(str,"%s $%04X,Y @ $%04X %s = #$%02X", chr,tmp,tmp2,stmp,GetMem(tmp2));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -956,7 +957,7 @@ int DisassembleWithDebug(int addr, uint8_t *opcode, int flags, char *str )
|
|||
if ( flags )
|
||||
{
|
||||
replaceSymbols( flags, tmp2, stmp );
|
||||
sprintf(str,"%s $%04X,X @ $%s = #$%02X", chr,tmp,stmp,GetMem(tmp2));
|
||||
sprintf(str,"%s $%04X,X @ $%04X %s = #$%02X", chr,tmp,tmp2,stmp,GetMem(tmp2));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -974,7 +975,7 @@ int DisassembleWithDebug(int addr, uint8_t *opcode, int flags, char *str )
|
|||
if ( flags )
|
||||
{
|
||||
replaceSymbols( flags, tmp, stmp );
|
||||
sprintf(str,"%s $%s", chr,stmp);
|
||||
sprintf(str,"%s $%04X %s", chr,tmp,stmp);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -992,7 +993,7 @@ int DisassembleWithDebug(int addr, uint8_t *opcode, int flags, char *str )
|
|||
if ( flags )
|
||||
{
|
||||
replaceSymbols( flags, tmp, stmp );
|
||||
sprintf(str,"%s $%02X,Y @ $%s = #$%02X", chr,opcode[1],stmp,GetMem(tmp));
|
||||
sprintf(str,"%s $%02X,Y @ $%04X %s = #$%02X", chr,opcode[1],tmp,stmp,GetMem(tmp));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -28,6 +28,32 @@ struct debugSymbol_t
|
|||
this->comment.assign( comment );
|
||||
}
|
||||
}
|
||||
|
||||
void trimTrailingSpaces(void)
|
||||
{
|
||||
while ( name.size() > 0 )
|
||||
{
|
||||
if ( isspace( name.back() ) )
|
||||
{
|
||||
name.pop_back();
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
while ( comment.size() > 0 )
|
||||
{
|
||||
if ( isspace( comment.back() ) )
|
||||
{
|
||||
comment.pop_back();
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
struct debugSymbolPage_t
|
||||
|
|
Loading…
Reference in New Issue