ASM display window changed to use QPlainTextEdit instead of QTextEdit.
This commit is contained in:
parent
ccbcab5e77
commit
254a1a1d37
|
@ -61,14 +61,17 @@ ConsoleDebugger::ConsoleDebugger(QWidget *parent)
|
||||||
|
|
||||||
mainLayout = new QHBoxLayout();
|
mainLayout = new QHBoxLayout();
|
||||||
|
|
||||||
asmText = new QTextEdit(this);
|
asmText = new QPlainTextEdit(this);
|
||||||
vbox1 = new QVBoxLayout();
|
vbox1 = new QVBoxLayout();
|
||||||
vbox2 = new QVBoxLayout();
|
vbox2 = new QVBoxLayout();
|
||||||
hbox1 = new QHBoxLayout();
|
hbox1 = new QHBoxLayout();
|
||||||
grid = new QGridLayout();
|
grid = new QGridLayout();
|
||||||
|
|
||||||
asmText->setFont(font);
|
asmText->setFont(font);
|
||||||
|
asmText->setReadOnly(true);
|
||||||
|
asmText->setOverwriteMode(true);
|
||||||
asmText->setMinimumWidth( 20 * fontCharWidth );
|
asmText->setMinimumWidth( 20 * fontCharWidth );
|
||||||
|
asmText->setLineWrapMode( QPlainTextEdit::NoWrap );
|
||||||
|
|
||||||
vbox1->addLayout( hbox1 );
|
vbox1->addLayout( hbox1 );
|
||||||
hbox1->addLayout( vbox2 );
|
hbox1->addLayout( vbox2 );
|
||||||
|
@ -152,7 +155,7 @@ ConsoleDebugger::ConsoleDebugger(QWidget *parent)
|
||||||
vbox2->addLayout( hbox );
|
vbox2->addLayout( hbox );
|
||||||
|
|
||||||
stackFrame = new QGroupBox(tr("Stack $0100"));
|
stackFrame = new QGroupBox(tr("Stack $0100"));
|
||||||
stackText = new QTextEdit(this);
|
stackText = new QPlainTextEdit(this);
|
||||||
hbox = new QHBoxLayout();
|
hbox = new QHBoxLayout();
|
||||||
hbox->addWidget( stackText );
|
hbox->addWidget( stackText );
|
||||||
vbox2->addWidget( stackFrame );
|
vbox2->addWidget( stackFrame );
|
||||||
|
@ -264,17 +267,23 @@ ConsoleDebugger::ConsoleDebugger(QWidget *parent)
|
||||||
|
|
||||||
setLayout( mainLayout );
|
setLayout( mainLayout );
|
||||||
|
|
||||||
displayROMoffsets = 0;
|
displayROMoffsets = false;
|
||||||
|
windowUpdateReq = true;
|
||||||
asmPC = NULL;
|
asmPC = NULL;
|
||||||
|
|
||||||
dbgWinList.push_back( this );
|
dbgWinList.push_back( this );
|
||||||
|
|
||||||
updateWindowData();
|
periodicTimer = new QTimer( this );
|
||||||
|
|
||||||
|
connect( periodicTimer, &QTimer::timeout, this, &ConsoleDebugger::updatePeriodic );
|
||||||
|
|
||||||
|
periodicTimer->start( 100 ); // 10hz
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
ConsoleDebugger::~ConsoleDebugger(void)
|
ConsoleDebugger::~ConsoleDebugger(void)
|
||||||
{
|
{
|
||||||
printf("Destroy Debugger Window\n");
|
printf("Destroy Debugger Window\n");
|
||||||
|
periodicTimer->stop();
|
||||||
asmClear();
|
asmClear();
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
@ -467,6 +476,8 @@ void ConsoleDebugger::updateAssemblyView(void)
|
||||||
addr = starting_address;
|
addr = starting_address;
|
||||||
asmPC = NULL;
|
asmPC = NULL;
|
||||||
|
|
||||||
|
asmText->clear();
|
||||||
|
|
||||||
//gtk_text_buffer_get_start_iter( textbuf, &iter );
|
//gtk_text_buffer_get_start_iter( textbuf, &iter );
|
||||||
|
|
||||||
//textview_lines_allocated = gtk_text_buffer_get_line_count( textbuf ) - 1;
|
//textview_lines_allocated = gtk_text_buffer_get_line_count( textbuf ) - 1;
|
||||||
|
@ -592,16 +603,43 @@ void ConsoleDebugger::updateWindowData(void)
|
||||||
{
|
{
|
||||||
updateAssemblyView();
|
updateAssemblyView();
|
||||||
|
|
||||||
|
windowUpdateReq = false;
|
||||||
|
}
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
void ConsoleDebugger::updatePeriodic(void)
|
||||||
|
{
|
||||||
|
//printf("Update Periodic\n");
|
||||||
|
|
||||||
|
if ( windowUpdateReq )
|
||||||
|
{
|
||||||
|
fceuWrapperLock();
|
||||||
|
updateWindowData();
|
||||||
|
fceuWrapperUnLock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
void ConsoleDebugger::breakPointNotify( int addr )
|
||||||
|
{
|
||||||
|
windowUpdateReq = true;
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void FCEUD_DebugBreakpoint( int addr )
|
void FCEUD_DebugBreakpoint( int addr )
|
||||||
{
|
{
|
||||||
std::list <ConsoleDebugger*>::iterator it;
|
std::list <ConsoleDebugger*>::iterator it;
|
||||||
|
|
||||||
printf("Breakpoint Hit: 0x%04X \n", addr );
|
printf("Breakpoint Hit: 0x%04X \n", addr );
|
||||||
|
|
||||||
|
fceuWrapperUnLock();
|
||||||
|
|
||||||
for (it=dbgWinList.begin(); it!=dbgWinList.end(); it++)
|
for (it=dbgWinList.begin(); it!=dbgWinList.end(); it++)
|
||||||
{
|
{
|
||||||
(*it)->updateWindowData();
|
(*it)->breakPointNotify( addr );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
while (FCEUI_EmulationPaused() && !FCEUI_EmulationFrameStepped())
|
||||||
|
{
|
||||||
|
usleep(100000);
|
||||||
|
}
|
||||||
|
fceuWrapperLock();
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
|
|
@ -13,12 +13,14 @@
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QFont>
|
#include <QFont>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
#include <QTimer>
|
||||||
#include <QFrame>
|
#include <QFrame>
|
||||||
#include <QGroupBox>
|
#include <QGroupBox>
|
||||||
#include <QTreeView>
|
#include <QTreeView>
|
||||||
#include <QTreeWidget>
|
#include <QTreeWidget>
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
#include <QTextEdit>
|
#include <QTextEdit>
|
||||||
|
#include <QPlainTextEdit>
|
||||||
|
|
||||||
#include "Qt/main.h"
|
#include "Qt/main.h"
|
||||||
|
|
||||||
|
@ -57,6 +59,7 @@ class ConsoleDebugger : public QDialog
|
||||||
void updateAssemblyView(void);
|
void updateAssemblyView(void);
|
||||||
void asmClear(void);
|
void asmClear(void);
|
||||||
int getAsmLineFromAddr(int addr);
|
int getAsmLineFromAddr(int addr);
|
||||||
|
void breakPointNotify(int addr);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void closeEvent(QCloseEvent *event);
|
void closeEvent(QCloseEvent *event);
|
||||||
|
@ -64,8 +67,8 @@ class ConsoleDebugger : public QDialog
|
||||||
//void keyReleaseEvent(QKeyEvent *event);
|
//void keyReleaseEvent(QKeyEvent *event);
|
||||||
|
|
||||||
//QTreeWidget *tree;
|
//QTreeWidget *tree;
|
||||||
QTextEdit *asmText;
|
QPlainTextEdit *asmText;
|
||||||
QTextEdit *stackText;
|
QPlainTextEdit *stackText;
|
||||||
QLineEdit *seekEntry;
|
QLineEdit *seekEntry;
|
||||||
QLineEdit *pcEntry;
|
QLineEdit *pcEntry;
|
||||||
QLineEdit *regAEntry;
|
QLineEdit *regAEntry;
|
||||||
|
@ -94,17 +97,20 @@ class ConsoleDebugger : public QDialog
|
||||||
QLabel *pixLbl;
|
QLabel *pixLbl;
|
||||||
QLabel *cpuCyclesLbl;
|
QLabel *cpuCyclesLbl;
|
||||||
QLabel *cpuInstrsLbl;
|
QLabel *cpuInstrsLbl;
|
||||||
|
QTimer *periodicTimer;
|
||||||
QFont font;
|
QFont font;
|
||||||
|
|
||||||
dbg_asm_entry_t *asmPC;
|
dbg_asm_entry_t *asmPC;
|
||||||
std::vector <dbg_asm_entry_t*> asmEntry;
|
std::vector <dbg_asm_entry_t*> asmEntry;
|
||||||
|
|
||||||
char displayROMoffsets;
|
bool displayROMoffsets;
|
||||||
|
bool windowUpdateReq;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void closeWindow(void);
|
void closeWindow(void);
|
||||||
private slots:
|
private slots:
|
||||||
|
void updatePeriodic(void);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue