X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgui%2Fdebug%2Fcpubrowser.cpp;h=2f478ce2eb3090952ed2f219e54caf75a1e7971d;hb=refs%2Ftags%2F2.1.2;hp=ac6063841ce451c6abf71feda5765cfacc0b5f8b;hpb=376c605508b0c1903dee5357a6d95499c940d258;p=virtualjaguar
diff --git a/src/gui/debug/cpubrowser.cpp b/src/gui/debug/cpubrowser.cpp
index ac60638..2f478ce 100644
--- a/src/gui/debug/cpubrowser.cpp
+++ b/src/gui/debug/cpubrowser.cpp
@@ -19,19 +19,25 @@
#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);
+ // 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);
@@ -40,9 +46,12 @@ CPUBrowserWindow::CPUBrowserWindow(QWidget * parent/*= 0*/): QWidget(parent, Qt:
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 &)));
}
@@ -56,6 +65,21 @@ void CPUBrowserWindow::RefreshContents(void)
uint32_t m68kSR = m68k_get_reg(NULL, M68K_REG_SR);
sprintf(string, "PC: %06X SR: %04X
", m68kPC, m68kSR);
s += QString(string);
+/*
+SR format:
++--+--+--+--+ +--+--+--+--+ +--+--+--+--+ +--+--+--+--+
+|T1|T0| S| M| |--|I2|I1|I0| |--|--|--| X| | N| Z| V| C|
++--+--+--+--+ +--+--+--+--+ +--+--+--+--+ +--+--+--+--+
+ T - Trace (T1 only in 68K, T0 = 0)
+ S - Supervisor flag
+ M - Master/Interrupt flag (= 0 in 68K)
+ I - Interrupt level mask
+ X - Extend flag
+ N - Negative flag
+ Z - Zero flag
+ V - Overflow flag
+ C - Carry flag
+*/
uint32_t m68kA0 = m68k_get_reg(NULL, M68K_REG_A0);
uint32_t m68kA1 = m68k_get_reg(NULL, M68K_REG_A1);
@@ -86,8 +110,30 @@ void CPUBrowserWindow::RefreshContents(void)
s += QString(string);
// GPU
- sprintf(string, "GPU PC: %06X FLAGS: %08X
", GPUReadLong(0xF02010), GPUReadLong(0xF02000));
+ sprintf(string, "GPU PC: %06X FLAGS: %04X SR: %04X
", GPUReadLong(0xF02110, DEBUG), GPUReadLong(0xF02100, DEBUG), GPUReadLong(0xF02114, DEBUG));
s += QString(string);
+/*
+GPU Flags:
+0 - Zero flag
+1 - Carry flag
+2 - Negative flag
+3 - IMASK (writing 0 clears, 1 has no effect)
+4-8 - IRQ enable 0 - 4
+9-13 - IRQ latch clear 0 - 4
+14 - REGPAGE
+15 - DMAEN
+
+GPU Control:
+0 - GPU Go
+1 - CPUINT
+2 - GPUINT0
+3 - Single Step
+4 - Single step go
+5 - Unused
+6-10 - IRQ Latch 0 - 4
+11 - Bus Hog
+12-15 - Version
+*/
sprintf(string, "Bank 0:
"
"R00: %08X R01: %08X R02: %08X R03: %08X
"
@@ -128,8 +174,33 @@ void CPUBrowserWindow::RefreshContents(void)
s += QString(string);
// DSP
- sprintf(string, "DSP PC: %06X FLAGS: %08X
", DSPReadLong(0xF1A110), DSPReadLong(0xF1A100));
+ sprintf(string, "DSP PC: %06X FLAGS: %05X SR: %05X
", DSPReadLong(0xF1A110, DEBUG), DSPReadLong(0xF1A100, DEBUG), DSPReadLong(0xF1A114, DEBUG));
s += QString(string);
+/*
+DSP Flags:
+0 - Zero flag
+1 - Carry flag
+2 - Negative flag
+3 - IMASK (writing 0 clears, 1 has no effect)
+4-8 - IRQ enable 0 - 4
+9-13 - IRQ latch clear 0 - 4
+14 - REGPAGE
+15 - DMAEN
+16 - IRQ enable 5
+17 - IRQ latch clear 5
+
+DSP Control:
+0 - DSP Go
+1 - CPUINT
+2 - DSPINT0
+3 - Single Step
+4 - Single step go
+5 - Unused
+6-10 - IRQ Latch 0 - 4
+11 - Bus Hog
+12-15 - Version
+16 - IRQ Latch 5
+*/
sprintf(string, "Bank 0:
"
"R00: %08X R01: %08X R02: %08X R03: %08X
"
@@ -174,10 +245,26 @@ void CPUBrowserWindow::RefreshContents(void)
}
+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;
@@ -214,4 +301,5 @@ void CPUBrowserWindow::keyPressEvent(QKeyEvent * e)
RefreshContents();
}
+#endif
}