X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgui%2Fdebug%2Fcpubrowser.cpp;h=331ac9059ac390f30f2536017876fa39d6a75603;hb=48dd9ba5b6742935eef61cec80964afe093139ad;hp=62d6d0a250ebe8a958806d7443069db2113a0a84;hpb=f7b2692b338aaf37470be0a1d0e5ae42c82e0c65;p=virtualjaguar diff --git a/src/gui/debug/cpubrowser.cpp b/src/gui/debug/cpubrowser.cpp index 62d6d0a..331ac90 100644 --- a/src/gui/debug/cpubrowser.cpp +++ b/src/gui/debug/cpubrowser.cpp @@ -7,7 +7,7 @@ // JLH = James Hammons // // Who When What -// --- ---------- ------------------------------------------------------------- +// --- ---------- ----------------------------------------------------------- // JLH 08/14/2012 Created this file // @@ -19,28 +19,39 @@ #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); 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 &))); } @@ -54,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); @@ -84,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
" @@ -126,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
" @@ -172,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; @@ -212,4 +301,5 @@ void CPUBrowserWindow::keyPressEvent(QKeyEvent * e) RefreshContents(); } +#endif }