// Do this in case original size isn't correct (mostly for the first-run case)
ResizeMainWindow();
- // Create our test pattern bitmap
+ // Create our test pattern bitmaps
QImage tempImg(":/res/test-pattern.jpg");
QImage tempImgScaled = tempImg.scaled(VIRTUAL_SCREEN_WIDTH, VIRTUAL_SCREEN_HEIGHT_PAL, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
}
}
+ QImage tempImg2(":/res/test-pattern-pal");
+ QImage tempImgScaled2 = tempImg2.scaled(VIRTUAL_SCREEN_WIDTH, VIRTUAL_SCREEN_HEIGHT_PAL, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
+
+ for(uint32_t y=0; y<VIRTUAL_SCREEN_HEIGHT_PAL; y++)
+ {
+ const QRgb * scanline = (QRgb *)tempImgScaled2.constScanLine(y);
+
+ for(uint32_t x=0; x<VIRTUAL_SCREEN_WIDTH; x++)
+ {
+ uint32_t pixel = (qRed(scanline[x]) << 24) | (qGreen(scanline[x]) << 16) | (qBlue(scanline[x]) << 8) | 0xFF;
+ testPattern2[(y * VIRTUAL_SCREEN_WIDTH) + x] = pixel;
+ }
+ }
+
// Set up timer based loop for animation...
timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(Timer()));
// the same as the picture buffer's pitch.
for(uint32_t y=0; y<videoWidget->rasterHeight; y++)
{
- memcpy(videoWidget->buffer + (y * videoWidget->textureWidth), testPattern + (y * VIRTUAL_SCREEN_WIDTH), VIRTUAL_SCREEN_WIDTH * sizeof(uint32_t));
+ if (vjs.hardwareTypeNTSC)
+ memcpy(videoWidget->buffer + (y * videoWidget->textureWidth), testPattern + (y * VIRTUAL_SCREEN_WIDTH), VIRTUAL_SCREEN_WIDTH * sizeof(uint32_t));
+ else
+ memcpy(videoWidget->buffer + (y * videoWidget->textureWidth), testPattern2 + (y * VIRTUAL_SCREEN_WIDTH), VIRTUAL_SCREEN_WIDTH * sizeof(uint32_t));
}
}
}
{
for(uint32_t y=0; y<videoWidget->rasterHeight; y++)
{
- memcpy(videoWidget->buffer + (y * videoWidget->textureWidth), testPattern + (y * VIRTUAL_SCREEN_WIDTH), VIRTUAL_SCREEN_WIDTH * sizeof(uint32_t));
+ if (vjs.hardwareTypeNTSC)
+ memcpy(videoWidget->buffer + (y * videoWidget->textureWidth), testPattern + (y * VIRTUAL_SCREEN_WIDTH), VIRTUAL_SCREEN_WIDTH * sizeof(uint32_t));
+ else
+ memcpy(videoWidget->buffer + (y * videoWidget->textureWidth), testPattern2 + (y * VIRTUAL_SCREEN_WIDTH), VIRTUAL_SCREEN_WIDTH * sizeof(uint32_t));
}
}
ReadProfiles(&settings);
}
-
+
void MainWin::WriteSettings(void)
{
QSettings settings("Underground Software", "Virtual Jaguar");