X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Fuiq3%2Fengine%2Fvid.cpp;h=b23a53111c0689835aa8c380ad3908ecbdced145;hb=a47dd66367c0d6d4ae2957dfd028125636ca9f65;hp=ea3cf9b11a5fcc617b757f478a427aca043f445e;hpb=f8af96349ea464111fbef3c6528016c3dc34cdcf;p=picodrive.git diff --git a/platform/uiq3/engine/vid.cpp b/platform/uiq3/engine/vid.cpp index ea3cf9b..b23a531 100644 --- a/platform/uiq3/engine/vid.cpp +++ b/platform/uiq3/engine/vid.cpp @@ -5,7 +5,7 @@ #include "vid.h" #include "../Engine.h" -#include +#include #include "../../common/emu.h" #include "blit.h" #include "debug.h" @@ -19,7 +19,7 @@ extern const char *actionNames[]; static void *screenbuff = 0; // pointer to real device video memory //static extern "C" { unsigned char *PicoDraw2FB = 0; } // temporary buffer -const int framebuffsize = (8+320)*(8+240+8)*2+8*2; // actual framebuffer size (in bytes+to support new rendering mode) +const int framebuffsize = (8+320)*(8+240+8)*2+8*2; // PicoDraw2FB size (in bytes+to support new rendering mode) // drawer function pointers static void (*drawTextFps)(const char *text) = 0; @@ -272,9 +272,9 @@ static void vidBlit_90(int full) vidConvCpy_90(pd, ps, localPal, 320/8); else { if(full) vidClear(pd, 32); - pd += 256*32; + pd += (240+VID_BORDER_R)*32; vidConvCpy_90(pd, ps, localPal, 256/8); - if(full) vidClear(pd + 256*256, 32); + if(full) vidClear(pd + (240+VID_BORDER_R)*256, 32); } } @@ -288,10 +288,10 @@ static void vidBlit_270(int full) vidConvCpy_270(pd, ps, localPal, 320/8); else { if(full) vidClear(pd, 32); - pd += 256*32; + pd += (240+VID_BORDER_R)*32; ps -= 64; // the blitter starts copying from the right border, so we need to adjust vidConvCpy_270(pd, ps, localPal, 256/8); - if(full) vidClear(pd + 256*256, 32); + if(full) vidClear(pd + (240+VID_BORDER_R)*256, 32); } } @@ -303,7 +303,7 @@ static void vidBlitCenter_0(int full) if(Pico.video.reg[12]&1) ps += 32; vidConvCpy_center_0(pd, ps, localPal); - if(full) vidClear(pd + 224*256, 96); + if(full) vidClear(pd + (240+VID_BORDER_R)*224, 96); } @@ -314,16 +314,16 @@ static void vidBlitCenter_180(int full) if(Pico.video.reg[12]&1) ps += 32; vidConvCpy_center_180(pd, ps, localPal); - if(full) vidClear(pd + 224*256, 96); + if(full) vidClear(pd + (240+VID_BORDER_R)*224, 96); } static void vidBlitFit_0(int full) { if(Pico.video.reg[12]&1) - vidConvCpy_center2_40c_0(screenbuff, PicoDraw2FB+328*8, localPal, 168); + vidConvCpy_center2_40c_0(screenbuff, PicoDraw2FB+328*8, localPal, 168); else vidConvCpy_center2_32c_0(screenbuff, PicoDraw2FB+328*8, localPal, 168); - if(full) vidClear((unsigned long *)screenbuff + 168*256, 320-168); + if(full) vidClear((unsigned long *)screenbuff + (240+VID_BORDER_R)*168, 320-168); } @@ -332,7 +332,7 @@ static void vidBlitFit_180(int full) if(Pico.video.reg[12]&1) vidConvCpy_center2_40c_180(screenbuff, PicoDraw2FB+328*8, localPal, 168); else vidConvCpy_center2_32c_180(screenbuff, PicoDraw2FB+328*8-64, localPal, 168); - if(full) vidClear((unsigned long *)screenbuff + 168*256, 320-168); + if(full) vidClear((unsigned long *)screenbuff + (240+VID_BORDER_R)*168, 320-168); } @@ -341,7 +341,7 @@ static void vidBlitFit2_0(int full) if(Pico.video.reg[12]&1) vidConvCpy_center2_40c_0(screenbuff, PicoDraw2FB+328*8, localPal, 224); else vidConvCpy_center2_32c_0(screenbuff, PicoDraw2FB+328*8, localPal, 224); - if(full) vidClear((unsigned long *)screenbuff + 224*256, 96); + if(full) vidClear((unsigned long *)screenbuff + (240+VID_BORDER_R)*224, 96); } @@ -350,10 +350,9 @@ static void vidBlitFit2_180(int full) if(Pico.video.reg[12]&1) vidConvCpy_center2_40c_180(screenbuff, PicoDraw2FB+328*8, localPal, 224); else vidConvCpy_center2_32c_180(screenbuff, PicoDraw2FB+328*8-64, localPal, 224); - if(full) vidClear((unsigned long *)screenbuff + 224*256, 96); + if(full) vidClear((unsigned long *)screenbuff + (240+VID_BORDER_R)*224, 96); } - static void vidBlitCfg(void) { unsigned short *ps = (unsigned short *) PicoDraw2FB; @@ -364,7 +363,7 @@ static void vidBlitCfg(void) //for (int i = 1; i < 320; i++, ps += 240, pd += 256) // vidConvCpyRGB32(pd, ps, 240); - for (i = 0; i < 320; i++, pd += 16) + for (i = 0; i < 320; i++, pd += VID_BORDER_R) for (int u = 0; u < 240; u++, ps++, pd++) *pd = ((*ps & 0xf) << 20) | ((*ps & 0xf0) << 8) | ((*ps & 0xf00) >> 4); } @@ -389,6 +388,7 @@ int vidInit(void *vidmem, int reinit) // select suitable blitters vidBlit = vidBlit_270; PicoScanBegin = EmuScanBegin8; + PicoScanEnd = NULL; drawTextFps = drawTextFps0; drawTextNotice = drawTextNotice0; @@ -411,6 +411,7 @@ int vidInit(void *vidmem, int reinit) vidBlit = vidBlitFit_0; drawTextFps = drawTextFpsFit0; drawTextNotice = drawTextNoticeFit0; + PicoScanBegin = NULL; PicoScanEnd = EmuScanEndFit0; } } else if (currentConfig.rotation == TPicoConfig::PRot90) { @@ -432,6 +433,7 @@ int vidInit(void *vidmem, int reinit) vidBlit = vidBlitFit_180; drawTextFps = drawTextFpsFit0; drawTextNotice = drawTextNoticeFit0; + PicoScanBegin = NULL; PicoScanEnd = EmuScanEndFit0; } }