len = 256;\r
}\r
\r
- if (!sh && (est->rendstatus & PDRAW_SONIC_MODE)) {\r
+ if (DrawLineDestBase == HighColBase) {\r
+ if (!sh && (est->rendstatus & PDRAW_SONIC_MODE))\r
+ blockcpy_or(pd+8, est->HighCol+8, len, est->SonicPalCount*0x40);\r
+ } else if (!sh && (est->rendstatus & PDRAW_SONIC_MODE)) {\r
// select active backup palette\r
blockcpy_or(pd, est->HighCol+8, len, est->SonicPalCount*0x40);\r
} else {\r
\r
void PicoDrawSetOutBufMD(void *dest, int increment)\r
{\r
+ if (FinalizeLine == FinalizeLine8bit && increment == 328) {\r
+ // kludge for no-copy mode\r
+ PicoDrawSetInternalBuf(dest, increment);\r
+ }\r
if (dest != NULL) {\r
DrawLineDestBase = dest;\r
DrawLineDestIncrement = increment;\r
static void (*FinalizeLineM4)(int line);
static int skip_next_line;
-static int screen_offset;
+static int screen_offset, line_offset;
static void TileBGM4(int sx, int pal)
{
if (pv->reg[0] & 8)
xoff = 0;
- if (!FinalizeLineM4 && !(PicoIn.opt & POPT_DIS_32C_BORDER))
- xoff += 32;
+ xoff += line_offset;
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;
+ dx += line_offset;
// low priority tiles
if (!(pv->debug_p & PVD_KILL_B))
{
unsigned char *pd = Pico.est.DrawLineDest;
- if (!(PicoIn.opt & POPT_DIS_32C_BORDER))
- pd += 32;
-
- memcpy(pd, Pico.est.HighCol + 8, 256);
+ if (HighColBase != DrawLineDestBase)
+ memcpy(pd + line_offset, Pico.est.HighCol + line_offset + 8, 256);
}
void PicoDrawSetOutputMode4(pdso_t which)
{
+ line_offset = PicoIn.opt & POPT_DIS_32C_BORDER ? 0 : 32;
switch (which)
{
case PDF_8BIT: FinalizeLineM4 = FinalizeLine8bitM4; break;
- case PDF_RGB555: FinalizeLineM4 = FinalizeLineRGB555M4; break;
+ case PDF_RGB555: FinalizeLineM4 = FinalizeLineRGB555M4;
+ line_offset = 0 /* done in FinalizeLine */; break;
default: FinalizeLineM4 = NULL;
PicoDrawSetInternalBuf(Pico.est.Draw2FB, 328); break;
}
localPalSize = make_local_pal(1);\r
// a hack for VR\r
if (PicoIn.AHW & PAHW_SVP)\r
- memset32((int *)(Pico.est.Draw2FB+328*8+328*223), 0xe0e0e0e0, 328);\r
+ memset32((int *)(Pico.est.Draw2FB+328*8+328*223), 0xe0e0e0e0, 328/4);\r
// do actual copy\r
vidcpyM2(g_screen_ptr, Pico.est.Draw2FB+328*8,\r
!(Pico.video.reg[12] & 1), !(PicoIn.opt & POPT_DIS_32C_BORDER));\r
case RT_8BIT_ACC:\r
PicoIn.opt &= ~POPT_ALT_RENDERER;\r
PicoDrawSetOutFormat(PDF_8BIT, 0);\r
- PicoDrawSetOutBuf(Pico.est.Draw2FB + 8, 328);\r
+ PicoDrawSetOutBuf(Pico.est.Draw2FB, 328);\r
break;\r
case RT_8BIT_FAST:\r
PicoIn.opt |= POPT_ALT_RENDERER;\r