From 26044acf8a4fe70772bd6e69afb8b8d20b5a6af5 Mon Sep 17 00:00:00 2001 From: Shamus Hammons Date: Sat, 13 Oct 2012 16:45:47 -0500 Subject: [PATCH] Fix for bad window position when coming out of full screen --- src/gui/mainwin.cpp | 17 ++++++++++++++--- src/gui/mainwin.h | 2 ++ src/jaguar.h | 10 ---------- src/tom.cpp | 2 +- src/tom.h | 8 ++++++++ 5 files changed, 25 insertions(+), 14 deletions(-) diff --git a/src/gui/mainwin.cpp b/src/gui/mainwin.cpp index cfd3ab9..ec3961c 100644 --- a/src/gui/mainwin.cpp +++ b/src/gui/mainwin.cpp @@ -809,8 +809,18 @@ void MainWin::FrameAdvance(void) void MainWin::SetFullScreen(bool state/*= true*/) { +#if 0 + QPoint pos = settings.value("pos", QPoint(200, 200)).toPoint(); + QSize size = settings.value("size", QSize(400, 400)).toSize(); + resize(size); + move(pos); + settings.setValue("pos", pos()); + settings.setValue("size", size()); +#endif if (state) { + mainWinPosition = pos(); +// mainWinSize = size(); menuBar()->hide(); statusBar()->hide(); showFullScreen(); @@ -832,6 +842,7 @@ void MainWin::SetFullScreen(bool state/*= true*/) statusBar()->show(); showNormal(); ResizeMainWindow(); + move(mainWinPosition); } // For some reason, this doesn't work: If the emu is paused, toggling from @@ -882,11 +893,11 @@ void MainWin::ResizeMainWindow(void) void MainWin::ReadSettings(void) { QSettings settings("Underground Software", "Virtual Jaguar"); - QPoint pos = settings.value("pos", QPoint(200, 200)).toPoint(); + mainWinPosition = settings.value("pos", QPoint(200, 200)).toPoint(); QSize size = settings.value("size", QSize(400, 400)).toSize(); resize(size); - move(pos); - pos = settings.value("cartLoadPos", QPoint(200, 200)).toPoint(); + move(mainWinPosition); + QPoint pos = settings.value("cartLoadPos", QPoint(200, 200)).toPoint(); filePickWin->move(pos); zoomLevel = settings.value("zoom", 2).toInt(); diff --git a/src/gui/mainwin.h b/src/gui/mainwin.h index 8d51e19..fe88892 100644 --- a/src/gui/mainwin.h +++ b/src/gui/mainwin.h @@ -90,6 +90,8 @@ class MainWin: public QMainWindow public: bool plzDontKillMyComputer; private: + QPoint mainWinPosition; +// QSize mainWinSize; QMenu * fileMenu; QMenu * helpMenu; QMenu * debugMenu; diff --git a/src/jaguar.h b/src/jaguar.h index c0cc1b3..8cd1988 100644 --- a/src/jaguar.h +++ b/src/jaguar.h @@ -20,8 +20,6 @@ void JaguarWriteLong(uint32 offset, uint32 data, uint32 who = UNKNOWN); bool JaguarInterruptHandlerIsValid(uint32 i); void JaguarDasm(uint32 offset, uint32 qt); -void JaguarExecute(uint32 * backbuffer, bool render); -//For testing the new system... void JaguarExecuteNew(void); // Exports from JAGUAR.CPP @@ -43,14 +41,6 @@ extern bool jaguarCartInserted; #define ASSERT_LINE 1 #define CLEAR_LINE 0 -// Video stuff (should go in tom.h?) - -// NB: This virtual width is for PWIDTH = 4 -//#define VIRTUAL_SCREEN_WIDTH 320 -#define VIRTUAL_SCREEN_WIDTH 340 -#define VIRTUAL_SCREEN_HEIGHT_NTSC 240 -#define VIRTUAL_SCREEN_HEIGHT_PAL 256 - //Temp debug stuff (will go away soon, so don't depend on these) void DumpMainMemory(void); diff --git a/src/tom.cpp b/src/tom.cpp index c9d0f3f..96f6ce9 100644 --- a/src/tom.cpp +++ b/src/tom.cpp @@ -322,7 +322,7 @@ //#define RIGHT_VISIBLE_HC (1488 - 32) // Split the difference? (Seems to be OK for the most part...) -// (-8 +8)*4 is for opening up the display by 16 pixels (may go to 20). Need to change VIRTUAL_SCREEN_WIDTH to match this as well (went from 320 to 336; this is 4 HCs per one of those pixels). <-- actually, not true. This is only place referenced. +// (-10 +10)*4 is for opening up the display by 16 pixels (may go to 20). Need to change VIRTUAL_SCREEN_WIDTH to match this as well (went from 320 to 340; this is 4 HCs per one of those pixels). #define LEFT_VISIBLE_HC (208 - 16 - (10 * 4)) //#define RIGHT_VISIBLE_HC (1488 - 16 + (10 * 4)) #define RIGHT_VISIBLE_HC (LEFT_VISIBLE_HC + (VIRTUAL_SCREEN_WIDTH * 4)) diff --git a/src/tom.h b/src/tom.h index 0fb1f2e..8b95a75 100644 --- a/src/tom.h +++ b/src/tom.h @@ -12,6 +12,14 @@ #define VIDEO_MODE_16BPP_DIRECT 2 #define VIDEO_MODE_16BPP_RGB 3 +// Virtual screen size stuff + +// NB: This virtual width is for PWIDTH = 4 +//#define VIRTUAL_SCREEN_WIDTH 320 +#define VIRTUAL_SCREEN_WIDTH 340 +#define VIRTUAL_SCREEN_HEIGHT_NTSC 240 +#define VIRTUAL_SCREEN_HEIGHT_PAL 256 + // 68000 Interrupt bit positions (enabled at $F000E0) enum { IRQ_VIDEO = 0, IRQ_GPU, IRQ_OPFLAG, IRQ_TIMER, IRQ_DSP }; -- 2.37.2