got rid of fb border integration, using defines instead
[picodrive.git] / platform / uiq3 / engine / vid.cpp
index b07e4a4..b23a531 100644 (file)
@@ -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
@@ -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,7 +314,7 @@ 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
@@ -323,7 +323,7 @@ static void vidBlitFit_0(int full)
        if(Pico.video.reg[12]&1)\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