]> Shamusworld >> Repos - virtualjaguar/blobdiff - src/gui/debug/m68kdasmbrowser.cpp
Changed fonts in developer dialogs to use system defaults.
[virtualjaguar] / src / gui / debug / m68kdasmbrowser.cpp
index 25829e15e47042c05230d9bd1c3e0c5304e88cf4..931b3db661289cbfd760455f728ab0fbf1066855 100644 (file)
@@ -25,22 +25,34 @@ M68KDasmBrowserWindow::M68KDasmBrowserWindow(QWidget * parent/*= 0*/): QWidget(p
 //     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(0x4000)
 {
        setWindowTitle(tr("M68K 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("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->addWidget(refresh);
+       layout->addLayout(hbox1);
 
        connect(refresh, SIGNAL(clicked()), this, SLOT(RefreshContents()));
+       connect(go, SIGNAL(clicked()), this, SLOT(GoToAddress()));
 }
 
 
@@ -89,7 +101,7 @@ void M68KDasmBrowserWindow::keyPressEvent(QKeyEvent * e)
 #if 1
        else if (e->key() == Qt::Key_PageUp)
        {
-               memBase -= 480;
+               memBase -= 64;
 
                if (memBase < 0)
                        memBase = 0;
@@ -98,10 +110,10 @@ void M68KDasmBrowserWindow::keyPressEvent(QKeyEvent * e)
        }
        else if (e->key() == Qt::Key_PageDown)
        {
-               memBase += 480;
+               memBase += 64;
 
-               if (memBase > (0x200000 - 480))
-                       memBase = 0x200000 - 480;
+               if (memBase > (0xF00000 - 64))
+                       memBase = 0xF00000 - 64;
 
                RefreshContents();
        }
@@ -118,10 +130,20 @@ void M68KDasmBrowserWindow::keyPressEvent(QKeyEvent * e)
        {
                memBase += 16;
 
-               if (memBase > (0x200000 - 480))
-                       memBase = 0x200000 - 480;
+               if (memBase > (0xF00000 - 64))
+                       memBase = 0xF00000 - 64;
 
                RefreshContents();
        }
 #endif
 }
+
+
+void M68KDasmBrowserWindow::GoToAddress(void)
+{
+       bool ok;
+       QString newAddress = address->text();
+       memBase = newAddress.toUInt(&ok, 16);
+       RefreshContents();
+}
+