]> Shamusworld >> Repos - virtualjaguar/blobdiff - src/gui/mainwin.cpp
2.0.2 release.
[virtualjaguar] / src / gui / mainwin.cpp
index 7abc8c75509405412af2f2e2f8b606c159aeee30..3cf2ec5a6d1ff183b9eaeebc19cc64b12b32f8d6 100644 (file)
@@ -185,6 +185,10 @@ MainWin::MainWin(): running(true), powerButtonOn(false), showUntunedTankCircuit(
        useCDAct->setCheckable(true);
        connect(useCDAct, SIGNAL(triggered()), this, SLOT(ToggleCDUsage()));
 
+       frameAdvanceAct = new QAction(QIcon(":/res/generic.png"), tr("&Frame Advance"), this);
+       frameAdvanceAct->setShortcut(QKeySequence(tr("F7")));
+       connect(frameAdvanceAct, SIGNAL(triggered()), this, SLOT(FrameAdvance()));
+
        // Misc. connections...
        connect(filePickWin, SIGNAL(RequestLoad(QString)), this, SLOT(LoadSoftware(QString)));
        connect(filePickWin, SIGNAL(FilePickerHiding()), this, SLOT(Unpause()));
@@ -194,6 +198,7 @@ MainWin::MainWin(): running(true), powerButtonOn(false), showUntunedTankCircuit(
        fileMenu = menuBar()->addMenu(tr("&Jaguar"));
        fileMenu->addAction(powerAct);
        fileMenu->addAction(pauseAct);
+       fileMenu->addAction(frameAdvanceAct);
        fileMenu->addAction(filePickAct);
        fileMenu->addAction(useCDAct);
        fileMenu->addAction(configAct);
@@ -587,7 +592,10 @@ void MainWin::Unpause(void)
        if (pauseForFileSelector)
        {
                pauseForFileSelector = false;
-               ToggleRunState();
+
+               // Some nutter might have unpaused while in the file selector, so check for that
+               if (!running)
+                       ToggleRunState();
        }
 }
 
@@ -640,6 +648,14 @@ void MainWin::ToggleCDUsage(void)
 #endif
 }
 
+void MainWin::FrameAdvance(void)
+{
+//printf("Frame Advance...\n");
+       // Execute 1 frame, then exit (only useful in Pause mode)
+       JaguarExecuteNew();
+       videoWidget->updateGL();
+}
+
 void MainWin::ResizeMainWindow(void)
 {
        videoWidget->setFixedSize(zoomLevel * 320, zoomLevel * (vjs.hardwareTypeNTSC ? 240 : 256));