2 // emustatus.cpp - Jaguar emulator status
5 // (C) 2012 Underground Software
7 // JPM = Jean-Paul Mari <djipi.mari@gmail.com>
10 // --- ---------- -----------------------------------------------------------
11 // JPM 02/02/2017 Created this file
17 #include "emustatus.h"
20 #include "m68000/m68kinterface.h"
24 EmuStatusWindow::EmuStatusWindow(QWidget
* parent
/*= 0*/): QWidget(parent
, Qt::Dialog
),
25 // layout(new QVBoxLayout), text(new QTextBrowser),
26 layout(new QVBoxLayout
),
28 //refresh(new QPushButton(tr("Refresh"))),
29 //address(new QLineEdit),
30 //go(new QPushButton(tr("Go"))),
31 GPURunning(GPUIsRunning())
33 setWindowTitle(tr("Emulator status"));
36 address->setInputMask("hhhhhh");
37 QHBoxLayout * hbox1 = new QHBoxLayout;
38 hbox1->addWidget(refresh);
39 hbox1->addWidget(address);
43 // Need to set the size as well...
46 QFont
fixedFont("Lucida Console", 8, QFont::Normal
);
47 // QFont fixedFont("", 8, QFont::Normal);
48 fixedFont
.setStyleHint(QFont::TypeWriter
);
49 text
->setFont(fixedFont
);
50 //// layout->setSizeConstraint(QLayout::SetFixedSize);
53 layout
->addWidget(text
);
54 // layout->addWidget(refresh);
56 layout->addLayout(hbox1);
60 connect(refresh, SIGNAL(clicked()), this, SLOT(RefreshContents()));
61 connect(go, SIGNAL(clicked()), this, SLOT(GoToAddress()));
66 void EmuStatusWindow::RefreshContents(void)
69 QString emuStatusDump
;
75 GPURunning
= GPUIsRunning();
76 sprintf(string
, " GPU active | %s\n", (GPURunning
? "Yes" : "No"));
77 emuStatusDump
+= QString(string
);
78 M68000DebugHaltStatus
= M68KDebugHaltStatus();
79 sprintf(string
, "M68K debugger status | %s\n", (M68000DebugHaltStatus
? "Halt" : "Run"));
80 emuStatusDump
+= QString(string
);
81 sprintf(string
, " M68K tracing | %s", (startM68KTracing
? "On" : "Off"));
82 emuStatusDump
+= QString(string
);
84 text
->setText(emuStatusDump
);
90 void EmuStatusWindow::keyPressEvent(QKeyEvent * e)
92 if (e->key() == Qt::Key_Escape)
94 else if (e->key() == Qt::Key_PageUp)
103 else if (e->key() == Qt::Key_PageDown)
107 if (memBase > (0x200000 - 480))
108 memBase = 0x200000 - 480;
112 else if (e->key() == Qt::Key_Up || e->key() == Qt::Key_Minus)
121 else if (e->key() == Qt::Key_Down || e->key() == Qt::Key_Equal)
125 if (memBase > (0x200000 - 480))
126 memBase = 0x200000 - 480;
135 void EmuStatusWindow::GoToAddress(void)
138 QString newAddress = address->text();
139 memBase = newAddress.toUInt(&ok, 16);