X-Git-Url: http://git.hcoop.net/clinton/Virtual-Jaguar-Rx.git/blobdiff_plain/d259f61f080f2388a00f36766240aac016970dd2..570dad923e20ad098263df653287a08f5473427a:/src/debugger/m68kDasmWin.cpp 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