menu: generalize credits code to show any message
[picodrive.git] / platform / uiq3 / engine / vid.cpp
index ea3cf9b..d004bdf 100644 (file)
@@ -5,7 +5,7 @@
 \r
 #include "vid.h"\r
 #include "../Engine.h"\r
-#include <Pico/PicoInt.h>\r
+#include <pico/pico_int.h>\r
 #include "../../common/emu.h"\r
 #include "blit.h"\r
 #include "debug.h"\r
@@ -19,7 +19,7 @@ extern const char *actionNames[];
 static void *screenbuff = 0; // pointer to real device video memory\r
 //static\r
 extern "C" { unsigned char *PicoDraw2FB = 0; }  // temporary buffer\r
-const int framebuffsize  = (8+320)*(8+240+8)*2+8*2; // actual framebuffer size (in bytes+to support new rendering mode)\r
+const int framebuffsize  = (8+320)*(8+240+8)*2+8*2; // PicoDraw2FB size (in bytes+to support new rendering mode)\r
 \r
 // drawer function pointers\r
 static void (*drawTextFps)(const char *text) = 0;\r
@@ -92,7 +92,7 @@ static const unsigned long mask_numbers[] = {
 \r
 static int EmuScanBegin8(unsigned int num)\r
 {\r
-       DrawLineDest = PicoDraw2FB + 328*num + 328*8 + 8;\r
+       DrawLineDest = PicoDraw2FB + 328*num + 8;\r
 \r
        return 0;\r
 }\r
@@ -105,7 +105,7 @@ static int EmuScanEndFit0(unsigned int num)
        static int u = 0, num2 = 0;\r
        if(!num) u = num2 = 0;\r
 \r
-       DrawLineDest = PicoDraw2FB + 328*(++num2) + 328*8 + 8;\r
+       DrawLineDest = PicoDraw2FB + 328*(++num2) + 8;\r
 \r
        u += 6666;\r
 \r
@@ -272,9 +272,9 @@ static void vidBlit_90(int full)
                vidConvCpy_90(pd, ps, localPal, 320/8);\r
        else {\r
                if(full) vidClear(pd, 32);\r
-               pd += 256*32;\r
+               pd += (240+VID_BORDER_R)*32;\r
                vidConvCpy_90(pd, ps, localPal, 256/8);\r
-               if(full) vidClear(pd + 256*256, 32);\r
+               if(full) vidClear(pd + (240+VID_BORDER_R)*256, 32);\r
        }\r
 }\r
 \r
@@ -288,10 +288,10 @@ static void vidBlit_270(int full)
                vidConvCpy_270(pd, ps, localPal, 320/8);\r
        else {\r
                if(full) vidClear(pd, 32);\r
-               pd += 256*32;\r
+               pd += (240+VID_BORDER_R)*32;\r
                ps -= 64;     // the blitter starts copying from the right border, so we need to adjust\r
                vidConvCpy_270(pd, ps, localPal, 256/8);\r
-               if(full) vidClear(pd + 256*256, 32);\r
+               if(full) vidClear(pd + (240+VID_BORDER_R)*256, 32);\r
        }\r
 }\r
 \r
@@ -303,7 +303,7 @@ static void vidBlitCenter_0(int full)
 \r
        if(Pico.video.reg[12]&1) ps += 32;\r
        vidConvCpy_center_0(pd, ps, localPal);\r
-       if(full) vidClear(pd + 224*256, 96);\r
+       if(full) vidClear(pd + (240+VID_BORDER_R)*224, 96);\r
 }\r
 \r
 \r
@@ -314,16 +314,16 @@ static void vidBlitCenter_180(int full)
 \r
        if(Pico.video.reg[12]&1) ps += 32;\r
        vidConvCpy_center_180(pd, ps, localPal);\r
-       if(full) vidClear(pd + 224*256, 96);\r
+       if(full) vidClear(pd + (240+VID_BORDER_R)*224, 96);\r
 }\r
 \r
 \r
 static void vidBlitFit_0(int full)\r
 {\r
        if(Pico.video.reg[12]&1)\r
-                vidConvCpy_center2_40c_0(screenbuff, PicoDraw2FB+328*8, localPal, 168);\r
+            vidConvCpy_center2_40c_0(screenbuff, PicoDraw2FB+328*8, localPal, 168);\r
        else vidConvCpy_center2_32c_0(screenbuff, PicoDraw2FB+328*8, localPal, 168);\r
-       if(full) vidClear((unsigned long *)screenbuff + 168*256, 320-168);\r
+       if(full) vidClear((unsigned long *)screenbuff + (240+VID_BORDER_R)*168, 320-168);\r
 }\r
 \r
 \r
@@ -332,7 +332,7 @@ static void vidBlitFit_180(int full)
        if(Pico.video.reg[12]&1)\r
             vidConvCpy_center2_40c_180(screenbuff, PicoDraw2FB+328*8, localPal, 168);\r
        else vidConvCpy_center2_32c_180(screenbuff, PicoDraw2FB+328*8-64, localPal, 168);\r
-       if(full) vidClear((unsigned long *)screenbuff + 168*256, 320-168);\r
+       if(full) vidClear((unsigned long *)screenbuff + (240+VID_BORDER_R)*168, 320-168);\r
 }\r
 \r
 \r
@@ -341,7 +341,7 @@ static void vidBlitFit2_0(int full)
        if(Pico.video.reg[12]&1)\r
             vidConvCpy_center2_40c_0(screenbuff, PicoDraw2FB+328*8, localPal, 224);\r
        else vidConvCpy_center2_32c_0(screenbuff, PicoDraw2FB+328*8, localPal, 224);\r
-       if(full) vidClear((unsigned long *)screenbuff + 224*256, 96);\r
+       if(full) vidClear((unsigned long *)screenbuff + (240+VID_BORDER_R)*224, 96);\r
 }\r
 \r
 \r
@@ -350,10 +350,9 @@ static void vidBlitFit2_180(int full)
        if(Pico.video.reg[12]&1)\r
             vidConvCpy_center2_40c_180(screenbuff, PicoDraw2FB+328*8, localPal, 224);\r
        else vidConvCpy_center2_32c_180(screenbuff, PicoDraw2FB+328*8-64, localPal, 224);\r
-       if(full) vidClear((unsigned long *)screenbuff + 224*256, 96);\r
+       if(full) vidClear((unsigned long *)screenbuff + (240+VID_BORDER_R)*224, 96);\r
 }\r
 \r
-\r
 static void vidBlitCfg(void)\r
 {\r
        unsigned short *ps = (unsigned short *) PicoDraw2FB;\r
@@ -364,7 +363,7 @@ static void vidBlitCfg(void)
        //for (int i = 1; i < 320; i++, ps += 240, pd += 256)\r
        //      vidConvCpyRGB32(pd, ps, 240);\r
 \r
-       for (i = 0; i < 320; i++, pd += 16)\r
+       for (i = 0; i < 320; i++, pd += VID_BORDER_R)\r
                for (int u = 0; u < 240; u++, ps++, pd++)\r
                        *pd = ((*ps & 0xf) << 20) | ((*ps & 0xf0) << 8) | ((*ps & 0xf00) >> 4);\r
 }\r
@@ -389,6 +388,7 @@ int vidInit(void *vidmem, int reinit)
        // select suitable blitters\r
        vidBlit = vidBlit_270;\r
        PicoScanBegin = EmuScanBegin8;\r
+       PicoScanEnd = NULL;\r
        drawTextFps = drawTextFps0;\r
        drawTextNotice = drawTextNotice0;\r
 \r
@@ -411,6 +411,7 @@ int vidInit(void *vidmem, int reinit)
                        vidBlit = vidBlitFit_0;\r
                        drawTextFps = drawTextFpsFit0;\r
                        drawTextNotice = drawTextNoticeFit0;\r
+                       PicoScanBegin = NULL;\r
                        PicoScanEnd = EmuScanEndFit0;\r
                }\r
        } else if (currentConfig.rotation == TPicoConfig::PRot90) {\r
@@ -432,6 +433,7 @@ int vidInit(void *vidmem, int reinit)
                        vidBlit = vidBlitFit_180;\r
                        drawTextFps = drawTextFpsFit0;\r
                        drawTextNotice = drawTextNoticeFit0;\r
+                       PicoScanBegin = NULL;\r
                        PicoScanEnd = EmuScanEndFit0;\r
                }\r
        }\r