Added a vertical sync test pattern to Qt GUI.
This commit is contained in:
parent
c72eac9970
commit
74a48e92d6
|
@ -42,7 +42,7 @@ extern int rerecord_display;
|
|||
ConsoleVideoConfDialog_t::ConsoleVideoConfDialog_t(QWidget *parent)
|
||||
: QDialog( parent )
|
||||
{
|
||||
QVBoxLayout *main_vbox, *vbox1, *vbox2, *vbox3, *vbox4, *vbox;
|
||||
QVBoxLayout *main_vbox, *vbox1, *vbox2, *vbox3, *vbox4, *vbox5, *vbox;
|
||||
QHBoxLayout *main_hbox, *hbox1, *hbox;
|
||||
QLabel *lbl;
|
||||
QPushButton *button;
|
||||
|
@ -205,6 +205,16 @@ ConsoleVideoConfDialog_t::ConsoleVideoConfDialog_t(QWidget *parent)
|
|||
|
||||
setComboBoxFromProperty( inputDisplaySel , "SDL.InputDisplay");
|
||||
|
||||
// Input Display Select
|
||||
videoTest = new QComboBox();
|
||||
|
||||
videoTest->addItem( tr("None") , 0 );
|
||||
videoTest->addItem( tr("Vertical Sync"), 1 );
|
||||
|
||||
videoTest->setCurrentIndex( nes_shm->video.test );
|
||||
|
||||
connect(videoTest, SIGNAL(currentIndexChanged(int)), this, SLOT(testPatternChanged(int)) );
|
||||
|
||||
setCheckBoxFromProperty( autoRegion , "SDL.AutoDetectPAL");
|
||||
setCheckBoxFromProperty( new_PPU_ena , "SDL.NewPPU");
|
||||
setCheckBoxFromProperty( frmskipcbx , "SDL.Frameskip");
|
||||
|
@ -349,6 +359,7 @@ ConsoleVideoConfDialog_t::ConsoleVideoConfDialog_t(QWidget *parent)
|
|||
gbox = new QGroupBox( tr("Overlay Options") );
|
||||
vbox3 = new QVBoxLayout();
|
||||
vbox4 = new QVBoxLayout();
|
||||
vbox5 = new QVBoxLayout();
|
||||
vbox = new QVBoxLayout();
|
||||
|
||||
vbox3->addWidget( gbox, 1 );
|
||||
|
@ -366,6 +377,11 @@ ConsoleVideoConfDialog_t::ConsoleVideoConfDialog_t(QWidget *parent)
|
|||
vbox->addWidget( gbox );
|
||||
vbox4->addWidget( inputDisplaySel );
|
||||
|
||||
gbox = new QGroupBox( tr("Test Pattern:") );
|
||||
gbox->setLayout( vbox5 );
|
||||
vbox->addWidget( gbox );
|
||||
vbox5->addWidget( videoTest );
|
||||
|
||||
gbox = new QGroupBox( tr("Drawing Area") );
|
||||
vbox2 = new QVBoxLayout();
|
||||
grid = new QGridLayout();
|
||||
|
@ -952,6 +968,11 @@ void ConsoleVideoConfDialog_t::inputDisplayChanged(int index)
|
|||
g_config->save ();
|
||||
}
|
||||
//----------------------------------------------------
|
||||
void ConsoleVideoConfDialog_t::testPatternChanged(int index)
|
||||
{
|
||||
nes_shm->video.test = videoTest->itemData(index).toInt();
|
||||
}
|
||||
//----------------------------------------------------
|
||||
void ConsoleVideoConfDialog_t::aspectChanged(int index)
|
||||
{
|
||||
int aspectID;
|
||||
|
|
|
@ -37,6 +37,7 @@ class ConsoleVideoConfDialog_t : public QDialog
|
|||
QComboBox *cursorSelect;
|
||||
QComboBox *aspectSelect;
|
||||
QComboBox *inputDisplaySel;
|
||||
QComboBox *videoTest;
|
||||
QCheckBox *autoRegion;
|
||||
QCheckBox *vsync_ena;
|
||||
QCheckBox *gl_LF_chkBox;
|
||||
|
@ -95,6 +96,7 @@ class ConsoleVideoConfDialog_t : public QDialog
|
|||
void regionChanged(int index);
|
||||
void driverChanged(int index);
|
||||
void scalerChanged(int index);
|
||||
void testPatternChanged(int index);
|
||||
void cursorShapeChanged(int index);
|
||||
void cursorVisChanged(int value);
|
||||
void drawInputAidsChanged(int value);
|
||||
|
|
|
@ -4253,16 +4253,16 @@ void consoleWin_t::transferVideoBuffer(void)
|
|||
{
|
||||
if ( nes_shm->blitUpdated )
|
||||
{
|
||||
nes_shm->blitUpdated = 0;
|
||||
|
||||
if ( viewport_SDL )
|
||||
{
|
||||
viewport_SDL->transfer2LocalBuffer();
|
||||
nes_shm->blitUpdated = 0;
|
||||
viewport_SDL->render();
|
||||
}
|
||||
else if ( viewport_GL )
|
||||
{
|
||||
viewport_GL->transfer2LocalBuffer();
|
||||
nes_shm->blitUpdated = 0;
|
||||
viewport_GL->update();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ struct nes_shm_t
|
|||
int yscale;
|
||||
int xyRatio;
|
||||
int preScaler;
|
||||
int test;
|
||||
} video;
|
||||
|
||||
char runEmulator;
|
||||
|
|
|
@ -393,20 +393,34 @@ void LockConsole(){}
|
|||
///Currently unimplemented.
|
||||
void UnlockConsole(){}
|
||||
|
||||
static int testPattern = 0;
|
||||
|
||||
static void WriteTestPattern(void)
|
||||
static void vsync_test(void)
|
||||
{
|
||||
int i, j, k;
|
||||
int i, j, k, l;
|
||||
int cycleLen, halfCycleLen;
|
||||
static int ofs = 0;
|
||||
|
||||
cycleLen = nes_shm->video.ncol / 4;
|
||||
|
||||
halfCycleLen = cycleLen / 2;
|
||||
|
||||
k=0;
|
||||
for (i=0; i<GL_NES_WIDTH; i++)
|
||||
for (j=0; j<nes_shm->video.nrow; j++)
|
||||
{
|
||||
for (j=0; j<GL_NES_HEIGHT; j++)
|
||||
for (i=0; i<nes_shm->video.ncol; i++)
|
||||
{
|
||||
l = ((i+ofs) % cycleLen);
|
||||
|
||||
if ( l < halfCycleLen )
|
||||
{
|
||||
nes_shm->pixbuf[k] = 0xffffffff; k++;
|
||||
}
|
||||
else
|
||||
{
|
||||
nes_shm->pixbuf[k] = 0x00000000; k++;
|
||||
}
|
||||
}
|
||||
}
|
||||
ofs = (ofs + 1) % nes_shm->video.ncol;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -455,9 +469,17 @@ doBlitScreen(uint8_t *XBuf, uint8_t *dest)
|
|||
|
||||
if ( dest == NULL ) return;
|
||||
|
||||
if ( testPattern )
|
||||
if ( nes_shm->video.test )
|
||||
{
|
||||
WriteTestPattern();
|
||||
switch ( nes_shm->video.test )
|
||||
{
|
||||
case 1:
|
||||
vsync_test();
|
||||
break;
|
||||
default:
|
||||
// Unknown Test Pattern
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue