X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fdraw.c;h=a03d8873a8734a5143af2ce87287f37b6d0fb235;hb=01685eefb022ab2d13cc154a43807e9d20c77c03;hp=0dd682c4b5e295afdb997194ab8a44dff20fc488;hpb=f4750ee051b509a17bb940d6372a0c12faae18cd;p=picodrive.git diff --git a/pico/draw.c b/pico/draw.c index 0dd682c..a03d887 100644 --- a/pico/draw.c +++ b/pico/draw.c @@ -1,11 +1,11 @@ -// This is part of Pico Library - -// (c) Copyright 2004 Dave, All rights reserved. -// (c) Copyright 2006-2008 notaz, All rights reserved. -// Free for non-commercial use. - -// For commercial use, separate licencing terms must be obtained. - +/* + * line renderer + * (c) Copyright Dave, 2004 + * (C) notaz, 2006-2010 + * + * This work is licensed under the terms of MAME license. + * See COPYING file in the top-level directory. + */ /* * The renderer has 4 modes now: * - normal @@ -1424,11 +1424,6 @@ PICO_INTERNAL void PicoFrameStart(void) lines = 240; } - HighCol = HighColBase + offs * HighColIncrement; - DrawLineDest = (char *)DrawLineDestBase + offs * DrawLineDestIncrement; - DrawScanline = 0; - skip_next_line = 0; - if (rendstatus != rendstatus_old || lines != rendlines) { rendlines = lines; // mode_change() might reset rendstatus_old by calling SetColorFormat @@ -1437,6 +1432,11 @@ PICO_INTERNAL void PicoFrameStart(void) rendstatus_old = rendstatus; } + HighCol = HighColBase + offs * HighColIncrement; + DrawLineDest = (char *)DrawLineDestBase + offs * DrawLineDestIncrement; + DrawScanline = 0; + skip_next_line = 0; + if (PicoOpt & POPT_ALT_RENDERER) return; @@ -1457,6 +1457,9 @@ static void DrawBlankedLine(int line, int offs, int sh, int bgc) if (PicoScanEnd != NULL) PicoScanEnd(line + offs); + + HighCol += HighColIncrement; + DrawLineDest = (char *)DrawLineDest + DrawLineDestIncrement; } static void PicoLine(int line, int offs, int sh, int bgc) @@ -1505,19 +1508,9 @@ void PicoDrawSync(int to, int blank_last_line) for (line = DrawScanline; line < to; line++) { -#if !CAN_HANDLE_240_LINES - if (line >= 224) break; -#endif PicoLine(line, offs, sh, bgc); } -#if !CAN_HANDLE_240_LINES - if (line >= 224) { - DrawScanline = 240; - return; - } -#endif - // last line if (line <= to) { @@ -1546,7 +1539,7 @@ void PicoDrawUpdateHighPal(void) } } -void PicoDrawSetOutFormat(pdso_t which, int allow_32x) +void PicoDrawSetOutFormat(pdso_t which, int use_32x_line_mode) { switch (which) { @@ -1555,7 +1548,7 @@ void PicoDrawSetOutFormat(pdso_t which, int allow_32x) break; case PDF_RGB555: - if ((PicoAHW & PAHW_32X) && allow_32x) + if ((PicoAHW & PAHW_32X) && use_32x_line_mode) FinalizeLine = FinalizeLine32xRGB555; else FinalizeLine = FinalizeLine555; @@ -1565,6 +1558,7 @@ void PicoDrawSetOutFormat(pdso_t which, int allow_32x) FinalizeLine = NULL; break; } + PicoDrawSetOutFormat32x(which, use_32x_line_mode); PicoDrawSetOutputMode4(which); rendstatus_old = -1; }