-- Added a specific breakpoint for the M68K bus error exception
21) Project has switched to libdwarf 20210305 library 64bits for VS 2017
22) Breakpoint list window is now refreshed after a new breakpoint is set
+23) Handle number of M68K cycles used when tracing in debugger mode
+-- The cycles are displayed in the emulator status window
Release 4a (15th August 2019)
-----------------------------
// Who When What
// --- ---------- -----------------------------------------------------------
// JPM 02/02/2017 Created this file
+// JPM Apr./2021 Display number of M68K cycles used in tracing mode
//
// STILL TO DO:
//
-EmuStatusWindow::EmuStatusWindow(QWidget * parent/*= 0*/): QWidget(parent, Qt::Dialog),
- layout(new QVBoxLayout),
- text(new QLabel),
- GPURunning(GPUIsRunning())
+EmuStatusWindow::EmuStatusWindow(QWidget * parent/*= 0*/) : QWidget(parent, Qt::Dialog),
+layout(new QVBoxLayout),
+resetcycles(new QPushButton(tr("Reset cycles"))),
+text(new QLabel),
+M68K_totalcycles(0),
+M68K_opcodecycles(0),
+GPURunning(GPUIsRunning())
{
setWindowTitle(tr("Emulator status"));
setLayout(layout);
layout->addWidget(text);
+ layout->addWidget(resetcycles);
+
+ connect(resetcycles, SIGNAL(clicked()), this, SLOT(ResetCycles()));
+}
+
+
+//
+void EmuStatusWindow::ResetCycles(void)
+{
+ ResetM68KCycles();
+ RefreshContents();
+}
+
+
+//
+void EmuStatusWindow::ResetM68KCycles(void)
+{
+ M68K_totalcycles = M68K_opcodecycles = 0;
+}
+
+
+//
+void EmuStatusWindow::UpdateM68KCycles(size_t cycles)
+{
+ M68K_totalcycles += (M68K_opcodecycles = cycles);
}
emuStatusDump += QString(string);
sprintf(string, " M68K tracing | %s\n", (startM68KTracing ? "On" : "Off"));
emuStatusDump += QString(string);
- sprintf(string, " DRAM | %i KB", (vjs.DRAM_size / 1024));
+ sprintf(string, " DRAM | %zi KB\n", (vjs.DRAM_size / 1024));
+ emuStatusDump += QString(string);
+ sprintf(string, " M68K tracing | %zi cycle%s\n", M68K_opcodecycles, (M68K_opcodecycles ? "s" : ""));
+ emuStatusDump += QString(string);
+ sprintf(string, " M68K tracing total | %zi cycle%s", M68K_totalcycles, (M68K_totalcycles ? "s" : ""));
emuStatusDump += QString(string);
text->setText(emuStatusDump);
public:
EmuStatusWindow(QWidget * parent = 0);
-
- public slots:
+ void UpdateM68KCycles(size_t cycles);
void RefreshContents(void);
+ void ResetM68KCycles(void);
+
+ private slots:
+ void ResetCycles(void);
protected:
void keyPressEvent(QKeyEvent *);
private:
QVBoxLayout * layout;
+ QPushButton * resetcycles;
QLabel * text;
- bool GPURunning;
- bool M68000DebugHaltStatus;
+ bool GPURunning;
+ bool M68000DebugHaltStatus;
+ size_t M68K_opcodecycles;
+ size_t M68K_totalcycles;
};
#endif // __EMUSTATUS_H__
// JPM Aug./2019 Update texts descriptions, set cartridge view menu for debugger mode only, added a HW registers browser and source level tracing\r
// JPM Marc./2020 Added the step over for source level tracing\r
// RG Jan./2021 Linux build fixes\r
+// JPM Apr./2021 Handle number of M68K cycles used in tracing mode\r
//\r
\r
// FIXED:\r
cpuBrowseWin->UnholdBPM();\r
}\r
\r
+ emuStatusWin->ResetM68KCycles();\r
// Pause/unpause any running/non-running threads...\r
DACPauseAudioThread(!running);\r
}\r
{\r
while (!SourcesWin->CheckChangeLine())\r
{\r
- JaguarStepInto();\r
+ emuStatusWin->UpdateM68KCycles(JaguarStepInto());\r
}\r
}\r
else\r
{\r
- JaguarStepInto();\r
+ emuStatusWin->UpdateM68KCycles(JaguarStepInto());\r
}\r
\r
videoWidget->updateGL();\r
dasmtabWidget->setCurrentIndex(1); // set focus on the disasm M68K tab\r
m68k_set_reg(M68K_REG_A6, 0);\r
m68k_brk_hitcounts_reset();\r
+ emuStatusWin->ResetM68KCycles();\r
bpmHitCounts = 0;\r
DebuggerResetWindows();\r
CommonResetWindows();\r
{\r
while (!SourcesWin->CheckChangeLine())\r
{\r
- JaguarStepOver(0);\r
+ emuStatusWin->UpdateM68KCycles(JaguarStepOver(0));\r
}\r
}\r
else\r
{\r
- JaguarStepOver(0);\r
+ emuStatusWin->UpdateM68KCycles(JaguarStepOver(0));\r
}\r
\r
videoWidget->updateGL();\r
// JPM Aug./2019 Fix specific breakpoint for ROM cartridge or unknown memory location writing; added a specific breakpoint for the M68K illegal & unimplemented instruction, unknown exceptions and address error exceptions
// JPM Aug./2019 Fix potential emulator freeze after an exception has occured
// JPM Feb./2021 Added a specific breakpoint for the M68K bus error exception, and a M68K exception catch detection
+// JPM Apr./2021 Keep number of M68K cycles used in tracing mode
//
// Step over function
-void JaguarStepOver(int depth)
+int JaguarStepOver(int depth)
{
bool exit;
+ int cycles;
//bool case55 = false;
//uint32_t m68kSR;
if (!depth)
{
+ cycles = 0;
exit = true;
}
else
do
{
- JaguarStepInto();
+ cycles += JaguarStepInto();
switch (M68KGetCurrentOpcodeFamily())
{
// bsr & jsr
case 54:
case 52:
- JaguarStepOver(depth+1);
+ cycles += JaguarStepOver(depth+1);
//if (depth)
//{
// exit = false;
#ifdef _MSC_VER
#pragma message("Warning: !!! Need to verify the Jaguar Step Over function !!!")
#else
- #warning "!!! Need to verify the Jaguar Step Over function !!!"
+#warning "!!! Need to verify the Jaguar Step Over function !!!"
#endif // _MSC_VER
+ return cycles;
}
// Step into function
-void JaguarStepInto(void)
+int JaguarStepInto(void)
{
+ int cycles;
// double timeToNextEvent = GetTimeToNextEvent();
- m68k_execute(USEC_TO_M68K_CYCLES(0));
+ cycles = m68k_execute(USEC_TO_M68K_CYCLES(0));
// m68k_execute(USEC_TO_M68K_CYCLES(timeToNextEvent));
if (vjs.GPUEnabled)
#else
#warning "!!! Need to verify the Jaguar Step Into function !!!"
#endif // _MSC_VER
+ return cycles;
}
void JaguarDasm(uint32_t offset, uint32_t qt);
void JaguarExecuteNew(void);
-void JaguarStepInto(void);
-void JaguarStepOver(int depth);
+int JaguarStepInto(void);
+int JaguarStepOver(int depth);
// Exports from JAGUAR.CPP