1 /***************************************************************************
2 * Copyright (C) 2010 PCSX4ALL Team *
3 * Copyright (C) 2010 Unai *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307 USA. *
19 ***************************************************************************/
21 #define GPU_TESTRANGE3() \
23 if(x0<0) { if((x1-x0)>CHKMAX_X) return; if((x2-x0)>CHKMAX_X) return; } \
24 if(x1<0) { if((x0-x1)>CHKMAX_X) return; if((x2-x1)>CHKMAX_X) return; } \
25 if(x2<0) { if((x0-x2)>CHKMAX_X) return; if((x1-x2)>CHKMAX_X) return; } \
26 if(y0<0) { if((y1-y0)>CHKMAX_Y) return; if((y2-y0)>CHKMAX_Y) return; } \
27 if(y1<0) { if((y0-y1)>CHKMAX_Y) return; if((y2-y1)>CHKMAX_Y) return; } \
28 if(y2<0) { if((y0-y2)>CHKMAX_Y) return; if((y1-y2)>CHKMAX_Y) return; } \
31 ///////////////////////////////////////////////////////////////////////////////
32 // GPU internal polygon drawing functions
34 ///////////////////////////////////////////////////////////////////////////////
35 void gpuDrawF3(const PP gpuPolySpanDriver)
37 const int li=linesInterlace;
39 s32 xa, xb, xmin, xmax;
40 s32 ya, yb, ymin, ymax;
41 s32 x0, x1, x2, x3, dx3=0, x4, dx4=0, dx;
44 x0 = GPU_EXPANDSIGN(PacketBuffer.S2[2]);
45 y0 = GPU_EXPANDSIGN(PacketBuffer.S2[3]);
46 x1 = GPU_EXPANDSIGN(PacketBuffer.S2[4]);
47 y1 = GPU_EXPANDSIGN(PacketBuffer.S2[5]);
48 x2 = GPU_EXPANDSIGN(PacketBuffer.S2[6]);
49 y2 = GPU_EXPANDSIGN(PacketBuffer.S2[7]);
53 x0 += DrawingOffset[0]; x1 += DrawingOffset[0]; x2 += DrawingOffset[0];
54 y0 += DrawingOffset[1]; y1 += DrawingOffset[1]; y2 += DrawingOffset[1];
56 xmin = DrawingArea[0]; xmax = DrawingArea[2];
57 ymin = DrawingArea[1]; ymax = DrawingArea[3];
60 int rx0 = Max2(xmin,Min3(x0,x1,x2));
61 int ry0 = Max2(ymin,Min3(y0,y1,y2));
62 int rx1 = Min2(xmax,Max3(x0,x1,x2));
63 int ry1 = Min2(ymax,Max3(y0,y1,y2));
64 if( rx0>=rx1 || ry0>=ry1) return;
67 PixelData = GPU_RGB16(PacketBuffer.U4[0]);
73 GPU_SWAP(x0, x1, temp);
74 GPU_SWAP(y0, y1, temp);
81 GPU_SWAP(x1, x2, temp);
82 GPU_SWAP(y1, y2, temp);
89 GPU_SWAP(x0, x1, temp);
90 GPU_SWAP(y0, y1, temp);
96 dx =(x2 - x1) * ya - (x2 - x0) * yb;
98 for (s32 loop0 = 2; loop0; --loop0)
105 x4 = y0!=y1 ? x3 : i2x(x1);
108 dx3 = xLoDivx((x2 - x0), (y2 - y0));
109 dx4 = xLoDivx((x1 - x0), (y1 - y0));
113 dx3 = xLoDivx((x1 - x0), (y1 - y0));
114 dx4 = xLoDivx((x2 - x0), (y2 - y0));
124 x3 = i2x(x0) + (dx3 * (y1 - y0));
125 dx4 = xLoDivx((x2 - x1), (y2 - y1));
130 x4 = i2x(x0) + (dx4 * (y1 - y0));
131 dx3 = xLoDivx((x2 - x1), (y2 - y1));
142 if (yb > ymax) yb = ymax;
143 if (ya>=yb) continue;
148 u16* PixelBase = &((u16*)GPU_FrameBuffer)[FRAME_OFFSET(0, ya)];
150 for(;ya<yb;++ya, PixelBase += FRAME_WIDTH, x3+=dx3, x4+=dx4)
155 if( (xa>xmax) || (xb<xmin) ) continue;
156 if(xa < xmin) xa = xmin;
157 if(xb > xmax) xb = xmax;
159 if(xb>0) gpuPolySpanDriver(PixelBase + xa,xb);
164 /*----------------------------------------------------------------------
166 ----------------------------------------------------------------------*/
168 void gpuDrawFT3(const PP gpuPolySpanDriver)
170 const int li=linesInterlace;
172 s32 xa, xb, xmin, xmax;
173 s32 ya, yb, ymin, ymax;
174 s32 x0, x1, x2, x3, dx3=0, x4, dx4=0, dx;
176 s32 u0, u1, u2, u3, du3=0;
177 s32 v0, v1, v2, v3, dv3=0;
179 x0 = GPU_EXPANDSIGN(PacketBuffer.S2[2] );
180 y0 = GPU_EXPANDSIGN(PacketBuffer.S2[3] );
181 x1 = GPU_EXPANDSIGN(PacketBuffer.S2[6] );
182 y1 = GPU_EXPANDSIGN(PacketBuffer.S2[7] );
183 x2 = GPU_EXPANDSIGN(PacketBuffer.S2[10]);
184 y2 = GPU_EXPANDSIGN(PacketBuffer.S2[11]);
188 x0 += DrawingOffset[0]; x1 += DrawingOffset[0]; x2 += DrawingOffset[0];
189 y0 += DrawingOffset[1]; y1 += DrawingOffset[1]; y2 += DrawingOffset[1];
191 xmin = DrawingArea[0]; xmax = DrawingArea[2];
192 ymin = DrawingArea[1]; ymax = DrawingArea[3];
195 int rx0 = Max2(xmin,Min3(x0,x1,x2));
196 int ry0 = Max2(ymin,Min3(y0,y1,y2));
197 int rx1 = Min2(xmax,Max3(x0,x1,x2));
198 int ry1 = Min2(ymax,Max3(y0,y1,y2));
199 if( rx0>=rx1 || ry0>=ry1) return;
202 u0 = PacketBuffer.U1[8]; v0 = PacketBuffer.U1[9];
203 u1 = PacketBuffer.U1[16]; v1 = PacketBuffer.U1[17];
204 u2 = PacketBuffer.U1[24]; v2 = PacketBuffer.U1[25];
206 r4 = s32(PacketBuffer.U1[0]);
207 g4 = s32(PacketBuffer.U1[1]);
208 b4 = s32(PacketBuffer.U1[2]);
213 if( y0!=y1 || x0>x1 )
215 GPU_SWAP(x0, x1, temp);
216 GPU_SWAP(y0, y1, temp);
217 GPU_SWAP(u0, u1, temp);
218 GPU_SWAP(v0, v1, temp);
223 if( y1!=y2 || x1>x2 )
225 GPU_SWAP(x1, x2, temp);
226 GPU_SWAP(y1, y2, temp);
227 GPU_SWAP(u1, u2, temp);
228 GPU_SWAP(v1, v2, temp);
233 if( y0!=y1 || x0>x1 )
235 GPU_SWAP(x0, x1, temp);
236 GPU_SWAP(y0, y1, temp);
237 GPU_SWAP(u0, u1, temp);
238 GPU_SWAP(v0, v1, temp);
244 dx = (x2 - x1) * ya - (x2 - x0) * yb;
245 du4 = (u2 - u1) * ya - (u2 - u0) * yb;
246 dv4 = (v2 - v1) * ya - (v2 - v0) * yb;
250 du4 = xInvMulx( du4, iF, iS);
251 dv4 = xInvMulx( dv4, iF, iS);
252 tInc = ((u32)(du4<<7)&0x7fff0000) | ((u32)(dv4>>9)&0x00007fff);
253 tMsk = (TextureWindow[2]<<23) | (TextureWindow[3]<<7) | 0x00ff00ff;
255 for (s32 loop0 = 2; loop0; --loop0)
264 x4 = y0!=y1 ? x3 : i2x(x1);
267 xInv( (y2 - y0), iF, iS);
268 dx3 = xInvMulx( (x2 - x0), iF, iS);
269 du3 = xInvMulx( (u2 - u0), iF, iS);
270 dv3 = xInvMulx( (v2 - v0), iF, iS);
271 dx4 = xLoDivx ( (x1 - x0), (y1 - y0));
275 xInv( (y1 - y0), iF, iS);
276 dx3 = xInvMulx( (x1 - x0), iF, iS);
277 du3 = xInvMulx( (u1 - u0), iF, iS);
278 dv3 = xInvMulx( (v1 - v0), iF, iS);
279 dx4 = xLoDivx ( (x2 - x0), (y2 - y0));
289 u3 = i2x(u0) + (du3 * temp);
290 v3 = i2x(v0) + (dv3 * temp);
291 x3 = i2x(x0) + (dx3 * temp);
293 dx4 = xLoDivx((x2 - x1), (y2 - y1));
300 x4 = i2x(x0) + (dx4 * (y1 - y0));
301 xInv( (y2 - y1), iF, iS);
302 dx3 = xInvMulx( (x2 - x1), iF, iS);
303 du3 = xInvMulx( (u2 - u1), iF, iS);
304 dv3 = xInvMulx( (v2 - v1), iF, iS);
317 if (yb > ymax) yb = ymax;
318 if (ya>=yb) continue;
325 u16* PixelBase = &((u16*)GPU_FrameBuffer)[FRAME_OFFSET(0, ya)];
327 for(;ya<yb;++ya, PixelBase += FRAME_WIDTH, x3+=dx3, x4+=dx4, u3+=du3, v3+=dv3)
332 if( (xa>xmax) || (xb<xmin) ) continue;
346 if(xb > xmax) xb = xmax;
348 if(xb>0) gpuPolySpanDriver(PixelBase + xa,xb);
353 /*----------------------------------------------------------------------
355 ----------------------------------------------------------------------*/
357 void gpuDrawG3(const PP gpuPolySpanDriver)
359 const int li=linesInterlace;
361 s32 xa, xb, xmin, xmax;
362 s32 ya, yb, ymin, ymax;
363 s32 x0, x1, x2, x3, dx3=0, x4, dx4=0, dx;
365 s32 r0, r1, r2, r3, dr3=0;
366 s32 g0, g1, g2, g3, dg3=0;
367 s32 b0, b1, b2, b3, db3=0;
369 x0 = GPU_EXPANDSIGN(PacketBuffer.S2[2] );
370 y0 = GPU_EXPANDSIGN(PacketBuffer.S2[3] );
371 x1 = GPU_EXPANDSIGN(PacketBuffer.S2[6] );
372 y1 = GPU_EXPANDSIGN(PacketBuffer.S2[7] );
373 x2 = GPU_EXPANDSIGN(PacketBuffer.S2[10]);
374 y2 = GPU_EXPANDSIGN(PacketBuffer.S2[11]);
378 x0 += DrawingOffset[0]; x1 += DrawingOffset[0]; x2 += DrawingOffset[0];
379 y0 += DrawingOffset[1]; y1 += DrawingOffset[1]; y2 += DrawingOffset[1];
381 xmin = DrawingArea[0]; xmax = DrawingArea[2];
382 ymin = DrawingArea[1]; ymax = DrawingArea[3];
385 int rx0 = Max2(xmin,Min3(x0,x1,x2));
386 int ry0 = Max2(ymin,Min3(y0,y1,y2));
387 int rx1 = Min2(xmax,Max3(x0,x1,x2));
388 int ry1 = Min2(ymax,Max3(y0,y1,y2));
389 if( rx0>=rx1 || ry0>=ry1) return;
392 r0 = PacketBuffer.U1[0]; g0 = PacketBuffer.U1[1]; b0 = PacketBuffer.U1[2];
393 r1 = PacketBuffer.U1[8]; g1 = PacketBuffer.U1[9]; b1 = PacketBuffer.U1[10];
394 r2 = PacketBuffer.U1[16]; g2 = PacketBuffer.U1[17]; b2 = PacketBuffer.U1[18];
398 if( y0!=y1 || x0>x1 )
400 GPU_SWAP(x0, x1, temp); GPU_SWAP(y0, y1, temp);
401 GPU_SWAP(r0, r1, temp); GPU_SWAP(g0, g1, temp); GPU_SWAP(b0, b1, temp);
406 if( y1!=y2 || x1>x2 )
408 GPU_SWAP(x1, x2, temp); GPU_SWAP(y1, y2, temp);
409 GPU_SWAP(r1, r2, temp); GPU_SWAP(g1, g2, temp); GPU_SWAP(b1, b2, temp);
414 if( y0!=y1 || x0>x1 )
416 GPU_SWAP(x0, x1, temp); GPU_SWAP(y0, y1, temp);
417 GPU_SWAP(r0, r1, temp); GPU_SWAP(g0, g1, temp); GPU_SWAP(b0, b1, temp);
423 dx = (x2 - x1) * ya - (x2 - x0) * yb;
424 dr4 = (r2 - r1) * ya - (r2 - r0) * yb;
425 dg4 = (g2 - g1) * ya - (g2 - g0) * yb;
426 db4 = (b2 - b1) * ya - (b2 - b0) * yb;
430 dr4 = xInvMulx( dr4, iF, iS);
431 dg4 = xInvMulx( dg4, iF, iS);
432 db4 = xInvMulx( db4, iF, iS);
433 u32 dr = (u32)(dr4<< 8)&(0xffffffff<<21); if(dr4<0) dr+= 1<<21;
434 u32 dg = (u32)(dg4>> 3)&(0xffffffff<<10); if(dg4<0) dg+= 1<<10;
435 u32 db = (u32)(db4>>14)&(0xffffffff ); if(db4<0) db+= 1<< 0;
438 for (s32 loop0 = 2; loop0; --loop0)
448 x4 = y0!=y1 ? x3 : i2x(x1);
451 xInv( (y2 - y0), iF, iS);
452 dx3 = xInvMulx( (x2 - x0), iF, iS);
453 dr3 = xInvMulx( (r2 - r0), iF, iS);
454 dg3 = xInvMulx( (g2 - g0), iF, iS);
455 db3 = xInvMulx( (b2 - b0), iF, iS);
456 dx4 = xLoDivx ( (x1 - x0), (y1 - y0));
460 xInv( (y1 - y0), iF, iS);
461 dx3 = xInvMulx( (x1 - x0), iF, iS);
462 dr3 = xInvMulx( (r1 - r0), iF, iS);
463 dg3 = xInvMulx( (g1 - g0), iF, iS);
464 db3 = xInvMulx( (b1 - b0), iF, iS);
465 dx4 = xLoDivx ( (x2 - x0), (y2 - y0));
475 r3 = i2x(r0) + (dr3 * temp);
476 g3 = i2x(g0) + (dg3 * temp);
477 b3 = i2x(b0) + (db3 * temp);
478 x3 = i2x(x0) + (dx3 * temp);
480 dx4 = xLoDivx((x2 - x1), (y2 - y1));
488 x4 = i2x(x0) + (dx4 * (y1 - y0));
490 xInv( (y2 - y1), iF, iS);
491 dx3 = xInvMulx( (x2 - x1), iF, iS);
492 dr3 = xInvMulx( (r2 - r1), iF, iS);
493 dg3 = xInvMulx( (g2 - g1), iF, iS);
494 db3 = xInvMulx( (b2 - b1), iF, iS);
502 x3 += dx3*temp; x4 += dx4*temp;
503 r3 += dr3*temp; g3 += dg3*temp; b3 += db3*temp;
505 if (yb > ymax) yb = ymax;
506 if (ya>=yb) continue;
508 x3+= fixed_HALF; x4+= fixed_HALF;
509 r3+= fixed_HALF; g3+= fixed_HALF; b3+= fixed_HALF;
511 u16* PixelBase = &((u16*)GPU_FrameBuffer)[FRAME_OFFSET(0, ya)];
513 for(;ya<yb;++ya, PixelBase += FRAME_WIDTH, x3+=dx3, x4+=dx4, r3+=dr3, g3+=dg3, b3+=db3)
518 if( (xa>xmax) || (xb<xmin) ) continue;
524 r4 = r3 + dr4*temp; g4 = g3 + dg4*temp; b4 = b3 + db4*temp;
528 r4 = r3; g4 = g3; b4 = b3;
530 if(xb > xmax) xb = xmax;
532 if(xb>0) gpuPolySpanDriver(PixelBase + xa,xb);
537 /*----------------------------------------------------------------------
539 ----------------------------------------------------------------------*/
541 void gpuDrawGT3(const PP gpuPolySpanDriver)
543 const int li=linesInterlace;
545 s32 xa, xb, xmin, xmax;
546 s32 ya, yb, ymin, ymax;
547 s32 x0, x1, x2, x3, dx3=0, x4, dx4=0, dx;
549 s32 u0, u1, u2, u3, du3=0;
550 s32 v0, v1, v2, v3, dv3=0;
551 s32 r0, r1, r2, r3, dr3=0;
552 s32 g0, g1, g2, g3, dg3=0;
553 s32 b0, b1, b2, b3, db3=0;
555 x0 = GPU_EXPANDSIGN(PacketBuffer.S2[2] );
556 y0 = GPU_EXPANDSIGN(PacketBuffer.S2[3] );
557 x1 = GPU_EXPANDSIGN(PacketBuffer.S2[8] );
558 y1 = GPU_EXPANDSIGN(PacketBuffer.S2[9] );
559 x2 = GPU_EXPANDSIGN(PacketBuffer.S2[14]);
560 y2 = GPU_EXPANDSIGN(PacketBuffer.S2[15]);
564 x0 += DrawingOffset[0]; x1 += DrawingOffset[0]; x2 += DrawingOffset[0];
565 y0 += DrawingOffset[1]; y1 += DrawingOffset[1]; y2 += DrawingOffset[1];
567 xmin = DrawingArea[0]; xmax = DrawingArea[2];
568 ymin = DrawingArea[1]; ymax = DrawingArea[3];
571 int rx0 = Max2(xmin,Min3(x0,x1,x2));
572 int ry0 = Max2(ymin,Min3(y0,y1,y2));
573 int rx1 = Min2(xmax,Max3(x0,x1,x2));
574 int ry1 = Min2(ymax,Max3(y0,y1,y2));
575 if( rx0>=rx1 || ry0>=ry1) return;
578 r0 = PacketBuffer.U1[0]; g0 = PacketBuffer.U1[1]; b0 = PacketBuffer.U1[2];
579 u0 = PacketBuffer.U1[8]; v0 = PacketBuffer.U1[9];
580 r1 = PacketBuffer.U1[12]; g1 = PacketBuffer.U1[13]; b1 = PacketBuffer.U1[14];
581 u1 = PacketBuffer.U1[20]; v1 = PacketBuffer.U1[21];
582 r2 = PacketBuffer.U1[24]; g2 = PacketBuffer.U1[25]; b2 = PacketBuffer.U1[26];
583 u2 = PacketBuffer.U1[32]; v2 = PacketBuffer.U1[33];
587 if( y0!=y1 || x0>x1 )
589 GPU_SWAP(x0, x1, temp); GPU_SWAP(y0, y1, temp);
590 GPU_SWAP(u0, u1, temp); GPU_SWAP(v0, v1, temp);
591 GPU_SWAP(r0, r1, temp); GPU_SWAP(g0, g1, temp); GPU_SWAP(b0, b1, temp);
596 if( y1!=y2 || x1>x2 )
598 GPU_SWAP(x1, x2, temp); GPU_SWAP(y1, y2, temp);
599 GPU_SWAP(u1, u2, temp); GPU_SWAP(v1, v2, temp);
600 GPU_SWAP(r1, r2, temp); GPU_SWAP(g1, g2, temp); GPU_SWAP(b1, b2, temp);
605 if( y0!=y1 || x0>x1 )
607 GPU_SWAP(x0, x1, temp); GPU_SWAP(y0, y1, temp);
608 GPU_SWAP(u0, u1, temp); GPU_SWAP(v0, v1, temp);
609 GPU_SWAP(r0, r1, temp); GPU_SWAP(g0, g1, temp); GPU_SWAP(b0, b1, temp);
615 dx = (x2 - x1) * ya - (x2 - x0) * yb;
616 du4 = (u2 - u1) * ya - (u2 - u0) * yb;
617 dv4 = (v2 - v1) * ya - (v2 - v0) * yb;
618 dr4 = (r2 - r1) * ya - (r2 - r0) * yb;
619 dg4 = (g2 - g1) * ya - (g2 - g0) * yb;
620 db4 = (b2 - b1) * ya - (b2 - b0) * yb;
625 du4 = xInvMulx( du4, iF, iS);
626 dv4 = xInvMulx( dv4, iF, iS);
627 dr4 = xInvMulx( dr4, iF, iS);
628 dg4 = xInvMulx( dg4, iF, iS);
629 db4 = xInvMulx( db4, iF, iS);
630 u32 dr = (u32)(dr4<< 8)&(0xffffffff<<21); if(dr4<0) dr+= 1<<21;
631 u32 dg = (u32)(dg4>> 3)&(0xffffffff<<10); if(dg4<0) dg+= 1<<10;
632 u32 db = (u32)(db4>>14)&(0xffffffff ); if(db4<0) db+= 1<< 0;
634 tInc = ((u32)(du4<<7)&0x7fff0000) | ((u32)(dv4>>9)&0x00007fff);
635 tMsk = (TextureWindow[2]<<23) | (TextureWindow[3]<<7) | 0x00ff00ff;
637 for (s32 loop0 = 2; loop0; --loop0)
649 x4 = y0!=y1 ? x3 : i2x(x1);
652 xInv( (y2 - y0), iF, iS);
653 dx3 = xInvMulx( (x2 - x0), iF, iS);
654 du3 = xInvMulx( (u2 - u0), iF, iS);
655 dv3 = xInvMulx( (v2 - v0), iF, iS);
656 dr3 = xInvMulx( (r2 - r0), iF, iS);
657 dg3 = xInvMulx( (g2 - g0), iF, iS);
658 db3 = xInvMulx( (b2 - b0), iF, iS);
659 dx4 = xLoDivx ( (x1 - x0), (y1 - y0));
663 xInv( (y1 - y0), iF, iS);
664 dx3 = xInvMulx( (x1 - x0), iF, iS);
665 du3 = xInvMulx( (u1 - u0), iF, iS);
666 dv3 = xInvMulx( (v1 - v0), iF, iS);
667 dr3 = xInvMulx( (r1 - r0), iF, iS);
668 dg3 = xInvMulx( (g1 - g0), iF, iS);
669 db3 = xInvMulx( (b1 - b0), iF, iS);
670 dx4 = xLoDivx ( (x2 - x0), (y2 - y0));
680 u3 = i2x(u0) + (du3 * temp);
681 v3 = i2x(v0) + (dv3 * temp);
682 r3 = i2x(r0) + (dr3 * temp);
683 g3 = i2x(g0) + (dg3 * temp);
684 b3 = i2x(b0) + (db3 * temp);
685 x3 = i2x(x0) + (dx3 * temp);
687 dx4 = xLoDivx((x2 - x1), (y2 - y1));
697 x4 = i2x(x0) + (dx4 * (y1 - y0));
699 xInv( (y2 - y1), iF, iS);
700 dx3 = xInvMulx( (x2 - x1), iF, iS);
701 du3 = xInvMulx( (u2 - u1), iF, iS);
702 dv3 = xInvMulx( (v2 - v1), iF, iS);
703 dr3 = xInvMulx( (r2 - r1), iF, iS);
704 dg3 = xInvMulx( (g2 - g1), iF, iS);
705 db3 = xInvMulx( (b2 - b1), iF, iS);
713 x3 += dx3*temp; x4 += dx4*temp;
714 u3 += du3*temp; v3 += dv3*temp;
715 r3 += dr3*temp; g3 += dg3*temp; b3 += db3*temp;
717 if (yb > ymax) yb = ymax;
718 if (ya>=yb) continue;
720 x3+= fixed_HALF; x4+= fixed_HALF;
721 u3+= fixed_HALF; v4+= fixed_HALF;
722 r3+= fixed_HALF; g3+= fixed_HALF; b3+= fixed_HALF;
723 u16* PixelBase = &((u16*)GPU_FrameBuffer)[FRAME_OFFSET(0, ya)];
725 for(;ya<yb;++ya, PixelBase += FRAME_WIDTH, x3+=dx3, x4+=dx4, u3+=du3, v3+=dv3, r3+=dr3, g3+=dg3, b3+=db3)
730 if( (xa>xmax) || (xb<xmin)) continue;
736 u4 = u3 + du4*temp; v4 = v3 + dv4*temp;
737 r4 = r3 + dr4*temp; g4 = g3 + dg4*temp; b4 = b3 + db4*temp;
742 r4 = r3; g4 = g3; b4 = b3;
744 if(xb > xmax) xb = xmax;
746 if(xb>0) gpuPolySpanDriver(PixelBase + xa,xb);