From: Jean-Paul Mari Date: Sun, 2 Sep 2018 02:14:59 +0000 (-0400) Subject: Debugger sources code clean-up X-Git-Tag: v2.1.3-R4~41 X-Git-Url: http://git.hcoop.net/clinton/Virtual-Jaguar-Rx.git/commitdiff_plain/570dad923e20ad098263df653287a08f5473427a Debugger sources code clean-up --- diff --git a/src/debugger/DSPDasmWin.cpp b/src/debugger/DSPDasmWin.cpp index fccd1da..cfd6156 100644 --- a/src/debugger/DSPDasmWin.cpp +++ b/src/debugger/DSPDasmWin.cpp @@ -14,7 +14,6 @@ // #include "DSPDasmWin.h" -//#include "memory.h" #include "dsp.h" #include "gpu.h" #include "jagdasm.h" @@ -22,46 +21,21 @@ DSPDasmWindow::DSPDasmWindow(QWidget * parent/*= 0*/): QWidget(parent, Qt::Dialog), -// layout(new QVBoxLayout), text(new QTextBrowser), layout(new QVBoxLayout), text(new QLabel), - //refresh(new QPushButton(tr("Refresh"))), - //go(new QPushButton(tr("Go"))), - //address(new QLineEdit), - //gpu(new QRadioButton(tr("GPU"))), - //dsp(new QRadioButton(tr("DSP"))), - //memBase(0x4000) memBase(DSPReadLong(0xF1A110, DEBUG)) { - //setWindowTitle(tr("RISC Disassembly Browser")); - - //address->setInputMask("hhhhhh"); - //QHBoxLayout * hbox1 = new QHBoxLayout; - //hbox1->addWidget(refresh); - //hbox1->addWidget(address); - //hbox1->addWidget(go); - - // Need to set the size as well... -// resize(560, 480); - QFont fixedFont("Lucida Console", 8, QFont::Normal); -// QFont fixedFont("", 8, QFont::Normal); fixedFont.setStyleHint(QFont::TypeWriter); text->setFont(fixedFont); -//// layout->setSizeConstraint(QLayout::SetFixedSize); setLayout(layout); layout->addWidget(text); -// layout->addWidget(refresh); - //layout->addLayout(hbox1); - - //connect(refresh, SIGNAL(clicked()), this, SLOT(RefreshContents())); - //connect(go, SIGNAL(clicked()), this, SLOT(GoToAddress())); } void DSPDasmWindow::RefreshContents(void) { - char string[1024];//, buf[64]; + char string[1024]; QString s; char buffer[2048]; int pc = memBase, oldpc; @@ -102,7 +76,6 @@ void DSPDasmWindow::RefreshContents(void) s += QString(buffer); } -// text->clear(); if (DSPPCShow) { text->setText(s); @@ -115,76 +88,9 @@ void DSPDasmWindow::RefreshContents(void) } -#if 0 -void DSPDasmWindow::keyPressEvent(QKeyEvent * e) -{ - if (e->key() == Qt::Key_Escape || e->key() == Qt::Key_Return) - hide(); -#if 1 - else if (e->key() == Qt::Key_PageUp) - { - memBase -= 64; - - if (memBase < 0) - memBase = 0; - - RefreshContents(); - } - else if (e->key() == Qt::Key_PageDown) - { - memBase += 64; - - if (memBase > (0x1000000 - 480)) - memBase = 0x1000000 - 480; - - RefreshContents(); - } - else if (e->key() == Qt::Key_Up || e->key() == Qt::Key_Minus) - { - memBase -= 2; - - if (memBase < 0) - memBase = 0; - - RefreshContents(); - } - else if (e->key() == Qt::Key_Down || e->key() == Qt::Key_Equal) - { - memBase += 2; - - if (memBase > (0x1000000 - 480)) - memBase = 0x1000000 - 480; - - RefreshContents(); - } -#endif -} -#endif - - -#if 0 -void DSPDasmWindow::GoToAddress(void) -{ - bool ok; - QString newAddress = address->text(); - memBase = newAddress.toUInt(&ok, 16); - RefreshContents(); -} -#endif - - // Set mem base PC address using the 68K pc current address void DSPDasmWindow::UseDSPPCAddress(void) { memBase = DSPReadLong(0xF1A110, DEBUG); } - -// Set mem base PC address -#if 0 -void DSPDasmWindow::SetAddress(int address) -{ - memBase = address; - // RefreshContents(); -} -#endif diff --git a/src/debugger/DSPDasmWin.h b/src/debugger/DSPDasmWin.h index 621bd1d..bdb3bd0 100644 --- a/src/debugger/DSPDasmWin.h +++ b/src/debugger/DSPDasmWin.h @@ -21,27 +21,15 @@ class DSPDasmWindow: public QWidget public: DSPDasmWindow(QWidget * parent = 0); - public slots: -// void DefineAllKeys(void); void RefreshContents(void); - //void GoToAddress(void); void UseDSPPCAddress(void); - //void SetAddress(int address); protected: - //void keyPressEvent(QKeyEvent *); private: QVBoxLayout * layout; -// QTextBrowser * text; QLabel * text; - //QPushButton * refresh; - //QPushButton * go; - //QLineEdit * address; - //QRadioButton * gpu; - //QRadioButton * dsp; - int32_t memBase; }; diff --git a/src/debugger/GPUDasmWin.cpp b/src/debugger/GPUDasmWin.cpp index 3366f7c..87cd077 100644 --- a/src/debugger/GPUDasmWin.cpp +++ b/src/debugger/GPUDasmWin.cpp @@ -14,7 +14,6 @@ // #include "GPUDasmWin.h" -//#include "memory.h" #include "dsp.h" #include "gpu.h" #include "jagdasm.h" @@ -22,46 +21,21 @@ GPUDasmWindow::GPUDasmWindow(QWidget * parent/*= 0*/): QWidget(parent, Qt::Dialog), -// layout(new QVBoxLayout), text(new QTextBrowser), layout(new QVBoxLayout), text(new QLabel), - //refresh(new QPushButton(tr("Refresh"))), - //go(new QPushButton(tr("Go"))), - //address(new QLineEdit), - //gpu(new QRadioButton(tr("GPU"))), - //dsp(new QRadioButton(tr("DSP"))), - //memBase(0x4000) memBase(GPUReadLong(0xF02110, DEBUG)) { - //setWindowTitle(tr("RISC Disassembly Browser")); - - //address->setInputMask("hhhhhh"); - //QHBoxLayout * hbox1 = new QHBoxLayout; - //hbox1->addWidget(refresh); - //hbox1->addWidget(address); - //hbox1->addWidget(go); - - // Need to set the size as well... -// resize(560, 480); - QFont fixedFont("Lucida Console", 8, QFont::Normal); -// QFont fixedFont("", 8, QFont::Normal); fixedFont.setStyleHint(QFont::TypeWriter); text->setFont(fixedFont); -//// layout->setSizeConstraint(QLayout::SetFixedSize); setLayout(layout); layout->addWidget(text); -// layout->addWidget(refresh); - //layout->addLayout(hbox1); - - //connect(refresh, SIGNAL(clicked()), this, SLOT(RefreshContents())); - //connect(go, SIGNAL(clicked()), this, SLOT(GoToAddress())); } void GPUDasmWindow::RefreshContents(void) { - char string[1024];//, buf[64]; + char string[1024]; QString s; char buffer[2048]; int pc = memBase, oldpc; @@ -102,7 +76,6 @@ void GPUDasmWindow::RefreshContents(void) s += QString(buffer); } -// text->clear(); if (GPUPCShow) { text->setText(s); @@ -115,76 +88,9 @@ void GPUDasmWindow::RefreshContents(void) } -#if 0 -void GPUDasmWindow::keyPressEvent(QKeyEvent * e) -{ - if (e->key() == Qt::Key_Escape || e->key() == Qt::Key_Return) - hide(); -#if 1 - else if (e->key() == Qt::Key_PageUp) - { - memBase -= 64; - - if (memBase < 0) - memBase = 0; - - RefreshContents(); - } - else if (e->key() == Qt::Key_PageDown) - { - memBase += 64; - - if (memBase > (0x1000000 - 480)) - memBase = 0x1000000 - 480; - - RefreshContents(); - } - else if (e->key() == Qt::Key_Up || e->key() == Qt::Key_Minus) - { - memBase -= 2; - - if (memBase < 0) - memBase = 0; - - RefreshContents(); - } - else if (e->key() == Qt::Key_Down || e->key() == Qt::Key_Equal) - { - memBase += 2; - - if (memBase > (0x1000000 - 480)) - memBase = 0x1000000 - 480; - - RefreshContents(); - } -#endif -} -#endif - - -#if 0 -void GPUDasmWindow::GoToAddress(void) -{ - bool ok; - QString newAddress = address->text(); - memBase = newAddress.toUInt(&ok, 16); - RefreshContents(); -} -#endif - - // Set mem base PC address using the 68K pc current address void GPUDasmWindow::UseGPUPCAddress(void) { memBase = GPUReadLong(0xF02110, DEBUG); } - -// Set mem base PC address -#if 0 -void GPUDasmWindow::SetAddress(int address) -{ - memBase = address; - // RefreshContents(); -} -#endif diff --git a/src/debugger/GPUDasmWin.h b/src/debugger/GPUDasmWin.h index e16510a..e0d8b01 100644 --- a/src/debugger/GPUDasmWin.h +++ b/src/debugger/GPUDasmWin.h @@ -21,27 +21,15 @@ class GPUDasmWindow: public QWidget public: GPUDasmWindow(QWidget * parent = 0); - public slots: -// void DefineAllKeys(void); void RefreshContents(void); - //void GoToAddress(void); void UseGPUPCAddress(void); - //void SetAddress(int address); protected: - //void keyPressEvent(QKeyEvent *); private: QVBoxLayout * layout; -// QTextBrowser * text; QLabel * text; - //QPushButton * refresh; - //QPushButton * go; - //QLineEdit * address; - //QRadioButton * gpu; - //QRadioButton * dsp; - int32_t memBase; }; diff --git a/src/debugger/allwatchbrowser.h b/src/debugger/allwatchbrowser.h index 7c4391c..e477409 100644 --- a/src/debugger/allwatchbrowser.h +++ b/src/debugger/allwatchbrowser.h @@ -15,10 +15,8 @@ class AllWatchBrowserWindow: public QWidget Q_OBJECT // - struct WatchInfo + typedef struct WatchInfo { - //size_t TypeEncoding; - //size_t TypeByteSize; size_t addr; size_t TypeTag; char *PtrVariableName; @@ -28,25 +26,18 @@ class AllWatchBrowserWindow: public QWidget public: AllWatchBrowserWindow(QWidget *parent = 0); ~AllWatchBrowserWindow(void); + void Reset(void); public slots: -// void DefineAllKeys(void); void RefreshContents(void); -// void GoToAddress(void); protected: -// void keyPressEvent(QKeyEvent *); + void keyPressEvent(QKeyEvent *); private: QVBoxLayout *layout; -// QTextBrowser * text; -// QLabel *text; QTextBrowser *text; -// QPushButton *refresh; -// QLineEdit *address; -// QPushButton *go; WatchInfo *PtrWatchInfo; -// int32_t memBase; size_t NbWatch; }; diff --git a/src/debugger/exceptionvectortablebrowser.cpp b/src/debugger/exceptionvectortablebrowser.cpp index 94fc1ed..e7fd51b 100644 --- a/src/debugger/exceptionvectortablebrowser.cpp +++ b/src/debugger/exceptionvectortablebrowser.cpp @@ -1,5 +1,5 @@ // -// exceptionvectortable.cpp - All Watch +// exceptionvectortable.cpp - Exception Vector Table // // by Jean-Paul Mari // @@ -11,6 +11,7 @@ // // STILL TO DO: +// Better display presentation // #include "debugger/exceptionvectortablebrowser.h" @@ -99,46 +100,28 @@ ExceptionVectorTable TabExceptionVectorTable[] = { ExceptionVectorTableBrowserWindow::ExceptionVectorTableBrowserWindow(QWidget * parent/*= 0*/): QWidget(parent, Qt::Dialog), layout(new QVBoxLayout), text(new QTextBrowser), -// layout(new QVBoxLayout), text(new QLabel), refresh(new QPushButton(tr("Refresh"))) -// address(new QLineEdit), -// go(new QPushButton(tr("Go"))), -// memBase(0), -// NbWatch(0), -// PtrWatchInfo(NULL) { setWindowTitle(tr("Exception Vector Table")); -// address->setInputMask("hhhhhh"); QHBoxLayout *hbox1 = new QHBoxLayout; hbox1->addWidget(refresh); -// hbox1->addWidget(address); -// hbox1->addWidget(go); - - // Need to set the size as well... -// resize(560, 480); QFont fixedFont("Lucida Console", 8, QFont::Normal); -// QFont fixedFont("", 8, QFont::Normal); fixedFont.setStyleHint(QFont::TypeWriter); text->setFont(fixedFont); -//// layout->setSizeConstraint(QLayout::SetFixedSize); setLayout(layout); layout->addWidget(text); layout->addWidget(refresh); -// layout->addLayout(hbox1); connect(refresh, SIGNAL(clicked()), this, SLOT(RefreshContents())); -// connect(go, SIGNAL(clicked()), this, SLOT(GoToAddress())); } // ExceptionVectorTableBrowserWindow::~ExceptionVectorTableBrowserWindow(void) { -// NbWatch = 0; -// free(PtrWatchInfo); } @@ -163,58 +146,10 @@ void ExceptionVectorTableBrowserWindow::RefreshContents(void) } -#if 0 void ExceptionVectorTableBrowserWindow::keyPressEvent(QKeyEvent * e) { if (e->key() == Qt::Key_Escape) - hide(); - else if (e->key() == Qt::Key_PageUp) - { - memBase -= 480; - - if (memBase < 0) - memBase = 0; - - RefreshContents(); - } - else if (e->key() == Qt::Key_PageDown) - { - memBase += 480; - - if (memBase > (0x200000 - 480)) - memBase = 0x200000 - 480; - - RefreshContents(); - } - else if (e->key() == Qt::Key_Up || e->key() == Qt::Key_Minus) - { - memBase -= 16; - - if (memBase < 0) - memBase = 0; - - RefreshContents(); - } - else if (e->key() == Qt::Key_Down || e->key() == Qt::Key_Equal) { - memBase += 16; - - if (memBase > (0x200000 - 480)) - memBase = 0x200000 - 480; - - RefreshContents(); + hide(); } } -#endif - - -#if 0 -void ExceptionVectorTableBrowserWindow::GoToAddress(void) -{ - bool ok; - QString newAddress = address->text(); - memBase = newAddress.toUInt(&ok, 16); - RefreshContents(); -} -#endif - diff --git a/src/debugger/exceptionvectortablebrowser.h b/src/debugger/exceptionvectortablebrowser.h index 31dfca3..12bf882 100644 --- a/src/debugger/exceptionvectortablebrowser.h +++ b/src/debugger/exceptionvectortablebrowser.h @@ -20,24 +20,15 @@ class ExceptionVectorTableBrowserWindow: public QWidget ~ExceptionVectorTableBrowserWindow(void); public slots: -// void DefineAllKeys(void); void RefreshContents(void); -// void GoToAddress(void); protected: -// void keyPressEvent(QKeyEvent *); + void keyPressEvent(QKeyEvent *); private: QVBoxLayout *layout; -// QTextBrowser * text; -// QLabel *text; QTextBrowser *text; QPushButton *refresh; -// QLineEdit *address; -// QPushButton *go; -// WatchInfo *PtrWatchInfo; -// int32_t memBase; -// size_t NbWatch; }; #endif // __EXCEPTIONVECTORTABLEBROWSER_H__ diff --git a/src/debugger/heapallocatorbrowser.cpp b/src/debugger/heapallocatorbrowser.cpp index fb1308b..7224be3 100644 --- a/src/debugger/heapallocatorbrowser.cpp +++ b/src/debugger/heapallocatorbrowser.cpp @@ -1,5 +1,5 @@ // -// allwatch.cpp - All Watch +// heapallocatorbrowser.cpp: Memory heap allocation // // by Jean-Paul Mari // @@ -21,48 +21,22 @@ HeapAllocatorBrowserWindow::HeapAllocatorBrowserWindow(QWidget * parent/*= 0*/) : QWidget(parent, Qt::Dialog), layout(new QVBoxLayout), text(new QTextBrowser), -// layout(new QVBoxLayout), text(new QLabel), -// refresh(new QPushButton(tr("Refresh"))), -// address(new QLineEdit), -// go(new QPushButton(tr("Go"))), -// memBase(0), -// NbWatch(0), -// PtrWatchInfo(NULL) Adr(0) -//PtrAdr(NULL) { setWindowTitle(tr("Heap Allocation")); -// address->setInputMask("hhhhhh"); -// QHBoxLayout * hbox1 = new QHBoxLayout; -// hbox1->addWidget(refresh); -// hbox1->addWidget(address); -// hbox1->addWidget(go); - - // Need to set the size as well... -// resize(560, 480); - QFont fixedFont("Lucida Console", 8, QFont::Normal); -// QFont fixedFont("", 8, QFont::Normal); fixedFont.setStyleHint(QFont::TypeWriter); text->setFont(fixedFont); -//// layout->setSizeConstraint(QLayout::SetFixedSize); setLayout(layout); layout->addWidget(text); -// layout->addWidget(refresh); -// layout->addLayout(hbox1); - -// connect(refresh, SIGNAL(clicked()), this, SLOT(RefreshContents())); -// connect(go, SIGNAL(clicked()), this, SLOT(GoToAddress())); } // HeapAllocatorBrowserWindow::~HeapAllocatorBrowserWindow(void) { -// NbWatch = 0; -// free(PtrAdr); } @@ -70,7 +44,6 @@ HeapAllocatorBrowserWindow::~HeapAllocatorBrowserWindow(void) void HeapAllocatorBrowserWindow::RefreshContents(void) { char string[1024]; -// char buf[64]; QString HA; size_t Adr68K; size_t Error = 0; @@ -146,7 +119,6 @@ void HeapAllocatorBrowserWindow::RefreshContents(void) else { return RefreshContents(); - //sprintf(string, "Memory allocator has been initialised"); } } else @@ -192,54 +164,5 @@ void HeapAllocatorBrowserWindow::keyPressEvent(QKeyEvent * e) { hide(); } -#if 0 - else if (e->key() == Qt::Key_PageUp) - { - memBase -= 480; - - if (memBase < 0) - memBase = 0; - - RefreshContents(); - } - else if (e->key() == Qt::Key_PageDown) - { - memBase += 480; - - if (memBase > (0x200000 - 480)) - memBase = 0x200000 - 480; - - RefreshContents(); - } - else if (e->key() == Qt::Key_Up || e->key() == Qt::Key_Minus) - { - memBase -= 16; - - if (memBase < 0) - memBase = 0; - - RefreshContents(); - } - else if (e->key() == Qt::Key_Down || e->key() == Qt::Key_Equal) - { - memBase += 16; - - if (memBase > (0x200000 - 480)) - memBase = 0x200000 - 480; - - RefreshContents(); - } -#endif -} - - -#if 0 -void HeapAllocatorBrowserWindow::GoToAddress(void) -{ - bool ok; - QString newAddress = address->text(); - memBase = newAddress.toUInt(&ok, 16); - RefreshContents(); } -#endif diff --git a/src/debugger/heapallocatorbrowser.h b/src/debugger/heapallocatorbrowser.h index 9afd9a1..234d8ae 100644 --- a/src/debugger/heapallocatorbrowser.h +++ b/src/debugger/heapallocatorbrowser.h @@ -1,8 +1,7 @@ // -// memoryheapallocatorbrowser.h: All Watch +// heapallocatorbrowser.h: Memory heap allocation // -// by James Hammons -// (C) 2012 Underground Software +// by Jean-Paul Mari // #ifndef __HEAPALLOCATORBROWSER_H__ @@ -15,13 +14,10 @@ class HeapAllocatorBrowserWindow: public QWidget { Q_OBJECT - struct HeapAllocation + typedef struct HeapAllocation { - //UINT32 nextalloc; uint32_t nextalloc; - //UINT32 size; uint32_t size; - //UINT16 used; uint16_t used; }S_HeapAllocation; @@ -30,27 +26,16 @@ class HeapAllocatorBrowserWindow: public QWidget ~HeapAllocatorBrowserWindow(void); public slots: -// void DefineAllKeys(void); void RefreshContents(void); void Reset(void); -// void GoToAddress(void); protected: void keyPressEvent(QKeyEvent *); private: QVBoxLayout *layout; -// QTextBrowser * text; -// QLabel *text; QTextBrowser *text; -// QPushButton *refresh; -// QLineEdit *address; -// QPushButton *go; -// WatchInfo *PtrWatchInfo; -// int32_t memBase; -// int32_t NbWatch; size_t Adr; -// HeapAllocation HeapAllocation; }; #endif // __HEAPALLOCATORBROWSER_H__ diff --git a/src/debugger/localbrowser.cpp b/src/debugger/localbrowser.cpp index f83120b..35b858d 100644 --- a/src/debugger/localbrowser.cpp +++ b/src/debugger/localbrowser.cpp @@ -21,39 +21,18 @@ // LocalBrowserWindow::LocalBrowserWindow(QWidget * parent/*= 0*/) : QWidget(parent, Qt::Dialog), layout(new QVBoxLayout), text(new QTextBrowser), -// layout(new QVBoxLayout), text(new QLabel), -// refresh(new QPushButton(tr("Refresh"))), -// address(new QLineEdit), -// go(new QPushButton(tr("Go"))), -// memBase(0), NbLocal(0), FuncName((char *)calloc(1, 1)), LocalInfo(NULL) { setWindowTitle(tr("Local")); -// address->setInputMask("hhhhhh"); -// QHBoxLayout * hbox1 = new QHBoxLayout; -// hbox1->addWidget(refresh); -// hbox1->addWidget(address); -// hbox1->addWidget(go); - - // Need to set the size as well... -// resize(560, 480); - QFont fixedFont("Lucida Console", 8, QFont::Normal); -// QFont fixedFont("", 8, QFont::Normal); fixedFont.setStyleHint(QFont::TypeWriter); text->setFont(fixedFont); -//// layout->setSizeConstraint(QLayout::SetFixedSize); setLayout(layout); layout->addWidget(text); -// layout->addWidget(refresh); -// layout->addLayout(hbox1); - -// connect(refresh, SIGNAL(clicked()), this, SLOT(RefreshContents())); -// connect(go, SIGNAL(clicked()), this, SLOT(GoToAddress())); } @@ -62,7 +41,6 @@ LocalBrowserWindow::~LocalBrowserWindow(void) { free(LocalInfo); free(FuncName); -// NbLocal = 0; } @@ -117,12 +95,9 @@ bool LocalBrowserWindow::UpdateInfos(void) void LocalBrowserWindow::RefreshContents(void) { char string[1024]; -// char buf[64]; QString Local; char Value[100]; char *PtrValue; -// size_t NbWatch, Adr; -// WatchInfo PtrLocalInfo; const char *CPURegName[] = { "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7", "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7" }; @@ -130,17 +105,6 @@ void LocalBrowserWindow::RefreshContents(void) { if (UpdateInfos()) { -//#ifdef _MSC_VER - //#pragma message("Warning: !!! Need to check the memory desalocation for LocalInfo !!!") -//#else - //#warning "!!! Need to do the memory desalocation for LocalInfo !!!" -//#endif // _MSC_VER -//#ifdef _MSC_VER - //#pragma message("Warning: !!! Need to check the memory desalocation for FuncName !!!") -//#else - //#warning "!!! Need to do the memory desalocation for FuncName !!!" -//#endif // _MSC_VER - for (size_t i = 0; i < NbLocal; i++) { if (LocalInfo[i].PtrVariableName) @@ -228,54 +192,4 @@ void LocalBrowserWindow::keyPressEvent(QKeyEvent * e) { hide(); } -#if 0 - else if (e->key() == Qt::Key_PageUp) - { - memBase -= 480; - - if (memBase < 0) - memBase = 0; - - RefreshContents(); - } - else if (e->key() == Qt::Key_PageDown) - { - memBase += 480; - - if (memBase > (0x200000 - 480)) - memBase = 0x200000 - 480; - - RefreshContents(); - } - else if (e->key() == Qt::Key_Up || e->key() == Qt::Key_Minus) - { - memBase -= 16; - - if (memBase < 0) - memBase = 0; - - RefreshContents(); - } - else if (e->key() == Qt::Key_Down || e->key() == Qt::Key_Equal) - { - memBase += 16; - - if (memBase > (0x200000 - 480)) - memBase = 0x200000 - 480; - - RefreshContents(); - } -#endif -} - - -#if 0 -void LocalBrowserWindow::GoToAddress(void) -{ - bool ok; - QString newAddress = address->text(); - memBase = newAddress.toUInt(&ok, 16); - RefreshContents(); } -#endif - diff --git a/src/debugger/localbrowser.h b/src/debugger/localbrowser.h index 6ee2a60..544957a 100644 --- a/src/debugger/localbrowser.h +++ b/src/debugger/localbrowser.h @@ -1,5 +1,5 @@ // -// localbrowser.h: All Watch +// localbrowser.h: Local variables // // by Jean-Paul Mari // @@ -15,10 +15,8 @@ class LocalBrowserWindow: public QWidget Q_OBJECT // - struct WatchInfo + typedef struct WatchInfo { - //size_t TypeEncoding; - //size_t TypeByteSize; size_t Op; size_t Adr; int Offset; @@ -35,24 +33,16 @@ class LocalBrowserWindow: public QWidget ~LocalBrowserWindow(void); public slots: -// void DefineAllKeys(void); void RefreshContents(void); bool UpdateInfos(void); -// void GoToAddress(void); protected: void keyPressEvent(QKeyEvent *); private: QVBoxLayout *layout; -// QTextBrowser * text; -// QLabel *text; QTextBrowser *text; -// QPushButton *refresh; -// QLineEdit *address; -// QPushButton *go; WatchInfo *LocalInfo; -// int32_t memBase; size_t NbLocal; char *FuncName; }; diff --git a/src/debugger/m68kDasmWin.cpp b/src/debugger/m68kDasmWin.cpp index 007c2b3..ec36938 100644 --- a/src/debugger/m68kDasmWin.cpp +++ b/src/debugger/m68kDasmWin.cpp @@ -17,74 +17,31 @@ #include #include "debugger/m68kDasmWin.h" -//#include "memory.h" #include "m68000/m68kinterface.h" #include "dsp.h" #include "gpu.h" -//#include "jaguar.h" -//#include "ELFManager.h" #include "DBGManager.h" -//extern jaguarRunAddress; #include "settings.h" // m68KDasmWindow::m68KDasmWindow(QWidget * parent/*= 0*/): QWidget(parent, Qt::Dialog), layout(new QVBoxLayout), text(new QTextBrowser), -// layout(new QTabWidget), text(new QLabel), -#if 0 - refresh(new QPushButton(tr("Refresh"))), - address(new QLineEdit), - go(new QPushButton(tr("Go"))), -#endif -// memBase(0x4000) - //sb(new QScrollBar), memBase(0) { -// m68kDasmWindow *m68kDasmWin = new m68kDasmWindow(); -// setWindowTitle(tr("Jaguar Disassembly Window")); -// layout->addTab(new m68KDasmWindow(), tr("M68K Disassembly")); - //layout = new QTabWidget; - //layout->QWidget(); - -#if 0 - address->setInputMask("hhhhhh"); - QHBoxLayout * hbox1 = new QHBoxLayout; - hbox1->addWidget(refresh); - hbox1->addWidget(address); - hbox1->addWidget(go); -#endif - - // Need to set the size as well... -// resize(560, 480); - QFont fixedFont("Lucida Console", 8, QFont::Normal); -// QFont fixedFont("", 8, QFont::Normal); fixedFont.setStyleHint(QFont::Monospace); //TypeWriter fixedFont.setLetterSpacing(QFont::PercentageSpacing, 100); text->setFont(fixedFont); -// sb = layout->text->verticalScrollBar(); -// text->setStyleSheet("background-color: DeepSkyBlue;"); -//// layout->setSizeConstraint(QLayout::SetFixedSize); setLayout(layout); layout->addWidget(text); -// layout->addWidget(refresh); -#if 0 - layout->addLayout(hbox1); -#endif - -#if 0 - connect(refresh, SIGNAL(clicked()), this, SLOT(RefreshContents())); - connect(go, SIGNAL(clicked()), this, SLOT(GoToAddress())); -#endif } // void m68KDasmWindow::RefreshContents(void) { - //char ; //, buf[64]; QString s; char buffer[1024], string[1024], adresse[16]; size_t pc = memBase, oldpc; @@ -97,24 +54,12 @@ void m68KDasmWindow::RefreshContents(void) size_t nbr = vjs.nbrdisasmlines; char *PtrFullSource, *CurrentPtrFullSource = (char *)calloc(1, 1); size_t NumLine; // , CurrentNumLine = 0; -// size_t CurrentNumLine = DBGManager_GetNumLineFromAdr(pc, DBG_NO_TAG) - 1; size_t CurrentNumLine; char singleCharString[2] = { 0, 0 }; - //text->clear(); - for (i = 0; i < nbr; i++) { - //sb->setValue(sb->maximum()); - //j = text->verticalScrollBar()->maximum(); - //text->verticalScrollBar()->setValue(text->verticalScrollBar()->maximum()); - //if (text->verticalScrollBar()->value()) - //{ - // j = 1; - //} - oldpc = pc; -// WriteLog("%06X: %s\n", oldpc, buffer); adr = constant = equal = false; // Display source filename based on the program address @@ -124,13 +69,12 @@ void m68KDasmWindow::RefreshContents(void) if (strcmp(OldPtrFullSource, PtrFullSource)) #endif { -#if 1 if (i) { nbr++; s += QString("
"); } -#endif + CurrentNumLine = DBGManager_GetNumLineFromAdr(pc, DBG_NO_TAG) - 1; nbr++; CurrentPtrFullSource = (char *)realloc(CurrentPtrFullSource, strlen(PtrFullSource) + 1); @@ -195,7 +139,6 @@ void m68KDasmWindow::RefreshContents(void) } buffer[0] = 0; // Clear string - //char singleCharString[2] = { 0, 0 }; for (j = 0; j < strlen(string); j++) { @@ -256,9 +199,7 @@ void m68KDasmWindow::RefreshContents(void) } Symbol = NULL; - // s += QString(string); s += QString(buffer); - // text->setStyleSheet("QLabel { background-color : red; color : blue; }"); } } } @@ -289,54 +230,6 @@ void m68KDasmWindow::RefreshContents(void) } -#if 0 -// -void m68KDasmWindow::keyPressEvent(QKeyEvent * e) -{ -// if (e->key() == Qt::Key_Escape || e->key() == Qt::Key_Return) -// hide(); -#if 0 - else if (e->key() == Qt::Key_PageUp) - { - memBase -= 64; - - if (memBase < 0) - memBase = 0; - - RefreshContents(); - } - else if (e->key() == Qt::Key_PageDown) - { - memBase += 64; - - if (memBase > (0xF00000 - 64)) - memBase = 0xF00000 - 64; - - RefreshContents(); - } - else if (e->key() == Qt::Key_Up || e->key() == Qt::Key_Minus) - { - memBase -= 16; - - if (memBase < 0) - memBase = 0; - - RefreshContents(); - } - else if (e->key() == Qt::Key_Down || e->key() == Qt::Key_Equal) - { - memBase += 16; - - if (memBase > (0xF00000 - 64)) - memBase = 0xF00000 - 64; - - RefreshContents(); - } -#endif -} -#endif - - // Set mem base PC address using the 68K pc current address void m68KDasmWindow::Use68KPCAddress(void) { @@ -348,18 +241,4 @@ void m68KDasmWindow::Use68KPCAddress(void) void m68KDasmWindow::SetAddress(int address) { memBase = address; -// RefreshContents(); } - - -#if 0 -// Set mem base PC address based on user interaction -void m68KDasmWindow::GoToAddress(void) -{ - bool ok; - - QString newAddress = address->text(); - memBase = newAddress.toUInt(&ok, 16); - RefreshContents(); -} -#endif diff --git a/src/debugger/m68kDasmWin.h b/src/debugger/m68kDasmWin.h index 72af61e..7ac5da6 100644 --- a/src/debugger/m68kDasmWin.h +++ b/src/debugger/m68kDasmWin.h @@ -22,29 +22,15 @@ class m68KDasmWindow: public QWidget m68KDasmWindow(QWidget * parent = 0); public slots: -// void DefineAllKeys(void); void RefreshContents(void); -#if 0 - void GoToAddress(void); -#endif void SetAddress(int address); void Use68KPCAddress(void); protected: -#if 0 - void keyPressEvent(QKeyEvent *); -#endif private: QVBoxLayout *layout; QTextBrowser *text; -// QScrollBar *sb; -// QLabel * text; -#if 0 - QPushButton * refresh; - QLineEdit * address; - QPushButton * go; -#endif size_t memBase; }; diff --git a/src/debugger/memory1browser.cpp b/src/debugger/memory1browser.cpp index a94ea84..c13f9ed 100644 --- a/src/debugger/memory1browser.cpp +++ b/src/debugger/memory1browser.cpp @@ -21,16 +21,12 @@ // Memory1BrowserWindow::Memory1BrowserWindow(QWidget * parent/*= 0*/): QWidget(parent, Qt::Dialog), -// layout(new QVBoxLayout), text(new QTextBrowser), layout(new QVBoxLayout), text(new QLabel), refresh(new QPushButton(tr("Refresh"))), address(new QLineEdit), go(new QPushButton(tr("Go"))), memBase(0), memOrigin(0), NumWinOrigin(0) { - //setWindowTitle(tr("Memory 1 Browser")); - - //address->setInputMask("hhhhhh"); address->setPlaceholderText("0x, decimal value or symbol name"); QHBoxLayout * hbox1 = new QHBoxLayout; @@ -38,18 +34,12 @@ Memory1BrowserWindow::Memory1BrowserWindow(QWidget * parent/*= 0*/): QWidget(par hbox1->addWidget(address); hbox1->addWidget(go); - // Need to set the size as well... -// resize(560, 480); - QFont fixedFont("Lucida Console", 8, QFont::Normal); -// QFont fixedFont("", 8, QFont::Normal); fixedFont.setStyleHint(QFont::TypeWriter); text->setFont(fixedFont); -//// layout->setSizeConstraint(QLayout::SetFixedSize); setLayout(layout); layout->addWidget(text); - //layout->addWidget(refresh); layout->addLayout(hbox1); connect(refresh, SIGNAL(clicked()), this, SLOT(RefreshContentsWindow())); diff --git a/src/debugger/memory1browser.h b/src/debugger/memory1browser.h index ff091e8..231db04 100644 --- a/src/debugger/memory1browser.h +++ b/src/debugger/memory1browser.h @@ -1,8 +1,7 @@ // // memory1browser.h: Jaguar memory window 1 browser // -// by James Hammons -// (C) 2012 Underground Software +// by Jean-Paul Mari // #ifndef __MEMORY1BROWSER_H__ @@ -19,7 +18,6 @@ class Memory1BrowserWindow: public QWidget Memory1BrowserWindow(QWidget * parent = 0); public slots: -// void DefineAllKeys(void); void RefreshContents(size_t NumWin); void RefreshContentsWindow(void); void GoToAddress(void); @@ -29,12 +27,10 @@ class Memory1BrowserWindow: public QWidget private: QVBoxLayout * layout; - // QTextBrowser * text; QLabel * text; QPushButton * refresh; QLineEdit * address; QPushButton * go; - int memBase; size_t memOrigin; size_t NumWinOrigin; diff --git a/src/gui/app.cpp b/src/gui/app.cpp index 3200468..9b3dc43 100644 --- a/src/gui/app.cpp +++ b/src/gui/app.cpp @@ -281,7 +281,7 @@ bool ParseCommandLine(int argc, char * argv[]) // DRAM size max if (strcmp(argv[i], "--dram-max") == 0) { - printf("DRAM size set at 8 Mbytes.\n"); + printf("DRAM size set at 8 MBytes.\n"); vjs.DRAM_size = 0x800000; }