summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
dffa89e)
Full screeen mode now correctly centers the image on wide screen
monitors. In addition, the virtual screen width has been reduced in size
back to what you would see on a TV with a modest amount of overscan.
Assuming all is well with this commit, this will be our 2.1.0 release.
Yes, there are still some regressions in a few games that we are aware
of, but the improvements over the last official release are too great to
hold this back any longer. :-)
src/m68000/*~
eeproms/*.eep
software/
src/m68000/*~
eeproms/*.eep
software/
+build/
+regression-test/
#include "about.h"
#include "version.h"
#include "about.h"
#include "version.h"
AboutWindow::AboutWindow(QWidget * parent/*= 0*/): QWidget(parent, Qt::Dialog)
{
setWindowTitle(tr("About Virtual Jaguar..."));
AboutWindow::AboutWindow(QWidget * parent/*= 0*/): QWidget(parent, Qt::Dialog)
{
setWindowTitle(tr("About Virtual Jaguar..."));
"</td></tr>"
"<tr><td align='right'><b>Coders: </b></td><td>James Hammons (shamus)<br>Niels Wagenaar (nwagenaar)<br>Carwin Jones (Caz)<br>Adam Green</td></tr>"
"<tr><td align='right'><b>Testers: </b></td><td>Cyrano Jones, LinkoVitch, neo-rg, Robert R,<br>TheUMan, Dissection, overridex, geormetal</td></tr>"
"</td></tr>"
"<tr><td align='right'><b>Coders: </b></td><td>James Hammons (shamus)<br>Niels Wagenaar (nwagenaar)<br>Carwin Jones (Caz)<br>Adam Green</td></tr>"
"<tr><td align='right'><b>Testers: </b></td><td>Cyrano Jones, LinkoVitch, neo-rg, Robert R,<br>TheUMan, Dissection, overridex, geormetal</td></tr>"
- "<tr><td align='right'><b>Build Team: </b></td><td>ggn (win32)<br>LinkoVitch, goldenegg (MacOS)</td></tr>"
+ "<tr><td align='right'><b>Build Team: </b></td><td>shamus (win32)<br>goldenegg (MacOS)</td></tr>"
"<tr><td align='right'><b>Homepage: </b></td><td>http://icculus.org/virtualjaguar/</td></tr>"
"</table>"
"<br><br>"
"<tr><td align='right'><b>Homepage: </b></td><td>http://icculus.org/virtualjaguar/</td></tr>"
"</table>"
"<br><br>"
layout->addWidget(text);
}
layout->addWidget(text);
}
void AboutWindow::keyPressEvent(QKeyEvent * e)
{
if (e->key() == Qt::Key_Escape || e->key() == Qt::Key_Return)
void AboutWindow::keyPressEvent(QKeyEvent * e)
{
if (e->key() == Qt::Key_Escape || e->key() == Qt::Key_Return)
#if 1
else if (e->key() == Qt::Key_PageUp)
{
#if 1
else if (e->key() == Qt::Key_PageUp)
{
if (memBase < 0)
memBase = 0;
if (memBase < 0)
memBase = 0;
}
else if (e->key() == Qt::Key_PageDown)
{
}
else if (e->key() == Qt::Key_PageDown)
{
- if (memBase > (0x200000 - 480))
- memBase = 0x200000 - 480;
+ if (memBase > (0xF00000 - 64))
+ memBase = 0xF00000 - 64;
- if (memBase > (0x200000 - 480))
- memBase = 0x200000 - 480;
+ if (memBase > (0xF00000 - 64))
+ memBase = 0xF00000 - 64;
// Who When What
// --- ---------- -------------------------------------------------------------
// JLH 01/14/2010 Created this file
// Who When What
// --- ---------- -------------------------------------------------------------
// JLH 01/14/2010 Created this file
+// JLH 02/03/2013 Added "centered" fullscreen mode with correct aspect ratio
#include <GL/glext.h>
#endif
#include <GL/glext.h>
#endif
GLWidget::GLWidget(QWidget * parent/*= 0*/): QGLWidget(parent), texture(0),
GLWidget::GLWidget(QWidget * parent/*= 0*/): QGLWidget(parent), texture(0),
- textureWidth(0), textureHeight(0), buffer(0), rasterWidth(340), rasterHeight(240)
+ textureWidth(0), textureHeight(0), buffer(0), rasterWidth(340), rasterHeight(240),
+ offset(0)
{
// Screen pitch has to be the texture width (in 32-bit pixels)...
JaguarSetScreenPitch(1024);
}
{
// Screen pitch has to be the texture width (in 32-bit pixels)...
JaguarSetScreenPitch(1024);
}
+ if (buffer)
+ delete[] buffer;
void GLWidget::initializeGL()
{
format().setDoubleBuffer(true);
void GLWidget::initializeGL()
{
format().setDoubleBuffer(true);
glClearColor(0.0, 0.0, 0.0, 0.0);
}
glClearColor(0.0, 0.0, 0.0, 0.0);
}
void GLWidget::paintGL()
{
//kludge
rasterHeight = (vjs.hardwareTypeNTSC ? VIRTUAL_SCREEN_HEIGHT_NTSC : VIRTUAL_SCREEN_HEIGHT_PAL);
void GLWidget::paintGL()
{
//kludge
rasterHeight = (vjs.hardwareTypeNTSC ? VIRTUAL_SCREEN_HEIGHT_NTSC : VIRTUAL_SCREEN_HEIGHT_PAL);
- unsigned outputWidth = width();
+ // If we're in fullscreen mode, we take the value of the screen width as
+ // set by MainWin, since it may be wider than what our aspect ratio allows.
+ // In that case, we adjust the viewport over so that it's centered on the
+ // screen. Otherwise, we simply take the width from our width() funtion
+ // which will always be correct in windowed mode.
+
+// unsigned outputWidth = width();
+ if (!fullscreen)
+ outputWidth = width();
+
unsigned outputHeight = height();
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0, outputWidth, 0, outputHeight, -1.0, 1.0);
unsigned outputHeight = height();
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0, outputWidth, 0, outputHeight, -1.0, 1.0);
- glViewport(0, 0, outputWidth, outputHeight);
+// glViewport(0, 0, outputWidth, outputHeight);
+ glViewport(0 + offset, 0, outputWidth, outputHeight);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
unsigned v = outputHeight;
glBegin(GL_TRIANGLE_STRIP);
unsigned v = outputHeight;
glBegin(GL_TRIANGLE_STRIP);
glTexCoord2f(0, 0); glVertex3i(0, v, 0);
glTexCoord2f(w, 0); glVertex3i(u, v, 0);
glTexCoord2f(0, h); glVertex3i(0, 0, 0);
glTexCoord2f(w, h); glVertex3i(u, 0, 0);
glTexCoord2f(0, 0); glVertex3i(0, v, 0);
glTexCoord2f(w, 0); glVertex3i(u, v, 0);
glTexCoord2f(0, h); glVertex3i(0, 0, 0);
glTexCoord2f(w, h); glVertex3i(u, 0, 0);
+#else
+ glTexCoord2f(0, 0); glVertex3i(0 + offset, v, 0);
+ glTexCoord2f(w, 0); glVertex3i(u + offset, v, 0);
+ glTexCoord2f(0, h); glVertex3i(0 + offset, 0, 0);
+ glTexCoord2f(w, h); glVertex3i(u + offset, 0, 0);
+#endif
void GLWidget::resizeGL(int width, int height)
{
if (width > textureWidth || height > textureHeight)
void GLWidget::resizeGL(int width, int height)
{
if (width > textureWidth || height > textureHeight)
#if 0
class RubyGLWidget: public QGLWidget
{
#if 0
class RubyGLWidget: public QGLWidget
{
bool synchronize;
unsigned filter;
bool synchronize;
unsigned filter;
+ int offset;
+ bool fullscreen;
+ int outputWidth;
};
#endif // __GLWIDGET_H__
};
#endif // __GLWIDGET_H__
// 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());
// 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
{
showFullScreen();
}
else
{
+ // Reset the video widget to windowed mode
+ videoWidget->offset = 0;
+ videoWidget->fullscreen = false;
menuBar()->show();
statusBar()->show();
showNormal();
menuBar()->show();
statusBar()->show();
showNormal();
// Split the difference? (Seems to be OK for the most part...)
// (-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).
// Split the difference? (Seems to be OK for the most part...)
// (-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 - (8 * 4))
+//NB: Went back to 330. May shrink more. :-)
+//#define LEFT_VISIBLE_HC (208 - 16 - (8 * 4))
+//#define LEFT_VISIBLE_HC (208 - 16 - (3 * 4))
+#define LEFT_VISIBLE_HC (208 - 16 - (1 * 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 RIGHT_VISIBLE_HC (1488 - 16 + (10 * 4))
#define RIGHT_VISIBLE_HC (LEFT_VISIBLE_HC + (VIRTUAL_SCREEN_WIDTH * 4))
//#define TOP_VISIBLE_VC 25
//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".
//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 - (4 * 4))
+//#define LEFT_VISIBLE_HC_PAL (208 - 16 - (4 * 4))
+//#define LEFT_VISIBLE_HC_PAL (208 - 16 - (-1 * 4))
+#define LEFT_VISIBLE_HC_PAL (208 - 16 - (-3 * 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 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
// NB: This virtual width is for PWIDTH = 4
//#define VIRTUAL_SCREEN_WIDTH 320
// NB: This virtual width is for PWIDTH = 4
//#define VIRTUAL_SCREEN_WIDTH 320
-#define VIRTUAL_SCREEN_WIDTH 340
+//was:340, 330
+#define VIRTUAL_SCREEN_WIDTH 326
#define VIRTUAL_SCREEN_HEIGHT_NTSC 240
#define VIRTUAL_SCREEN_HEIGHT_PAL 256
#define VIRTUAL_SCREEN_HEIGHT_NTSC 240
#define VIRTUAL_SCREEN_HEIGHT_PAL 256