extern TPicoAreaConfigEntry areaConfig[];\r
extern const char *actionNames[];\r
\r
// main framebuffer\r
static void *screenbuff = 0; // pointer to real device video memory\r
//static\r
extern TPicoAreaConfigEntry areaConfig[];\r
extern const char *actionNames[];\r
\r
// main framebuffer\r
static void *screenbuff = 0; // pointer to real device video memory\r
//static\r
-extern "C" { unsigned char *framebuff = 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
+extern "C" { unsigned char *PicoDraw2FB = 0; } // temporary buffer\r
+const int framebuffsize = (8+320)*(8+240+8)*2+8*2; // PicoDraw2FB size (in bytes+to support new rendering mode)\r
int charmask, i, cx = x, cy;\r
unsigned char *l, *le;\r
\r
int charmask, i, cx = x, cy;\r
unsigned char *l, *le;\r
\r
int charmask, i, cx = x&~1, cy;\r
unsigned short *l, *le;\r
\r
int charmask, i, cx = x&~1, cy;\r
unsigned short *l, *le;\r
\r
vidConvCpyRGB32(localPal, Pico.cram, 0x40);\r
vidConvCpyRGB32sh(localPal+0x40, Pico.cram, 0x40);\r
vidConvCpyRGB32hi(localPal+0x80, Pico.cram, 0x40);\r
vidConvCpyRGB32(localPal, Pico.cram, 0x40);\r
vidConvCpyRGB32sh(localPal+0x40, Pico.cram, 0x40);\r
vidConvCpyRGB32hi(localPal+0x80, Pico.cram, 0x40);\r
vidConvCpyRGB32(localPal, Pico.cram, 0x40);\r
vidConvCpyRGB32(localPal+0x40, HighPal, 0x40);\r
vidConvCpyRGB32(localPal+0x80, HighPal+0x40, 0x40);\r
} else {\r
vidConvCpyRGB32(localPal, Pico.cram, 0x40);\r
vidConvCpyRGB32(localPal, Pico.cram, 0x40);\r
vidConvCpyRGB32(localPal+0x40, HighPal, 0x40);\r
vidConvCpyRGB32(localPal+0x80, HighPal+0x40, 0x40);\r
} else {\r
vidConvCpyRGB32(localPal, Pico.cram, 0x40);\r
if(Pico.video.reg[12]&1)\r
vidConvCpy_90(pd, ps, localPal, 320/8);\r
else {\r
if(full) vidClear(pd, 32);\r
if(Pico.video.reg[12]&1)\r
vidConvCpy_90(pd, ps, localPal, 320/8);\r
else {\r
if(full) vidClear(pd, 32);\r
vidConvCpy_90(pd, ps, localPal, 256/8);\r
vidConvCpy_90(pd, ps, localPal, 256/8);\r
if(Pico.video.reg[12]&1)\r
vidConvCpy_270(pd, ps, localPal, 320/8);\r
else {\r
if(full) vidClear(pd, 32);\r
if(Pico.video.reg[12]&1)\r
vidConvCpy_270(pd, ps, localPal, 320/8);\r
else {\r
if(full) vidClear(pd, 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
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(Pico.video.reg[12]&1) ps += 32;\r
vidConvCpy_center_0(pd, ps, localPal);\r
if(Pico.video.reg[12]&1) ps += 32;\r
vidConvCpy_center_0(pd, ps, localPal);\r
if(Pico.video.reg[12]&1) ps += 32;\r
vidConvCpy_center_180(pd, ps, localPal);\r
if(Pico.video.reg[12]&1) ps += 32;\r
vidConvCpy_center_180(pd, ps, localPal);\r
- vidConvCpy_center2_40c_0(screenbuff, framebuff+328*8, localPal, 168);\r
- else vidConvCpy_center2_32c_0(screenbuff, framebuff+328*8, localPal, 168);\r
- if(full) vidClear((unsigned long *)screenbuff + 168*256, 320-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 + (240+VID_BORDER_R)*168, 320-168);\r
- vidConvCpy_center2_40c_180(screenbuff, framebuff+328*8, localPal, 168);\r
- else vidConvCpy_center2_32c_180(screenbuff, framebuff+328*8-64, localPal, 168);\r
- if(full) vidClear((unsigned long *)screenbuff + 168*256, 320-168);\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 + (240+VID_BORDER_R)*168, 320-168);\r
- vidConvCpy_center2_40c_0(screenbuff, framebuff+328*8, localPal, 224);\r
- else vidConvCpy_center2_32c_0(screenbuff, framebuff+328*8, localPal, 224);\r
- if(full) vidClear((unsigned long *)screenbuff + 224*256, 96);\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 + (240+VID_BORDER_R)*224, 96);\r
- vidConvCpy_center2_40c_180(screenbuff, framebuff+328*8, localPal, 224);\r
- else vidConvCpy_center2_32c_180(screenbuff, framebuff+328*8-64, localPal, 224);\r
- if(full) vidClear((unsigned long *)screenbuff + 224*256, 96);\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 + (240+VID_BORDER_R)*224, 96);\r
//for (int i = 1; i < 320; i++, ps += 240, pd += 256)\r
// vidConvCpyRGB32(pd, ps, 240);\r
\r
//for (int i = 1; i < 320; i++, ps += 240, pd += 256)\r
// vidConvCpyRGB32(pd, ps, 240);\r
\r
for (int u = 0; u < 240; u++, ps++, pd++)\r
*pd = ((*ps & 0xf) << 20) | ((*ps & 0xf0) << 8) | ((*ps & 0xf00) >> 4);\r
}\r
for (int u = 0; u < 240; u++, ps++, pd++)\r
*pd = ((*ps & 0xf) << 20) | ((*ps & 0xf0) << 8) | ((*ps & 0xf00) >> 4);\r
}\r
- memset(framebuff, 0, framebuffsize);\r
-\r
- // Cram function: go and hack Pico so it never gets called\r
- PicoCram = EmuCramNull;\r
+ memset(PicoDraw2FB, 0, framebuffsize);\r
- if(currentConfig->iScreenRotation == TPicoConfig::PRot0) {\r
- if(currentConfig->iScreenMode == TPicoConfig::PMCenter) {\r
+ if (currentConfig.rotation == TPicoConfig::PRot0)\r
+ {\r
+ if (currentConfig.scaling == TPicoConfig::PMCenter) {\r
vidBlit = vidBlitCenter_0;\r
drawTextFps = drawTextFpsCenter0;\r
drawTextNotice = drawTextNoticeCenter0;\r
vidBlit = vidBlitCenter_0;\r
drawTextFps = drawTextFpsCenter0;\r
drawTextNotice = drawTextNoticeCenter0;\r
vidBlit = vidBlitFit2_0;\r
drawTextFps = drawTextFpsFit2_0;\r
drawTextNotice = drawTextNoticeFit2_0;\r
vidBlit = vidBlitFit2_0;\r
drawTextFps = drawTextFpsFit2_0;\r
drawTextNotice = drawTextNoticeFit2_0;\r
vidBlit = vidBlitFit_0;\r
drawTextFps = drawTextFpsFit0;\r
drawTextNotice = drawTextNoticeFit0;\r
vidBlit = vidBlitFit_0;\r
drawTextFps = drawTextFpsFit0;\r
drawTextNotice = drawTextNoticeFit0;\r
- } else if(currentConfig->iScreenRotation == TPicoConfig::PRot180) {\r
- if(currentConfig->iScreenMode == TPicoConfig::PMCenter) {\r
+ }\r
+ else if (currentConfig.rotation == TPicoConfig::PRot180)\r
+ {\r
+ if (currentConfig.scaling == TPicoConfig::PMCenter)\r
+ {\r
vidBlit = vidBlitCenter_180;\r
drawTextFps = drawTextFpsCenter0;\r
drawTextNotice = drawTextNoticeCenter0;\r
vidBlit = vidBlitCenter_180;\r
drawTextFps = drawTextFpsCenter0;\r
drawTextNotice = drawTextNoticeCenter0;\r
vidBlit = vidBlitFit2_180;\r
drawTextFps = drawTextFpsFit2_0;\r
drawTextNotice = drawTextNoticeFit2_0;\r
vidBlit = vidBlitFit2_180;\r
drawTextFps = drawTextFpsFit2_0;\r
drawTextNotice = drawTextNoticeFit2_0;\r
vidBlit = vidBlitFit_180;\r
drawTextFps = drawTextFpsFit0;\r
drawTextNotice = drawTextNoticeFit0;\r
vidBlit = vidBlitFit_180;\r
drawTextFps = drawTextFpsFit0;\r
drawTextNotice = drawTextNoticeFit0;\r
\r
static void drawText0(int x, int y, const char *text, long color)\r
{\r
\r
static void drawText0(int x, int y, const char *text, long color)\r
{\r
int charmask, i, cx = x, cy;\r
unsigned short *l, *le, dmask=0x0333;\r
\r
int charmask, i, cx = x, cy;\r
unsigned short *l, *le, dmask=0x0333;\r
\r
// draws rect with width - 1 and height - 1\r
static void drawRect(const TRect &rc, unsigned short color)\r
{\r
// draws rect with width - 1 and height - 1\r
static void drawRect(const TRect &rc, unsigned short color)\r
{\r
// draws fullsize filled rect\r
static void drawRectFilled(const TRect rc, unsigned short color)\r
{\r
// draws fullsize filled rect\r
static void drawRectFilled(const TRect rc, unsigned short color)\r
{\r
// direction: -1 left, 1 right\r
static void drawArrow0(TPoint p, int direction, unsigned short color)\r
{\r
// direction: -1 left, 1 right\r
static void drawArrow0(TPoint p, int direction, unsigned short color)\r
{\r
const TPicoAreaConfigEntry *e = areaConfig + 1; i = 0;\r
while(e->rect != TRect(0,0,0,0)) { e++; i++; }\r
for(e--, i--; e->rect != TRect(0,0,0,0); e--, i--)\r
const TPicoAreaConfigEntry *e = areaConfig + 1; i = 0;\r
while(e->rect != TRect(0,0,0,0)) { e++; i++; }\r
for(e--, i--; e->rect != TRect(0,0,0,0); e--, i--)\r
\r
// action name control\r
drawRectFilled(TRect(72, 2, 168, 20), color_grey); // 96x14\r
\r
// action name control\r
drawRectFilled(TRect(72, 2, 168, 20), color_grey); // 96x14\r
drawText0(86, 9, actionNames[whichAction], color_red);\r
\r
// draw active button names if there are any\r
drawText0(86, 9, actionNames[whichAction], color_red);\r
\r
// draw active button names if there are any\r
if(buttonNames[0]) strcat(buttonNames, ";@");\r
strcat(buttonNames, vidGetScanName(i));\r
}\r
}\r
\r
if(buttonNames[0]) strcat(buttonNames, ";@");\r
strcat(buttonNames, vidGetScanName(i));\r
}\r
}\r
\r
buttonNames[61] = 0; // only 60 chars fit\r
drawText0(6, 48, buttonNames, color_blue);\r
}\r
buttonNames[61] = 0; // only 60 chars fit\r
drawText0(6, 48, buttonNames, color_blue);\r
}\r