Document updates for the R3 release
[clinton/Virtual-Jaguar-Rx.git] / src / gui / emustatus.cpp
CommitLineData
cf76e892
JPM
1//
2// emustatus.cpp - Jaguar emulator status
3//
4// by Jean-Paul Mari
5// (C) 2012 Underground Software
6//
7// JPM = Jean-Paul Mari <djipi.mari@gmail.com>
8//
9// Who When What
10// --- ---------- -----------------------------------------------------------
11// JPM 02/02/2017 Created this file
12//
13
14// STILL TO DO:
15//
16
17#include "emustatus.h"
18#include "memory.h"
19#include "gpu.h"
20#include "m68000/m68kinterface.h"
21#include "jaguar.h"
22
23
24EmuStatusWindow::EmuStatusWindow(QWidget * parent/*= 0*/): QWidget(parent, Qt::Dialog),
25// layout(new QVBoxLayout), text(new QTextBrowser),
26 layout(new QVBoxLayout),
27 text(new QLabel),
28 //refresh(new QPushButton(tr("Refresh"))),
29 //address(new QLineEdit),
30 //go(new QPushButton(tr("Go"))),
31 GPURunning(GPUIsRunning())
32{
33 setWindowTitle(tr("Emulator status"));
34
35/*
36 address->setInputMask("hhhhhh");
37 QHBoxLayout * hbox1 = new QHBoxLayout;
38 hbox1->addWidget(refresh);
39 hbox1->addWidget(address);
40 hbox1->addWidget(go);
41*/
42
43 // Need to set the size as well...
44// resize(560, 480);
45
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);
51 setLayout(layout);
52
53 layout->addWidget(text);
54// layout->addWidget(refresh);
55/*
56 layout->addLayout(hbox1);
57*/
58
59/*
60 connect(refresh, SIGNAL(clicked()), this, SLOT(RefreshContents()));
61 connect(go, SIGNAL(clicked()), this, SLOT(GoToAddress()));
62*/
63}
64
65
66void EmuStatusWindow::RefreshContents(void)
67{
68 char string[1024];
69 QString emuStatusDump;
70
71 if (isVisible())
72 {
73 text->clear();
74
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);
83
84 text->setText(emuStatusDump);
85 }
86}
87
88
89/*
90void EmuStatusWindow::keyPressEvent(QKeyEvent * e)
91{
92 if (e->key() == Qt::Key_Escape)
93 hide();
94 else if (e->key() == Qt::Key_PageUp)
95 {
96 memBase -= 480;
97
98 if (memBase < 0)
99 memBase = 0;
100
101 RefreshContents();
102 }
103 else if (e->key() == Qt::Key_PageDown)
104 {
105 memBase += 480;
106
107 if (memBase > (0x200000 - 480))
108 memBase = 0x200000 - 480;
109
110 RefreshContents();
111 }
112 else if (e->key() == Qt::Key_Up || e->key() == Qt::Key_Minus)
113 {
114 memBase -= 16;
115
116 if (memBase < 0)
117 memBase = 0;
118
119 RefreshContents();
120 }
121 else if (e->key() == Qt::Key_Down || e->key() == Qt::Key_Equal)
122 {
123 memBase += 16;
124
125 if (memBase > (0x200000 - 480))
126 memBase = 0x200000 - 480;
127
128 RefreshContents();
129 }
130}
131*/
132
133
134/*
135void EmuStatusWindow::GoToAddress(void)
136{
137 bool ok;
138 QString newAddress = address->text();
139 memBase = newAddress.toUInt(&ok, 16);
140 RefreshContents();
141}
142*/