int (*PicoScanEnd) (unsigned int num) = NULL;\r
\r
static unsigned char DefHighCol[8+320+8];\r
-static unsigned char *HighColBase = DefHighCol;\r
-static int HighColIncrement;\r
+unsigned char *HighColBase = DefHighCol;\r
+int HighColIncrement;\r
\r
static unsigned int DefOutBuff[320*2/2];\r
void *DrawLineDestBase = DefOutBuff;\r
if ((PicoIn.opt & POPT_ALT_RENDERER) | (est->rendstatus & PDRAW_SONIC_MODE))\r
sh = 0; // no s/h support\r
\r
- if (FinalizeLine == FinalizeLine8bit)\r
+ if (PicoIn.AHW & PAHW_SMS)\r
+ PicoDoHighPal555M4();\r
+ else if (FinalizeLine == FinalizeLine8bit)\r
PicoDoHighPal555_8bit(sh, 0, est);\r
else\r
PicoDoHighPal555(sh, 0, est);\r
\r
void PicoDrawSetOutFormat(pdso_t which, int use_32x_line_mode)\r
{\r
+ PicoDrawSetInternalBuf(NULL, 0);\r
switch (which)\r
{\r
case PDF_8BIT:\r
\r
default:\r
FinalizeLine = NULL;\r
+ PicoDrawSetOutBufMD(Pico.est.Draw2FB+8, 328);\r
break;\r
}\r
if (PicoIn.AHW & PAHW_32X)\r
if (pv->reg[0] & 8)
xoff = 0;
+ if (!(PicoIn.opt & POPT_DIS_32C_BORDER))
+ xoff += 32;
sat = (unsigned char *)PicoMem.vram + ((pv->reg[5] & 0x7e) << 7);
if (pv->reg[1] & 2) {
if (dx != 8)
cells++; // have hscroll, need to draw 1 cell more
dx += cellskip << 3;
+ if (!FinalizeLineM4 && !(PicoIn.opt & POPT_DIS_32C_BORDER))
+ dx += 32;
// low priority tiles
if (!(pv->debug_p & PVD_KILL_B))
if (!(pv->debug_p & PVD_KILL_A))
draw_strip(nametab, dx, cells, tilex | 0x1000 | (ty << 16));
- if (pv->reg[0] & 0x20)
- // first column masked
- ((int *)Pico.est.HighCol)[2] = ((int *)Pico.est.HighCol)[3] = 0xe0e0e0e0;
+ if (pv->reg[0] & 0x20) {
+ // first column masked, caculate offset to start of line
+ dx = (dx&~0x1f) / 4;
+ ((u32 *)Pico.est.HighCol)[dx+2] = ((u32 *)Pico.est.HighCol)[dx+3] = 0xe0e0e0e0;
+ }
}
void PicoFrameStartMode4(void)
rendlines = lines;
}
+ Pico.est.HighCol = HighColBase + screen_offset * HighColIncrement;
Pico.est.DrawLineDest = (char *)DrawLineDestBase + screen_offset * DrawLineDestIncrement;
}
if (PicoScanEnd != NULL)
skip_next_line = PicoScanEnd(line + screen_offset);
+ Pico.est.HighCol += HighColIncrement;
Pico.est.DrawLineDest = (char *)Pico.est.DrawLineDest + DrawLineDestIncrement;
}
{
case PDF_8BIT: FinalizeLineM4 = FinalizeLine8bitM4; break;
case PDF_RGB555: FinalizeLineM4 = FinalizeLineRGB555M4; break;
- default: FinalizeLineM4 = NULL; break;
+ default: FinalizeLineM4 = NULL;
+ PicoDrawSetInternalBuf(Pico.est.Draw2FB, 328); break;
}
}
extern int (*PicoScanEnd)(unsigned int num);\r
#define MAX_LINE_SPRITES 27 // +1 last sprite width, +4 hdr; total 32\r
extern unsigned char HighLnSpr[240][4+MAX_LINE_SPRITES+1];\r
+extern unsigned char *HighColBase;\r
+extern int HighColIncrement;\r
extern void *DrawLineDestBase;\r
extern int DrawLineDestIncrement;\r
extern unsigned int VdpSATCache[128];\r
const char *renderer_names32x[] = { "accurate", "faster", "fastest", NULL };\r
enum renderer_types { RT_16BIT, RT_8BIT_ACC, RT_8BIT_FAST, RT_COUNT };\r
\r
+static int out_x, out_y;\r
+static int out_w, out_h;\r
\r
void pemu_prep_defconfig(void)\r
{\r
void pemu_finalize_frame(const char *fps, const char *notice)\r
{\r
if (currentConfig.renderer != RT_16BIT && !(PicoIn.AHW & PAHW_32X)) {\r
- unsigned short *pd = (unsigned short *)g_screen_ptr + 8 * g_screen_ppitch;\r
- unsigned char *ps = Pico.est.Draw2FB + 328*8 + 8;\r
+ unsigned short *pd = (unsigned short *)g_screen_ptr + out_y * g_screen_ppitch + out_x;\r
+ unsigned char *ps = Pico.est.Draw2FB + 328*out_y + out_x + 8;\r
unsigned short *pal = Pico.est.HighPal;\r
int i, x;\r
\r
PicoDrawUpdateHighPal();\r
- for (i = 0; i < 224; i++, ps += 8)\r
- for (x = 0; x < 320; x++)\r
+ for (i = 0; i < out_h; i++, ps += 8) {\r
+ for (x = 0; x < out_w; x++)\r
*pd++ = pal[*ps++];\r
+ pd += 320 - out_w;\r
+ ps += 320 - out_w;\r
+ }\r
}\r
\r
if (notice || (currentConfig.EmuOpt & EOPT_SHOW_FPS)) {\r
{\r
// clear whole screen in all buffers\r
if (currentConfig.renderer != RT_16BIT && !(PicoIn.AHW & PAHW_32X))\r
- memset32(Pico.est.Draw2FB, 0, (320+8) * (8+240+8) / 4);\r
- else\r
- memset32(g_screen_ptr, 0, g_screen_ppitch * g_screen_height * 2 / 4);\r
+ memset32(Pico.est.Draw2FB, 0xe0e0e0e0, (320+8) * (8+240+8) / 4);\r
+ memset32(g_screen_ptr, 0, g_screen_ppitch * g_screen_height * 2 / 4);\r
+ out_y = start_line; out_x = (is_32cols ? 32 : 0);\r
+ out_h = line_count; out_w = (is_32cols ? 256:320);\r
}\r
\r
void pemu_loop_prep(void)\r