]> Shamusworld >> Repos - virtualjaguar/commitdiff
Added region specific test pattern for correctness' sake. ;-)
authorShamus Hammons <jlhamm@acm.org>
Thu, 9 Oct 2014 19:31:15 +0000 (14:31 -0500)
committerShamus Hammons <jlhamm@acm.org>
Thu, 9 Oct 2014 19:31:15 +0000 (14:31 -0500)
res/test-pattern-pal.jpg [new file with mode: 0644]
src/gui/mainwin.cpp
src/gui/mainwin.h
src/gui/virtualjaguar.qrc

diff --git a/res/test-pattern-pal.jpg b/res/test-pattern-pal.jpg
new file mode 100644 (file)
index 0000000..cde6f04
Binary files /dev/null and b/res/test-pattern-pal.jpg differ
index 713ec11abe9ec101dfe151d4abd71b1c6ed7741b..cc5dab1880c251e9001a5f55f60f717d89970007 100644 (file)
@@ -330,7 +330,7 @@ MainWin::MainWin(bool autoRun): running(true), powerButtonOn(false),
        // 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);
 
@@ -345,6 +345,20 @@ MainWin::MainWin(bool autoRun): running(true), powerButtonOn(false),
                }
        }
 
+       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()));
@@ -768,7 +782,10 @@ void MainWin::TogglePowerState(void)
                        // 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));
                        }
                }
        }
@@ -1084,7 +1101,10 @@ void MainWin::ResizeMainWindow(void)
        {
                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));
                }
        }
 
@@ -1191,7 +1211,7 @@ WriteLog("Pipelined DSP = %s\n", (vjs.usePipelinedDSP ? "ON" : "off"));
        ReadProfiles(&settings);
 }
 
-
+  
 void MainWin::WriteSettings(void)
 {
        QSettings settings("Underground Software", "Virtual Jaguar");
index e5dc8e2ebc11f51a152b6f341ad5e2813b6ea800..a87289d47ace2bd0e8873259f635634aefff4a46 100644 (file)
@@ -145,6 +145,7 @@ class MainWin: public QMainWindow
                QIcon powerGreen;
                QIcon powerRed;
                uint32_t testPattern[VIRTUAL_SCREEN_WIDTH * VIRTUAL_SCREEN_HEIGHT_PAL];
+               uint32_t testPattern2[VIRTUAL_SCREEN_WIDTH * VIRTUAL_SCREEN_HEIGHT_PAL];
 };
 
 #endif // __MAINWIN_H__
index 19e99ed2c59bcc51f0323ad8e9679c2407855ab4..5d43c4a9c21b266c8b40ed18181dac865f69c9f6 100644 (file)
@@ -35,6 +35,7 @@
        <file>../../res/homebrew-file.png</file>
        <file>../../res/unknown-file.png</file>
        <file>../../res/test-pattern.jpg</file>
+       <file>../../res/test-pattern-pal.jpg</file>
        <file>../../res/help.html</file>
 </qresource>
 <qresource lang="fr">