+void MainWin::SetFullScreen(bool state/*= true*/)
+{
+ if (state)
+ {
+ mainWinPosition = pos();
+// mainWinSize = size();
+ menuBar()->hide();
+ statusBar()->hide();
+ x1Act->setDisabled(true);
+ x2Act->setDisabled(true);
+ x3Act->setDisabled(true);
+ showFullScreen();
+ // 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);
+ double aspectRatio = targetWidth / targetHeight;
+ // 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(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();
+ ResizeMainWindow();
+ move(mainWinPosition);
+ }
+
+ // For some reason, this doesn't work: If the emu is paused, toggling from
+ // fullscreen to windowed (& vice versa) shows a white screen.
+// videoWidget->updateGL();
+}
+
+
+void MainWin::ToggleFullScreen(void)
+{
+ fullScreen = !fullScreen;
+ SetFullScreen(fullScreen);
+}
+
+
+void MainWin::ShowMemoryBrowserWin(void)
+{
+ memBrowseWin->show();
+ memBrowseWin->RefreshContents();
+}
+
+
+void MainWin::ShowCPUBrowserWin(void)
+{
+ cpuBrowseWin->show();
+ cpuBrowseWin->RefreshContents();
+}
+
+
+void MainWin::ShowOPBrowserWin(void)
+{
+ opBrowseWin->show();
+ opBrowseWin->RefreshContents();
+}
+
+
+void MainWin::ShowM68KDasmBrowserWin(void)
+{
+ m68kDasmBrowseWin->show();
+ m68kDasmBrowseWin->RefreshContents();
+}
+
+
+void MainWin::ShowRISCDasmBrowserWin(void)
+{
+ riscDasmBrowseWin->show();
+ riscDasmBrowseWin->RefreshContents();
+}
+
+