PSXRect_t xrMovieArea; // rect for movie upload\r
short sSprite_ux2; // needed for sprire adjust\r
short sSprite_vy2; // \r
-unsigned long ulOLDCOL=0; // active color\r
-unsigned long ulClutID; // clut\r
+unsigned int ulOLDCOL=0; // active color\r
+unsigned int ulClutID; // clut\r
\r
-unsigned long dwCfgFixes; // game fixes\r
-unsigned long dwActFixes=0;\r
-unsigned long dwEmuFixes=0;\r
+unsigned int dwCfgFixes; // game fixes\r
+unsigned int dwActFixes=0;\r
+unsigned int dwEmuFixes=0;\r
BOOL bUseFixes;\r
\r
-long drawX,drawY,drawW,drawH; // offscreen drawing checkers\r
+int drawX,drawY,drawW,drawH; // offscreen drawing checkers\r
short sxmin,sxmax,symin,symax;\r
unsigned int CSVERTEX=0,CSCOLOR=0,CSTEXTURE=0;\r
\r
////////////////////////////////////////////////////////////////////////\r
\r
\r
-unsigned long DoubleBGR2RGB (unsigned long BGR)\r
+unsigned int DoubleBGR2RGB (unsigned int BGR)\r
{\r
- unsigned long ebx,eax,edx;\r
+ unsigned int ebx,eax,edx;\r
\r
ebx=(BGR&0x000000ff)<<1;\r
if(ebx&0x00000100) ebx=0x000000ff;\r
return (ebx|eax|edx);\r
}\r
\r
-unsigned short BGR24to16 (unsigned long BGR)\r
+unsigned short BGR24to16 (unsigned int BGR)\r
{\r
return ((BGR>>3)&0x1f)|((BGR&0xf80000)>>9)|((BGR&0xf800)>>6);\r
}\r
\r
////////////////////////////////////////////////////////////////////////\r
\r
- void SetRenderState(unsigned long DrawAttributes)\r
+ void SetRenderState(unsigned int DrawAttributes)\r
{\r
bDrawNonShaded = (SHADETEXBIT(DrawAttributes)) ? TRUE : FALSE;\r
DrawSemiTrans = (SEMITRANSBIT(DrawAttributes)) ? TRUE : FALSE;\r
\r
//////////////////////////////////////////////////////////////////////// \r
\r
- void SetRenderColor(unsigned long DrawAttributes)\r
+ void SetRenderColor(unsigned int DrawAttributes)\r
{\r
if(bDrawNonShaded) {g_m1=g_m2=g_m3=128;}\r
else\r
\r
//////////////////////////////////////////////////////////////////////// \r
\r
-void SetRenderMode(unsigned long DrawAttributes,BOOL bSCol)\r
+void SetRenderMode(unsigned int DrawAttributes,BOOL bSCol)\r
{\r
if((bUseMultiPass) && (bDrawTextured) && !(bDrawNonShaded))\r
{bDrawMultiPass = TRUE; SetSemiTransMulti(0);}\r
// Set Opaque multipass color\r
////////////////////////////////////////////////////////////////////////\r
\r
-void SetOpaqueColor(unsigned long DrawAttributes)\r
+void SetOpaqueColor(unsigned int DrawAttributes)\r
{\r
if(bDrawNonShaded) return; // no shading? bye\r
\r
\r
////////////////////////////////////////////////////////////////////////\r
\r
-void PrepareFullScreenUpload (long Position)\r
+void PrepareFullScreenUpload (int Position)\r
{\r
if (Position==-1) // rgb24\r
{\r
\r
unsigned char * LoadDirectMovieFast(void);\r
\r
-void UploadScreenEx(long Position)\r
+void UploadScreenEx(int Position)\r
{\r
short ya,yb,xa,xb,x, y, YStep, XStep, U, UStep,ux[4],vy[4];\r
\r
\r
////////////////////////////////////////////////////////////////////////\r
\r
-void UploadScreen(long Position)\r
+void UploadScreen(int Position)\r
{\r
short x, y, YStep, XStep, U, s, UStep,ux[4],vy[4];\r
short xa,xb,ya,yb;\r
gl_vy[2] = gl_vy[3] = s;\r
gl_ux[0] = gl_ux[3] = gl_vy[0] = gl_vy[1] = 0;\r
\r
- SetRenderState((unsigned long)0x01000000);\r
- SetRenderMode((unsigned long)0x01000000, FALSE); // upload texture data\r
+ SetRenderState((unsigned int)0x01000000);\r
+ SetRenderMode((unsigned int)0x01000000, FALSE); // upload texture data\r
offsetScreenUpload(Position);\r
assignTextureVRAMWrite();\r
\r
\r
void cmdSTP(unsigned char * baseAddr)\r
{\r
- unsigned long gdata = ((unsigned long*)baseAddr)[0];\r
+ unsigned int gdata = ((unsigned int*)baseAddr)[0];\r
\r
STATUSREG&=~0x1800; // clear the necessary bits\r
STATUSREG|=((gdata & 0x03) << 11); // set the current bits\r
\r
void cmdTexturePage(unsigned char * baseAddr)\r
{\r
- unsigned long gdata = ((unsigned long*)baseAddr)[0];\r
+ unsigned int gdata = ((unsigned int*)baseAddr)[0];\r
UpdateGlobalTP((unsigned short)gdata);\r
GlobalTextREST = (gdata&0x00ffffff)>>9;\r
}\r
\r
void cmdTextureWindow(unsigned char *baseAddr)\r
{\r
- unsigned long gdata = ((unsigned long*)baseAddr)[0];\r
+ unsigned int gdata = ((unsigned int*)baseAddr)[0];\r
\r
- unsigned long YAlign,XAlign;\r
+ unsigned int YAlign,XAlign;\r
\r
ulGPUInfoVals[INFO_TW]=gdata&0xFFFFF;\r
\r
\r
// Re-calculate the bit field, because we can't trust what is passed in the data\r
\r
- YAlign = (unsigned long)(32 - (TWin.Position.y1 >> 3));\r
- XAlign = (unsigned long)(32 - (TWin.Position.x1 >> 3));\r
+ YAlign = (unsigned int)(32 - (TWin.Position.y1 >> 3));\r
+ XAlign = (unsigned int)(32 - (TWin.Position.x1 >> 3));\r
\r
// Absolute position of the start of the texture window\r
\r
\r
void cmdDrawAreaStart(unsigned char * baseAddr)\r
{\r
- unsigned long gdata = ((unsigned long*)baseAddr)[0];\r
+ unsigned int gdata = ((unsigned int*)baseAddr)[0];\r
\r
drawX = gdata & 0x3ff; // for soft drawing\r
if(drawX>=1024) drawX=1023;\r
\r
void cmdDrawAreaEnd(unsigned char * baseAddr)\r
{\r
- unsigned long gdata = ((unsigned long*)baseAddr)[0];\r
+ unsigned int gdata = ((unsigned int*)baseAddr)[0];\r
\r
drawW = gdata & 0x3ff; // for soft drawing\r
if(drawW>=1024) drawW=1023;\r
\r
void cmdDrawOffset(unsigned char * baseAddr)\r
{\r
- unsigned long gdata = ((unsigned long*)baseAddr)[0];\r
+ unsigned int gdata = ((unsigned int*)baseAddr)[0];\r
\r
PreviousPSXDisplay.DrawOffset.x = \r
PSXDisplay.DrawOffset.x = (short)(gdata & 0x7ff);\r
\r
void primBlkFill(unsigned char * baseAddr)\r
{\r
- unsigned long *gpuData = ((unsigned long *) baseAddr);\r
+ unsigned int *gpuData = ((unsigned int *) baseAddr);\r
short *sgpuData = ((short *) baseAddr);\r
\r
iDrawnSomething=1;\r
{\r
bDrawTextured = FALSE;\r
bDrawSmoothShaded = FALSE;\r
- SetRenderState((unsigned long)0x01000000);\r
- SetRenderMode((unsigned long)0x01000000, FALSE);\r
+ SetRenderState((unsigned int)0x01000000);\r
+ SetRenderMode((unsigned int)0x01000000, FALSE);\r
vertex[0].c.lcol=0xff000000;\r
SETCOL(vertex[0]); \r
if(ly0>pd->DisplayPosition.y)\r
{\r
bDrawTextured = FALSE;\r
bDrawSmoothShaded = FALSE;\r
- SetRenderState((unsigned long)0x01000000);\r
- SetRenderMode((unsigned long)0x01000000, FALSE);\r
+ SetRenderState((unsigned int)0x01000000);\r
+ SetRenderMode((unsigned int)0x01000000, FALSE);\r
vertex[0].c.lcol=gpuData[0]|0xff000000;\r
SETCOL(vertex[0]); \r
//glDisable(GL_SCISSOR_TEST); glError();\r
}\r
else\r
{\r
- unsigned long *SRCPtr, *DSTPtr;\r
+ unsigned int *SRCPtr, *DSTPtr;\r
unsigned short LineOffset;\r
int dx=imageSX>>1;\r
\r
- SRCPtr = (unsigned long *)(psxVuw + (1024*imageY0) + imageX0);\r
- DSTPtr = (unsigned long *)(psxVuw + (1024*imageY1) + imageX1);\r
+ SRCPtr = (unsigned int *)(psxVuw + (1024*imageY0) + imageX0);\r
+ DSTPtr = (unsigned int *)(psxVuw + (1024*imageY1) + imageX1);\r
\r
LineOffset = 512 - dx;\r
\r
\r
void primTileS(unsigned char * baseAddr)\r
{\r
- unsigned long *gpuData = ((unsigned long*)baseAddr);\r
+ unsigned int *gpuData = ((unsigned int*)baseAddr);\r
short *sgpuData = ((short *) baseAddr);\r
\r
sprtX = sgpuData[2];\r
\r
void primTile1(unsigned char * baseAddr)\r
{\r
- unsigned long *gpuData = ((unsigned long*)baseAddr);\r
+ unsigned int *gpuData = ((unsigned int*)baseAddr);\r
short *sgpuData = ((short *) baseAddr);\r
\r
sprtX = sgpuData[2];\r
\r
void primTile8(unsigned char * baseAddr)\r
{\r
- unsigned long *gpuData = ((unsigned long*)baseAddr);\r
+ unsigned int *gpuData = ((unsigned int*)baseAddr);\r
short *sgpuData = ((short *) baseAddr);\r
\r
sprtX = sgpuData[2];\r
\r
void primTile16(unsigned char * baseAddr)\r
{\r
- unsigned long *gpuData = ((unsigned long*)baseAddr);\r
+ unsigned int *gpuData = ((unsigned int*)baseAddr);\r
short *sgpuData = ((short *) baseAddr);\r
\r
sprtX = sgpuData[2];\r
\r
/*void DrawMultiBlur(void)\r
{\r
- long lABR,lDST;float fx,fy;\r
+ int lABR,lDST;float fx,fy;\r
\r
lABR=GlobalTextABR;\r
lDST=DrawSemiTrans;\r
\r
void DrawMultiFilterSprite(void)\r
{\r
- long lABR,lDST;\r
+ int lABR,lDST;\r
\r
if(bUseMultiPass || DrawSemiTrans || ubOpaqueDraw) \r
{\r
\r
void primSprt8(unsigned char * baseAddr)\r
{\r
- unsigned long *gpuData = ((unsigned long *) baseAddr);\r
+ unsigned int *gpuData = ((unsigned int *) baseAddr);\r
short *sgpuData = ((short *) baseAddr);\r
short s;\r
\r
\r
void primSprt16(unsigned char * baseAddr)\r
{\r
- unsigned long *gpuData = ((unsigned long *) baseAddr);\r
+ unsigned int *gpuData = ((unsigned int *) baseAddr);\r
short *sgpuData = ((short *) baseAddr);\r
short s;\r
\r
\r
void primSprtSRest(unsigned char * baseAddr,unsigned short type)\r
{\r
- unsigned long *gpuData = ((unsigned long *) baseAddr);\r
+ unsigned int *gpuData = ((unsigned int *) baseAddr);\r
short *sgpuData = ((short *) baseAddr);\r
short s;unsigned short sTypeRest=0;\r
\r
\r
void primSprtS(unsigned char * baseAddr)\r
{\r
- unsigned long *gpuData = ((unsigned long *) baseAddr);\r
+ unsigned int *gpuData = ((unsigned int *) baseAddr);\r
short *sgpuData = ((short *) baseAddr);\r
\r
short s;unsigned short sTypeRest=0;\r
\r
void primPolyF4(unsigned char *baseAddr)\r
{\r
- unsigned long *gpuData = ((unsigned long *) baseAddr);\r
+ unsigned int *gpuData = ((unsigned int *) baseAddr);\r
short *sgpuData = ((short *) baseAddr);\r
\r
lx0 = sgpuData[2];\r
\r
if(iFF9Fix==2)\r
{\r
- long labr=GlobalTextABR;\r
+ int labr=GlobalTextABR;\r
GlobalTextABR=1;\r
primPolyG4(pFF9G4Cache);\r
GlobalTextABR=labr;\r
\r
void primPolyG4(unsigned char * baseAddr)\r
{\r
- unsigned long *gpuData = (unsigned long *)baseAddr;\r
+ unsigned int *gpuData = (unsigned int *)baseAddr;\r
short *sgpuData = ((short *) baseAddr);\r
\r
lx0 = sgpuData[2];\r
// cmd: flat shaded Texture3\r
////////////////////////////////////////////////////////////////////////\r
\r
-BOOL DoLineCheck(unsigned long * gpuData)\r
+BOOL DoLineCheck(unsigned int * gpuData)\r
{\r
BOOL bQuad=FALSE;short dx,dy;\r
\r
\r
void primPolyFT3(unsigned char * baseAddr)\r
{\r
- unsigned long *gpuData = ((unsigned long *) baseAddr);\r
+ unsigned int *gpuData = ((unsigned int *) baseAddr);\r
short *sgpuData = ((short *) baseAddr);\r
\r
lx0 = sgpuData[2];\r
\r
void primPolyFT4(unsigned char * baseAddr)\r
{\r
- unsigned long *gpuData = ((unsigned long *) baseAddr);\r
+ unsigned int *gpuData = ((unsigned int *) baseAddr);\r
short *sgpuData = ((short *) baseAddr);\r
\r
lx0 = sgpuData[2];\r
\r
void primPolyGT3(unsigned char *baseAddr)\r
{ \r
- unsigned long *gpuData = ((unsigned long *) baseAddr);\r
+ unsigned int *gpuData = ((unsigned int *) baseAddr);\r
short *sgpuData = ((short *) baseAddr);\r
\r
lx0 = sgpuData[2];\r
\r
void primPolyG3(unsigned char *baseAddr)\r
{ \r
- unsigned long *gpuData = ((unsigned long *) baseAddr);\r
+ unsigned int *gpuData = ((unsigned int *) baseAddr);\r
short *sgpuData = ((short *) baseAddr);\r
\r
lx0 = sgpuData[2];\r
\r
void primPolyGT4(unsigned char *baseAddr)\r
{ \r
- unsigned long *gpuData = ((unsigned long *) baseAddr);\r
+ unsigned int *gpuData = ((unsigned int *) baseAddr);\r
short *sgpuData = ((short *) baseAddr);\r
\r
lx0 = sgpuData[2];\r
\r
void primPolyF3(unsigned char *baseAddr)\r
{ \r
- unsigned long *gpuData = ((unsigned long *) baseAddr);\r
+ unsigned int *gpuData = ((unsigned int *) baseAddr);\r
short *sgpuData = ((short *) baseAddr);\r
\r
lx0 = sgpuData[2];\r
\r
void primLineGSkip(unsigned char *baseAddr)\r
{ \r
- unsigned long *gpuData = ((unsigned long *) baseAddr);\r
+ unsigned int *gpuData = ((unsigned int *) baseAddr);\r
short *sgpuData = ((short *) baseAddr);\r
int iMax=255;\r
int i=2;\r
\r
void primLineGEx(unsigned char *baseAddr)\r
{ \r
- unsigned long *gpuData = ((unsigned long *) baseAddr);\r
+ unsigned int *gpuData = ((unsigned int *) baseAddr);\r
int iMax=255;\r
short cx0,cx1,cy0,cy1;int i;BOOL bDraw=TRUE;\r
\r
\r
void primLineG2(unsigned char *baseAddr)\r
{ \r
- unsigned long *gpuData = ((unsigned long *) baseAddr);\r
+ unsigned int *gpuData = ((unsigned int *) baseAddr);\r
short *sgpuData = ((short *) baseAddr);\r
\r
lx0 = sgpuData[2];\r
\r
void primLineFSkip(unsigned char *baseAddr)\r
{\r
- unsigned long *gpuData = ((unsigned long *) baseAddr);\r
+ unsigned int *gpuData = ((unsigned int *) baseAddr);\r
int i=2,iMax=255;\r
\r
ly1 = (short)((gpuData[1]>>16) & 0xffff);\r
\r
void primLineFEx(unsigned char *baseAddr)\r
{\r
- unsigned long *gpuData = ((unsigned long *) baseAddr);\r
+ unsigned int *gpuData = ((unsigned int *) baseAddr);\r
int iMax;\r
short cx0,cx1,cy0,cy1;int i;\r
\r
\r
void primLineF2(unsigned char *baseAddr)\r
{\r
- unsigned long *gpuData = ((unsigned long *) baseAddr);\r
+ unsigned int *gpuData = ((unsigned int *) baseAddr);\r
short *sgpuData = ((short *) baseAddr);\r
\r
lx0 = sgpuData[2];\r
GLuint gTexBlurName=0;\r
GLuint gTexFrameName=0;\r
int iTexGarbageCollection=1;\r
-unsigned long dwTexPageComp=0;\r
+unsigned int dwTexPageComp=0;\r
int iVRamSize=0;\r
int iClampType=GL_CLAMP_TO_EDGE;\r
int iFilter = GL_LINEAR;\r
void (*LoadSubTexFn) (int,int,short,short);\r
-unsigned long (*PalTexturedColourFn) (unsigned long);\r
+unsigned int (*PalTexturedColourFn) (unsigned int);\r
\r
////////////////////////////////////////////////////////////////////////\r
// defines\r
\r
////////////////////////////////////////////////////////////////////////\r
\r
-unsigned char * CheckTextureInSubSCache(long TextureMode,unsigned long GivenClutId,unsigned short * pCache);\r
+unsigned char * CheckTextureInSubSCache(int TextureMode,unsigned int GivenClutId,unsigned short * pCache);\r
void LoadSubTexturePageSort(int pageid, int mode, short cx, short cy);\r
void LoadPackedSubTexturePageSort(int pageid, int mode, short cx, short cy);\r
void DefineSubTextureSort(void);\r
// some globals\r
////////////////////////////////////////////////////////////////////////\r
\r
-long GlobalTexturePage;\r
+int GlobalTexturePage;\r
GLint XTexS;\r
GLint YTexS;\r
GLint DXTexS;\r
int iFrameTexType=0;\r
int iFrameReadType=0;\r
\r
-unsigned long (*TCF[2]) (unsigned long);\r
+unsigned int (*TCF[2]) (unsigned int);\r
unsigned short (*PTCF[2]) (unsigned short);\r
\r
////////////////////////////////////////////////////////////////////////\r
\r
typedef struct textureWndCacheEntryTag\r
{\r
- unsigned long ClutID;\r
+ unsigned int ClutID;\r
short pageid;\r
short textureMode;\r
short Opaque;\r
\r
typedef struct textureSubCacheEntryTagS \r
{\r
- unsigned long ClutID;\r
+ unsigned int ClutID;\r
EXLong pos;\r
unsigned char posTX;\r
unsigned char posTY;\r
\r
GLubyte * texturepart=NULL;\r
GLubyte * texturebuffer=NULL;\r
-unsigned long g_x1,g_y1,g_x2,g_y2;\r
+unsigned int g_x1,g_y1,g_x2,g_y2;\r
unsigned char ubOpaqueDraw=0;\r
\r
unsigned short MAXTPAGES = 32;\r
// porting... and honestly: nowadays the speed gain would be pointless \r
////////////////////////////////////////////////////////////////////////\r
\r
-unsigned long XP8RGBA(unsigned long BGR)\r
+unsigned int XP8RGBA(unsigned int BGR)\r
{\r
if(!(BGR&0xffff)) return 0x50000000;\r
if(DrawSemiTrans && !(BGR&0x8000)) \r
return ((((BGR<<3)&0xf8)|((BGR<<6)&0xf800)|((BGR<<9)&0xf80000))&0xffffff)|0xff000000;\r
}\r
\r
-unsigned long XP8RGBAEx(unsigned long BGR)\r
+unsigned int XP8RGBAEx(unsigned int BGR)\r
{\r
if(!(BGR&0xffff)) return 0x03000000;\r
if(DrawSemiTrans && !(BGR&0x8000)) \r
return ((((BGR<<3)&0xf8)|((BGR<<6)&0xf800)|((BGR<<9)&0xf80000))&0xffffff)|0xff000000;\r
}\r
\r
-unsigned long CP8RGBA(unsigned long BGR)\r
+unsigned int CP8RGBA(unsigned int BGR)\r
{\r
- unsigned long l;\r
+ unsigned int l;\r
if(!(BGR&0xffff)) return 0x50000000;\r
if(DrawSemiTrans && !(BGR&0x8000)) \r
{ubOpaqueDraw=1;return ((((BGR<<3)&0xf8)|((BGR<<6)&0xf800)|((BGR<<9)&0xf80000))&0xffffff);}\r
return l;\r
}\r
\r
-unsigned long CP8RGBAEx(unsigned long BGR)\r
+unsigned int CP8RGBAEx(unsigned int BGR)\r
{\r
- unsigned long l;\r
+ unsigned int l;\r
if(!(BGR&0xffff)) return 0x03000000;\r
if(DrawSemiTrans && !(BGR&0x8000)) \r
{ubOpaqueDraw=1;return ((((BGR<<3)&0xf8)|((BGR<<6)&0xf800)|((BGR<<9)&0xf80000))&0xffffff);}\r
return l;\r
}\r
\r
-unsigned long XP8RGBA_0(unsigned long BGR)\r
+unsigned int XP8RGBA_0(unsigned int BGR)\r
{\r
if(!(BGR&0xffff)) return 0x50000000;\r
return ((((BGR<<3)&0xf8)|((BGR<<6)&0xf800)|((BGR<<9)&0xf80000))&0xffffff)|0xff000000;\r
}\r
\r
-unsigned long XP8RGBAEx_0(unsigned long BGR)\r
+unsigned int XP8RGBAEx_0(unsigned int BGR)\r
{\r
if(!(BGR&0xffff)) return 0x03000000;\r
return ((((BGR<<3)&0xf8)|((BGR<<6)&0xf800)|((BGR<<9)&0xf80000))&0xffffff)|0xff000000;\r
}\r
\r
-unsigned long XP8BGRA_0(unsigned long BGR)\r
+unsigned int XP8BGRA_0(unsigned int BGR)\r
{\r
if(!(BGR&0xffff)) return 0x50000000;\r
return ((((BGR>>7)&0xf8)|((BGR<<6)&0xf800)|((BGR<<19)&0xf80000))&0xffffff)|0xff000000;\r
}\r
\r
-unsigned long XP8BGRAEx_0(unsigned long BGR)\r
+unsigned int XP8BGRAEx_0(unsigned int BGR)\r
{\r
if(!(BGR&0xffff)) return 0x03000000;\r
return ((((BGR>>7)&0xf8)|((BGR<<6)&0xf800)|((BGR<<19)&0xf80000))&0xffffff)|0xff000000;\r
}\r
\r
-unsigned long CP8RGBA_0(unsigned long BGR)\r
+unsigned int CP8RGBA_0(unsigned int BGR)\r
{\r
- unsigned long l;\r
+ unsigned int l;\r
\r
if(!(BGR&0xffff)) return 0x50000000;\r
l=((((BGR<<3)&0xf8)|((BGR<<6)&0xf800)|((BGR<<9)&0xf80000))&0xffffff)|0xff000000;\r
return l;\r
}\r
\r
-unsigned long CP8RGBAEx_0(unsigned long BGR)\r
+unsigned int CP8RGBAEx_0(unsigned int BGR)\r
{\r
- unsigned long l;\r
+ unsigned int l;\r
\r
if(!(BGR&0xffff)) return 0x03000000;\r
l=((((BGR<<3)&0xf8)|((BGR<<6)&0xf800)|((BGR<<9)&0xf80000))&0xffffff)|0xff000000;\r
return l;\r
}\r
\r
-unsigned long CP8BGRA_0(unsigned long BGR)\r
+unsigned int CP8BGRA_0(unsigned int BGR)\r
{\r
- unsigned long l;\r
+ unsigned int l;\r
\r
if(!(BGR&0xffff)) return 0x50000000;\r
l=((((BGR>>7)&0xf8)|((BGR<<6)&0xf800)|((BGR<<19)&0xf80000))&0xffffff)|0xff000000;\r
return l;\r
}\r
\r
-unsigned long CP8BGRAEx_0(unsigned long BGR)\r
+unsigned int CP8BGRAEx_0(unsigned int BGR)\r
{\r
- unsigned long l;\r
+ unsigned int l;\r
\r
if(!(BGR&0xffff)) return 0x03000000;\r
l=((((BGR>>7)&0xf8)|((BGR<<6)&0xf800)|((BGR<<19)&0xf80000))&0xffffff)|0xff000000;\r
return l;\r
}\r
\r
-unsigned long XP8RGBA_1(unsigned long BGR)\r
+unsigned int XP8RGBA_1(unsigned int BGR)\r
{\r
if(!(BGR&0xffff)) return 0x50000000;\r
if(!(BGR&0x8000)) {ubOpaqueDraw=1;return ((((BGR<<3)&0xf8)|((BGR<<6)&0xf800)|((BGR<<9)&0xf80000))&0xffffff);}\r
return ((((BGR<<3)&0xf8)|((BGR<<6)&0xf800)|((BGR<<9)&0xf80000))&0xffffff)|0xff000000;\r
}\r
\r
-unsigned long XP8RGBAEx_1(unsigned long BGR)\r
+unsigned int XP8RGBAEx_1(unsigned int BGR)\r
{\r
if(!(BGR&0xffff)) return 0x03000000;\r
if(!(BGR&0x8000)) {ubOpaqueDraw=1;return ((((BGR<<3)&0xf8)|((BGR<<6)&0xf800)|((BGR<<9)&0xf80000))&0xffffff);}\r
return ((((BGR<<3)&0xf8)|((BGR<<6)&0xf800)|((BGR<<9)&0xf80000))&0xffffff)|0xff000000;\r
}\r
\r
-unsigned long XP8BGRA_1(unsigned long BGR)\r
+unsigned int XP8BGRA_1(unsigned int BGR)\r
{\r
if(!(BGR&0xffff)) return 0x50000000;\r
if(!(BGR&0x8000)) {ubOpaqueDraw=1;return ((((BGR>>7)&0xf8)|((BGR<<6)&0xf800)|((BGR<<19)&0xf80000))&0xffffff);}\r
return ((((BGR>>7)&0xf8)|((BGR<<6)&0xf800)|((BGR<<19)&0xf80000))&0xffffff)|0xff000000;\r
}\r
\r
-unsigned long XP8BGRAEx_1(unsigned long BGR)\r
+unsigned int XP8BGRAEx_1(unsigned int BGR)\r
{\r
if(!(BGR&0xffff)) return 0x03000000;\r
if(!(BGR&0x8000)) {ubOpaqueDraw=1;return ((((BGR>>7)&0xf8)|((BGR<<6)&0xf800)|((BGR<<19)&0xf80000))&0xffffff);}\r
return ((((BGR>>7)&0xf8)|((BGR<<6)&0xf800)|((BGR<<19)&0xf80000))&0xffffff)|0xff000000;\r
}\r
\r
-unsigned long P8RGBA(unsigned long BGR)\r
+unsigned int P8RGBA(unsigned int BGR)\r
{\r
if(!(BGR&0xffff)) return 0;\r
return ((((BGR<<3)&0xf8)|((BGR<<6)&0xf800)|((BGR<<9)&0xf80000))&0xffffff)|0xff000000;\r
}\r
\r
-unsigned long P8BGRA(unsigned long BGR)\r
+unsigned int P8BGRA(unsigned int BGR)\r
{\r
if(!(BGR&0xffff)) return 0;\r
return ((((BGR>>7)&0xf8)|((BGR<<6)&0xf800)|((BGR<<19)&0xf80000))&0xffffff)|0xff000000;\r
// Invalidate tex windows\r
////////////////////////////////////////////////////////////////////////\r
\r
-void InvalidateWndTextureArea(long X,long Y,long W, long H)\r
+void InvalidateWndTextureArea(int X,int Y,int W, int H)\r
{\r
int i,px1,px2,py1,py2,iYM=1;\r
textureWndCacheEntry * tsw=wcWndtexStore;\r
}\r
}\r
\r
-void InvalidateSubSTextureArea(long X,long Y,long W, long H)\r
+void InvalidateSubSTextureArea(int X,int Y,int W, int H)\r
{\r
int i,j,k,iMax,px,py,px1,px2,py1,py2,iYM=1;\r
EXLong npos;textureSubCacheEntryS * tsb;\r
- long x1,x2,y1,y2,xa,sw;\r
+ int x1,x2,y1,y2,xa,sw;\r
\r
W+=X-1; \r
H+=Y-1;\r
\r
////////////////////////////////////////////////////////////////////////\r
\r
-void InvalidateTextureArea(long X,long Y,long W, long H)\r
+void InvalidateTextureArea(int X,int Y,int W, int H)\r
{\r
if(W==0 && H==0) return;\r
\r
\r
void LoadStretchPackedWndTexturePage(int pageid, int mode, short cx, short cy)\r
{\r
- unsigned long start,row,column,j,sxh,sxm,ldx,ldy,ldxo;\r
+ unsigned int start,row,column,j,sxh,sxm,ldx,ldy,ldxo;\r
unsigned int palstart;\r
unsigned short *px,*pa,*ta;\r
unsigned char *cSRCPtr,*cOSRCPtr;\r
unsigned short *wSRCPtr,*wOSRCPtr;\r
- unsigned long LineOffset;unsigned short s;\r
+ unsigned int LineOffset;unsigned short s;\r
int pmult=pageid/16;\r
unsigned short (*LPTCOL)(unsigned short);\r
\r
\r
void LoadStretchWndTexturePage(int pageid, int mode, short cx, short cy)\r
{\r
- unsigned long start,row,column,j,sxh,sxm,ldx,ldy,ldxo,s;\r
+ unsigned int start,row,column,j,sxh,sxm,ldx,ldy,ldxo,s;\r
unsigned int palstart;\r
- unsigned long *px,*pa,*ta;\r
+ unsigned int *px,*pa,*ta;\r
unsigned char *cSRCPtr,*cOSRCPtr;\r
unsigned short *wSRCPtr,*wOSRCPtr;\r
- unsigned long LineOffset;\r
+ unsigned int LineOffset;\r
int pmult=pageid/16;\r
- unsigned long (*LTCOL)(unsigned long);\r
+ unsigned int (*LTCOL)(unsigned int);\r
\r
LTCOL=TCF[DrawSemiTrans];\r
\r
ldxo=TWin.Position.x1-TWin.OPosition.x1;\r
ldy =TWin.Position.y1-TWin.OPosition.y1;\r
\r
- pa=px=(unsigned long *)ubPaletteBuffer;\r
- ta=(unsigned long *)texturepart;\r
+ pa=px=(unsigned int *)ubPaletteBuffer;\r
+ ta=(unsigned int *)texturepart;\r
palstart=cx+(cy*1024);\r
\r
ubOpaqueDraw=0;\r
\r
void LoadPackedWndTexturePage(int pageid, int mode, short cx, short cy)\r
{\r
- unsigned long start,row,column,j,sxh,sxm;\r
+ unsigned int start,row,column,j,sxh,sxm;\r
unsigned int palstart;\r
unsigned short *px,*pa,*ta;\r
unsigned char *cSRCPtr;\r
unsigned short *wSRCPtr;\r
- unsigned long LineOffset;\r
+ unsigned int LineOffset;\r
int pmult=pageid/16;\r
unsigned short (*LPTCOL)(unsigned short);\r
\r
\r
void LoadWndTexturePage(int pageid, int mode, short cx, short cy)\r
{\r
- unsigned long start,row,column,j,sxh,sxm;\r
+ unsigned int start,row,column,j,sxh,sxm;\r
unsigned int palstart;\r
- unsigned long *px,*pa,*ta;\r
+ unsigned int *px,*pa,*ta;\r
unsigned char *cSRCPtr;\r
unsigned short *wSRCPtr;\r
- unsigned long LineOffset;\r
+ unsigned int LineOffset;\r
int pmult=pageid/16;\r
- unsigned long (*LTCOL)(unsigned long);\r
+ unsigned int (*LTCOL)(unsigned int);\r
\r
LTCOL=TCF[DrawSemiTrans];\r
\r
- pa=px=(unsigned long *)ubPaletteBuffer;\r
- ta=(unsigned long *)texturepart;\r
+ pa=px=(unsigned int *)ubPaletteBuffer;\r
+ ta=(unsigned int *)texturepart;\r
palstart=cx+(cy*1024);\r
\r
ubOpaqueDraw=0;\r
{\r
unsigned int i,iSize;\r
unsigned short * wSrcPtr;\r
- unsigned long * ta=(unsigned long *)texturepart;\r
+ unsigned int * ta=(unsigned int *)texturepart;\r
\r
wSrcPtr=psxVuw+cx+(cy*1024);\r
if(mode==0) i=4; else i=64;\r
\r
void LoadPalWndTexturePage(int pageid, int mode, short cx, short cy)\r
{\r
- unsigned long start,row,column,j,sxh,sxm;\r
+ unsigned int start,row,column,j,sxh,sxm;\r
unsigned char *ta;\r
unsigned char *cSRCPtr;\r
- unsigned long LineOffset;\r
+ unsigned int LineOffset;\r
int pmult=pageid/16;\r
\r
ta=(unsigned char *)texturepart;\r
\r
void LoadStretchPalWndTexturePage(int pageid, int mode, short cx, short cy)\r
{\r
- unsigned long start,row,column,j,sxh,sxm,ldx,ldy,ldxo;\r
+ unsigned int start,row,column,j,sxh,sxm,ldx,ldy,ldxo;\r
unsigned char *ta,s;\r
unsigned char *cSRCPtr,*cOSRCPtr;\r
- unsigned long LineOffset;\r
+ unsigned int LineOffset;\r
int pmult=pageid/16;\r
\r
ldxo=TWin.Position.x1-TWin.OPosition.x1;\r
// tex window: main selecting, cache handler included\r
////////////////////////////////////////////////////////////////////////\r
\r
-GLuint LoadTextureWnd(long pageid,long TextureMode,unsigned long GivenClutId)\r
+GLuint LoadTextureWnd(int pageid,int TextureMode,unsigned int GivenClutId)\r
{\r
textureWndCacheEntry * ts, * tsx=NULL;\r
int i;short cx,cy;\r
\r
// palette check sum\r
{\r
- unsigned long l=0,row;\r
- unsigned long * lSRCPtr=(unsigned long *)(psxVuw+cx+(cy*1024));\r
+ unsigned int l=0,row;\r
+ unsigned int * lSRCPtr=(unsigned int *)(psxVuw+cx+(cy*1024));\r
if(TextureMode==1) for(row=1;row<129;row++) l+=((*lSRCPtr++)-1)*row;\r
else for(row=1;row<9;row++) l+=((*lSRCPtr++)-1)<<row;\r
l=(l+HIWORD(l))&0x3fffL;\r
\r
unsigned char * LoadDirectMovieFast(void)\r
{\r
- long row,column;\r
+ int row,column;\r
unsigned int startxy;\r
\r
- unsigned long * ta=(unsigned long *)texturepart;\r
+ unsigned int * ta=(unsigned int *)texturepart;\r
\r
if(PSXDisplay.RGB24)\r
{\r
pD=(unsigned char *)&psxVuw[startxy];\r
for(row=xrMovieArea.x0;row<xrMovieArea.x1;row++)\r
{\r
- *ta++=*((unsigned long *)pD)|0xff000000;\r
+ *ta++=*((unsigned int *)pD)|0xff000000;\r
pD+=3;\r
}\r
}\r
}\r
else\r
{\r
- unsigned long (*LTCOL)(unsigned long);\r
+ unsigned int (*LTCOL)(unsigned int);\r
\r
LTCOL=XP8RGBA_0;//TCF[0];\r
\r
\r
GLuint LoadTextureMovieFast(void)\r
{\r
- long row,column;\r
+ int row,column;\r
unsigned int start,startxy;\r
\r
{\r
if(PSXDisplay.RGB24)\r
{\r
unsigned char * pD;\r
- unsigned long * ta=(unsigned long *)texturepart;\r
+ unsigned int * ta=(unsigned int *)texturepart;\r
\r
startxy=((1024)*xrMovieArea.y0)+xrMovieArea.x0;\r
\r
pD=(unsigned char *)&psxVuw[startxy];\r
for(row=xrMovieArea.x0;row<xrMovieArea.x1;row++)\r
{\r
- *ta++=*((unsigned long *)pD)|0xff000000;\r
+ *ta++=*((unsigned int *)pD)|0xff000000;\r
pD+=3;\r
}\r
}\r
}\r
else\r
{\r
- unsigned long (*LTCOL)(unsigned long);\r
- unsigned long *ta;\r
+ unsigned int (*LTCOL)(unsigned int);\r
+ unsigned int *ta;\r
\r
LTCOL=XP8RGBA_0;//TCF[0];\r
\r
ubOpaqueDraw=0;\r
- ta=(unsigned long *)texturepart;\r
+ ta=(unsigned int *)texturepart;\r
\r
for(column=xrMovieArea.y0;column<xrMovieArea.y1;column++)\r
{\r
if(PSXDisplay.RGB24)\r
{\r
unsigned char * pD;\r
- unsigned long * ta=(unsigned long *)texturepart;\r
+ unsigned int * ta=(unsigned int *)texturepart;\r
\r
if(b_X)\r
{\r
pD=(unsigned char *)&psxVuw[startxy];\r
for(row=xrMovieArea.x0;row<xrMovieArea.x1;row++)\r
{\r
- *ta++=*((unsigned long *)pD)|0xff000000;\r
+ *ta++=*((unsigned int *)pD)|0xff000000;\r
pD+=3;\r
}\r
*ta++=*(ta-1);\r
pD=(unsigned char *)&psxVuw[startxy];\r
for(row=xrMovieArea.x0;row<xrMovieArea.x1;row++)\r
{\r
- *ta++=*((unsigned long *)pD)|0xff000000;\r
+ *ta++=*((unsigned int *)pD)|0xff000000;\r
pD+=3;\r
}\r
}\r
}\r
else\r
{\r
- unsigned long (*LTCOL)(unsigned long);\r
- unsigned long *ta;\r
+ unsigned int (*LTCOL)(unsigned int);\r
+ unsigned int *ta;\r
\r
LTCOL=XP8RGBA_0;//TCF[0];\r
\r
ubOpaqueDraw=0;\r
- ta=(unsigned long *)texturepart;\r
+ ta=(unsigned int *)texturepart;\r
\r
if(b_X)\r
{\r
\r
GLuint BlackFake15BitTexture(void)\r
{\r
- long pmult;short x1,x2,y1,y2;\r
+ int pmult;short x1,x2,y1,y2;\r
\r
if(PSXDisplay.InterlacedTest) return 0;\r
\r
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, iFilter); glError();\r
\r
{\r
- unsigned long * ta=(unsigned long *)texturepart;\r
+ unsigned int * ta=(unsigned int *)texturepart;\r
for(y1=0;y1<=4;y1++)\r
for(x1=0;x1<=4;x1++)\r
*ta++=0xff000000;\r
\r
GLuint Fake15BitTexture(void)\r
{\r
- long pmult;short x1,x2,y1,y2;int iYAdjust;\r
+ int pmult;short x1,x2,y1,y2;int iYAdjust;\r
float ScaleX,ScaleY;RECT rSrc;\r
\r
if(iFrameTexType==1) return BlackFake15BitTexture();\r
\r
void LoadSubTexturePageSort(int pageid, int mode, short cx, short cy)\r
{\r
- unsigned long start,row,column,j,sxh,sxm;\r
+ unsigned int start,row,column,j,sxh,sxm;\r
unsigned int palstart;\r
- unsigned long *px,*pa,*ta;\r
+ unsigned int *px,*pa,*ta;\r
unsigned char *cSRCPtr;\r
unsigned short *wSRCPtr;\r
- unsigned long LineOffset;\r
- unsigned long x2a,xalign=0;\r
- unsigned long x1=gl_ux[7];\r
- unsigned long x2=gl_ux[6];\r
- unsigned long y1=gl_ux[5];\r
- unsigned long y2=gl_ux[4];\r
- unsigned long dx=x2-x1+1;\r
- unsigned long dy=y2-y1+1;\r
+ unsigned int LineOffset;\r
+ unsigned int x2a,xalign=0;\r
+ unsigned int x1=gl_ux[7];\r
+ unsigned int x2=gl_ux[6];\r
+ unsigned int y1=gl_ux[5];\r
+ unsigned int y2=gl_ux[4];\r
+ unsigned int dx=x2-x1+1;\r
+ unsigned int dy=y2-y1+1;\r
int pmult=pageid/16;\r
- unsigned long (*LTCOL)(unsigned long);\r
+ unsigned int (*LTCOL)(unsigned int);\r
unsigned int a,r,g,b,cnt,h;\r
- unsigned long scol[8];\r
+ unsigned int scol[8];\r
\r
LTCOL=TCF[DrawSemiTrans];\r
\r
- pa=px=(unsigned long *)ubPaletteBuffer;\r
- ta=(unsigned long *)texturepart;\r
+ pa=px=(unsigned int *)ubPaletteBuffer;\r
+ ta=(unsigned int *)texturepart;\r
palstart=cx+(cy<<10);\r
\r
ubOpaqueDraw=0;\r
\r
if(YTexS)\r
{\r
- ta=(unsigned long *)texturepart;\r
- pa=(unsigned long *)texturepart+x2a;\r
+ ta=(unsigned int *)texturepart;\r
+ pa=(unsigned int *)texturepart+x2a;\r
row=x2a;do {*ta++=*pa++;row--;} while(row); \r
- pa=(unsigned long *)texturepart+dy*x2a;\r
+ pa=(unsigned int *)texturepart+dy*x2a;\r
ta=pa+x2a;\r
row=x2a;do {*ta++=*pa++;row--;} while(row);\r
YTexS--;\r
\r
if(XTexS)\r
{\r
- ta=(unsigned long *)texturepart;\r
+ ta=(unsigned int *)texturepart;\r
pa=ta+1;\r
row=dy;do {*ta=*pa;ta+=x2a;pa+=x2a;row--;} while(row);\r
- pa=(unsigned long *)texturepart+dx;\r
+ pa=(unsigned int *)texturepart+dx;\r
ta=pa+1;\r
row=dy;do {*ta=*pa;ta+=x2a;pa+=x2a;row--;} while(row);\r
XTexS--;\r
if((iFilterType==4 || iFilterType==6) && ly0==ly1 && ly2==ly3 && lx0==lx3 && lx1==lx2)\r
{DefineSubTextureSort();return;}\r
\r
- ta=(unsigned long *)texturepart;\r
+ ta=(unsigned int *)texturepart;\r
x1=dx-1;\r
y1=dy-1;\r
\r
\r
void LoadPackedSubTexturePageSort(int pageid, int mode, short cx, short cy)\r
{\r
- unsigned long start,row,column,j,sxh,sxm;\r
+ unsigned int start,row,column,j,sxh,sxm;\r
unsigned int palstart;\r
unsigned short *px,*pa,*ta;\r
unsigned char *cSRCPtr;\r
unsigned short *wSRCPtr;\r
- unsigned long LineOffset;\r
- unsigned long x2a,xalign=0;\r
- unsigned long x1=gl_ux[7];\r
- unsigned long x2=gl_ux[6];\r
- unsigned long y1=gl_ux[5];\r
- unsigned long y2=gl_ux[4];\r
- unsigned long dx=x2-x1+1;\r
- unsigned long dy=y2-y1+1;\r
+ unsigned int LineOffset;\r
+ unsigned int x2a,xalign=0;\r
+ unsigned int x1=gl_ux[7];\r
+ unsigned int x2=gl_ux[6];\r
+ unsigned int y1=gl_ux[5];\r
+ unsigned int y2=gl_ux[4];\r
+ unsigned int dx=x2-x1+1;\r
+ unsigned int dy=y2-y1+1;\r
int pmult=pageid/16;\r
unsigned short (*LPTCOL)(unsigned short);\r
unsigned int a,r,g,b,cnt,h;\r
/////////////////////////////////////////////////////////////////////////////\r
/////////////////////////////////////////////////////////////////////////////\r
\r
-unsigned char * CheckTextureInSubSCache(long TextureMode,unsigned long GivenClutId,unsigned short * pCache)\r
+unsigned char * CheckTextureInSubSCache(int TextureMode,unsigned int GivenClutId,unsigned short * pCache)\r
{\r
textureSubCacheEntryS * tsx, * tsb, *tsg;//, *tse=NULL;\r
int i,iMax;EXLong npos;\r
unsigned char cx,cy;\r
- int iC,j,k;unsigned long rx,ry,mx,my;\r
+ int iC,j,k;unsigned int rx,ry,mx,my;\r
EXLong * ul=0, * uls;\r
EXLong rfree;\r
unsigned char cXAdj,cYAdj;\r
\r
- npos.l=*((unsigned long *)&gl_ux[4]);\r
+ npos.l=*((unsigned int *)&gl_ux[4]);\r
\r
//--------------------------------------------------------------//\r
// find matching texturepart first... speed up...\r
\r
if(tsx) // 3. if one or more found, create a new rect with bigger size\r
{\r
- *((unsigned long *)&gl_ux[4])=npos.l=rfree.l;\r
+ *((unsigned int *)&gl_ux[4])=npos.l=rfree.l;\r
rx=(int)rfree.c[2]-(int)rfree.c[3];\r
ry=(int)rfree.c[0]-(int)rfree.c[1];\r
DoTexGarbageCollection();\r
\r
BOOL GetCompressTexturePlace(textureSubCacheEntryS * tsx)\r
{\r
- int i,j,k,iMax,iC;unsigned long rx,ry,mx,my;\r
+ int i,j,k,iMax,iC;unsigned int rx,ry,mx,my;\r
EXLong * ul=0, * uls, rfree;\r
unsigned char cXAdj=1,cYAdj=1;\r
\r
textureSubCacheEntryS * tsx, * tsg, * tsb;\r
int i,j,k,m,n,iMax;EXLong * ul, r,opos;\r
short sOldDST=DrawSemiTrans,cx,cy;\r
- long lOGTP=GlobalTexturePage;\r
- unsigned long l,row;\r
- unsigned long * lSRCPtr;\r
+ int lOGTP=GlobalTexturePage;\r
+ unsigned int l,row;\r
+ unsigned int * lSRCPtr;\r
\r
- opos.l=*((unsigned long *)&gl_ux[4]);\r
+ opos.l=*((unsigned int *)&gl_ux[4]);\r
\r
// 1. mark all textures as free\r
for(i=0;i<iSortTexCnt;i++)\r
if(j!=2)\r
{\r
// palette check sum\r
- l=0;lSRCPtr=(unsigned long *)(psxVuw+cx+(cy*1024));\r
+ l=0;lSRCPtr=(unsigned int *)(psxVuw+cx+(cy*1024));\r
if(j==1) for(row=1;row<129;row++) l+=((*lSRCPtr++)-1)*row;\r
else for(row=1;row<9;row++) l+=((*lSRCPtr++)-1)<<row;\r
l=((l+HIWORD(l))&0x3fffL)<<16;\r
usLRUTexPage=0;\r
DrawSemiTrans=sOldDST;\r
GlobalTexturePage=lOGTP;\r
- *((unsigned long *)&gl_ux[4])=opos.l;\r
+ *((unsigned int *)&gl_ux[4])=opos.l;\r
dwTexPageComp=0;\r
\r
return;\r
\r
if(tsx->ClutID&(1<<30)) DrawSemiTrans=1;\r
else DrawSemiTrans=0;\r
- *((unsigned long *)&gl_ux[4])=r.l;\r
+ *((unsigned int *)&gl_ux[4])=r.l;\r
\r
gTexName=uiStexturePage[tsx->cTexID];\r
LoadSubTexFn(k,j,cx,cy);\r
\r
if(dwTexPageComp==0xffffffff) dwTexPageComp=0;\r
\r
- *((unsigned long *)&gl_ux[4])=opos.l;\r
+ *((unsigned int *)&gl_ux[4])=opos.l;\r
GlobalTexturePage=lOGTP;\r
DrawSemiTrans=sOldDST;\r
}\r
/////////////////////////////////////////////////////////////////////////////\r
/////////////////////////////////////////////////////////////////////////////\r
\r
-GLuint SelectSubTextureS(long TextureMode, unsigned long GivenClutId) \r
+GLuint SelectSubTextureS(int TextureMode, unsigned int GivenClutId) \r
{\r
unsigned char * OPtr;unsigned short iCache;short cx,cy;\r
\r
\r
// palette check sum.. removed MMX asm, this easy func works as well\r
{\r
- unsigned long l=0,row;\r
+ unsigned int l=0,row;\r
\r
- unsigned long * lSRCPtr=(unsigned long *)(psxVuw+cx+(cy*1024));\r
+ unsigned int * lSRCPtr=(unsigned int *)(psxVuw+cx+(cy*1024));\r
if(TextureMode==1) for(row=1;row<129;row++) l+=((*lSRCPtr++)-1)*row;\r
else for(row=1;row<9;row++) l+=((*lSRCPtr++)-1)<<row;\r
l=(l+HIWORD(l))&0x3fffL;\r