From: Shamus Hammons Date: Tue, 9 Oct 2012 04:49:31 +0000 (-0500) Subject: Fixed command line PAL/NSTC switches to work properly. X-Git-Tag: 2.1.0~13 X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=virtualjaguar;a=commitdiff_plain;h=09b508a759ca512da810722a0d4786dd1695d47c Fixed command line PAL/NSTC switches to work properly. --- diff --git a/src/gui/mainwin.cpp b/src/gui/mainwin.cpp index 56c5747..22c211b 100644 --- a/src/gui/mainwin.cpp +++ b/src/gui/mainwin.cpp @@ -276,13 +276,13 @@ MainWin::MainWin(bool autoRun): running(true), powerButtonOn(false), // Set up timer based loop for animation... timer = new QTimer(this); connect(timer, SIGNAL(timeout()), this, SLOT(Timer())); -//This is only correct for PAL. !!! FIX !!! [DONE] -//Use timer->setInterval( int msec ) to fix this on the fly -// timer->start(20); + // This isn't very accurate for NTSC: This is early by 40 msec per frame. // This is because it's discarding the 0.6666... on the end of the fraction. // Alas, 6 doesn't divide cleanly into 10. :-P - timer->start(vjs.hardwareTypeNTSC ? 16 : 20); +//Should we defer this until SyncUI? Probably. +//No, it doesn't work, because it uses setInterval() instead of start()... +// timer->start(vjs.hardwareTypeNTSC ? 16 : 20); // We set this initially, to make VJ behave somewhat as it would if no // cart were inserted and the BIOS was set as active... @@ -355,6 +355,10 @@ void MainWin::SyncUI(void) fullScreen = vjs.fullscreen; SetFullScreen(fullScreen); + + // Reset the timer to be what was set in the command line (if any): +// timer->setInterval(vjs.hardwareTypeNTSC ? 16 : 20); + timer->start(vjs.hardwareTypeNTSC ? 16 : 20); }