From: Shamus Hammons Date: Fri, 12 Oct 2012 00:48:49 +0000 (-0500) Subject: Stretched the virtual screen slightly. X-Git-Tag: 2.1.0~12 X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=virtualjaguar;a=commitdiff_plain;h=d14b5af2a9a42a5ec8f7af92b286aa6333ea6de6 Stretched the virtual screen slightly. --- diff --git a/src/gui/glwidget.cpp b/src/gui/glwidget.cpp index 7473707..56fcd0e 100644 --- a/src/gui/glwidget.cpp +++ b/src/gui/glwidget.cpp @@ -23,7 +23,7 @@ #endif GLWidget::GLWidget(QWidget * parent/*= 0*/): QGLWidget(parent), texture(0), - textureWidth(0), textureHeight(0), buffer(0), rasterWidth(320), rasterHeight(240) + textureWidth(0), textureHeight(0), buffer(0), rasterWidth(340), rasterHeight(240) { // Screen pitch has to be the texture width (in 32-bit pixels)... JaguarSetScreenPitch(1024); @@ -52,7 +52,7 @@ void GLWidget::initializeGL() void GLWidget::paintGL() { //kludge -rasterHeight = (vjs.hardwareTypeNTSC ? 240 : 256); +rasterHeight = (vjs.hardwareTypeNTSC ? VIRTUAL_SCREEN_HEIGHT_NTSC : VIRTUAL_SCREEN_HEIGHT_PAL); unsigned outputWidth = width(); unsigned outputHeight = height(); diff --git a/src/gui/mainwin.cpp b/src/gui/mainwin.cpp index 22c211b..cfd3ab9 100644 --- a/src/gui/mainwin.cpp +++ b/src/gui/mainwin.cpp @@ -815,7 +815,9 @@ void MainWin::SetFullScreen(bool state/*= true*/) statusBar()->hide(); showFullScreen(); QRect r = QApplication::desktop()->availableGeometry(); - double targetWidth = 320.0, targetHeight = (vjs.hardwareTypeNTSC ? 240.0 : 256.0); +// 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. @@ -861,7 +863,9 @@ void MainWin::ShowCPUBrowserWin(void) void MainWin::ResizeMainWindow(void) { - videoWidget->setFixedSize(zoomLevel * 320, zoomLevel * (vjs.hardwareTypeNTSC ? 240 : 256)); +// videoWidget->setFixedSize(zoomLevel * 320, zoomLevel * (vjs.hardwareTypeNTSC ? 240 : 256)); + videoWidget->setFixedSize(zoomLevel * VIRTUAL_SCREEN_WIDTH, + zoomLevel * (vjs.hardwareTypeNTSC ? VIRTUAL_SCREEN_HEIGHT_NTSC : VIRTUAL_SCREEN_HEIGHT_PAL)); show(); for(int i=0; i<2; i++) diff --git a/src/jaguar.h b/src/jaguar.h index 4d33afc..c0cc1b3 100644 --- a/src/jaguar.h +++ b/src/jaguar.h @@ -45,7 +45,9 @@ extern bool jaguarCartInserted; // Video stuff (should go in tom.h?) -#define VIRTUAL_SCREEN_WIDTH 320 +// 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 diff --git a/src/tom.cpp b/src/tom.cpp index 88223c2..c9d0f3f 100644 --- a/src/tom.cpp +++ b/src/tom.cpp @@ -321,8 +321,11 @@ //#define LEFT_VISIBLE_HC (208 - 32) //#define RIGHT_VISIBLE_HC (1488 - 32) // Split the difference? (Seems to be OK for the most part...) -#define LEFT_VISIBLE_HC (208 - 16) -#define RIGHT_VISIBLE_HC (1488 - 16) + +// (-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. +#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)) //#define TOP_VISIBLE_VC 25 //#define BOTTOM_VISIBLE_VC 503 #define TOP_VISIBLE_VC 31 @@ -331,8 +334,9 @@ //Are these PAL horizontals correct? //They seem to be for the most part, but there are some games that seem to be //shifted over to the right from this "window". -#define LEFT_VISIBLE_HC_PAL (208 - 16) -#define RIGHT_VISIBLE_HC_PAL (1488 - 16) +#define LEFT_VISIBLE_HC_PAL (208 - 16 - (10 * 4)) +//#define RIGHT_VISIBLE_HC_PAL (1488 - 16 + (10 * 4)) +#define RIGHT_VISIBLE_HC_PAL (LEFT_VISIBLE_HC_PAL + (VIRTUAL_SCREEN_WIDTH * 4)) #define TOP_VISIBLE_VC_PAL 67 #define BOTTOM_VISIBLE_VC_PAL 579