X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgui%2Fmainwin.cpp;h=ba0b21ebe09bc94f7e5db84ba6cc2a1ebe760a3b;hb=d9abe1a157bbd35e8b282927489b687f56048ce6;hp=7abc8c75509405412af2f2e2f8b606c159aeee30;hpb=8edf7ac06469707cc221b2cdaa8bea0ed4e2f898;p=virtualjaguar diff --git a/src/gui/mainwin.cpp b/src/gui/mainwin.cpp index 7abc8c7..ba0b21e 100644 --- a/src/gui/mainwin.cpp +++ b/src/gui/mainwin.cpp @@ -1,9 +1,9 @@ // // mainwin.cpp - Qt-based GUI for Virtual Jaguar: Main Application Window -// by James L. Hammons +// by James Hammons // (C) 2009 Underground Software // -// JLH = James L. Hammons +// JLH = James Hammons // // Who When What // --- ---------- ------------------------------------------------------------- @@ -72,7 +72,7 @@ MainWin::MainWin(): running(true), powerButtonOn(false), showUntunedTankCircuit(true), cartridgeLoaded(false), CDActive(false),//, alpineLoadSuccessful(false), - pauseForFileSelector(false) + pauseForFileSelector(false), plzDontKillMyComputer(false) { videoWidget = new GLWidget(this); setCentralWidget(videoWidget); @@ -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); @@ -437,6 +442,9 @@ void MainWin::Timer(void) if (showUntunedTankCircuit) { + // Some machines can't handle this, so we give them the option to disable it. :-) + if (!plzDontKillMyComputer) + { // Random hash & trash // We try to simulate an untuned tank circuit here... :-) for(uint32_t x=0; xrasterWidth; x++) @@ -447,6 +455,7 @@ void MainWin::Timer(void) = (rand() & 0xFF) << 8 | (rand() & 0xFF) << 16 | (rand() & 0xFF) << 24; } } + } } else { @@ -587,7 +596,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 +652,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));