]> Shamusworld >> Repos - virtualjaguar/blobdiff - src/gui/mainwin.cpp
Fixed limits on cartridge space from 4MB to 6MB.
[virtualjaguar] / src / gui / mainwin.cpp
index 88b4d19e160e201a4e2876f8d104e480fa27ef0b..b17ef8d91e923b709fa28259a668416602058b4a 100644 (file)
@@ -24,7 +24,7 @@
 // - Remove SDL dependencies (sound, mainly) from Jaguar core lib
 // - Fix inconsistency with trailing slashes in paths (eeproms needs one, software doesn't)
 //
-// SFDX CODE: 9XF9TUHFM2359
+// SFDX CODE: S1E9T8H5M23YS
 
 // Uncomment this for debugging...
 //#define DEBUG
@@ -403,12 +403,22 @@ void MainWin::closeEvent(QCloseEvent * event)
 
 void MainWin::keyPressEvent(QKeyEvent * e)
 {
+       // From jaguar.cpp
+       extern bool startM68KTracing;
+
        // We ignore the Alt key for now, since it causes problems with the GUI
        if (e->key() == Qt::Key_Alt)
        {
                e->accept();
                return;
        }
+       else if (e->key() == Qt::Key_F11)
+       {
+               startM68KTracing = true;
+               e->accept();
+               return;
+       }
+
 /*
        if (e->key() == Qt::Key_F9)
        {
@@ -865,8 +875,14 @@ void MainWin::SetFullScreen(bool state/*= true*/)
 //             mainWinSize = size();
                menuBar()->hide();
                statusBar()->hide();
+               x1Act->setDisabled(true);
+               x2Act->setDisabled(true);
+               x3Act->setDisabled(true);
                showFullScreen();
-               QRect r = QApplication::desktop()->availableGeometry();
+               // This is needed because the fullscreen may happen on a different
+               // screen than screen 0:
+               int screenNum = QApplication::desktop()->screenNumber(videoWidget);
+               QRect r = QApplication::desktop()->availableGeometry(screenNum);
 //             double targetWidth = 320.0, targetHeight = (vjs.hardwareTypeNTSC ? 240.0 : 256.0);
                double targetWidth = (double)VIRTUAL_SCREEN_WIDTH,
                        targetHeight = (double)(vjs.hardwareTypeNTSC ? VIRTUAL_SCREEN_HEIGHT_NTSC : VIRTUAL_SCREEN_HEIGHT_PAL);
@@ -874,12 +890,22 @@ void MainWin::SetFullScreen(bool state/*= true*/)
                // NOTE: Really should check here to see which dimension constrains the other.
                //       Right now, we assume that height is the constraint.
                int newWidth = (int)(aspectRatio * (double)r.height());
+               videoWidget->offset = (r.width() - newWidth) / 2;
+               videoWidget->fullscreen = true;
+               videoWidget->outputWidth = newWidth;
 
-               videoWidget->setFixedSize(newWidth, r.height());
+//             videoWidget->setFixedSize(newWidth, r.height());
+               videoWidget->setFixedSize(r.width(), r.height());
                showFullScreen();
        }
        else
        {
+               // Reset the video widget to windowed mode
+               videoWidget->offset = 0;
+               videoWidget->fullscreen = false;
+               x1Act->setDisabled(false);
+               x2Act->setDisabled(false);
+               x3Act->setDisabled(false);
                menuBar()->show();
                statusBar()->show();
                showNormal();