#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);
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();
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.
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++)
// 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
//#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
//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