X-Git-Url: http://git.hcoop.net/clinton/Virtual-Jaguar-Rx.git/blobdiff_plain/c4fe5864602982ced026178abdfe862eb2c5e1c5..HEAD:/src/gui/mainwin.cpp diff --git a/src/gui/mainwin.cpp b/src/gui/mainwin.cpp index eca4846..7fb2f3d 100644 --- a/src/gui/mainwin.cpp +++ b/src/gui/mainwin.cpp @@ -28,6 +28,7 @@ // JPM Aug./2019 Update texts descriptions, set cartridge view menu for debugger mode only, added a HW registers browser and source level tracing // JPM Marc./2020 Added the step over for source level tracing // RG Jan./2021 Linux build fixes +// JPM Apr./2021 Handle number of M68K cycles used in tracing mode, added video output display in a window // // FIXED: @@ -93,7 +94,7 @@ #include "m68000/m68kinterface.h" #include "debugger/DBGManager.h" -//#include "debugger/VideoWin.h" +#include "debugger/VideoWin.h" //#include "debugger/DasmWin.h" #include "debugger/SourcesWin.h" #include "debugger/m68kDasmWin.h" @@ -205,7 +206,8 @@ MainWin::MainWin(bool autoRun): running(true), powerButtonOn(false), // Windows debugger mode features if (vjs.softTypeDebugger) { - //VideoOutputWin = new VideoOutputWindow(this); + VideoOutputWin = new VideoOutputWindow(this); + //VideoOutputWin->show(); //VideoOutputWin->setCentralWidget() //DasmWin = new DasmWindow(); //DasmWin = new DasmWindow(this); @@ -441,9 +443,9 @@ MainWin::MainWin(bool autoRun): running(true), powerButtonOn(false), saveDumpAsAct->setDisabled(false); connect(saveDumpAsAct, SIGNAL(triggered()), this, SLOT(ShowSaveDumpAsWin())); - //VideoOutputAct = new QAction(tr("Output Video"), this); - //VideoOutputAct->setStatusTip(tr("Shows the output video window")); - //connect(VideoOutputAct, SIGNAL(triggered()), this, SLOT(ShowVideoOutputWin())); + VideoOutputAct = new QAction(tr("Output Video"), this); + VideoOutputAct->setStatusTip(tr("Shows the output video window")); + connect(VideoOutputAct, SIGNAL(triggered()), this, SLOT(ShowVideoOutputWin())); //DasmAct = new QAction(tr("Disassembly"), this); //DasmAct->setStatusTip(tr("Shows the disassembly window")); @@ -580,11 +582,9 @@ MainWin::MainWin(bool autoRun): running(true), powerButtonOn(false), debugWindowExceptionMenu = debugWindowsMenu->addMenu(tr("&Exception")); debugWindowExceptionMenu->addAction(exceptionVectorTableBrowseAct); debugWindowsMenu->addSeparator(); -#if 0 debugWindowOutputMenu = debugWindowsMenu->addMenu(tr("&Output")); debugWindowOutputMenu->addAction(VideoOutputAct); debugWindowsMenu->addSeparator(); -#endif debugWindowsWatchMenu = debugWindowsMenu->addMenu(tr("&Watch")); debugWindowsWatchMenu->addAction(allWatchBrowseAct); debugWindowsMenu->addAction(LocalBrowseAct); @@ -1188,6 +1188,7 @@ static uint32_t refresh = 0; //if (!vjs.softTypeDebugger) videoWidget->updateGL(); + //vjs.softTypeDebugger ? VideoOutputWin->RefreshContents(videoWidget) : NULL; // FPS handling // Approach: We use a ring buffer to store times (in ms) over a given @@ -1331,6 +1332,7 @@ void MainWin::ToggleRunState(void) } videoWidget->updateGL(); + //vjs.softTypeDebugger ? VideoOutputWin->RefreshContents(videoWidget) : NULL; cpuBrowseWin->HoldBPM(); cpuBrowseWin->HandleBPMContinue(); @@ -1353,6 +1355,7 @@ void MainWin::ToggleRunState(void) cpuBrowseWin->UnholdBPM(); } + emuStatusWin->ResetM68KCycles(); // Pause/unpause any running/non-running threads... DACPauseAudioThread(!running); } @@ -1563,6 +1566,7 @@ void MainWin::DisableAllBreakpoints(void) // Open, or display, the new breakpoint function window void MainWin::ShowNewFunctionBreakpointWin(void) { + NewFunctionBreakpointWin->SetFnctBreakpointWin(BreakpointsWin); NewFunctionBreakpointWin->show(); ShowBreakpointsWin(); } @@ -1590,12 +1594,12 @@ void MainWin::DebuggerTraceStepInto(void) { while (!SourcesWin->CheckChangeLine()) { - JaguarStepInto(); + emuStatusWin->UpdateM68KCycles(JaguarStepInto()); } } else { - JaguarStepInto(); + emuStatusWin->UpdateM68KCycles(JaguarStepInto()); } videoWidget->updateGL(); @@ -1620,6 +1624,7 @@ void MainWin::DebuggerRestart(void) dasmtabWidget->setCurrentIndex(1); // set focus on the disasm M68K tab m68k_set_reg(M68K_REG_A6, 0); m68k_brk_hitcounts_reset(); + emuStatusWin->ResetM68KCycles(); bpmHitCounts = 0; DebuggerResetWindows(); CommonResetWindows(); @@ -1640,12 +1645,12 @@ void MainWin::DebuggerTraceStepOver(void) { while (!SourcesWin->CheckChangeLine()) { - JaguarStepOver(0); + emuStatusWin->UpdateM68KCycles(JaguarStepOver(0)); } } else { - JaguarStepOver(0); + emuStatusWin->UpdateM68KCycles(JaguarStepOver(0)); } videoWidget->updateGL(); @@ -1667,6 +1672,7 @@ void MainWin::FrameAdvance(void) JaguarExecuteNew(); //if (!vjs.softTypeDebugger) videoWidget->updateGL(); + //vjs.softTypeDebugger ? VideoOutputWin->RefreshContents(videoWidget) : NULL; ToggleRunState(); // Need to execute 1 frames' worth of DSP thread as well :-/ @@ -1859,17 +1865,17 @@ void MainWin::ShowDasmWin(void) // -#if 0 void MainWin::ShowVideoOutputWin(void) { //VideoOutputWindowCentrale = mainWindowCentrale->addSubWindow(videoWidget); //VideoOutputWindowCentrale->setWindowTitle(QString(tr("Video output"))); //VideoOutputWindowCentrale->show(); //memBrowseWin->show(); - //VideoOutputWin->show(); + VideoOutputWin->show(); + VideoOutputWin->SetupVideo(videoWidget); + //VideoOutputWin->adjustSize(); //VideoOutputWin->RefreshContents(videoWidget); } -#endif // Resize video window based on zoom factor @@ -1952,6 +1958,7 @@ void MainWin::ReadSettings(void) strcpy(vjs.absROMPath, settings.value("DefaultABS", "").toString().toUtf8().data()); vjs.refresh = settings.value("refresh", 60).toUInt(); vjs.allowWritesToROM = settings.value("writeROM", false).toBool(); + vjs.allowM68KExceptionCatch = settings.value("M68KExceptionCatch", false).toBool(); settings.endGroup(); // Read settings from the Keybindings @@ -2174,6 +2181,13 @@ void MainWin::ReadUISettings(void) size = settings.value("SaveDumpAsWinSize", QSize(400, 400)).toSize(); SaveDumpAsWin->resize(size); + // save output video UI information + pos = settings.value("VideoOutputWinPos", QPoint(200, 200)).toPoint(); + VideoOutputWin->move(pos); + settings.value("VideoOutputWinIsVisible", false).toBool() ? ShowVideoOutputWin() : void(); + size = settings.value("VideoOutputWinSize", QSize(400, 400)).toSize(); + VideoOutputWin->resize(size); + // Breakpoints UI information pos = settings.value("BreakpointsWinPos", QPoint(200, 200)).toPoint(); BreakpointsWin->move(pos); @@ -2252,6 +2266,7 @@ void MainWin::WriteSettings(void) settings.setValue("DefaultROM", vjs.alpineROMPath); settings.setValue("DefaultABS", vjs.absROMPath); settings.setValue("writeROM", vjs.allowWritesToROM); + settings.setValue("M68KExceptionCatch", vjs.allowM68KExceptionCatch); settings.endGroup(); // Write settings from the Debugger mode @@ -2405,6 +2420,9 @@ void MainWin::WriteUISettings(void) settings.setValue("SaveDumpAsWinPos", SaveDumpAsWin->pos()); settings.setValue("SaveDumpAsWinIsVisible", SaveDumpAsWin->isVisible()); settings.setValue("SaveDumpAsWinSize", SaveDumpAsWin->size()); + settings.setValue("VideoOutputWinPos", VideoOutputWin->pos()); + settings.setValue("VideoOutputWinIsVisible", VideoOutputWin->isVisible()); + settings.setValue("VideoOutputWinSize", VideoOutputWin->size()); for (i = 0; i < vjs.nbrmemory1browserwindow; i++) { @@ -2499,6 +2517,7 @@ void MainWin::DebuggerRefreshWindows(void) { if (vjs.softTypeDebugger) { + //VideoOutputWin->RefreshContents(videoWidget); FilesrcListWin->RefreshContents(); SourcesWin->RefreshContents(); m68kDasmWin->RefreshContents();