X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=plugins%2Fgpu-gles%2FgpuPrim.c;h=ed16e4a9c53498071e17aa27112e2b4795ec03bb;hb=5fa6cb1729bd2bc6c1d9d0d04c4acd611675518f;hp=218ff66d30e1360f2ff107d500c266a0ac9ff86b;hpb=679d5ee3c46235923a99391922de1df0239e9ff3;p=pcsx_rearmed.git diff --git a/plugins/gpu-gles/gpuPrim.c b/plugins/gpu-gles/gpuPrim.c index 218ff66d..ed16e4a9 100644 --- a/plugins/gpu-gles/gpuPrim.c +++ b/plugins/gpu-gles/gpuPrim.c @@ -77,15 +77,15 @@ BOOL bUsingMovie=FALSE; // movie active flag PSXRect_t xrMovieArea; // rect for movie upload short sSprite_ux2; // needed for sprire adjust short sSprite_vy2; // -unsigned long ulOLDCOL=0; // active color -unsigned long ulClutID; // clut +unsigned int ulOLDCOL=0; // active color +unsigned int ulClutID; // clut -unsigned long dwCfgFixes; // game fixes -unsigned long dwActFixes=0; -unsigned long dwEmuFixes=0; +unsigned int dwCfgFixes; // game fixes +unsigned int dwActFixes=0; +unsigned int dwEmuFixes=0; BOOL bUseFixes; -long drawX,drawY,drawW,drawH; // offscreen drawing checkers +int drawX,drawY,drawW,drawH; // offscreen drawing checkers short sxmin,sxmax,symin,symax; unsigned int CSVERTEX=0,CSCOLOR=0,CSTEXTURE=0; @@ -147,9 +147,9 @@ void UpdateGlobalTP(unsigned short gdata) //////////////////////////////////////////////////////////////////////// -unsigned long DoubleBGR2RGB (unsigned long BGR) +unsigned int DoubleBGR2RGB (unsigned int BGR) { - unsigned long ebx,eax,edx; + unsigned int ebx,eax,edx; ebx=(BGR&0x000000ff)<<1; if(ebx&0x00000100) ebx=0x000000ff; @@ -163,7 +163,7 @@ unsigned long DoubleBGR2RGB (unsigned long BGR) return (ebx|eax|edx); } -unsigned short BGR24to16 (unsigned long BGR) +unsigned short BGR24to16 (unsigned int BGR) { return ((BGR>>3)&0x1f)|((BGR&0xf80000)>>9)|((BGR&0xf800)>>6); } @@ -947,7 +947,7 @@ void SetZMask3NT(void) //////////////////////////////////////////////////////////////////////// - void SetRenderState(unsigned long DrawAttributes) + void SetRenderState(unsigned int DrawAttributes) { bDrawNonShaded = (SHADETEXBIT(DrawAttributes)) ? TRUE : FALSE; DrawSemiTrans = (SEMITRANSBIT(DrawAttributes)) ? TRUE : FALSE; @@ -955,7 +955,7 @@ void SetZMask3NT(void) //////////////////////////////////////////////////////////////////////// - void SetRenderColor(unsigned long DrawAttributes) + void SetRenderColor(unsigned int DrawAttributes) { if(bDrawNonShaded) {g_m1=g_m2=g_m3=128;} else @@ -968,7 +968,7 @@ void SetZMask3NT(void) //////////////////////////////////////////////////////////////////////// -void SetRenderMode(unsigned long DrawAttributes,BOOL bSCol) +void SetRenderMode(unsigned int DrawAttributes,BOOL bSCol) { if((bUseMultiPass) && (bDrawTextured) && !(bDrawNonShaded)) {bDrawMultiPass = TRUE; SetSemiTransMulti(0);} @@ -1024,7 +1024,7 @@ void SetRenderMode(unsigned long DrawAttributes,BOOL bSCol) // Set Opaque multipass color //////////////////////////////////////////////////////////////////////// -void SetOpaqueColor(unsigned long DrawAttributes) +void SetOpaqueColor(unsigned int DrawAttributes) { if(bDrawNonShaded) return; // no shading? bye @@ -1399,7 +1399,7 @@ BOOL CheckAgainstFrontScreen(short imageX0,short imageY0,short imageX1,short ima //////////////////////////////////////////////////////////////////////// -void PrepareFullScreenUpload (long Position) +void PrepareFullScreenUpload (int Position) { if (Position==-1) // rgb24 { @@ -1481,7 +1481,7 @@ void PrepareFullScreenUpload (long Position) unsigned char * LoadDirectMovieFast(void); -void UploadScreenEx(long Position) +void UploadScreenEx(int Position) { short ya,yb,xa,xb,x, y, YStep, XStep, U, UStep,ux[4],vy[4]; @@ -1565,7 +1565,7 @@ void UploadScreenEx(long Position) //////////////////////////////////////////////////////////////////////// -void UploadScreen(long Position) +void UploadScreen(int Position) { short x, y, YStep, XStep, U, s, UStep,ux[4],vy[4]; short xa,xb,ya,yb; @@ -1646,8 +1646,8 @@ void UploadScreen(long Position) gl_vy[2] = gl_vy[3] = s; gl_ux[0] = gl_ux[3] = gl_vy[0] = gl_vy[1] = 0; - SetRenderState((unsigned long)0x01000000); - SetRenderMode((unsigned long)0x01000000, FALSE); // upload texture data + SetRenderState((unsigned int)0x01000000); + SetRenderMode((unsigned int)0x01000000, FALSE); // upload texture data offsetScreenUpload(Position); assignTextureVRAMWrite(); @@ -1712,7 +1712,7 @@ BOOL IsInsideNextScreen(short x, short y, short xoff, short yoff) void cmdSTP(unsigned char * baseAddr) { - unsigned long gdata = ((unsigned long*)baseAddr)[0]; + unsigned int gdata = ((unsigned int*)baseAddr)[0]; STATUSREG&=~0x1800; // clear the necessary bits STATUSREG|=((gdata & 0x03) << 11); // set the current bits @@ -1745,7 +1745,7 @@ void cmdSTP(unsigned char * baseAddr) void cmdTexturePage(unsigned char * baseAddr) { - unsigned long gdata = ((unsigned long*)baseAddr)[0]; + unsigned int gdata = ((unsigned int*)baseAddr)[0]; UpdateGlobalTP((unsigned short)gdata); GlobalTextREST = (gdata&0x00ffffff)>>9; } @@ -1756,9 +1756,9 @@ void cmdTexturePage(unsigned char * baseAddr) void cmdTextureWindow(unsigned char *baseAddr) { - unsigned long gdata = ((unsigned long*)baseAddr)[0]; + unsigned int gdata = ((unsigned int*)baseAddr)[0]; - unsigned long YAlign,XAlign; + unsigned int YAlign,XAlign; ulGPUInfoVals[INFO_TW]=gdata&0xFFFFF; @@ -1792,8 +1792,8 @@ void cmdTextureWindow(unsigned char *baseAddr) // Re-calculate the bit field, because we can't trust what is passed in the data - YAlign = (unsigned long)(32 - (TWin.Position.y1 >> 3)); - XAlign = (unsigned long)(32 - (TWin.Position.x1 >> 3)); + YAlign = (unsigned int)(32 - (TWin.Position.y1 >> 3)); + XAlign = (unsigned int)(32 - (TWin.Position.x1 >> 3)); // Absolute position of the start of the texture window @@ -1965,7 +1965,7 @@ void ClampToPSXScreenOffset(short *x0, short *y0, short *x1, short *y1) void cmdDrawAreaStart(unsigned char * baseAddr) { - unsigned long gdata = ((unsigned long*)baseAddr)[0]; + unsigned int gdata = ((unsigned int*)baseAddr)[0]; drawX = gdata & 0x3ff; // for soft drawing if(drawX>=1024) drawX=1023; @@ -1996,7 +1996,7 @@ void cmdDrawAreaStart(unsigned char * baseAddr) void cmdDrawAreaEnd(unsigned char * baseAddr) { - unsigned long gdata = ((unsigned long*)baseAddr)[0]; + unsigned int gdata = ((unsigned int*)baseAddr)[0]; drawW = gdata & 0x3ff; // for soft drawing if(drawW>=1024) drawW=1023; @@ -2031,7 +2031,7 @@ void cmdDrawAreaEnd(unsigned char * baseAddr) void cmdDrawOffset(unsigned char * baseAddr) { - unsigned long gdata = ((unsigned long*)baseAddr)[0]; + unsigned int gdata = ((unsigned int*)baseAddr)[0]; PreviousPSXDisplay.DrawOffset.x = PSXDisplay.DrawOffset.x = (short)(gdata & 0x7ff); @@ -2241,7 +2241,7 @@ void primStoreImage(unsigned char * baseAddr) void primBlkFill(unsigned char * baseAddr) { - unsigned long *gpuData = ((unsigned long *) baseAddr); + unsigned int *gpuData = ((unsigned int *) baseAddr); short *sgpuData = ((short *) baseAddr); iDrawnSomething=1; @@ -2292,8 +2292,8 @@ void primBlkFill(unsigned char * baseAddr) { bDrawTextured = FALSE; bDrawSmoothShaded = FALSE; - SetRenderState((unsigned long)0x01000000); - SetRenderMode((unsigned long)0x01000000, FALSE); + SetRenderState((unsigned int)0x01000000); + SetRenderMode((unsigned int)0x01000000, FALSE); vertex[0].c.lcol=0xff000000; SETCOL(vertex[0]); if(ly0>pd->DisplayPosition.y) @@ -2320,8 +2320,8 @@ void primBlkFill(unsigned char * baseAddr) { bDrawTextured = FALSE; bDrawSmoothShaded = FALSE; - SetRenderState((unsigned long)0x01000000); - SetRenderMode((unsigned long)0x01000000, FALSE); + SetRenderState((unsigned int)0x01000000); + SetRenderMode((unsigned int)0x01000000, FALSE); vertex[0].c.lcol=gpuData[0]|0xff000000; SETCOL(vertex[0]); //glDisable(GL_SCISSOR_TEST); glError(); @@ -2491,12 +2491,12 @@ void primMoveImage(unsigned char * baseAddr) } else { - unsigned long *SRCPtr, *DSTPtr; + unsigned int *SRCPtr, *DSTPtr; unsigned short LineOffset; int dx=imageSX>>1; - SRCPtr = (unsigned long *)(psxVuw + (1024*imageY0) + imageX0); - DSTPtr = (unsigned long *)(psxVuw + (1024*imageY1) + imageX1); + SRCPtr = (unsigned int *)(psxVuw + (1024*imageY0) + imageX0); + DSTPtr = (unsigned int *)(psxVuw + (1024*imageY1) + imageX1); LineOffset = 512 - dx; @@ -2597,7 +2597,7 @@ void primMoveImage(unsigned char * baseAddr) void primTileS(unsigned char * baseAddr) { - unsigned long *gpuData = ((unsigned long*)baseAddr); + unsigned int *gpuData = ((unsigned int*)baseAddr); short *sgpuData = ((short *) baseAddr); sprtX = sgpuData[2]; @@ -2662,7 +2662,7 @@ void primTileS(unsigned char * baseAddr) void primTile1(unsigned char * baseAddr) { - unsigned long *gpuData = ((unsigned long*)baseAddr); + unsigned int *gpuData = ((unsigned int*)baseAddr); short *sgpuData = ((short *) baseAddr); sprtX = sgpuData[2]; @@ -2709,7 +2709,7 @@ void primTile1(unsigned char * baseAddr) void primTile8(unsigned char * baseAddr) { - unsigned long *gpuData = ((unsigned long*)baseAddr); + unsigned int *gpuData = ((unsigned int*)baseAddr); short *sgpuData = ((short *) baseAddr); sprtX = sgpuData[2]; @@ -2756,7 +2756,7 @@ void primTile8(unsigned char * baseAddr) void primTile16(unsigned char * baseAddr) { - unsigned long *gpuData = ((unsigned long*)baseAddr); + unsigned int *gpuData = ((unsigned int*)baseAddr); short *sgpuData = ((short *) baseAddr); sprtX = sgpuData[2]; @@ -2803,7 +2803,7 @@ void primTile16(unsigned char * baseAddr) /*void DrawMultiBlur(void) { - long lABR,lDST;float fx,fy; + int lABR,lDST;float fx,fy; lABR=GlobalTextABR; lDST=DrawSemiTrans; @@ -2836,7 +2836,7 @@ void primTile16(unsigned char * baseAddr) void DrawMultiFilterSprite(void) { - long lABR,lDST; + int lABR,lDST; if(bUseMultiPass || DrawSemiTrans || ubOpaqueDraw) { @@ -2867,7 +2867,7 @@ void DrawMultiFilterSprite(void) void primSprt8(unsigned char * baseAddr) { - unsigned long *gpuData = ((unsigned long *) baseAddr); + unsigned int *gpuData = ((unsigned int *) baseAddr); short *sgpuData = ((short *) baseAddr); short s; @@ -2988,7 +2988,7 @@ void primSprt8(unsigned char * baseAddr) void primSprt16(unsigned char * baseAddr) { - unsigned long *gpuData = ((unsigned long *) baseAddr); + unsigned int *gpuData = ((unsigned int *) baseAddr); short *sgpuData = ((short *) baseAddr); short s; @@ -3108,7 +3108,7 @@ void primSprt16(unsigned char * baseAddr) void primSprtSRest(unsigned char * baseAddr,unsigned short type) { - unsigned long *gpuData = ((unsigned long *) baseAddr); + unsigned int *gpuData = ((unsigned int *) baseAddr); short *sgpuData = ((short *) baseAddr); short s;unsigned short sTypeRest=0; @@ -3279,7 +3279,7 @@ void primSprtSRest(unsigned char * baseAddr,unsigned short type) void primSprtS(unsigned char * baseAddr) { - unsigned long *gpuData = ((unsigned long *) baseAddr); + unsigned int *gpuData = ((unsigned int *) baseAddr); short *sgpuData = ((short *) baseAddr); short s;unsigned short sTypeRest=0; @@ -3418,7 +3418,7 @@ void primSprtS(unsigned char * baseAddr) void primPolyF4(unsigned char *baseAddr) { - unsigned long *gpuData = ((unsigned long *) baseAddr); + unsigned int *gpuData = ((unsigned int *) baseAddr); short *sgpuData = ((short *) baseAddr); lx0 = sgpuData[2]; @@ -3513,7 +3513,7 @@ BOOL bCheckFF9G4(unsigned char * baseAddr) if(iFF9Fix==2) { - long labr=GlobalTextABR; + int labr=GlobalTextABR; GlobalTextABR=1; primPolyG4(pFF9G4Cache); GlobalTextABR=labr; @@ -3527,7 +3527,7 @@ BOOL bCheckFF9G4(unsigned char * baseAddr) void primPolyG4(unsigned char * baseAddr) { - unsigned long *gpuData = (unsigned long *)baseAddr; + unsigned int *gpuData = (unsigned int *)baseAddr; short *sgpuData = ((short *) baseAddr); lx0 = sgpuData[2]; @@ -3578,7 +3578,7 @@ void primPolyG4(unsigned char * baseAddr) // cmd: flat shaded Texture3 //////////////////////////////////////////////////////////////////////// -BOOL DoLineCheck(unsigned long * gpuData) +BOOL DoLineCheck(unsigned int * gpuData) { BOOL bQuad=FALSE;short dx,dy; @@ -3745,7 +3745,7 @@ BOOL DoLineCheck(unsigned long * gpuData) void primPolyFT3(unsigned char * baseAddr) { - unsigned long *gpuData = ((unsigned long *) baseAddr); + unsigned int *gpuData = ((unsigned int *) baseAddr); short *sgpuData = ((short *) baseAddr); lx0 = sgpuData[2]; @@ -4181,7 +4181,7 @@ void RectTexAlign(void) void primPolyFT4(unsigned char * baseAddr) { - unsigned long *gpuData = ((unsigned long *) baseAddr); + unsigned int *gpuData = ((unsigned int *) baseAddr); short *sgpuData = ((short *) baseAddr); lx0 = sgpuData[2]; @@ -4269,7 +4269,7 @@ void primPolyFT4(unsigned char * baseAddr) void primPolyGT3(unsigned char *baseAddr) { - unsigned long *gpuData = ((unsigned long *) baseAddr); + unsigned int *gpuData = ((unsigned int *) baseAddr); short *sgpuData = ((short *) baseAddr); lx0 = sgpuData[2]; @@ -4378,7 +4378,7 @@ void primPolyGT3(unsigned char *baseAddr) void primPolyG3(unsigned char *baseAddr) { - unsigned long *gpuData = ((unsigned long *) baseAddr); + unsigned int *gpuData = ((unsigned int *) baseAddr); short *sgpuData = ((short *) baseAddr); lx0 = sgpuData[2]; @@ -4423,7 +4423,7 @@ void primPolyG3(unsigned char *baseAddr) void primPolyGT4(unsigned char *baseAddr) { - unsigned long *gpuData = ((unsigned long *) baseAddr); + unsigned int *gpuData = ((unsigned int *) baseAddr); short *sgpuData = ((short *) baseAddr); lx0 = sgpuData[2]; @@ -4543,7 +4543,7 @@ void primPolyGT4(unsigned char *baseAddr) void primPolyF3(unsigned char *baseAddr) { - unsigned long *gpuData = ((unsigned long *) baseAddr); + unsigned int *gpuData = ((unsigned int *) baseAddr); short *sgpuData = ((short *) baseAddr); lx0 = sgpuData[2]; @@ -4587,7 +4587,7 @@ void primPolyF3(unsigned char *baseAddr) void primLineGSkip(unsigned char *baseAddr) { - unsigned long *gpuData = ((unsigned long *) baseAddr); + unsigned int *gpuData = ((unsigned int *) baseAddr); short *sgpuData = ((short *) baseAddr); int iMax=255; int i=2; @@ -4612,7 +4612,7 @@ void primLineGSkip(unsigned char *baseAddr) void primLineGEx(unsigned char *baseAddr) { - unsigned long *gpuData = ((unsigned long *) baseAddr); + unsigned int *gpuData = ((unsigned int *) baseAddr); int iMax=255; short cx0,cx1,cy0,cy1;int i;BOOL bDraw=TRUE; @@ -4676,7 +4676,7 @@ void primLineGEx(unsigned char *baseAddr) void primLineG2(unsigned char *baseAddr) { - unsigned long *gpuData = ((unsigned long *) baseAddr); + unsigned int *gpuData = ((unsigned int *) baseAddr); short *sgpuData = ((short *) baseAddr); lx0 = sgpuData[2]; @@ -4721,7 +4721,7 @@ void primLineG2(unsigned char *baseAddr) void primLineFSkip(unsigned char *baseAddr) { - unsigned long *gpuData = ((unsigned long *) baseAddr); + unsigned int *gpuData = ((unsigned int *) baseAddr); int i=2,iMax=255; ly1 = (short)((gpuData[1]>>16) & 0xffff); @@ -4741,7 +4741,7 @@ void primLineFSkip(unsigned char *baseAddr) void primLineFEx(unsigned char *baseAddr) { - unsigned long *gpuData = ((unsigned long *) baseAddr); + unsigned int *gpuData = ((unsigned int *) baseAddr); int iMax; short cx0,cx1,cy0,cy1;int i; @@ -4799,7 +4799,7 @@ void primLineFEx(unsigned char *baseAddr) void primLineF2(unsigned char *baseAddr) { - unsigned long *gpuData = ((unsigned long *) baseAddr); + unsigned int *gpuData = ((unsigned int *) baseAddr); short *sgpuData = ((short *) baseAddr); lx0 = sgpuData[2];