-
-}
-
-////////////////////////////////////////////////////////////////////////
-
-static void drawPoly3G(int32_t rgb1, int32_t rgb2, int32_t rgb3)
-{
- drawPoly3Gi(lx0,ly0,lx1,ly1,lx2,ly2,rgb1,rgb2,rgb3);
-}
-
-// draw two g-shaded tris for right psx shading emulation
-
-static void drawPoly4G(int32_t rgb1, int32_t rgb2, int32_t rgb3, int32_t rgb4)
-{
- drawPoly3Gi(lx1,ly1,lx3,ly3,lx2,ly2,
- rgb2,rgb4,rgb3);
- drawPoly3Gi(lx0,ly0,lx1,ly1,lx2,ly2,
- rgb1,rgb2,rgb3);
-}
-
-////////////////////////////////////////////////////////////////////////
-// POLY 3/4 G-SHADED TEX PAL4
-////////////////////////////////////////////////////////////////////////
-
-static void drawPoly3TGEx4(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short clX, short clY,int32_t col1, int32_t col2, int32_t col3)
-{
- int i,j,xmin,xmax,ymin,ymax;
- int32_t cR1,cG1,cB1;
- int32_t difR,difB,difG,difR2,difB2,difG2;
- int32_t difX, difY,difX2, difY2;
- int32_t posX,posY,YAdjust,clutP,XAdjust;
- short tC1,tC2;
-
- if(x1>drawW && x2>drawW && x3>drawW) return;
- if(y1>drawH && y2>drawH && y3>drawH) return;
- if(x1<drawX && x2<drawX && x3<drawX) return;
- if(y1<drawY && y2<drawY && y3<drawY) return;
- if(drawY>=drawH) return;
- if(drawX>=drawW) return;
-
- if(!SetupSections_GT(x1,y1,x2,y2,x3,y3,tx1,ty1,tx2,ty2,tx3,ty3,col1,col2,col3)) return;
-
- ymax=Ymax;
-
- for(ymin=Ymin;ymin<drawY;ymin++)
- if(NextRow_GT()) return;
-
- clutP=(clY<<10)+clX;
-
- YAdjust=((GlobalTextAddrY)<<11)+(GlobalTextAddrX<<1);
-
- difR=delta_right_R;
- difG=delta_right_G;
- difB=delta_right_B;
- difR2=difR<<1;
- difG2=difG<<1;
- difB2=difB<<1;
-
- difX=delta_right_u;difX2=difX<<1;
- difY=delta_right_v;difY2=difY<<1;
-
-#ifdef FASTSOLID
-
- if(!bCheckMask && !DrawSemiTrans && !iDither)
- {
- for (i=ymin;i<=ymax;i++)
- {
- xmin=((left_x) >> 16);
- xmax=((right_x) >> 16)-1; //!!!!!!!!!!!!!
- if(drawW<xmax) xmax=drawW;
-
- if(xmax>=xmin)
- {
- posX=left_u;
- posY=left_v;
- cR1=left_R;
- cG1=left_G;
- cB1=left_B;
-
- if(xmin<drawX)
- {j=drawX-xmin;xmin=drawX;posX+=j*difX;posY+=j*difY;cR1+=j*difR;cG1+=j*difG;cB1+=j*difB;}
-
- for(j=xmin;j<xmax;j+=2)
- {
- XAdjust=(posX>>16);
- tC1 = psxVub[((posY>>5)&0xFFFFF800)+YAdjust+(XAdjust>>1)];
- tC1=(tC1>>((XAdjust&1)<<2))&0xf;
- XAdjust=((posX+difX)>>16);
- tC2 = psxVub[(((posY+difY)>>5)&(int32_t)0xFFFFF800)+YAdjust+
- (XAdjust>>1)];
- tC2=(tC2>>((XAdjust&1)<<2))&0xf;
-
- GetTextureTransColGX32_S((uint32_t *)&psxVuw[(i<<10)+j],
- GETLE16(&psxVuw[clutP+tC1])|
- ((int32_t)GETLE16(&psxVuw[clutP+tC2]))<<16,
- (cB1>>16)|((cB1+difB)&0xff0000),
- (cG1>>16)|((cG1+difG)&0xff0000),
- (cR1>>16)|((cR1+difR)&0xff0000));
- posX+=difX2;
- posY+=difY2;
- cR1+=difR2;
- cG1+=difG2;
- cB1+=difB2;
- }
- if(j==xmax)
- {
- XAdjust=(posX>>16);
- tC1 = psxVub[((posY>>5)&(int32_t)0xFFFFF800)+YAdjust+(XAdjust>>1)];
- tC1=(tC1>>((XAdjust&1)<<2))&0xf;
- GetTextureTransColGX_S(&psxVuw[(i<<10)+j],
- GETLE16(&psxVuw[clutP+tC1]),
- (cB1>>16),(cG1>>16),(cR1>>16));
- }
- }
- if(NextRow_GT())
- {
- return;
- }
- }
- return;
- }
-
-#endif
-
- for (i=ymin;i<=ymax;i++)
- {
- xmin=(left_x >> 16);
- xmax=(right_x >> 16)-1; //!!!!!!!!!!!!!!!!
- if(drawW<xmax) xmax=drawW;
-
- if(xmax>=xmin)
- {
- posX=left_u;
- posY=left_v;
- cR1=left_R;
- cG1=left_G;
- cB1=left_B;
-
- if(xmin<drawX)
- {j=drawX-xmin;xmin=drawX;posX+=j*difX;posY+=j*difY;cR1+=j*difR;cG1+=j*difG;cB1+=j*difB;}
-
- for(j=xmin;j<=xmax;j++)
- {
- XAdjust=(posX>>16);
- tC1 = psxVub[((posY>>5)&(int32_t)0xFFFFF800)+YAdjust+(XAdjust>>1)];
- tC1=(tC1>>((XAdjust&1)<<2))&0xf;
- if(iDither)
- GetTextureTransColGX_Dither(&psxVuw[(i<<10)+j],
- GETLE16(&psxVuw[clutP+tC1]),
- (cB1>>16),(cG1>>16),(cR1>>16));
- else
- GetTextureTransColGX(&psxVuw[(i<<10)+j],
- GETLE16(&psxVuw[clutP+tC1]),
- (cB1>>16),(cG1>>16),(cR1>>16));
- posX+=difX;
- posY+=difY;
- cR1+=difR;
- cG1+=difG;
- cB1+=difB;
- }
- }
- if(NextRow_GT())
- {
- return;
- }
- }