-// This is part of Pico Library\r
-\r
-// (c) Copyright 2004 Dave, All rights reserved.\r
-// (c) Copyright 2006-2008 notaz, All rights reserved.\r
-// Free for non-commercial use.\r
-\r
-// For commercial use, separate licencing terms must be obtained.\r
-\r
+/*\r
+ * line renderer\r
+ * (c) Copyright Dave, 2004\r
+ * (C) notaz, 2006-2010\r
+ *\r
+ * This work is licensed under the terms of MAME license.\r
+ * See COPYING file in the top-level directory.\r
+ */\r
/*\r
* The renderer has 4 modes now:\r
* - normal\r
lines = 240;\r
}\r
\r
- HighCol = HighColBase + offs * HighColIncrement;\r
- DrawLineDest = (char *)DrawLineDestBase + offs * DrawLineDestIncrement;\r
- DrawScanline = 0;\r
- skip_next_line = 0;\r
-\r
if (rendstatus != rendstatus_old || lines != rendlines) {\r
rendlines = lines;\r
// mode_change() might reset rendstatus_old by calling SetColorFormat\r
rendstatus_old = rendstatus;\r
}\r
\r
+ HighCol = HighColBase + offs * HighColIncrement;\r
+ DrawLineDest = (char *)DrawLineDestBase + offs * DrawLineDestIncrement;\r
+ DrawScanline = 0;\r
+ skip_next_line = 0;\r
+\r
if (PicoOpt & POPT_ALT_RENDERER)\r
return;\r
\r
\r
if (PicoScanEnd != NULL)\r
PicoScanEnd(line + offs);\r
+\r
+ HighCol += HighColIncrement;\r
+ DrawLineDest = (char *)DrawLineDest + DrawLineDestIncrement;\r
}\r
\r
static void PicoLine(int line, int offs, int sh, int bgc)\r
\r
for (line = DrawScanline; line < to; line++)\r
{\r
-#if !CAN_HANDLE_240_LINES\r
- if (line >= 224) break;\r
-#endif\r
PicoLine(line, offs, sh, bgc);\r
}\r
\r
-#if !CAN_HANDLE_240_LINES\r
- if (line >= 224) {\r
- DrawScanline = 240;\r
- return;\r
- }\r
-#endif\r
-\r
// last line\r
if (line <= to)\r
{\r
}\r
}\r
\r
-void PicoDrawSetOutFormat(pdso_t which, int allow_32x)\r
+void PicoDrawSetOutFormat(pdso_t which, int use_32x_line_mode)\r
{\r
switch (which)\r
{\r
break;\r
\r
case PDF_RGB555:\r
- if ((PicoAHW & PAHW_32X) && allow_32x)\r
+ if ((PicoAHW & PAHW_32X) && use_32x_line_mode)\r
FinalizeLine = FinalizeLine32xRGB555;\r
else\r
FinalizeLine = FinalizeLine555;\r
FinalizeLine = NULL;\r
break;\r
}\r
+ PicoDrawSetOutFormat32x(which, use_32x_line_mode);\r
PicoDrawSetOutputMode4(which);\r
rendstatus_old = -1;\r
}\r
{\r
DrawLineDestBase = dest;\r
DrawLineDestIncrement = increment;\r
- DrawLineDest = DrawLineDestBase + DrawScanline * increment;\r
+ DrawLineDest = (unsigned char*)DrawLineDestBase + DrawScanline * increment;\r
}\r
\r
void PicoDrawSetInternalBuf(void *dest, int increment)\r
}\r
}\r
\r
+void PicoDrawSetCallbacks(int (*begin)(unsigned int num), int (*end)(unsigned int num))\r
+{\r
+ PicoScanBegin = NULL;\r
+ PicoScanEnd = NULL;\r
+ PicoScan32xBegin = NULL;\r
+ PicoScan32xEnd = NULL;\r
+\r
+ if ((PicoAHW & PAHW_32X) && FinalizeLine != FinalizeLine32xRGB555) {\r
+ PicoScan32xBegin = begin;\r
+ PicoScan32xEnd = end;\r
+ }\r
+ else {\r
+ PicoScanBegin = begin;\r
+ PicoScanEnd = end;\r
+ }\r
+}\r