]> Shamusworld >> Repos - virtualjaguar/blobdiff - src/gui/debug/cpubrowser.cpp
Fix stupid button failure bug for controller #2.
[virtualjaguar] / src / gui / debug / cpubrowser.cpp
index daabbf30be9ecb33f3c08648de8f05756e066aa6..331ac9059ac390f30f2536017876fa39d6a75603 100644 (file)
@@ -7,7 +7,7 @@
 // JLH = James Hammons <jlhamm@acm.org>
 //
 // Who  When        What
-// ---  ----------  -------------------------------------------------------------
+// ---  ----------  -----------------------------------------------------------
 // JLH  08/14/2012  Created this file
 //
 
 #include "m68000/m68kinterface.h"
 #include "dsp.h"
 #include "gpu.h"
+#include "jaguar.h"
 
 
 CPUBrowserWindow::CPUBrowserWindow(QWidget * parent/*= 0*/): QWidget(parent, Qt::Dialog),
-//     layout(new QVBoxLayout), text(new QTextBrowser),
        layout(new QVBoxLayout), text(new QLabel),
        refresh(new QPushButton(tr("Refresh"))),
-       memBase(0)
+       bpm(new QCheckBox(tr("BPM"))), bpmAddress(new QLineEdit)
 {
        setWindowTitle(tr("CPU Browser"));
 
        // Need to set the size as well...
 //     resize(560, 480);
 
-//     QFont fixedFont("Lucida Console", 8, QFont::Normal);
-       QFont fixedFont("", 8, QFont::Normal);
+       // Limit input to 6 hex digits
+       bpmAddress->setInputMask("hhhhhh");
+       QHBoxLayout * hbox1 = new QHBoxLayout;
+       hbox1->addWidget(bpm);
+       hbox1->addWidget(bpmAddress);
+
+       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->addLayout(hbox1);
        layout->addWidget(refresh);
 
        connect(refresh, SIGNAL(clicked()), this, SLOT(RefreshContents()));
+       connect(bpm, SIGNAL(clicked(bool)), this, SLOT(HandleBPM(bool)));
+       connect(bpmAddress, SIGNAL(textChanged(const QString &)), this, SLOT(HandleBPMAddress(const QString &)));
 }
 
 
@@ -236,10 +245,26 @@ DSP Control:
 }
 
 
+void CPUBrowserWindow::HandleBPM(bool state)
+{
+       bpmActive = state;
+if (bpmActive)
+       printf("BPM Set: $%06X\n", bpmAddress1);
+}
+
+
+void CPUBrowserWindow::HandleBPMAddress(const QString & newText)
+{
+       bool ok;
+       bpmAddress1 = newText.toUInt(&ok, 16);
+}
+
+
 void CPUBrowserWindow::keyPressEvent(QKeyEvent * e)
 {
        if (e->key() == Qt::Key_Escape)
                hide();
+#if 0
        else if (e->key() == Qt::Key_PageUp)
        {
                memBase -= 480;
@@ -276,4 +301,5 @@ void CPUBrowserWindow::keyPressEvent(QKeyEvent * e)
 
                RefreshContents();
        }
+#endif
 }