X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fdraw.c;h=0480242f7879cbd7ffaf4521397c9c919db38956;hb=d3bbc8d2cbb5fcc61e9f4e282effd0f2777a5cc3;hp=11cd82041d675fd6dac8dc9cf8621c87556c5ec4;hpb=41946d7023cded9999495eb8916eeb5ab0480a1f;p=picodrive.git diff --git a/pico/draw.c b/pico/draw.c index 11cd820..0480242 100644 --- a/pico/draw.c +++ b/pico/draw.c @@ -1197,46 +1197,6 @@ void PicoDoHighPal555(int sh) } } -#if 0 -static void FinalizeLineBGR444(int sh, int line) -{ - unsigned short *pd=DrawLineDest; - unsigned char *ps=HighCol+8; - unsigned short *pal=Pico.cram; - int len, i, t, mask=0xff; - - if (Pico.video.reg[12]&1) { - len = 320; - } else { - if(!(PicoOpt&POPT_DIS_32C_BORDER)) pd+=32; - len = 256; - } - - if(sh) { - pal=HighPal; - if(Pico.m.dirtyPal) { - blockcpy(pal, Pico.cram, 0x40*2); - // shadowed pixels - for(i = 0x3f; i >= 0; i--) - pal[0x40|i] = pal[0xc0|i] = (unsigned short)((pal[i]>>1)&0x0777); - // hilighted pixels - for(i = 0x3f; i >= 0; i--) { - t=pal[i]&0xeee;t+=0x444;if(t&0x10)t|=0xe;if(t&0x100)t|=0xe0;if(t&0x1000)t|=0xe00;t&=0xeee; - pal[0x80|i]=(unsigned short)t; - } - Pico.m.dirtyPal = 0; - } - } - - if (!sh && (rendstatus & PDRAW_SPR_LO_ON_HI)) - mask=0x3f; // accurate sprites - - for(i = 0; i < len; i++) - pd[i] = pal[ps[i] & mask]; -} -#endif - - void FinalizeLine555(int sh, int line) { unsigned short *pd=DrawLineDest; @@ -1424,11 +1384,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 +1392,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 +1417,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 +1468,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) { @@ -1575,7 +1528,7 @@ void PicoDrawSetOutBuf(void *dest, int increment) { DrawLineDestBase = dest; DrawLineDestIncrement = increment; - DrawLineDest = DrawLineDestBase + DrawScanline * increment; + DrawLineDest = (unsigned char*)DrawLineDestBase + DrawScanline * increment; } void PicoDrawSetInternalBuf(void *dest, int increment)