summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2009-05-30 07:19:21 +0000
committerSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2009-05-30 07:19:21 +0000
commit928e43def776ab2cb40dbca87316ef956b805249 (patch)
treeb1db04d3535e7b311b46361980962377b218d9ac /plugins
parent51cf70467dfbcca5fbce7f25761678dd8b487d4e (diff)
downloadpcsxr-928e43def776ab2cb40dbca87316ef956b805249.tar.gz
x86_64 compatiablity for P.E.Op.S OpenGL Driver (untested)
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@23601 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'plugins')
-rw-r--r--plugins/peopsxgl/draw.c4
-rw-r--r--plugins/peopsxgl/draw.h2
-rw-r--r--plugins/peopsxgl/externals.h88
-rw-r--r--plugins/peopsxgl/gpu.c131
-rw-r--r--plugins/peopsxgl/key.c2
-rw-r--r--plugins/peopsxgl/menu.c7
-rw-r--r--plugins/peopsxgl/prim.c153
-rw-r--r--plugins/peopsxgl/prim.h4
-rw-r--r--plugins/peopsxgl/soft.c910
-rw-r--r--plugins/peopsxgl/soft.h26
-rw-r--r--plugins/peopsxgl/texture.c415
-rw-r--r--plugins/peopsxgl/texture.h45
12 files changed, 877 insertions, 910 deletions
diff --git a/plugins/peopsxgl/draw.c b/plugins/peopsxgl/draw.c
index fdb220ba..1c431e3c 100644
--- a/plugins/peopsxgl/draw.c
+++ b/plugins/peopsxgl/draw.c
@@ -1018,14 +1018,14 @@ void offsetST(void)
/////////////////////////////////////////////////////////
-void offsetScreenUpload(long Position)
+void offsetScreenUpload(int Position)
{
if(bDisplayNotSet)
SetOGLDisplaySettings(1);
if(Position==-1)
{
- long lmdx,lmdy;
+ int lmdx,lmdy;
lmdx=xrUploadArea.x0;
lmdy=xrUploadArea.y0;
diff --git a/plugins/peopsxgl/draw.h b/plugins/peopsxgl/draw.h
index 5828087e..14d2373e 100644
--- a/plugins/peopsxgl/draw.h
+++ b/plugins/peopsxgl/draw.h
@@ -36,7 +36,7 @@ BOOL offset4(void);
BOOL offsetline(void);
void offsetST(void);
void offsetBlk(void);
-void offsetScreenUpload(long Position);
+void offsetScreenUpload(int Position);
void assignTexture3(void);
void assignTexture4(void);
void assignTextureSprite(void);
diff --git a/plugins/peopsxgl/externals.h b/plugins/peopsxgl/externals.h
index 2a723354..8ce2b914 100644
--- a/plugins/peopsxgl/externals.h
+++ b/plugins/peopsxgl/externals.h
@@ -83,10 +83,10 @@
#define BOOL unsigned short
#define bool unsigned short
#define LOWORD(l) ((unsigned short)(l))
-#define HIWORD(l) ((unsigned short)(((unsigned long)(l) >> 16) & 0xFFFF))
+#define HIWORD(l) ((unsigned short)(((uint32_t)(l) >> 16) & 0xFFFF))
#define max(a,b) (((a) > (b)) ? (a) : (b))
#define min(a,b) (((a) < (b)) ? (a) : (b))
-#define DWORD unsigned long
+#define DWORD uint32_t
typedef struct RECTTAG
{
@@ -109,8 +109,8 @@ typedef struct VRAMLOADTAG
typedef struct PSXPOINTTAG
{
- long x;
- long y;
+ int x;
+ int y;
} PSXPoint_t;
typedef struct PSXSPOINTTAG
@@ -143,19 +143,19 @@ typedef struct PSXDISPLAYTAG
PSXPoint_t DisplayPosition;
PSXPoint_t DisplayEnd;
- long Double;
- long Height;
- long PAL;
- long InterlacedNew;
- long Interlaced;
- long InterlacedTest;
- long RGB24New;
- long RGB24;
+ int Double;
+ int Height;
+ int PAL;
+ int InterlacedNew;
+ int Interlaced;
+ int InterlacedTest;
+ int RGB24New;
+ int RGB24;
PSXSPoint_t DrawOffset;
PSXRect_t DrawArea;
PSXPoint_t GDrawOffset;
PSXPoint_t CumulOffset;
- long Disabled;
+ int Disabled;
PSXRect_t Range;
} PSXDisplay_t;
@@ -168,13 +168,11 @@ typedef struct OGLVertexTag
GLfloat sow;
GLfloat tow;
- union
-COLTAG
+ union COLTAG
{
unsigned char col[4];
- unsigned long lcol;
+ unsigned int lcol;
} c;
-
} OGLVertex;
typedef union EXShortTag
@@ -186,7 +184,7 @@ typedef union EXShortTag
typedef union EXLongTag
{
unsigned char c[4];
- unsigned long l;
+ unsigned int l;
EXShort s[2];
} EXLong;
@@ -242,8 +240,8 @@ extern GLuint gTexScanName;
#ifndef _IN_SOFT
-extern long GlobalTextAddrX,GlobalTextAddrY,GlobalTextTP;
-extern long GlobalTextREST,GlobalTextABR,GlobalTextPAGE;
+extern int GlobalTextAddrX,GlobalTextAddrY,GlobalTextTP;
+extern int GlobalTextREST,GlobalTextABR,GlobalTextPAGE;
extern short ly0,lx0,ly1,lx1,ly2,lx2,ly3,lx3;
extern short g_m1;
extern short g_m2;
@@ -278,22 +276,22 @@ extern GLubyte ubGloAlpha;
extern short sSprite_ux2;
extern short sSprite_vy2;
extern BOOL bRenderFrontBuffer;
-extern unsigned long ulOLDCOL;
-extern unsigned long ulClutID;
+extern uint32_t ulOLDCOL;
+extern uint32_t ulClutID;
extern void (*primTableJ[256])(unsigned char *);
extern void (*primTableSkip[256])(unsigned char *);
extern unsigned short usMirror;
-extern unsigned long dwCfgFixes;
-extern unsigned long dwActFixes;
-extern unsigned long dwEmuFixes;
+extern uint32_t dwCfgFixes;
+extern uint32_t dwActFixes;
+extern uint32_t dwEmuFixes;
extern BOOL bUseFixes;
extern int iSpriteTex;
extern int iDrawnSomething;
-extern long drawX;
-extern long drawY;
-extern long drawW;
-extern long drawH;
+extern int drawX;
+extern int drawY;
+extern int drawW;
+extern int drawH;
extern short sxmin;
extern short sxmax;
extern short symin;
@@ -308,10 +306,10 @@ extern GLint giWantedRGBA;
extern GLint giWantedFMT;
extern GLint giWantedTYPE;
extern void (*LoadSubTexFn) (int,int,short,short);
-extern long GlobalTexturePage;
-extern unsigned long (*TCF[]) (unsigned long);
+extern int GlobalTexturePage;
+extern uint32_t (*TCF[]) (uint32_t);
extern unsigned short (*PTCF[]) (unsigned short);
-extern unsigned long (*PalTexturedColourFn) (unsigned long);
+extern uint32_t (*PalTexturedColourFn) (uint32_t);
extern BOOL bUseFastMdec;
extern BOOL bUse15bitMdec;
extern int iFrameTexType;
@@ -343,32 +341,32 @@ extern char szDispBuf[];
extern char szGPUKeys[];
extern PSXDisplay_t PSXDisplay;
extern PSXDisplay_t PreviousPSXDisplay;
-extern unsigned long ulKeybits;
+extern uint32_t ulKeybits;
extern TWin_t TWin;
extern BOOL bDisplayNotSet;
-extern long lGPUstatusRet;
+extern int lGPUstatusRet;
extern short imageX0,imageX1;
extern short imageY0,imageY1;
-extern long lClearOnSwap,lClearOnSwapColor;
-extern unsigned char * psxVub;
-extern signed char * psxVsb;
-extern unsigned short * psxVuw;
-extern signed short * psxVsw;
-extern unsigned long * psxVul;
-extern signed long * psxVsl;
+extern int lClearOnSwap,lClearOnSwapColor;
+extern unsigned char *psxVub;
+extern signed char *psxVsb;
+extern unsigned short *psxVuw;
+extern signed short *psxVsw;
+extern uint32_t *psxVul;
+extern signed int *psxVsl;
extern GLfloat gl_z;
extern BOOL bNeedRGB24Update;
extern BOOL bChangeWinMode;
extern GLuint uiScanLine;
extern int iUseScanLines;
-extern long lSelectedSlot;
+extern int lSelectedSlot;
extern int iScanBlend;
extern BOOL bInitCap;
extern int iBlurBuffer;
extern int iLastRGB24;
extern int iRenderFVR;
extern int iNoScreenSaver;
-extern unsigned long ulGPUInfoVals[];
+extern uint32_t ulGPUInfoVals[];
extern BOOL bNeedInterlaceUpdate;
extern BOOL bNeedWriteUpload;
extern BOOL bSkipNextFrame;
@@ -379,7 +377,7 @@ extern int bFullScreen;
#ifndef _IN_MENU
-extern unsigned long dwCoreFlags;
+extern uint32_t dwCoreFlags;
extern GLuint gTexPicName;
extern PSXPoint_t ptCursorPoint[];
extern unsigned short usCursorActive;
@@ -400,7 +398,7 @@ extern float fps_cur;
#ifndef _IN_KEY
-extern unsigned long ulKeybits;
+extern uint32_t ulKeybits;
#endif
diff --git a/plugins/peopsxgl/gpu.c b/plugins/peopsxgl/gpu.c
index 3e424f80..1ccf9a02 100644
--- a/plugins/peopsxgl/gpu.c
+++ b/plugins/peopsxgl/gpu.c
@@ -64,8 +64,8 @@ signed char *psxVsb;
unsigned short *psxVuw;
unsigned short *psxVuw_eom;
signed short *psxVsw;
-unsigned long *psxVul;
-signed long *psxVsl;
+uint32_t *psxVul;
+signed int *psxVsl;
// macro for easy access to packet information
#define GPUCOMMAND(x) ((x>>24) & 0xff)
@@ -75,14 +75,14 @@ BOOL bNeedInterlaceUpdate=FALSE;
BOOL bNeedRGB24Update=FALSE;
BOOL bChangeWinMode=FALSE;
-unsigned long ulStatusControl[256];
+uint32_t ulStatusControl[256];
////////////////////////////////////////////////////////////////////////
// global GPU vars
////////////////////////////////////////////////////////////////////////
-static long GPUdataRet;
-long lGPUstatusRet;
+static int GPUdataRet;
+int lGPUstatusRet;
char szDispBuf[64];
uint32_t dwGPUVersion = 0;
@@ -91,18 +91,18 @@ int iGPUHeightMask = 511;
int GlobalTextIL = 0;
int iTileCheat = 0;
-static unsigned long gpuDataM[256];
+static uint32_t gpuDataM[256];
static unsigned char gpuCommand = 0;
-static long gpuDataC = 0;
-static long gpuDataP = 0;
+static int gpuDataC = 0;
+static int gpuDataP = 0;
VRAMLoad_t VRAMWrite;
VRAMLoad_t VRAMRead;
int iDataWriteMode;
int iDataReadMode;
-long lClearOnSwap;
-long lClearOnSwapColor;
+int lClearOnSwap;
+int lClearOnSwapColor;
BOOL bSkipNextFrame = FALSE;
int iColDepth;
BOOL bChangeRes;
@@ -120,13 +120,13 @@ short imageY0,imageY1;
BOOL bDisplayNotSet = TRUE;
GLuint uiScanLine=0;
int iUseScanLines=0;
-long lSelectedSlot=0;
+int lSelectedSlot=0;
unsigned char * pGfxCardScreen=0;
int iBlurBuffer=0;
int iScanBlend=0;
int iRenderFVR=0;
int iNoScreenSaver=0;
-unsigned long ulGPUInfoVals[16];
+uint32_t ulGPUInfoVals[16];
int iFakePrimBusy = 0;
int iRumbleVal = 0;
int iRumbleTime = 0;
@@ -341,9 +341,9 @@ void DoSnapShot(void)
{
unsigned char * snapshotdumpmem=NULL,* p,c;
FILE *bmpfile;char filename[256];
- unsigned char header[0x36];long size;
+ unsigned char header[0x36];int size;
unsigned char empty[2]={0,0};int i;
- unsigned long snapshotnr = 0;
+ unsigned int snapshotnr = 0;
short SnapWidth;
short SnapHeigth;
@@ -425,7 +425,7 @@ void CALLBACK GPUmakeSnapshot(void)
long CALLBACK GPUinit()
{
- memset(ulStatusControl,0,256*sizeof(unsigned long));
+ memset(ulStatusControl,0,256*sizeof(uint32_t));
// different ways of accessing PSX VRAM
@@ -435,14 +435,14 @@ long CALLBACK GPUinit()
psxVub=psxVSecure+512*1024; // security offset into double sized psx vram!
psxVsb=(signed char *)psxVub;
psxVsw=(signed short *)psxVub;
- psxVsl=(signed long *)psxVub;
+ psxVsl=(signed int *)psxVub;
psxVuw=(unsigned short *)psxVub;
- psxVul=(unsigned long *)psxVub;
+ psxVul=(uint32_t *)psxVub;
psxVuw_eom=psxVuw+1024*iGPUHeight; // pre-calc of end of vram
memset(psxVSecure,0x00,(iGPUHeight*2)*1024 + (1024*1024));
- memset(ulGPUInfoVals,0x00,16*sizeof(unsigned long));
+ memset(ulGPUInfoVals,0x00,16*sizeof(uint32_t));
InitFrameCap(); // init frame rate stuff
@@ -804,7 +804,7 @@ long GPUopen(unsigned long * disp,char * CapText,char * CfgFile)
if(disp)
{
- *disp=(unsigned long)display; // return display ID to main emu
+ *disp=(unsigned long *)display; // return display ID to main emu
}
if(display) return 0;
@@ -1369,13 +1369,13 @@ void updateFrontDisplay(void)
void ChangeDispOffsetsX(void) // CENTER X
{
- long lx,l;short sO;
+ int lx,l;short sO;
if(!PSXDisplay.Range.x1) return; // some range given?
l=PSXDisplay.DisplayMode.x;
- l*=(long)PSXDisplay.Range.x1; // some funky calculation
+ l*=(int)PSXDisplay.Range.x1; // some funky calculation
l/=2560;lx=l;l&=0xfffffff8;
if(l==PreviousPSXDisplay.Range.x1) return; // some change?
@@ -1679,7 +1679,7 @@ void CALLBACK GPUupdateLace(void)
// process read request from GPU status register
////////////////////////////////////////////////////////////////////////
-unsigned long CALLBACK GPUreadStatus(void)
+uint32_t CALLBACK GPUreadStatus(void)
{
if(dwActFixes&0x1000) // CC game fix
{
@@ -1715,9 +1715,9 @@ unsigned long CALLBACK GPUreadStatus(void)
// these are always single packet commands.
////////////////////////////////////////////////////////////////////////
-void CALLBACK GPUwriteStatus(unsigned long gdata)
+void CALLBACK GPUwriteStatus(uint32_t gdata)
{
- unsigned long lCommand=(gdata>>24)&0xff;
+ uint32_t lCommand=(gdata>>24)&0xff;
ulStatusControl[lCommand]=gdata;
@@ -1726,8 +1726,8 @@ void CALLBACK GPUwriteStatus(unsigned long gdata)
//--------------------------------------------------//
// reset gpu
case 0x00:
- memset(ulGPUInfoVals,0x00,16*sizeof(unsigned long));
- lGPUstatusRet=0x14802000;
+ memset(ulGPUInfoVals, 0x00, 16 * sizeof(uint32_t));
+ lGPUstatusRet = 0x14802000;
PSXDisplay.Disabled=1;
iDataWriteMode=iDataReadMode=DR_NORMAL;
PSXDisplay.DrawOffset.x=PSXDisplay.DrawOffset.y=0;
@@ -2323,7 +2323,7 @@ void CheckVRamRead(int x, int y, int dx, int dy,BOOL bFront)
// core read from vram
////////////////////////////////////////////////////////////////////////
-void CALLBACK GPUreadDataMem(unsigned long * pMem, int iSize)
+void CALLBACK GPUreadDataMem(uint32_t *pMem, int iSize)
{
int i;
@@ -2354,7 +2354,7 @@ void CALLBACK GPUreadDataMem(unsigned long * pMem, int iSize)
if ((VRAMRead.ColsRemaining > 0) && (VRAMRead.RowsRemaining > 0))
{
// lower 16 bit
- GPUdataRet=(unsigned long)*VRAMRead.ImagePtr;
+ GPUdataRet=(uint32_t)*VRAMRead.ImagePtr;
VRAMRead.ImagePtr++;
if(VRAMRead.ImagePtr>=psxVuw_eom) VRAMRead.ImagePtr-=iGPUHeight*1024;
@@ -2369,7 +2369,7 @@ void CALLBACK GPUreadDataMem(unsigned long * pMem, int iSize)
}
// higher 16 bit (always, even if it's an odd width)
- GPUdataRet|=(unsigned long)(*VRAMRead.ImagePtr)<<16;
+ GPUdataRet|=(uint32_t)(*VRAMRead.ImagePtr)<<16;
*pMem++=GPUdataRet;
if(VRAMRead.ColsRemaining <= 0)
@@ -2395,9 +2395,9 @@ ENDREAD:
GPUIsIdle;
}
-unsigned long CALLBACK GPUreadData(void)
+uint32_t CALLBACK GPUreadData(void)
{
- unsigned long l;
+ uint32_t l;
GPUreadDataMem(&l,1);
return GPUdataRet;
}
@@ -2480,10 +2480,10 @@ const unsigned char primTableCX[256] =
// processes data send to GPU data register
////////////////////////////////////////////////////////////////////////
-void CALLBACK GPUwriteDataMem(unsigned long * pMem, int iSize)
+void CALLBACK GPUwriteDataMem(uint32_t *pMem, int iSize)
{
unsigned char command;
- unsigned long gdata=0;
+ uint32_t gdata=0;
int i=0;
GPUIsBusy;
GPUIsNotReadyForCommands;
@@ -2517,7 +2517,7 @@ STARTVRAM:
VRAMWrite.ColsRemaining--;
if (VRAMWrite.ColsRemaining <= 0) // last pixel is odd width
{
- gdata=(gdata&0xFFFF)|(((unsigned long)(*VRAMWrite.ImagePtr))<<16);
+ gdata=(gdata&0xFFFF)|(((uint32_t)(*VRAMWrite.ImagePtr))<<16);
FinishedVRAMWrite();
goto ENDVRAM;
}
@@ -2599,39 +2599,12 @@ ENDVRAM:
////////////////////////////////////////////////////////////////////////
-void CALLBACK GPUwriteData(unsigned long gdata)
+void CALLBACK GPUwriteData(uint32_t gdata)
{
GPUwriteDataMem(&gdata,1);
}
////////////////////////////////////////////////////////////////////////
-// this function will be removed soon (or 'soonish') (or never)
-////////////////////////////////////////////////////////////////////////
-
-void CALLBACK GPUsetMode(unsigned long gdata)
-{
- // ignore old psemu setmode:
-
- // imageTransfer = gdata;
- // iDataWriteMode=(gdata&1)?DR_VRAMTRANSFER:DR_NORMAL;
- // iDataReadMode =(gdata&2)?DR_VRAMTRANSFER:DR_NORMAL;
-}
-
-// and this function will be removed soon as well, hehehe...
-long CALLBACK GPUgetMode(void)
-{
- // ignore old psemu setmode
- // return imageTransfer;
-
- long iT=0;
-
- if(iDataWriteMode==DR_VRAMTRANSFER) iT|=0x1;
- if(iDataReadMode ==DR_VRAMTRANSFER) iT|=0x2;
-
- return iT;
-}
-
-////////////////////////////////////////////////////////////////////////
// call config dlg
////////////////////////////////////////////////////////////////////////
@@ -2690,9 +2663,9 @@ void SetFixes(void)
// Pete Special: make an 'intelligent' dma chain check (<-Tekken3)
////////////////////////////////////////////////////////////////////////
-unsigned long lUsedAddr[3];
+uint32_t lUsedAddr[3];
-__inline BOOL CheckForEndlessLoop(unsigned long laddr)
+__inline BOOL CheckForEndlessLoop(uint32_t laddr)
{
if(laddr==lUsedAddr[1]) return TRUE;
if(laddr==lUsedAddr[2]) return TRUE;
@@ -2707,9 +2680,9 @@ __inline BOOL CheckForEndlessLoop(unsigned long laddr)
// core gives a dma chain to gpu: same as the gpuwrite interface funcs
////////////////////////////////////////////////////////////////////////
-long CALLBACK GPUdmaChain(unsigned long * baseAddrL, unsigned long addr)
+long CALLBACK GPUdmaChain(uint32_t *baseAddrL, uint32_t addr)
{
- unsigned long dmaMem;
+ uint32_t dmaMem;
unsigned char * baseAddrB;
short count;unsigned int DMACommandCounter = 0;
@@ -2768,21 +2741,21 @@ long CALLBACK GPUtest(void)
// save state funcs
////////////////////////////////////////////////////////////////////////
-typedef struct
-{
- unsigned long ulFreezeVersion; // should be always 1 for now
- unsigned long ulStatus; // current gpu status
- unsigned long ulControl[256]; // latest control register values
- unsigned char psxVRam[1024*1024*2]; // current VRam image
+typedef struct GPUFREEZETAG
+{
+ uint32_t ulFreezeVersion; // should be always 1 for now (set by main emu)
+ uint32_t ulStatus; // current gpu status
+ uint32_t ulControl[256]; // latest control register values
+ unsigned char psxVRam[1024*1024*2]; // current VRam image (full 2 MB for ZN)
} GPUFreeze_t;
////////////////////////////////////////////////////////////////////////
-long CALLBACK GPUfreeze(unsigned long ulGetFreezeData,GPUFreeze_t * pF)
+long CALLBACK GPUfreeze(uint32_t ulGetFreezeData,GPUFreeze_t * pF)
{
if(ulGetFreezeData==2)
{
- long lSlotNum=*((long *)pF);
+ int lSlotNum=*((int *)pF);
if(lSlotNum<0) return 0;
if(lSlotNum>8) return 0;
lSelectedSlot=lSlotNum+1;
@@ -2795,7 +2768,7 @@ long CALLBACK GPUfreeze(unsigned long ulGetFreezeData,GPUFreeze_t * pF)
if(ulGetFreezeData==1)
{
pF->ulStatus=STATUSREG;
- memcpy(pF->ulControl,ulStatusControl,256*sizeof(unsigned long));
+ memcpy(pF->ulControl,ulStatusControl,256*sizeof(uint32_t));
memcpy(pF->psxVRam, psxVub, 1024*iGPUHeight*2);
return 1;
@@ -2804,7 +2777,7 @@ long CALLBACK GPUfreeze(unsigned long ulGetFreezeData,GPUFreeze_t * pF)
if(ulGetFreezeData!=0) return 0;
STATUSREG=pF->ulStatus;
- memcpy(ulStatusControl,pF->ulControl,256*sizeof(unsigned long));
+ memcpy(ulStatusControl,pF->ulControl,256*sizeof(uint32_t));
memcpy(psxVub, pF->psxVRam, 1024*iGPUHeight*2);
ResetTextureArea(TRUE);
@@ -3154,14 +3127,14 @@ void CALLBACK GPUshowScreenPic(unsigned char * pMem)
////////////////////////////////////////////////////////////////////////
-void CALLBACK GPUsetfix(unsigned long dwFixBits)
+void CALLBACK GPUsetfix(uint32_t dwFixBits)
{
dwEmuFixes=dwFixBits;
}
////////////////////////////////////////////////////////////////////////
-void CALLBACK GPUvisualVibration(unsigned long iSmall, unsigned long iBig)
+void CALLBACK GPUvisualVibration(uint32_t iSmall, uint32_t iBig)
{
int iVibVal;
@@ -3181,7 +3154,7 @@ void CALLBACK GPUvisualVibration(unsigned long iSmall, unsigned long iBig)
// main emu can set display infos (A/M/G/D)
////////////////////////////////////////////////////////////////////////
-void CALLBACK GPUdisplayFlags(unsigned long dwFlags)
+void CALLBACK GPUdisplayFlags(uint32_t dwFlags)
{
dwCoreFlags=dwFlags;
}
diff --git a/plugins/peopsxgl/key.c b/plugins/peopsxgl/key.c
index 8dc216a6..25afa172 100644
--- a/plugins/peopsxgl/key.c
+++ b/plugins/peopsxgl/key.c
@@ -30,7 +30,7 @@
// KeyBoard handler stuff
////////////////////////////////////////////////////////////////////////
-unsigned long ulKeybits=0;
+uint32_t ulKeybits = 0;
////////////////////////////////////////////////////////////////////////
// keyboard handler (LINUX)
diff --git a/plugins/peopsxgl/menu.c b/plugins/peopsxgl/menu.c
index 8cc85c53..f26d5ce2 100644
--- a/plugins/peopsxgl/menu.c
+++ b/plugins/peopsxgl/menu.c
@@ -25,7 +25,7 @@
#include "menu.h"
#include "gpu.h"
-unsigned long dwCoreFlags=0;
+uint32_t dwCoreFlags=0;
PSXPoint_t ptCursorPoint[8];
unsigned short usCursorActive=0;
@@ -1385,7 +1385,7 @@ void ShowGunCursor(void)
{
int iPlayer;
GLfloat fX,fY,fDX,fDY,fYS,fXS;
- const unsigned long crCursorColor32[8]={0xff00ff00,0xffff0000,0xff0000ff,0xffff00ff,0xffffff00,0xff00ffff,0xffffffff,0xff7f7f7f};
+ const uint32_t crCursorColor32[8]={0xff00ff00,0xffff0000,0xff0000ff,0xffff00ff,0xffffff00,0xff00ffff,0xffffffff,0xff7f7f7f};
if(!gTexCursorName) // create gun cursor texture the first time
{
@@ -1441,6 +1441,3 @@ void ShowGunCursor(void)
glEnable(GL_SCISSOR_TEST);
}
-
-////////////////////////////////////////////////////////////////////////
-
diff --git a/plugins/peopsxgl/prim.c b/plugins/peopsxgl/prim.c
index daf986e3..323b1d81 100644
--- a/plugins/peopsxgl/prim.c
+++ b/plugins/peopsxgl/prim.c
@@ -69,15 +69,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
+uint32_t ulOLDCOL=0; // active color
+uint32_t ulClutID; // clut
-unsigned long dwCfgFixes; // game fixes
-unsigned long dwActFixes=0;
-unsigned long dwEmuFixes=0;
+uint32_t dwCfgFixes; // game fixes
+uint32_t dwActFixes=0;
+uint32_t 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;
////////////////////////////////////////////////////////////////////////
@@ -121,9 +121,9 @@ void UpdateGlobalTP(unsigned short gdata)
STATUSREG|=(gdata & 0x07ff); // set the necessary bits
}
-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;
@@ -137,7 +137,7 @@ unsigned long DoubleBGR2RGB (unsigned long BGR)
return (ebx|eax|edx);
}
-unsigned short BGR24to16 (unsigned long BGR)
+unsigned short BGR24to16 (uint32_t BGR)
{
return ((BGR>>3)&0x1f)|((BGR&0xf80000)>>9)|((BGR&0xf800)>>6);
}
@@ -622,7 +622,7 @@ __inline void SetZMask4SP(void)
////////////////////////////////////////////////////////////////////////
-__inline void SetRenderState(unsigned long DrawAttributes)
+__inline void SetRenderState(uint32_t DrawAttributes)
{
bDrawNonShaded = (SHADETEXBIT(DrawAttributes)) ? TRUE : FALSE;
DrawSemiTrans = (SEMITRANSBIT(DrawAttributes)) ? TRUE : FALSE;
@@ -630,7 +630,7 @@ __inline void SetRenderState(unsigned long DrawAttributes)
////////////////////////////////////////////////////////////////////////
-__inline void SetRenderColor(unsigned long DrawAttributes)
+__inline void SetRenderColor(uint32_t DrawAttributes)
{
if(bDrawNonShaded) {g_m1=g_m2=g_m3=128;}
else
@@ -643,7 +643,7 @@ __inline void SetRenderColor(unsigned long DrawAttributes)
////////////////////////////////////////////////////////////////////////
-void SetRenderMode(unsigned long DrawAttributes,BOOL bSCol)
+void SetRenderMode(uint32_t DrawAttributes, BOOL bSCol)
{
if((bUseMultiPass) && (bDrawTextured) && !(bDrawNonShaded))
{bDrawMultiPass = TRUE; SetSemiTransMulti(0);}
@@ -698,7 +698,7 @@ void SetRenderMode(unsigned long DrawAttributes,BOOL bSCol)
// Set Opaque multipass color
////////////////////////////////////////////////////////////////////////
-void SetOpaqueColor(unsigned long DrawAttributes)
+void SetOpaqueColor(uint32_t DrawAttributes)
{
if(bDrawNonShaded) return; // no shading? bye
@@ -1073,7 +1073,7 @@ BOOL CheckAgainstFrontScreen(short imageX0,short imageY0,short imageX1,short ima
////////////////////////////////////////////////////////////////////////
-void PrepareFullScreenUpload (long Position)
+void PrepareFullScreenUpload (int Position)
{
if (Position==-1) // rgb24
{
@@ -1155,7 +1155,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];
@@ -1239,7 +1239,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;
@@ -1320,8 +1320,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((uint32_t)0x01000000);
+ SetRenderMode((uint32_t)0x01000000, FALSE); // upload texture data
offsetScreenUpload(Position);
assignTextureVRAMWrite();
@@ -1386,7 +1386,7 @@ BOOL IsInsideNextScreen(short x, short y, short xoff, short yoff)
void cmdSTP(unsigned char * baseAddr)
{
- unsigned long gdata = ((unsigned long*)baseAddr)[0];
+ uint32_t gdata = ((uint32_t*)baseAddr)[0];
STATUSREG&=~0x1800; // clear the necessary bits
STATUSREG|=((gdata & 0x03) << 11); // set the current bits
@@ -1419,7 +1419,7 @@ void cmdSTP(unsigned char * baseAddr)
void cmdTexturePage(unsigned char * baseAddr)
{
- unsigned long gdata = ((unsigned long*)baseAddr)[0];
+ uint32_t gdata = ((uint32_t *)baseAddr)[0];
UpdateGlobalTP((unsigned short)gdata);
GlobalTextREST = (gdata&0x00ffffff)>>9;
}
@@ -1430,9 +1430,8 @@ void cmdTexturePage(unsigned char * baseAddr)
void cmdTextureWindow(unsigned char *baseAddr)
{
- unsigned long gdata = ((unsigned long*)baseAddr)[0];
-
- unsigned long YAlign,XAlign;
+ uint32_t gdata = ((uint32_t *)baseAddr)[0];
+ uint32_t YAlign,XAlign;
ulGPUInfoVals[INFO_TW]=gdata&0xFFFFF;
@@ -1466,8 +1465,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 = (uint32_t)(32 - (TWin.Position.y1 >> 3));
+ XAlign = (uint32_t)(32 - (TWin.Position.x1 >> 3));
// Absolute position of the start of the texture window
@@ -1639,7 +1638,7 @@ void ClampToPSXScreenOffset(short *x0, short *y0, short *x1, short *y1)
void cmdDrawAreaStart(unsigned char * baseAddr)
{
- unsigned long gdata = ((unsigned long*)baseAddr)[0];
+ uint32_t gdata = ((uint32_t *)baseAddr)[0];
drawX = gdata & 0x3ff; // for soft drawing
if(drawX>=1024) drawX=1023;
@@ -1670,7 +1669,7 @@ void cmdDrawAreaStart(unsigned char * baseAddr)
void cmdDrawAreaEnd(unsigned char * baseAddr)
{
- unsigned long gdata = ((unsigned long*)baseAddr)[0];
+ uint32_t gdata = ((uint32_t *)baseAddr)[0];
drawW = gdata & 0x3ff; // for soft drawing
if(drawW>=1024) drawW=1023;
@@ -1705,14 +1704,14 @@ void cmdDrawAreaEnd(unsigned char * baseAddr)
void cmdDrawOffset(unsigned char * baseAddr)
{
- unsigned long gdata = ((unsigned long*)baseAddr)[0];
+ uint32_t gdata = ((uint32_t *)baseAddr)[0];
PreviousPSXDisplay.DrawOffset.x =
PSXDisplay.DrawOffset.x = (short)(gdata & 0x7ff);
- if(dwGPUVersion==2)
+ if (dwGPUVersion == 2)
{
- ulGPUInfoVals[INFO_DRAWOFF]=gdata&0x7FFFFF;
+ ulGPUInfoVals[INFO_DRAWOFF] = gdata&0x7FFFFF;
PSXDisplay.DrawOffset.y = (short)((gdata>>12) & 0x7ff);
}
else
@@ -1915,17 +1914,17 @@ void primStoreImage(unsigned char * baseAddr)
void primBlkFill(unsigned char * baseAddr)
{
- unsigned long *gpuData = ((unsigned long *) baseAddr);
+ uint32_t *gpuData = ((uint32_t *) baseAddr);
short *sgpuData = ((short *) baseAddr);
- iDrawnSomething=1;
+ iDrawnSomething = 1;
sprtX = sgpuData[2];
sprtY = sgpuData[3];
sprtW = sgpuData[4] & 0x3ff;
sprtH = sgpuData[5] & iGPUHeightMask;
- sprtW = (sprtW+15) & ~15;
+ sprtW = (sprtW + 15) & ~15;
// Increase H & W if they are one short of full values, because they never can be full values
if (sprtH == iGPUHeightMask) sprtH=iGPUHeight;
@@ -1966,8 +1965,8 @@ void primBlkFill(unsigned char * baseAddr)
{
bDrawTextured = FALSE;
bDrawSmoothShaded = FALSE;
- SetRenderState((unsigned long)0x01000000);
- SetRenderMode((unsigned long)0x01000000, FALSE);
+ SetRenderState((uint32_t)0x01000000);
+ SetRenderMode((uint32_t)0x01000000, FALSE);
vertex[0].c.lcol=0xff000000;
SETCOL(vertex[0]);
if(ly0>pd->DisplayPosition.y)
@@ -1994,8 +1993,8 @@ void primBlkFill(unsigned char * baseAddr)
{
bDrawTextured = FALSE;
bDrawSmoothShaded = FALSE;
- SetRenderState((unsigned long)0x01000000);
- SetRenderMode((unsigned long)0x01000000, FALSE);
+ SetRenderState((uint32_t)0x01000000);
+ SetRenderMode((uint32_t)0x01000000, FALSE);
vertex[0].c.lcol=gpuData[0]|0xff000000;
SETCOL(vertex[0]);
glDisable(GL_SCISSOR_TEST);
@@ -2165,12 +2164,12 @@ void primMoveImage(unsigned char * baseAddr)
}
else
{
- unsigned long *SRCPtr, *DSTPtr;
+ uint32_t *SRCPtr, *DSTPtr;
unsigned short LineOffset;
int dx=imageSX>>1;
- SRCPtr = (unsigned long *)(psxVuw + (1024*imageY0) + imageX0);
- DSTPtr = (unsigned long *)(psxVuw + (1024*imageY1) + imageX1);
+ SRCPtr = (uint32_t *)(psxVuw + (1024*imageY0) + imageX0);
+ DSTPtr = (uint32_t *)(psxVuw + (1024*imageY1) + imageX1);
LineOffset = 512 - dx;
@@ -2271,7 +2270,7 @@ void primMoveImage(unsigned char * baseAddr)
void primTileS(unsigned char * baseAddr)
{
- unsigned long *gpuData = ((unsigned long*)baseAddr);
+ uint32_t *gpuData = ((uint32_t *)baseAddr);
short *sgpuData = ((short *) baseAddr);
sprtX = sgpuData[2];
@@ -2336,8 +2335,8 @@ void primTileS(unsigned char * baseAddr)
void primTile1(unsigned char * baseAddr)
{
- unsigned long *gpuData = ((unsigned long*)baseAddr);
- short *sgpuData = ((short *) baseAddr);
+ uint32_t *gpuData = ((uint32_t *)baseAddr);
+ short *sgpuData = ((short *)baseAddr);
sprtX = sgpuData[2];
sprtY = sgpuData[3];
@@ -2383,7 +2382,7 @@ void primTile1(unsigned char * baseAddr)
void primTile8(unsigned char * baseAddr)
{
- unsigned long *gpuData = ((unsigned long*)baseAddr);
+ uint32_t *gpuData = ((uint32_t *)baseAddr);
short *sgpuData = ((short *) baseAddr);
sprtX = sgpuData[2];
@@ -2430,8 +2429,8 @@ void primTile8(unsigned char * baseAddr)
void primTile16(unsigned char * baseAddr)
{
- unsigned long *gpuData = ((unsigned long*)baseAddr);
- short *sgpuData = ((short *) baseAddr);
+ uint32_t *gpuData = ((uint32_t *)baseAddr);
+ short *sgpuData = ((short *)baseAddr);
sprtX = sgpuData[2];
sprtY = sgpuData[3];
@@ -2477,7 +2476,8 @@ void primTile16(unsigned char * baseAddr)
void DrawMultiBlur(void)
{
- long lABR,lDST;float fx,fy;
+ int lABR,lDST;
+ float fx,fy;
lABR=GlobalTextABR;
lDST=DrawSemiTrans;
@@ -2510,7 +2510,7 @@ void DrawMultiBlur(void)
void DrawMultiFilterSprite(void)
{
- long lABR,lDST;
+ int lABR,lDST;
if(bUseMultiPass || DrawSemiTrans || ubOpaqueDraw)
{
@@ -2541,7 +2541,7 @@ void DrawMultiFilterSprite(void)
void primSprt8(unsigned char * baseAddr)
{
- unsigned long *gpuData = ((unsigned long *) baseAddr);
+ uint32_t *gpuData = ((uint32_t *) baseAddr);
short *sgpuData = ((short *) baseAddr);
short s;
@@ -2662,7 +2662,7 @@ void primSprt8(unsigned char * baseAddr)
void primSprt16(unsigned char * baseAddr)
{
- unsigned long *gpuData = ((unsigned long *) baseAddr);
+ uint32_t *gpuData = ((uint32_t *) baseAddr);
short *sgpuData = ((short *) baseAddr);
short s;
@@ -2782,16 +2782,16 @@ void primSprt16(unsigned char * baseAddr)
void primSprtSRest(unsigned char * baseAddr,unsigned short type)
{
- unsigned long *gpuData = ((unsigned long *) baseAddr);
+ uint32_t *gpuData = ((uint32_t *)baseAddr);
short *sgpuData = ((short *) baseAddr);
- short s;unsigned short sTypeRest=0;
+ short s;
+ unsigned short sTypeRest=0;
sprtX = sgpuData[2];
sprtY = sgpuData[3];
sprtW = sgpuData[6] & 0x3ff;
sprtH = sgpuData[7] & 0x1ff;
-
// do texture stuff
switch(type)
{
@@ -2953,10 +2953,11 @@ void primSprtSRest(unsigned char * baseAddr,unsigned short type)
void primSprtS(unsigned char * baseAddr)
{
- unsigned long *gpuData = ((unsigned long *) baseAddr);
+ uint32_t *gpuData = ((uint32_t *) baseAddr);
short *sgpuData = ((short *) baseAddr);
- short s;unsigned short sTypeRest=0;
+ short s;
+ unsigned short sTypeRest=0;
sprtX = sgpuData[2];
sprtY = sgpuData[3];
@@ -3092,7 +3093,7 @@ void primSprtS(unsigned char * baseAddr)
void primPolyF4(unsigned char *baseAddr)
{
- unsigned long *gpuData = ((unsigned long *) baseAddr);
+ uint32_t *gpuData = ((uint32_t *) baseAddr);
short *sgpuData = ((short *) baseAddr);
lx0 = sgpuData[2];
@@ -3187,12 +3188,12 @@ BOOL bCheckFF9G4(unsigned char * baseAddr)
if(iFF9Fix==2)
{
- long labr=GlobalTextABR;
- GlobalTextABR=1;
+ int labr=GlobalTextABR;
+ GlobalTextABR = 1;
primPolyG4(pFF9G4Cache);
- GlobalTextABR=labr;
+ GlobalTextABR = labr;
}
- iFF9Fix=0;
+ iFF9Fix = 0;
return FALSE;
}
@@ -3201,8 +3202,8 @@ BOOL bCheckFF9G4(unsigned char * baseAddr)
void primPolyG4(unsigned char * baseAddr)
{
- unsigned long *gpuData = (unsigned long *)baseAddr;
- short *sgpuData = ((short *) baseAddr);
+ uint32_t *gpuData = (uint32_t *)baseAddr;
+ short *sgpuData = ((short *)baseAddr);
lx0 = sgpuData[2];
ly0 = sgpuData[3];
@@ -3252,7 +3253,7 @@ void primPolyG4(unsigned char * baseAddr)
// cmd: flat shaded Texture3
////////////////////////////////////////////////////////////////////////
-BOOL DoLineCheck(unsigned long * gpuData)
+BOOL DoLineCheck(uint32_t *gpuData)
{
BOOL bQuad=FALSE;short dx,dy;
@@ -3419,7 +3420,7 @@ BOOL DoLineCheck(unsigned long * gpuData)
void primPolyFT3(unsigned char * baseAddr)
{
- unsigned long *gpuData = ((unsigned long *) baseAddr);
+ uint32_t *gpuData = ((uint32_t *) baseAddr);
short *sgpuData = ((short *) baseAddr);
lx0 = sgpuData[2];
@@ -3855,7 +3856,7 @@ void RectTexAlign(void)
void primPolyFT4(unsigned char * baseAddr)
{
- unsigned long *gpuData = ((unsigned long *) baseAddr);
+ uint32_t *gpuData = ((uint32_t *)baseAddr);
short *sgpuData = ((short *) baseAddr);
lx0 = sgpuData[2];
@@ -3942,7 +3943,7 @@ void primPolyFT4(unsigned char * baseAddr)
void primPolyGT3(unsigned char *baseAddr)
{
- unsigned long *gpuData = ((unsigned long *) baseAddr);
+ uint32_t *gpuData = ((uint32_t *) baseAddr);
short *sgpuData = ((short *) baseAddr);
lx0 = sgpuData[2];
@@ -4051,7 +4052,7 @@ void primPolyGT3(unsigned char *baseAddr)
void primPolyG3(unsigned char *baseAddr)
{
- unsigned long *gpuData = ((unsigned long *) baseAddr);
+ uint32_t *gpuData = ((uint32_t *)baseAddr);
short *sgpuData = ((short *) baseAddr);
lx0 = sgpuData[2];
@@ -4096,8 +4097,8 @@ void primPolyG3(unsigned char *baseAddr)
void primPolyGT4(unsigned char *baseAddr)
{
- unsigned long *gpuData = ((unsigned long *) baseAddr);
- short *sgpuData = ((short *) baseAddr);
+ uint32_t *gpuData = ((uint32_t *)baseAddr);
+ short *sgpuData = ((short *)baseAddr);
lx0 = sgpuData[2];
ly0 = sgpuData[3];
@@ -4216,7 +4217,7 @@ void primPolyGT4(unsigned char *baseAddr)
void primPolyF3(unsigned char *baseAddr)
{
- unsigned long *gpuData = ((unsigned long *) baseAddr);
+ uint32_t *gpuData = ((uint32_t *) baseAddr);
short *sgpuData = ((short *) baseAddr);
lx0 = sgpuData[2];
@@ -4260,7 +4261,7 @@ void primPolyF3(unsigned char *baseAddr)
void primLineGSkip(unsigned char *baseAddr)
{
- unsigned long *gpuData = ((unsigned long *) baseAddr);
+ uint32_t *gpuData = ((uint32_t *) baseAddr);
short *sgpuData = ((short *) baseAddr);
int iMax=255;
int i=2;
@@ -4285,7 +4286,7 @@ void primLineGSkip(unsigned char *baseAddr)
void primLineGEx(unsigned char *baseAddr)
{
- unsigned long *gpuData = ((unsigned long *) baseAddr);
+ uint32_t *gpuData = ((uint32_t *) baseAddr);
int iMax=255;
short cx0,cx1,cy0,cy1;int i;BOOL bDraw=TRUE;
@@ -4349,7 +4350,7 @@ void primLineGEx(unsigned char *baseAddr)
void primLineG2(unsigned char *baseAddr)
{
- unsigned long *gpuData = ((unsigned long *) baseAddr);
+ uint32_t *gpuData = ((uint32_t *) baseAddr);
short *sgpuData = ((short *) baseAddr);
lx0 = sgpuData[2];
@@ -4394,7 +4395,7 @@ void primLineG2(unsigned char *baseAddr)
void primLineFSkip(unsigned char *baseAddr)
{
- unsigned long *gpuData = ((unsigned long *) baseAddr);
+ uint32_t *gpuData = ((uint32_t *) baseAddr);
int i=2,iMax=255;
ly1 = (short)((gpuData[1]>>16) & 0xffff);
@@ -4414,7 +4415,7 @@ void primLineFSkip(unsigned char *baseAddr)
void primLineFEx(unsigned char *baseAddr)
{
- unsigned long *gpuData = ((unsigned long *) baseAddr);
+ uint32_t *gpuData = ((uint32_t *) baseAddr);
int iMax;
short cx0,cx1,cy0,cy1;int i;
@@ -4472,7 +4473,7 @@ void primLineFEx(unsigned char *baseAddr)
void primLineF2(unsigned char *baseAddr)
{
- unsigned long *gpuData = ((unsigned long *) baseAddr);
+ uint32_t *gpuData = ((uint32_t *) baseAddr);
short *sgpuData = ((short *) baseAddr);
lx0 = sgpuData[2];
diff --git a/plugins/peopsxgl/prim.h b/plugins/peopsxgl/prim.h
index 3515169d..e10f1ade 100644
--- a/plugins/peopsxgl/prim.h
+++ b/plugins/peopsxgl/prim.h
@@ -19,8 +19,8 @@
#ifndef _PRIMDRAW_H_
#define _PRIMDRAW_H_
-void UploadScreen (long Position);
-void PrepareFullScreenUpload (long Position);
+void UploadScreen (int Position);
+void PrepareFullScreenUpload (int Position);
BOOL CheckAgainstScreen(short imageX0,short imageY0,short imageX1,short imageY1);
BOOL CheckAgainstFrontScreen(short imageX0,short imageY0,short imageX1,short imageY1);
BOOL FastCheckAgainstScreen(short imageX0,short imageY0,short imageX1,short imageY1);
diff --git a/plugins/peopsxgl/soft.c b/plugins/peopsxgl/soft.c
index 7136aef6..2b1e5e73 100644
--- a/plugins/peopsxgl/soft.c
+++ b/plugins/peopsxgl/soft.c
@@ -23,7 +23,7 @@
#include "externals.h"
#include "soft.h"
-int iDither=0;
+int iDither = 0;
////////////////////////////////////////////////////////////////////////////////////
// "NO EDGE BUFFER" POLY VERSION... FUNCS BASED ON FATMAP.TXT FROM MRI / Doomsday
@@ -81,14 +81,14 @@ int iDither=0;
// soft globals
////////////////////////////////////////////////////////////////////////////////////
-short g_m1=255,g_m2=255,g_m3=255;
-short DrawSemiTrans=FALSE;
+short g_m1 = 255, g_m2 = 255, g_m3 = 255;
+short DrawSemiTrans = FALSE;
short Ymin;
short Ymax;
-short ly0,lx0,ly1,lx1,ly2,lx2,ly3,lx3; // global psx vertex coords
-long GlobalTextAddrX,GlobalTextAddrY,GlobalTextTP;
-long GlobalTextREST,GlobalTextABR,GlobalTextPAGE;
+short ly0, lx0, ly1, lx1, ly2, lx2, ly3, lx3; // global psx vertex coords
+int GlobalTextAddrX, GlobalTextAddrY, GlobalTextTP;
+int GlobalTextREST, GlobalTextABR, GlobalTextPAGE;
////////////////////////////////////////////////////////////////////////
// POLYGON OFFSET FUNCS
@@ -205,15 +205,15 @@ unsigned char dithertable[16] =
4, 3, 5, 2
};
-void Dither16(unsigned short * pdest,unsigned long r,unsigned long g,unsigned long b,unsigned short sM)
+void Dither16(unsigned short *pdest, uint32_t r, uint32_t g, uint32_t b, unsigned short sM)
{
unsigned char coeff;
unsigned char rlow, glow, blow;
- int x,y;
+ int x, y;
- x=pdest-psxVuw;
- y=x>>10;
- x-=(y<<10);
+ x = pdest - psxVuw;
+ y = x >> 10;
+ x -= (y << 10);
coeff = dithertable[(y&3)*4+(x&3)];
@@ -231,16 +231,14 @@ void Dither16(unsigned short * pdest,unsigned long r,unsigned long g,unsigned lo
}
/////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////
-__inline void GetShadeTransCol_Dither(unsigned short * pdest,long m1,long m2,long m3)
+__inline void GetShadeTransCol_Dither(unsigned short *pdest, int m1, int m2, int m3)
{
- long r,g,b;
+ int r,g,b;
- if(bCheckMask && *pdest&0x8000) return;
+ if (bCheckMask && *pdest & 0x8000) return;
- if(DrawSemiTrans)
+ if (DrawSemiTrans)
{
r=((XCOL1D(*pdest))<<3);
b=((XCOL2D(*pdest))<<3);
@@ -304,7 +302,7 @@ __inline void GetShadeTransCol(unsigned short * pdest,unsigned short color)
if(DrawSemiTrans)
{
- long r,g,b;
+ int r,g,b;
if(GlobalTextABR==0)
{
@@ -357,12 +355,12 @@ __inline void GetShadeTransCol(unsigned short * pdest,unsigned short color)
////////////////////////////////////////////////////////////////////////
-__inline void GetShadeTransCol32(unsigned long * pdest,unsigned long color)
+__inline void GetShadeTransCol32(uint32_t *pdest, uint32_t color)
{
- if(DrawSemiTrans)
+ if (DrawSemiTrans)
{
- long r,g,b;
-
+ int r,g,b;
+
if(GlobalTextABR==0)
{
if(!bCheckMask)
@@ -384,13 +382,13 @@ __inline void GetShadeTransCol32(unsigned long * pdest,unsigned long color)
else
if(GlobalTextABR==2)
{
- long sr,sb,sg,src,sbc,sgc,c;
+ int sr,sb,sg,src,sbc,sgc,c;
src=XCOL1(color);sbc=XCOL2(color);sgc=XCOL3(color);
c=(*pdest)>>16;
sr=(XCOL1(c))-src; if(sr&0x8000) sr=0;
sb=(XCOL2(c))-sbc; if(sb&0x8000) sb=0;
sg=(XCOL3(c))-sgc; if(sg&0x8000) sg=0;
- r=((long)sr)<<16;b=((long)sb)<<11;g=((long)sg)<<6;
+ r=((int)sr)<<16;b=((int)sb)<<11;g=((int)sg)<<6;
c=LOWORD(*pdest);
sr=(XCOL1(c))-src; if(sr&0x8000) sr=0;
sb=(XCOL2(c))-sbc; if(sb&0x8000) sb=0;
@@ -419,7 +417,7 @@ __inline void GetShadeTransCol32(unsigned long * pdest,unsigned long color)
if(bCheckMask)
{
- unsigned long ma=*pdest;
+ uint32_t ma=*pdest;
*pdest=(X32PSXCOL(r,g,b))|lSetMask;//0x80008000;
if(ma&0x80000000) *pdest=(ma&0xFFFF0000)|(*pdest&0xFFFF);
if(ma&0x00008000) *pdest=(ma&0xFFFF) |(*pdest&0xFFFF0000);
@@ -431,7 +429,7 @@ __inline void GetShadeTransCol32(unsigned long * pdest,unsigned long color)
{
if(bCheckMask)
{
- unsigned long ma=*pdest;
+ uint32_t ma=*pdest;
*pdest=color|lSetMask;//0x80008000;
if(ma&0x80000000) *pdest=(ma&0xFFFF0000)|(*pdest&0xFFFF);
if(ma&0x00008000) *pdest=(ma&0xFFFF) |(*pdest&0xFFFF0000);
@@ -446,7 +444,7 @@ __inline void GetShadeTransCol32(unsigned long * pdest,unsigned long color)
__inline void GetTextureTransColG(unsigned short * pdest,unsigned short color)
{
- long r,g,b;unsigned short l;
+ int r,g,b;unsigned short l;
if(color==0) return;
@@ -519,7 +517,7 @@ __inline void GetTextureTransColG(unsigned short * pdest,unsigned short color)
__inline void GetTextureTransColG_S(unsigned short * pdest,unsigned short color)
{
- long r,g,b;unsigned short l;
+ int r,g,b;unsigned short l;
if(color==0) return;
@@ -541,7 +539,7 @@ __inline void GetTextureTransColG_S(unsigned short * pdest,unsigned short color)
__inline void GetTextureTransColG_SPR(unsigned short * pdest,unsigned short color)
{
- long r,g,b;unsigned short l;
+ int r,g,b;unsigned short l;
if(color==0) return;
@@ -612,9 +610,9 @@ __inline void GetTextureTransColG_SPR(unsigned short * pdest,unsigned short colo
////////////////////////////////////////////////////////////////////////
-__inline void GetTextureTransColG32(unsigned long * pdest,unsigned long color)
+__inline void GetTextureTransColG32(uint32_t *pdest, uint32_t color)
{
- long r,g,b,l;
+ int r,g,b,l;
if(color==0) return;
@@ -638,7 +636,7 @@ __inline void GetTextureTransColG32(unsigned long * pdest,unsigned long color)
else
if(GlobalTextABR==2)
{
- long t;
+ int t;
r=(((((X32COL1(color)))* g_m1)&0xFF80FF80)>>7);
t=(*pdest&0x001f0000)-(r&0x003f0000); if(t&0x80000000) t=0;
r=(*pdest&0x0000001f)-(r&0x0000003f); if(r&0x80000000) r=0;
@@ -697,7 +695,7 @@ __inline void GetTextureTransColG32(unsigned long * pdest,unsigned long color)
if(bCheckMask)
{
- unsigned long ma=*pdest;
+ uint32_t ma=*pdest;
*pdest=(X32PSXCOL(r,g,b))|l;
@@ -716,9 +714,9 @@ __inline void GetTextureTransColG32(unsigned long * pdest,unsigned long color)
////////////////////////////////////////////////////////////////////////
-__inline void GetTextureTransColG32_S(unsigned long * pdest,unsigned long color)
+__inline void GetTextureTransColG32_S(uint32_t *pdest, uint32_t color)
{
- long r,g,b;
+ int r,g,b;
if(color==0) return;
@@ -741,10 +739,10 @@ __inline void GetTextureTransColG32_S(unsigned long * pdest,unsigned long color)
////////////////////////////////////////////////////////////////////////
-__inline void GetTextureTransColG32_SPR(unsigned long * pdest,unsigned long color)
+__inline void GetTextureTransColG32_SPR(uint32_t *pdest, uint32_t color)
{
- long r,g,b;
-
+ int r,g,b;
+
if(color==0) return;
if(DrawSemiTrans && (color&0x80008000))
@@ -765,7 +763,7 @@ __inline void GetTextureTransColG32_SPR(unsigned long * pdest,unsigned long colo
else
if(GlobalTextABR==2)
{
- long t;
+ int t;
r=(((((X32COL1(color)))* g_m1)&0xFF80FF80)>>7);
t=(*pdest&0x001f0000)-(r&0x003f0000); if(t&0x80000000) t=0;
r=(*pdest&0x0000001f)-(r&0x0000003f); if(r&0x80000000) r=0;
@@ -824,7 +822,7 @@ __inline void GetTextureTransColG32_SPR(unsigned long * pdest,unsigned long colo
if(bCheckMask)
{
- unsigned long ma=*pdest;
+ uint32_t ma=*pdest;
*pdest=(X32PSXCOL(r,g,b))|lSetMask|(color&0x80008000);
@@ -843,9 +841,9 @@ __inline void GetTextureTransColG32_SPR(unsigned long * pdest,unsigned long colo
////////////////////////////////////////////////////////////////////////
-__inline void GetTextureTransColGX_Dither(unsigned short * pdest,unsigned short color,long m1,long m2,long m3)
+__inline void GetTextureTransColGX_Dither(unsigned short * pdest, unsigned short color, int m1, int m2, int m3)
{
- long r,g,b;
+ int r,g,b;
if(color==0) return;
@@ -916,7 +914,7 @@ __inline void GetTextureTransColGX_Dither(unsigned short * pdest,unsigned short
__inline void GetTextureTransColGX(unsigned short * pdest,unsigned short color,short m1,short m2,short m3)
{
- long r,g,b;unsigned short l;
+ int r,g,b;unsigned short l;
if(color==0) return;
@@ -988,7 +986,7 @@ __inline void GetTextureTransColGX(unsigned short * pdest,unsigned short color,s
__inline void GetTextureTransColGX_S(unsigned short * pdest,unsigned short color,short m1,short m2,short m3)
{
- long r,g,b;
+ int r,g,b;
if(color==0) return;
@@ -1005,9 +1003,9 @@ __inline void GetTextureTransColGX_S(unsigned short * pdest,unsigned short color
////////////////////////////////////////////////////////////////////////
-__inline void GetTextureTransColGX32_S(unsigned long * pdest,unsigned long color,short m1,short m2,short m3)
+__inline void GetTextureTransColGX32_S(uint32_t *pdest, uint32_t color, short m1, short m2, short m3)
{
- long r,g,b;
+ int r,g,b;
if(color==0) return;
@@ -1093,11 +1091,11 @@ readdatamem 0x00008000 1
}
else // fast fill
{
- unsigned long *DSTPtr;
+ uint32_t *DSTPtr;
unsigned short LineOffset;
- unsigned long lcol=lSetMask|(((unsigned long)(col))<<16)|col;
+ uint32_t lcol=lSetMask|(((uint32_t)(col))<<16)|col;
dx>>=1;
- DSTPtr = (unsigned long *)(psxVuw + (1024*y0) + x0);
+ DSTPtr = (uint32_t *)(psxVuw + (1024*y0) + x0);
LineOffset = 512 - dx;
if(!bCheckMask && !DrawSemiTrans)
@@ -1153,11 +1151,11 @@ void FillSoftwareArea(short x0,short y0,short x1, // FILL AREA (BLK FILL)
}
else
{
- unsigned long *DSTPtr;
+ uint32_t *DSTPtr;
unsigned short LineOffset;
- unsigned long lcol=(((long)col)<<16)|col;
+ uint32_t lcol=(((int)col)<<16)|col;
dx>>=1;
- DSTPtr = (unsigned long *)(psxVuw + (1024*y0) + x0);
+ DSTPtr = (uint32_t *)(psxVuw + (1024*y0) + x0);
LineOffset = 512 - dx;
for(i=0;i<dy;i++)
@@ -1169,18 +1167,14 @@ void FillSoftwareArea(short x0,short y0,short x1, // FILL AREA (BLK FILL)
}
////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////
// EDGE INTERPOLATION
////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////
-
+
typedef struct SOFTVTAG
{
int x,y;
int u,v;
- long R,G,B;
+ int R,G,B;
} soft_vertex;
static soft_vertex vtx[4];
@@ -1374,10 +1368,9 @@ __inline BOOL NextRow_G(void)
return FALSE;
}
-__inline BOOL SetupSections_G(short x1,short y1,short x2,short y2,short x3,short y3,long rgb1, long rgb2, long rgb3)
-{
- soft_vertex * v1, * v2, * v3;
- int height,longest,temp;
+__inline BOOL SetupSections_G(short x1,short y1,short x2,short y2,short x3,short y3, int rgb1, int rgb2, int rgb3){
+ soft_vertex *v1, *v2, *v3;
+ int height, longest, temp;
v1 = vtx; v1->x=x1<<16;v1->y=y1;
v1->R=(rgb1) & 0x00ff0000;
@@ -1662,7 +1655,7 @@ __inline BOOL NextRow_GT(void)
return FALSE;
}
-__inline BOOL SetupSections_GT(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, long rgb1, long rgb2, long rgb3)
+__inline BOOL SetupSections_GT(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, int rgb1, int rgb2, int rgb3)
{
soft_vertex * v1, * v2, * v3;
int height,longest,temp;
@@ -2285,7 +2278,7 @@ __inline BOOL NextRow_GT4(void)
return FALSE;
}
-__inline BOOL SetupSections_GT4(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,long rgb1,long rgb2,long rgb3,long rgb4)
+__inline BOOL SetupSections_GT4(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4, int rgb1, int rgb2, int rgb3, int rgb4)
{
soft_vertex * v1, * v2, * v3, * v4;
int height,width,longest1,longest2;
@@ -2451,10 +2444,11 @@ __inline BOOL SetupSections_GT4(short x1, short y1, short x2, short y2, short x3
// POLY 3/4 FLAT SHADED
////////////////////////////////////////////////////////////////////////
-__inline void drawPoly3Fi(short x1,short y1,short x2,short y2,short x3,short y3,long rgb)
+__inline void drawPoly3Fi(short x1, short y1, short x2, short y2, short x3, short y3, int rgb)
{
int i,j,xmin,xmax,ymin,ymax;
- unsigned short color;unsigned long lcolor;
+ unsigned short color;
+ uint32_t lcolor;
if(x1>drawW && x2>drawW && x3>drawW) return;
if(y1>drawH && y2>drawH && y3>drawH) return;
@@ -2468,7 +2462,7 @@ __inline void drawPoly3Fi(short x1,short y1,short x2,short y2,short x3,short y3,
ymax=Ymax;
color = ((rgb & 0x00f80000)>>9) | ((rgb & 0x0000f800)>>6) | ((rgb & 0x000000f8)>>3);
- lcolor=lSetMask|(((unsigned long)(color))<<16)|color;
+ lcolor=lSetMask|(((uint32_t)(color))<<16)|color;
for(ymin=Ymin;ymin<drawY;ymin++)
if(NextRow_F()) return;
@@ -2485,7 +2479,7 @@ __inline void drawPoly3Fi(short x1,short y1,short x2,short y2,short x3,short y3,
for(j=xmin;j<xmax;j+=2)
{
- *((unsigned long *)&psxVuw[(i<<10)+j])=lcolor;
+ *((uint32_t *)&psxVuw[(i<<10)+j])=lcolor;
}
if(j==xmax) psxVuw[(i<<10)+j]=color;
@@ -2503,10 +2497,10 @@ __inline void drawPoly3Fi(short x1,short y1,short x2,short y2,short x3,short y3,
for(j=xmin;j<xmax;j+=2)
{
- GetShadeTransCol32((unsigned long *)&psxVuw[(i<<10)+j],lcolor);
+ GetShadeTransCol32((uint32_t *)&psxVuw[(i<<10)+j], lcolor);
}
- if(j==xmax)
- GetShadeTransCol(&psxVuw[(i<<10)+j],color);
+ if(j == xmax)
+ GetShadeTransCol(&psxVuw[(i << 10) + j],color);
if(NextRow_F()) return;
}
@@ -2514,14 +2508,14 @@ __inline void drawPoly3Fi(short x1,short y1,short x2,short y2,short x3,short y3,
////////////////////////////////////////////////////////////////////////
-void drawPoly3F(long rgb)
+void drawPoly3F(int rgb)
{
drawPoly3Fi(lx0,ly0,lx1,ly1,lx2,ly2,rgb);
}
#ifdef POLYQUAD3FS
-void drawPoly4F_TRI(long rgb)
+void drawPoly4F_TRI(int rgb)
{
drawPoly3Fi(lx1,ly1,lx3,ly3,lx2,ly2,rgb);
drawPoly3Fi(lx0,ly0,lx1,ly1,lx2,ly2,rgb);
@@ -2531,10 +2525,10 @@ void drawPoly4F_TRI(long rgb)
// more exact:
-void drawPoly4F(long rgb)
+void drawPoly4F(int rgb)
{
int i,j,xmin,xmax,ymin,ymax;
- unsigned short color;unsigned long lcolor;
+ unsigned short color;unsigned int lcolor;
if(lx0>drawW && lx1>drawW && lx2>drawW && lx3>drawW) return;
if(ly0>drawH && ly1>drawH && ly2>drawH && ly3>drawH) return;
@@ -2551,7 +2545,7 @@ void drawPoly4F(long rgb)
if(NextRow_F4()) return;
color = ((rgb & 0x00f80000)>>9) | ((rgb & 0x0000f800)>>6) | ((rgb & 0x000000f8)>>3);
- lcolor= lSetMask|(((unsigned long)(color))<<16)|color;
+ lcolor= lSetMask|(((uint32_t)(color))<<16)|color;
#ifdef FASTSOLID
@@ -2565,7 +2559,7 @@ void drawPoly4F(long rgb)
for(j=xmin;j<xmax;j+=2)
{
- *((unsigned long *)&psxVuw[(i<<10)+j])=lcolor;
+ *((uint32_t *)&psxVuw[(i<<10)+j])=lcolor;
}
if(j==xmax) psxVuw[(i<<10)+j]=color;
@@ -2576,16 +2570,16 @@ void drawPoly4F(long rgb)
#endif
- for (i=ymin;i<=ymax;i++)
+ for (i = ymin; i <= ymax; i++)
{
- xmin=left_x >> 16; if(drawX>xmin) xmin=drawX;
- xmax=(right_x >> 16)-1; if(drawW<xmax) xmax=drawW;
+ xmin = left_x >> 16; if(drawX > xmin) xmin = drawX;
+ xmax = (right_x >> 16) - 1; if(drawW < xmax) xmax = drawW;
- for(j=xmin;j<xmax;j+=2)
+ for(j = xmin; j < xmax; j += 2)
{
- GetShadeTransCol32((unsigned long *)&psxVuw[(i<<10)+j],lcolor);
+ GetShadeTransCol32((uint32_t *)&psxVuw[(i<<10) + j],lcolor);
}
- if(j==xmax) GetShadeTransCol(&psxVuw[(i<<10)+j],color);
+ if(j == xmax) GetShadeTransCol(&psxVuw[(i<<10) + j],color);
if(NextRow_F4()) return;
}
@@ -2598,31 +2592,31 @@ void drawPoly4F(long rgb)
void drawPoly3TEx4(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)
{
int i,j,xmin,xmax,ymin,ymax;
- long difX, difY,difX2, difY2;
- long posX,posY,YAdjust,XAdjust;
- long clutP;
+ int difX, difY,difX2, difY2;
+ int posX,posY,YAdjust,XAdjust;
+ int clutP;
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 (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_FT(x1,y1,x2,y2,x3,y3,tx1,ty1,tx2,ty2,tx3,ty3)) return;
+ if (!SetupSections_FT(x1,y1,x2,y2,x3,y3,tx1,ty1,tx2,ty2,tx3,ty3)) return;
- ymax=Ymax;
+ ymax = Ymax;
- for(ymin=Ymin;ymin<drawY;ymin++)
- if(NextRow_FT()) return;
+ for (ymin = Ymin; ymin < drawY; ymin++)
+ if (NextRow_FT()) return;
- clutP=(clY<<10)+clX;
+ clutP = (clY << 10) + clX;
- YAdjust=((GlobalTextAddrY)<<11)+(GlobalTextAddrX<<1);
+ YAdjust = ((GlobalTextAddrY) << 11) + (GlobalTextAddrX << 1);
- difX=delta_right_u;difX2=difX<<1;
- difY=delta_right_v;difY2=difY<<1;
+ difX = delta_right_u; difX2 = difX << 1;
+ difY = delta_right_v; difY2 = difY << 1;
#ifdef FASTSOLID
@@ -2652,9 +2646,9 @@ void drawPoly3TEx4(short x1, short y1, short x2, short y2, short x3, short y3, s
(XAdjust>>1)];
tC2=(tC2>>((XAdjust&1)<<2))&0xf;
- GetTextureTransColG32_S((unsigned long *)&psxVuw[(i<<10)+j],
+ GetTextureTransColG32_S((uint32_t *)&psxVuw[(i<<10)+j],
psxVuw[clutP+tC1]|
- ((long)psxVuw[clutP+tC2])<<16);
+ ((int)psxVuw[clutP+tC2])<<16);
posX+=difX2;
posY+=difY2;
@@ -2702,9 +2696,9 @@ void drawPoly3TEx4(short x1, short y1, short x2, short y2, short x3, short y3, s
(XAdjust>>1)];
tC2=(tC2>>((XAdjust&1)<<2))&0xf;
- GetTextureTransColG32((unsigned long *)&psxVuw[(i<<10)+j],
+ GetTextureTransColG32((uint32_t *)&psxVuw[(i<<10)+j],
psxVuw[clutP+tC1]|
- ((long)psxVuw[clutP+tC2])<<16);
+ ((int)psxVuw[clutP+tC2])<<16);
posX+=difX2;
posY+=difY2;
@@ -2730,9 +2724,9 @@ void drawPoly3TEx4(short x1, short y1, short x2, short y2, short x3, short y3, s
void drawPoly3TEx4_IL(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)
{
int i,j,xmin,xmax,ymin,ymax,n_xi,n_yi,TXV;
- long difX, difY,difX2, difY2;
- long posX,posY,YAdjust,XAdjust;
- long clutP;
+ int difX, difY,difX2, difY2;
+ int posX,posY,YAdjust,XAdjust;
+ int clutP;
short tC1,tC2;
if(x1>drawW && x2>drawW && x3>drawW) return;
@@ -2792,9 +2786,9 @@ void drawPoly3TEx4_IL(short x1, short y1, short x2, short y2, short x3, short y3
tC2= (psxVuw[(n_yi<<10)+YAdjust+n_xi] >> ((XAdjust & 0x03)<<2)) & 0x0f ;
- GetTextureTransColG32_S((unsigned long *)&psxVuw[(i<<10)+j],
+ GetTextureTransColG32_S((uint32_t *)&psxVuw[(i<<10)+j],
psxVuw[clutP+tC1]|
- ((long)psxVuw[clutP+tC2])<<16);
+ ((int)psxVuw[clutP+tC2])<<16);
posX+=difX2;
posY+=difY2;
@@ -2854,9 +2848,9 @@ void drawPoly3TEx4_IL(short x1, short y1, short x2, short y2, short x3, short y3
tC2= (psxVuw[(n_yi<<10)+YAdjust+n_xi] >> ((XAdjust & 0x03)<<2)) & 0x0f ;
- GetTextureTransColG32((unsigned long *)&psxVuw[(i<<10)+j],
+ GetTextureTransColG32((uint32_t *)&psxVuw[(i<<10)+j],
psxVuw[clutP+tC1]|
- ((long)psxVuw[clutP+tC2])<<16);
+ ((int)psxVuw[clutP+tC2])<<16);
posX+=difX2;
posY+=difY2;
@@ -2886,9 +2880,9 @@ void drawPoly3TEx4_IL(short x1, short y1, short x2, short y2, short x3, short y3
void drawPoly3TEx4_TW(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)
{
int i,j,xmin,xmax,ymin,ymax;
- long difX, difY,difX2, difY2;
- long posX,posY,YAdjust,XAdjust;
- long clutP;
+ int difX, difY,difX2, difY2;
+ int posX,posY,YAdjust,XAdjust;
+ int clutP;
short tC1,tC2;
if(x1>drawW && x2>drawW && x3>drawW) return;
@@ -2944,9 +2938,9 @@ void drawPoly3TEx4_TW(short x1, short y1, short x2, short y2, short x3, short y3
YAdjust+(XAdjust>>1)];
tC2=(tC2>>((XAdjust&1)<<2))&0xf;
- GetTextureTransColG32_S((unsigned long *)&psxVuw[(i<<10)+j],
+ GetTextureTransColG32_S((uint32_t *)&psxVuw[(i << 10) + j],
psxVuw[clutP+tC1]|
- ((long)psxVuw[clutP+tC2])<<16);
+ ((int)psxVuw[clutP+tC2])<<16);
posX+=difX2;
posY+=difY2;
@@ -2995,9 +2989,9 @@ void drawPoly3TEx4_TW(short x1, short y1, short x2, short y2, short x3, short y3
YAdjust+(XAdjust>>1)];
tC2=(tC2>>((XAdjust&1)<<2))&0xf;
- GetTextureTransColG32((unsigned long *)&psxVuw[(i<<10)+j],
+ GetTextureTransColG32((uint32_t *)&psxVuw[(i<<10)+j],
psxVuw[clutP+tC1]|
- ((long)psxVuw[clutP+tC2])<<16);
+ ((int)psxVuw[clutP+tC2])<<16);
posX+=difX2;
posY+=difY2;
@@ -3038,10 +3032,10 @@ void drawPoly4TEx4_TRI(short x1, short y1, short x2, short y2, short x3, short y
void drawPoly4TEx4(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,short clX, short clY)
{
- long num;
- long i,j,xmin,xmax,ymin,ymax;
- long difX, difY, difX2, difY2;
- long posX,posY,YAdjust,clutP,XAdjust;
+ int num;
+ int i,j,xmin,xmax,ymin,ymax;
+ int difX, difY, difX2, difY2;
+ int posX,posY,YAdjust,clutP,XAdjust;
short tC1,tC2;
if(x1>drawW && x2>drawW && x3>drawW && x4>drawW) return;
@@ -3097,9 +3091,9 @@ void drawPoly4TEx4(short x1, short y1, short x2, short y2, short x3, short y3, s
(XAdjust>>1)];
tC2=(tC2>>((XAdjust&1)<<2))&0xf;
- GetTextureTransColG32_S((unsigned long *)&psxVuw[(i<<10)+j],
+ GetTextureTransColG32_S((uint32_t *)&psxVuw[(i<<10)+j],
psxVuw[clutP+tC1]|
- ((long)psxVuw[clutP+tC2])<<16);
+ ((int)psxVuw[clutP+tC2])<<16);
posX+=difX2;
posY+=difY2;
}
@@ -3151,9 +3145,9 @@ void drawPoly4TEx4(short x1, short y1, short x2, short y2, short x3, short y3, s
(XAdjust>>1)];
tC2=(tC2>>((XAdjust&1)<<2))&0xf;
- GetTextureTransColG32((unsigned long *)&psxVuw[(i<<10)+j],
+ GetTextureTransColG32((uint32_t *)&psxVuw[(i<<10)+j],
psxVuw[clutP+tC1]|
- ((long)psxVuw[clutP+tC2])<<16);
+ ((int)psxVuw[clutP+tC2])<<16);
posX+=difX2;
posY+=difY2;
}
@@ -3174,10 +3168,10 @@ void drawPoly4TEx4(short x1, short y1, short x2, short y2, short x3, short y3, s
void drawPoly4TEx4_IL(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,short clX, short clY)
{
- long num;
- long i,j,xmin,xmax,ymin,ymax,n_xi,n_yi,TXV;
- long difX, difY, difX2, difY2;
- long posX,posY,YAdjust,clutP,XAdjust;
+ int num;
+ int i,j,xmin,xmax,ymin,ymax,n_xi,n_yi,TXV;
+ int difX, difY, difX2, difY2;
+ int posX,posY,YAdjust,clutP,XAdjust;
short tC1,tC2;
if(x1>drawW && x2>drawW && x3>drawW && x4>drawW) return;
@@ -3241,9 +3235,9 @@ void drawPoly4TEx4_IL(short x1, short y1, short x2, short y2, short x3, short y3
tC2= (psxVuw[(n_yi<<10)+YAdjust+n_xi] >> ((XAdjust & 0x03)<<2)) & 0x0f ;
- GetTextureTransColG32_S((unsigned long *)&psxVuw[(i<<10)+j],
+ GetTextureTransColG32_S((uint32_t *)&psxVuw[(i<<10)+j],
psxVuw[clutP+tC1]|
- ((long)psxVuw[clutP+tC2])<<16);
+ ((int)psxVuw[clutP+tC2])<<16);
posX+=difX2;
posY+=difY2;
}
@@ -3307,9 +3301,9 @@ void drawPoly4TEx4_IL(short x1, short y1, short x2, short y2, short x3, short y3
tC2= (psxVuw[(n_yi<<10)+YAdjust+n_xi] >> ((XAdjust & 0x03)<<2)) & 0x0f ;
- GetTextureTransColG32((unsigned long *)&psxVuw[(i<<10)+j],
+ GetTextureTransColG32((uint32_t *)&psxVuw[(i<<10)+j],
psxVuw[clutP+tC1]|
- ((long)psxVuw[clutP+tC2])<<16);
+ ((int)psxVuw[clutP+tC2])<<16);
posX+=difX2;
posY+=difY2;
}
@@ -3333,10 +3327,10 @@ void drawPoly4TEx4_IL(short x1, short y1, short x2, short y2, short x3, short y3
void drawPoly4TEx4_TW(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,short clX, short clY)
{
- long num;
- long i,j,xmin,xmax,ymin,ymax;
- long difX, difY, difX2, difY2;
- long posX,posY,YAdjust,clutP,XAdjust;
+ int num;
+ int i,j,xmin,xmax,ymin,ymax;
+ int difX, difY, difX2, difY2;
+ int posX,posY,YAdjust,clutP,XAdjust;
short tC1,tC2;
if(x1>drawW && x2>drawW && x3>drawW && x4>drawW) return;
@@ -3394,9 +3388,9 @@ void drawPoly4TEx4_TW(short x1, short y1, short x2, short y2, short x3, short y3
YAdjust+(XAdjust>>1)];
tC2=(tC2>>((XAdjust&1)<<2))&0xf;
- GetTextureTransColG32_S((unsigned long *)&psxVuw[(i<<10)+j],
+ GetTextureTransColG32_S((uint32_t *)&psxVuw[(i<<10)+j],
psxVuw[clutP+tC1]|
- ((long)psxVuw[clutP+tC2])<<16);
+ ((int)psxVuw[clutP+tC2])<<16);
posX+=difX2;
posY+=difY2;
}
@@ -3448,9 +3442,9 @@ void drawPoly4TEx4_TW(short x1, short y1, short x2, short y2, short x3, short y3
YAdjust+(XAdjust>>1)];
tC2=(tC2>>((XAdjust&1)<<2))&0xf;
- GetTextureTransColG32((unsigned long *)&psxVuw[(i<<10)+j],
+ GetTextureTransColG32((uint32_t *)&psxVuw[(i<<10)+j],
psxVuw[clutP+tC1]|
- ((long)psxVuw[clutP+tC2])<<16);
+ ((int)psxVuw[clutP+tC2])<<16);
posX+=difX2;
posY+=difY2;
}
@@ -3471,10 +3465,10 @@ void drawPoly4TEx4_TW(short x1, short y1, short x2, short y2, short x3, short y3
void drawPoly4TEx4_TW_S(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,short clX, short clY)
{
- long num;
- long i,j,xmin,xmax,ymin,ymax;
- long difX, difY, difX2, difY2;
- long posX,posY,YAdjust,clutP,XAdjust;
+ int num;
+ int i,j,xmin,xmax,ymin,ymax;
+ int difX, difY, difX2, difY2;
+ int posX,posY,YAdjust,clutP,XAdjust;
short tC1,tC2;
if(x1>drawW && x2>drawW && x3>drawW && x4>drawW) return;
@@ -3532,9 +3526,9 @@ void drawPoly4TEx4_TW_S(short x1, short y1, short x2, short y2, short x3, short
YAdjust+(XAdjust>>1)];
tC2=(tC2>>((XAdjust&1)<<2))&0xf;
- GetTextureTransColG32_S((unsigned long *)&psxVuw[(i<<10)+j],
+ GetTextureTransColG32_S((uint32_t *)&psxVuw[(i<<10)+j],
psxVuw[clutP+tC1]|
- ((long)psxVuw[clutP+tC2])<<16);
+ ((int)psxVuw[clutP+tC2])<<16);
posX+=difX2;
posY+=difY2;
}
@@ -3586,9 +3580,9 @@ void drawPoly4TEx4_TW_S(short x1, short y1, short x2, short y2, short x3, short
YAdjust+(XAdjust>>1)];
tC2=(tC2>>((XAdjust&1)<<2))&0xf;
- GetTextureTransColG32_SPR((unsigned long *)&psxVuw[(i<<10)+j],
+ GetTextureTransColG32_SPR((uint32_t *)&psxVuw[(i<<10)+j],
psxVuw[clutP+tC1]|
- ((long)psxVuw[clutP+tC2])<<16);
+ ((int)psxVuw[clutP+tC2])<<16);
posX+=difX2;
posY+=difY2;
}
@@ -3611,8 +3605,8 @@ void drawPoly4TEx4_TW_S(short x1, short y1, short x2, short y2, short x3, short
void drawPoly3TEx8(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)
{
int i,j,xmin,xmax,ymin,ymax;
- long difX, difY,difX2, difY2;
- long posX,posY,YAdjust,clutP;
+ int difX, difY,difX2, difY2;
+ int posX,posY,YAdjust,clutP;
short tC1,tC2;
if(x1>drawW && x2>drawW && x3>drawW) return;
@@ -3659,9 +3653,9 @@ void drawPoly3TEx8(short x1, short y1, short x2, short y2, short x3, short y3, s
tC1 = psxVub[((posY>>5)&0xFFFFF800)+YAdjust+(posX>>16)];
tC2 = psxVub[(((posY+difY)>>5)&0xFFFFF800)+YAdjust+
((posX+difX)>>16)];
- GetTextureTransColG32_S((unsigned long *)&psxVuw[(i<<10)+j],
+ GetTextureTransColG32_S((uint32_t *)&psxVuw[(i<<10)+j],
psxVuw[clutP+tC1]|
- ((long)psxVuw[clutP+tC2])<<16);
+ ((int)psxVuw[clutP+tC2])<<16);
posX+=difX2;
posY+=difY2;
}
@@ -3701,9 +3695,9 @@ void drawPoly3TEx8(short x1, short y1, short x2, short y2, short x3, short y3, s
tC1 = psxVub[((posY>>5)&0xFFFFF800)+YAdjust+(posX>>16)];
tC2 = psxVub[(((posY+difY)>>5)&0xFFFFF800)+YAdjust+
((posX+difX)>>16)];
- GetTextureTransColG32((unsigned long *)&psxVuw[(i<<10)+j],
+ GetTextureTransColG32((uint32_t *)&psxVuw[(i<<10)+j],
psxVuw[clutP+tC1]|
- ((long)psxVuw[clutP+tC2])<<16);
+ ((int)psxVuw[clutP+tC2])<<16);
posX+=difX2;
posY+=difY2;
}
@@ -3727,8 +3721,8 @@ void drawPoly3TEx8(short x1, short y1, short x2, short y2, short x3, short y3, s
void drawPoly3TEx8_IL(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)
{
int i,j,xmin,xmax,ymin,ymax,n_xi,n_yi,TXV,TXU;
- long difX, difY,difX2, difY2;
- long posX,posY,YAdjust,clutP;
+ int difX, difY,difX2, difY2;
+ int posX,posY,YAdjust,clutP;
short tC1,tC2;
if(x1>drawW && x2>drawW && x3>drawW) return;
@@ -3786,9 +3780,9 @@ void drawPoly3TEx8_IL(short x1, short y1, short x2, short y2, short x3, short y3
tC2= (psxVuw[(n_yi<<10)+YAdjust+n_xi] >> ((TXU & 0x01)<<3)) & 0xff;
- GetTextureTransColG32_S((unsigned long *)&psxVuw[(i<<10)+j],
+ GetTextureTransColG32_S((uint32_t *)&psxVuw[(i<<10)+j],
psxVuw[clutP+tC1]|
- ((long)psxVuw[clutP+tC2])<<16);
+ ((int)psxVuw[clutP+tC2])<<16);
posX+=difX2;
posY+=difY2;
}
@@ -3845,9 +3839,9 @@ void drawPoly3TEx8_IL(short x1, short y1, short x2, short y2, short x3, short y3
tC2= (psxVuw[(n_yi<<10)+YAdjust+n_xi] >> ((TXU & 0x01)<<3)) & 0xff;
- GetTextureTransColG32((unsigned long *)&psxVuw[(i<<10)+j],
+ GetTextureTransColG32((uint32_t *)&psxVuw[(i<<10)+j],
psxVuw[clutP+tC1]|
- ((long)psxVuw[clutP+tC2])<<16);
+ ((int)psxVuw[clutP+tC2])<<16);
posX+=difX2;
posY+=difY2;
}
@@ -3877,8 +3871,8 @@ void drawPoly3TEx8_IL(short x1, short y1, short x2, short y2, short x3, short y3
void drawPoly3TEx8_TW(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)
{
int i,j,xmin,xmax,ymin,ymax;
- long difX, difY,difX2, difY2;
- long posX,posY,YAdjust,clutP;
+ int difX, difY,difX2, difY2;
+ int posX,posY,YAdjust,clutP;
short tC1,tC2;
if(x1>drawW && x2>drawW && x3>drawW) return;
@@ -3929,9 +3923,9 @@ void drawPoly3TEx8_TW(short x1, short y1, short x2, short y2, short x3, short y3
YAdjust+((posX>>16)%TWin.Position.x1)];
tC2 = psxVub[((((posY+difY)>>16)%TWin.Position.y1)<<11)+
YAdjust+(((posX+difX)>>16)%TWin.Position.x1)];
- GetTextureTransColG32_S((unsigned long *)&psxVuw[(i<<10)+j],
+ GetTextureTransColG32_S((uint32_t *)&psxVuw[(i<<10)+j],
psxVuw[clutP+tC1]|
- ((long)psxVuw[clutP+tC2])<<16);
+ ((int)psxVuw[clutP+tC2])<<16);
posX+=difX2;
posY+=difY2;
}
@@ -3973,9 +3967,9 @@ void drawPoly3TEx8_TW(short x1, short y1, short x2, short y2, short x3, short y3
YAdjust+((posX>>16)%TWin.Position.x1)];
tC2 = psxVub[((((posY+difY)>>16)%TWin.Position.y1)<<11)+
YAdjust+(((posX+difX)>>16)%TWin.Position.x1)];
- GetTextureTransColG32((unsigned long *)&psxVuw[(i<<10)+j],
+ GetTextureTransColG32((uint32_t *)&psxVuw[(i<<10)+j],
psxVuw[clutP+tC1]|
- ((long)psxVuw[clutP+tC2])<<16);
+ ((int)psxVuw[clutP+tC2])<<16);
posX+=difX2;
posY+=difY2;
}
@@ -4016,10 +4010,10 @@ void drawPoly4TEx8_TRI(short x1, short y1, short x2, short y2, short x3, short y
void drawPoly4TEx8(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,short clX, short clY)
{
- long num;
- long i,j,xmin,xmax,ymin,ymax;
- long difX, difY, difX2, difY2;
- long posX,posY,YAdjust,clutP;
+ int num;
+ int i,j,xmin,xmax,ymin,ymax;
+ int difX, difY, difX2, difY2;
+ int posX,posY,YAdjust,clutP;
short tC1,tC2;
if(x1>drawW && x2>drawW && x3>drawW && x4>drawW) return;
@@ -4070,9 +4064,9 @@ void drawPoly4TEx8(short x1, short y1, short x2, short y2, short x3, short y3, s
tC1 = psxVub[((posY>>5)&0xFFFFF800)+YAdjust+(posX>>16)];
tC2 = psxVub[(((posY+difY)>>5)&0xFFFFF800)+YAdjust+
((posX+difX)>>16)];
- GetTextureTransColG32_S((unsigned long *)&psxVuw[(i<<10)+j],
+ GetTextureTransColG32_S((uint32_t *)&psxVuw[(i<<10)+j],
psxVuw[clutP+tC1]|
- ((long)psxVuw[clutP+tC2])<<16);
+ ((int)psxVuw[clutP+tC2])<<16);
posX+=difX2;
posY+=difY2;
}
@@ -4115,9 +4109,9 @@ void drawPoly4TEx8(short x1, short y1, short x2, short y2, short x3, short y3, s
tC1 = psxVub[((posY>>5)&0xFFFFF800)+YAdjust+(posX>>16)];
tC2 = psxVub[(((posY+difY)>>5)&0xFFFFF800)+YAdjust+
((posX+difX)>>16)];
- GetTextureTransColG32((unsigned long *)&psxVuw[(i<<10)+j],
+ GetTextureTransColG32((uint32_t *)&psxVuw[(i<<10)+j],
psxVuw[clutP+tC1]|
- ((long)psxVuw[clutP+tC2])<<16);
+ ((int)psxVuw[clutP+tC2])<<16);
posX+=difX2;
posY+=difY2;
}
@@ -4135,10 +4129,10 @@ void drawPoly4TEx8(short x1, short y1, short x2, short y2, short x3, short y3, s
void drawPoly4TEx8_IL(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,short clX, short clY)
{
- long num;
- long i,j,xmin,xmax,ymin,ymax,n_xi,n_yi,TXV,TXU;
- long difX, difY, difX2, difY2;
- long posX,posY,YAdjust,clutP;
+ int num;
+ int i,j,xmin,xmax,ymin,ymax,n_xi,n_yi,TXV,TXU;
+ int difX, difY, difX2, difY2;
+ int posX,posY,YAdjust,clutP;
short tC1,tC2;
if(x1>drawW && x2>drawW && x3>drawW && x4>drawW) return;
@@ -4200,9 +4194,9 @@ void drawPoly4TEx8_IL(short x1, short y1, short x2, short y2, short x3, short y3
tC2= (psxVuw[(n_yi<<10)+YAdjust+n_xi] >> ((TXU & 0x01)<<3)) & 0xff;
- GetTextureTransColG32_S((unsigned long *)&psxVuw[(i<<10)+j],
+ GetTextureTransColG32_S((uint32_t *)&psxVuw[(i<<10)+j],
psxVuw[clutP+tC1]|
- ((long)psxVuw[clutP+tC2])<<16);
+ ((int)psxVuw[clutP+tC2])<<16);
posX+=difX2;
posY+=difY2;
}
@@ -4262,9 +4256,9 @@ void drawPoly4TEx8_IL(short x1, short y1, short x2, short y2, short x3, short y3
tC2= (psxVuw[(n_yi<<10)+YAdjust+n_xi] >> ((TXU & 0x01)<<3)) & 0xff;
- GetTextureTransColG32((unsigned long *)&psxVuw[(i<<10)+j],
+ GetTextureTransColG32((uint32_t *)&psxVuw[(i<<10)+j],
psxVuw[clutP+tC1]|
- ((long)psxVuw[clutP+tC2])<<16);
+ ((int)psxVuw[clutP+tC2])<<16);
posX+=difX2;
posY+=difY2;
}
@@ -4286,11 +4280,11 @@ void drawPoly4TEx8_IL(short x1, short y1, short x2, short y2, short x3, short y3
void drawPoly4TEx8_TW(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,short clX, short clY)
{
- long num;
- long i,j,xmin,xmax,ymin,ymax;
- long difX, difY, difX2, difY2;
- long posX,posY,YAdjust,clutP;
- short tC1,tC2;
+ int num;
+ int i, j, xmin, xmax, ymin, ymax;
+ int difX, difY, difX2, difY2;
+ int posX, posY, YAdjust, clutP;
+ short tC1, tC2;
if(x1>drawW && x2>drawW && x3>drawW && x4>drawW) return;
if(y1>drawH && y2>drawH && y3>drawH && y4>drawH) return;
@@ -4342,11 +4336,11 @@ void drawPoly4TEx8_TW(short x1, short y1, short x2, short y2, short x3, short y3
YAdjust+((posX>>16)%TWin.Position.x1)];
tC2 = psxVub[((((posY+difY)>>16)%TWin.Position.y1)<<11)+
YAdjust+(((posX+difX)>>16)%TWin.Position.x1)];
- GetTextureTransColG32_S((unsigned long *)&psxVuw[(i<<10)+j],
+ GetTextureTransColG32_S((uint32_t *)&psxVuw[(i<<10)+j],
psxVuw[clutP+tC1]|
- ((long)psxVuw[clutP+tC2])<<16);
- posX+=difX2;
- posY+=difY2;
+ ((int)psxVuw[clutP+tC2])<<16);
+ posX += difX2;
+ posY += difY2;
}
if(j==xmax)
{
@@ -4390,9 +4384,9 @@ void drawPoly4TEx8_TW(short x1, short y1, short x2, short y2, short x3, short y3
YAdjust+((posX>>16)%TWin.Position.x1)];
tC2 = psxVub[((((posY+difY)>>16)%TWin.Position.y1)<<11)+
YAdjust+(((posX+difX)>>16)%TWin.Position.x1)];
- GetTextureTransColG32((unsigned long *)&psxVuw[(i<<10)+j],
+ GetTextureTransColG32((uint32_t *)&psxVuw[(i<<10)+j],
psxVuw[clutP+tC1]|
- ((long)psxVuw[clutP+tC2])<<16);
+ ((int)psxVuw[clutP+tC2])<<16);
posX+=difX2;
posY+=difY2;
}
@@ -4411,10 +4405,10 @@ void drawPoly4TEx8_TW(short x1, short y1, short x2, short y2, short x3, short y3
void drawPoly4TEx8_TW_S(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,short clX, short clY)
{
- long num;
- long i,j,xmin,xmax,ymin,ymax;
- long difX, difY, difX2, difY2;
- long posX,posY,YAdjust,clutP;
+ int num;
+ int i,j,xmin,xmax,ymin,ymax;
+ int difX, difY, difX2, difY2;
+ int posX,posY,YAdjust,clutP;
short tC1,tC2;
if(x1>drawW && x2>drawW && x3>drawW && x4>drawW) return;
@@ -4467,9 +4461,9 @@ void drawPoly4TEx8_TW_S(short x1, short y1, short x2, short y2, short x3, short
YAdjust+((posX>>16)%TWin.Position.x1)];
tC2 = psxVub[((((posY+difY)>>16)%TWin.Position.y1)<<11)+
YAdjust+(((posX+difX)>>16)%TWin.Position.x1)];
- GetTextureTransColG32_S((unsigned long *)&psxVuw[(i<<10)+j],
+ GetTextureTransColG32_S((uint32_t *)&psxVuw[(i<<10)+j],
psxVuw[clutP+tC1]|
- ((long)psxVuw[clutP+tC2])<<16);
+ ((int)psxVuw[clutP+tC2])<<16);
posX+=difX2;
posY+=difY2;
}
@@ -4515,9 +4509,9 @@ void drawPoly4TEx8_TW_S(short x1, short y1, short x2, short y2, short x3, short
YAdjust+((posX>>16)%TWin.Position.x1)];
tC2 = psxVub[((((posY+difY)>>16)%TWin.Position.y1)<<11)+
YAdjust+(((posX+difX)>>16)%TWin.Position.x1)];
- GetTextureTransColG32_SPR((unsigned long *)&psxVuw[(i<<10)+j],
+ GetTextureTransColG32_SPR((uint32_t *)&psxVuw[(i<<10)+j],
psxVuw[clutP+tC1]|
- ((long)psxVuw[clutP+tC2])<<16);
+ ((int)psxVuw[clutP+tC2])<<16);
posX+=difX2;
posY+=difY2;
}
@@ -4539,8 +4533,8 @@ void drawPoly4TEx8_TW_S(short x1, short y1, short x2, short y2, short x3, short
void drawPoly3TD(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3)
{
int i,j,xmin,xmax,ymin,ymax;
- long difX, difY,difX2, difY2;
- long posX,posY;
+ int difX, difY,difX2, difY2;
+ int posX,posY;
if(x1>drawW && x2>drawW && x3>drawW) return;
if(y1>drawH && y2>drawH && y3>drawH) return;
@@ -4579,8 +4573,8 @@ void drawPoly3TD(short x1, short y1, short x2, short y2, short x3, short y3, sho
for(j=xmin;j<xmax;j+=2)
{
- GetTextureTransColG32_S((unsigned long *)&psxVuw[(i<<10)+j],
- (((long)psxVuw[((((posY+difY)>>16)+GlobalTextAddrY)<<10)+((posX+difX)>>16)+GlobalTextAddrX])<<16)|
+ GetTextureTransColG32_S((uint32_t *)&psxVuw[(i<<10)+j],
+ (((int)psxVuw[((((posY+difY)>>16)+GlobalTextAddrY)<<10)+((posX+difX)>>16)+GlobalTextAddrX])<<16)|
psxVuw[(((posY>>16)+GlobalTextAddrY)<<10)+((posX)>>16)+GlobalTextAddrX]);
posX+=difX2;
@@ -4616,8 +4610,8 @@ void drawPoly3TD(short x1, short y1, short x2, short y2, short x3, short y3, sho
for(j=xmin;j<xmax;j+=2)
{
- GetTextureTransColG32((unsigned long *)&psxVuw[(i<<10)+j],
- (((long)psxVuw[((((posY+difY)>>16)+GlobalTextAddrY)<<10)+((posX+difX)>>16)+GlobalTextAddrX])<<16)|
+ GetTextureTransColG32((uint32_t *)&psxVuw[(i<<10)+j],
+ (((int)psxVuw[((((posY+difY)>>16)+GlobalTextAddrY)<<10)+((posX+difX)>>16)+GlobalTextAddrX])<<16)|
psxVuw[(((posY>>16)+GlobalTextAddrY)<<10)+((posX)>>16)+GlobalTextAddrX]);
posX+=difX2;
@@ -4639,8 +4633,8 @@ void drawPoly3TD(short x1, short y1, short x2, short y2, short x3, short y3, sho
void drawPoly3TD_TW(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3)
{
int i,j,xmin,xmax,ymin,ymax;
- long difX, difY,difX2, difY2;
- long posX,posY;
+ int difX, difY,difX2, difY2;
+ int posX,posY;
if(x1>drawW && x2>drawW && x3>drawW) return;
if(y1>drawH && y2>drawH && y3>drawH) return;
@@ -4679,8 +4673,8 @@ void drawPoly3TD_TW(short x1, short y1, short x2, short y2, short x3, short y3,
for(j=xmin;j<xmax;j+=2)
{
- GetTextureTransColG32_S((unsigned long *)&psxVuw[(i<<10)+j],
- (((long)psxVuw[(((((posY+difY)>>16)%TWin.Position.y1)+GlobalTextAddrY+TWin.Position.y0)<<10)+
+ GetTextureTransColG32_S((uint32_t *)&psxVuw[(i<<10)+j],
+ (((int)psxVuw[(((((posY+difY)>>16)%TWin.Position.y1)+GlobalTextAddrY+TWin.Position.y0)<<10)+
(((posX+difX)>>16)%TWin.Position.x1)+GlobalTextAddrX+TWin.Position.x0])<<16)|
psxVuw[((((posY>>16)%TWin.Position.y1)+GlobalTextAddrY+TWin.Position.y0)<<10)+
(((posX)>>16)%TWin.Position.x1)+GlobalTextAddrX+TWin.Position.x0]);
@@ -4719,8 +4713,8 @@ void drawPoly3TD_TW(short x1, short y1, short x2, short y2, short x3, short y3,
for(j=xmin;j<xmax;j+=2)
{
- GetTextureTransColG32((unsigned long *)&psxVuw[(i<<10)+j],
- (((long)psxVuw[(((((posY+difY)>>16)%TWin.Position.y1)+GlobalTextAddrY+TWin.Position.y0)<<10)+
+ GetTextureTransColG32((uint32_t *)&psxVuw[(i<<10)+j],
+ (((int)psxVuw[(((((posY+difY)>>16)%TWin.Position.y1)+GlobalTextAddrY+TWin.Position.y0)<<10)+
(((posX+difX)>>16)%TWin.Position.x1)+GlobalTextAddrX+TWin.Position.x0])<<16)|
psxVuw[((((posY>>16)%TWin.Position.y1)+GlobalTextAddrY+TWin.Position.y0)<<10)+
(((posX)>>16)%TWin.Position.x1)+GlobalTextAddrX+TWin.Position.x0]);
@@ -4759,10 +4753,10 @@ void drawPoly4TD_TRI(short x1, short y1, short x2, short y2, short x3, short y3,
void drawPoly4TD(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4)
{
- long num;
- long i,j,xmin,xmax,ymin,ymax;
- long difX, difY, difX2, difY2;
- long posX,posY;
+ int num;
+ int i,j,xmin,xmax,ymin,ymax;
+ int difX, difY, difX2, difY2;
+ int posX,posY;
if(x1>drawW && x2>drawW && x3>drawW && x4>drawW) return;
if(y1>drawH && y2>drawH && y3>drawH && y4>drawH) return;
@@ -4805,8 +4799,8 @@ void drawPoly4TD(short x1, short y1, short x2, short y2, short x3, short y3, sho
for(j=xmin;j<xmax;j+=2)
{
- GetTextureTransColG32_S((unsigned long *)&psxVuw[(i<<10)+j],
- (((long)psxVuw[((((posY+difY)>>16)+GlobalTextAddrY)<<10)+((posX+difX)>>16)+GlobalTextAddrX])<<16)|
+ GetTextureTransColG32_S((uint32_t *)&psxVuw[(i<<10)+j],
+ (((int)psxVuw[((((posY+difY)>>16)+GlobalTextAddrY)<<10)+((posX+difX)>>16)+GlobalTextAddrX])<<16)|
psxVuw[(((posY>>16)+GlobalTextAddrY)<<10)+((posX)>>16)+GlobalTextAddrX]);
posX+=difX2;
@@ -4846,8 +4840,8 @@ void drawPoly4TD(short x1, short y1, short x2, short y2, short x3, short y3, sho
for(j=xmin;j<xmax;j+=2)
{
- GetTextureTransColG32((unsigned long *)&psxVuw[(i<<10)+j],
- (((long)psxVuw[((((posY+difY)>>16)+GlobalTextAddrY)<<10)+((posX+difX)>>16)+GlobalTextAddrX])<<16)|
+ GetTextureTransColG32((uint32_t *)&psxVuw[(i<<10)+j],
+ (((int)psxVuw[((((posY+difY)>>16)+GlobalTextAddrY)<<10)+((posX+difX)>>16)+GlobalTextAddrX])<<16)|
psxVuw[(((posY>>16)+GlobalTextAddrY)<<10)+((posX)>>16)+GlobalTextAddrX]);
posX+=difX2;
@@ -4865,10 +4859,10 @@ void drawPoly4TD(short x1, short y1, short x2, short y2, short x3, short y3, sho
void drawPoly4TD_TW(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4)
{
- long num;
- long i,j,xmin,xmax,ymin,ymax;
- long difX, difY, difX2, difY2;
- long posX,posY;
+ int num;
+ int i,j,xmin,xmax,ymin,ymax;
+ int difX, difY, difX2, difY2;
+ int posX,posY;
if(x1>drawW && x2>drawW && x3>drawW && x4>drawW) return;
if(y1>drawH && y2>drawH && y3>drawH && y4>drawH) return;
@@ -4911,8 +4905,8 @@ void drawPoly4TD_TW(short x1, short y1, short x2, short y2, short x3, short y3,
for(j=xmin;j<xmax;j+=2)
{
- GetTextureTransColG32_S((unsigned long *)&psxVuw[(i<<10)+j],
- (((long)psxVuw[(((((posY+difY)>>16)%TWin.Position.y1)+GlobalTextAddrY+TWin.Position.y0)<<10)+
+ GetTextureTransColG32_S((uint32_t *)&psxVuw[(i<<10)+j],
+ (((int)psxVuw[(((((posY+difY)>>16)%TWin.Position.y1)+GlobalTextAddrY+TWin.Position.y0)<<10)+
(((posX+difX)>>16)%TWin.Position.x1)+GlobalTextAddrX+TWin.Position.x0])<<16)|
psxVuw[((((posY>>16)%TWin.Position.y1)+GlobalTextAddrY)<<10)+TWin.Position.y0+
((posX>>16)%TWin.Position.x1)+GlobalTextAddrX+TWin.Position.x0]);
@@ -4955,8 +4949,8 @@ void drawPoly4TD_TW(short x1, short y1, short x2, short y2, short x3, short y3,
for(j=xmin;j<xmax;j+=2)
{
- GetTextureTransColG32((unsigned long *)&psxVuw[(i<<10)+j],
- (((long)psxVuw[(((((posY+difY)>>16)%TWin.Position.y1)+GlobalTextAddrY+TWin.Position.y0)<<10)+
+ GetTextureTransColG32((uint32_t *)&psxVuw[(i<<10)+j],
+ (((int)psxVuw[(((((posY+difY)>>16)%TWin.Position.y1)+GlobalTextAddrY+TWin.Position.y0)<<10)+
(((posX+difX)>>16)%TWin.Position.x1)+GlobalTextAddrX+TWin.Position.x0])<<16)|
psxVuw[((((posY>>16)%TWin.Position.y1)+GlobalTextAddrY+TWin.Position.y0)<<10)+
((posX>>16)%TWin.Position.x1)+GlobalTextAddrX+TWin.Position.x0]);
@@ -4977,10 +4971,10 @@ void drawPoly4TD_TW(short x1, short y1, short x2, short y2, short x3, short y3,
void drawPoly4TD_TW_S(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4)
{
- long num;
- long i,j,xmin,xmax,ymin,ymax;
- long difX, difY, difX2, difY2;
- long posX,posY;
+ int num;
+ int i,j,xmin,xmax,ymin,ymax;
+ int difX, difY, difX2, difY2;
+ int posX, posY;
if(x1>drawW && x2>drawW && x3>drawW && x4>drawW) return;
if(y1>drawH && y2>drawH && y3>drawH && y4>drawH) return;
@@ -5023,8 +5017,8 @@ void drawPoly4TD_TW_S(short x1, short y1, short x2, short y2, short x3, short y3
for(j=xmin;j<xmax;j+=2)
{
- GetTextureTransColG32_S((unsigned long *)&psxVuw[(i<<10)+j],
- (((long)psxVuw[(((((posY+difY)>>16)%TWin.Position.y1)+GlobalTextAddrY+TWin.Position.y0)<<10)+
+ GetTextureTransColG32_S((uint32_t *)&psxVuw[(i<<10)+j],
+ (((int)psxVuw[(((((posY+difY)>>16)%TWin.Position.y1)+GlobalTextAddrY+TWin.Position.y0)<<10)+
(((posX+difX)>>16)%TWin.Position.x1)+GlobalTextAddrX+TWin.Position.x0])<<16)|
psxVuw[((((posY>>16)%TWin.Position.y1)+GlobalTextAddrY)<<10)+TWin.Position.y0+
((posX>>16)%TWin.Position.x1)+GlobalTextAddrX+TWin.Position.x0]);
@@ -5067,8 +5061,8 @@ void drawPoly4TD_TW_S(short x1, short y1, short x2, short y2, short x3, short y3
for(j=xmin;j<xmax;j+=2)
{
- GetTextureTransColG32_SPR((unsigned long *)&psxVuw[(i<<10)+j],
- (((long)psxVuw[(((((posY+difY)>>16)%TWin.Position.y1)+GlobalTextAddrY+TWin.Position.y0)<<10)+
+ GetTextureTransColG32_SPR((uint32_t *)&psxVuw[(i<<10)+j],
+ (((int)psxVuw[(((((posY+difY)>>16)%TWin.Position.y1)+GlobalTextAddrY+TWin.Position.y0)<<10)+
(((posX+difX)>>16)%TWin.Position.x1)+GlobalTextAddrX+TWin.Position.x0])<<16)|
psxVuw[((((posY>>16)%TWin.Position.y1)+GlobalTextAddrY+TWin.Position.y0)<<10)+
((posX>>16)%TWin.Position.x1)+GlobalTextAddrX+TWin.Position.x0]);
@@ -5089,11 +5083,11 @@ void drawPoly4TD_TW_S(short x1, short y1, short x2, short y2, short x3, short y3
// POLY 3/4 G-SHADED
////////////////////////////////////////////////////////////////////////
-__inline void drawPoly3Gi(short x1,short y1,short x2,short y2,short x3,short y3,long rgb1, long rgb2, long rgb3)
+__inline void drawPoly3Gi(short x1,short y1,short x2,short y2,short x3,short y3, int rgb1, int rgb2, int rgb3)
{
int i,j,xmin,xmax,ymin,ymax;
- long cR1,cG1,cB1;
- long difR,difB,difG,difR2,difB2,difG2;
+ int cR1,cG1,cB1;
+ int difR,difB,difG,difR2,difB2,difG2;
if(x1>drawW && x2>drawW && x3>drawW) return;
if(y1>drawH && y2>drawH && y3>drawH) return;
@@ -5136,7 +5130,7 @@ __inline void drawPoly3Gi(short x1,short y1,short x2,short y2,short x3,short y3,
for(j=xmin;j<xmax;j+=2)
{
- *((unsigned long *)&psxVuw[(i<<10)+j])=
+ *((uint32_t *)&psxVuw[(i<<10)+j])=
((((cR1+difR) <<7)&0x7c000000)|(((cG1+difG) << 2)&0x03e00000)|(((cB1+difB)>>3)&0x001f0000)|
(((cR1) >> 9)&0x7c00)|(((cG1) >> 14)&0x03e0)|(((cB1) >> 19)&0x001f))|lSetMask;
@@ -5211,14 +5205,14 @@ __inline void drawPoly3Gi(short x1,short y1,short x2,short y2,short x3,short y3,
////////////////////////////////////////////////////////////////////////
-void drawPoly3G(long rgb1, long rgb2, long rgb3)
+void drawPoly3G(int rgb1, int rgb2, int rgb3)
{
drawPoly3Gi(lx0,ly0,lx1,ly1,lx2,ly2,rgb1,rgb2,rgb3);
}
// draw two g-shaded tris for right psx shading emulation
-void drawPoly4G(long rgb1, long rgb2, long rgb3, long rgb4)
+void drawPoly4G(int rgb1, int rgb2, int rgb3, int rgb4)
{
drawPoly3Gi(lx1,ly1,lx3,ly3,lx2,ly2,
rgb2,rgb4,rgb3);
@@ -5230,13 +5224,13 @@ void drawPoly4G(long rgb1, long rgb2, long rgb3, long rgb4)
// POLY 3/4 G-SHADED TEX PAL4
////////////////////////////////////////////////////////////////////////
-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,long col1, long col2, long col3)
+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,int col1, int col2, int col3)
{
int i,j,xmin,xmax,ymin,ymax;
- long cR1,cG1,cB1;
- long difR,difB,difG,difR2,difB2,difG2;
- long difX, difY,difX2, difY2;
- long posX,posY,YAdjust,clutP,XAdjust;
+ int cR1,cG1,cB1;
+ int difR,difB,difG,difR2,difB2,difG2;
+ int difX, difY,difX2, difY2;
+ int posX,posY,YAdjust,clutP,XAdjust;
short tC1,tC2;
if(x1>drawW && x2>drawW && x3>drawW) return;
@@ -5298,9 +5292,9 @@ void drawPoly3TGEx4(short x1, short y1, short x2, short y2, short x3, short y3,
(XAdjust>>1)];
tC2=(tC2>>((XAdjust&1)<<2))&0xf;
- GetTextureTransColGX32_S((unsigned long *)&psxVuw[(i<<10)+j],
+ GetTextureTransColGX32_S((uint32_t *)&psxVuw[(i<<10)+j],
psxVuw[clutP+tC1]|
- ((long)psxVuw[clutP+tC2])<<16,
+ ((int)psxVuw[clutP+tC2])<<16,
(cB1>>16)|((cB1+difB)&0xff0000),
(cG1>>16)|((cG1+difG)&0xff0000),
(cR1>>16)|((cR1+difR)&0xff0000));
@@ -5376,13 +5370,13 @@ void drawPoly3TGEx4(short x1, short y1, short x2, short y2, short x3, short y3,
////////////////////////////////////////////////////////////////////////
-void drawPoly3TGEx4_IL(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,long col1, long col2, long col3)
+void drawPoly3TGEx4_IL(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,int col1, int col2, int col3)
{
int i,j,xmin,xmax,ymin,ymax,n_xi,n_yi,TXV;
- long cR1,cG1,cB1;
- long difR,difB,difG,difR2,difB2,difG2;
- long difX, difY,difX2, difY2;
- long posX,posY,YAdjust,clutP,XAdjust;
+ int cR1,cG1,cB1;
+ int difR,difB,difG,difR2,difB2,difG2;
+ int difX, difY,difX2, difY2;
+ int posX,posY,YAdjust,clutP,XAdjust;
short tC1,tC2;
if(x1>drawW && x2>drawW && x3>drawW) return;
@@ -5452,9 +5446,9 @@ void drawPoly3TGEx4_IL(short x1, short y1, short x2, short y2, short x3, short y
tC2= (psxVuw[(n_yi<<10)+YAdjust+n_xi] >> ((XAdjust & 0x03)<<2)) & 0x0f ;
- GetTextureTransColGX32_S((unsigned long *)&psxVuw[(i<<10)+j],
+ GetTextureTransColGX32_S((uint32_t *)&psxVuw[(i<<10)+j],
psxVuw[clutP+tC1]|
- ((long)psxVuw[clutP+tC2])<<16,
+ ((int)psxVuw[clutP+tC2])<<16,
(cB1>>16)|((cB1+difB)&0xff0000),
(cG1>>16)|((cG1+difG)&0xff0000),
(cR1>>16)|((cR1+difR)&0xff0000));
@@ -5540,13 +5534,13 @@ void drawPoly3TGEx4_IL(short x1, short y1, short x2, short y2, short x3, short y
////////////////////////////////////////////////////////////////////////
-void drawPoly3TGEx4_TW(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,long col1, long col2, long col3)
+void drawPoly3TGEx4_TW(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, int col1, int col2, int col3)
{
- int i,j,xmin,xmax,ymin,ymax;
- long cR1,cG1,cB1;
- long difR,difB,difG,difR2,difB2,difG2;
- long difX, difY,difX2, difY2;
- long posX,posY,YAdjust,clutP,XAdjust;
+ int i, j, xmin, xmax, ymin, ymax;
+ int cR1, cG1, cB1;
+ int difR, difB, difG, difR2, difB2, difG2;
+ int difX, difY,difX2, difY2;
+ int posX, posY, YAdjust, clutP, XAdjust;
short tC1,tC2;
if(x1>drawW && x2>drawW && x3>drawW) return;
@@ -5609,9 +5603,9 @@ void drawPoly3TGEx4_TW(short x1, short y1, short x2, short y2, short x3, short y
tC2 = psxVub[((((posY+difY)>>16)%TWin.Position.y1)<<11)+
YAdjust+(XAdjust>>1)];
tC2=(tC2>>((XAdjust&1)<<2))&0xf;
- GetTextureTransColGX32_S((unsigned long *)&psxVuw[(i<<10)+j],
+ GetTextureTransColGX32_S((uint32_t *)&psxVuw[(i<<10)+j],
psxVuw[clutP+tC1]|
- ((long)psxVuw[clutP+tC2])<<16,
+ ((int)psxVuw[clutP+tC2])<<16,
(cB1>>16)|((cB1+difB)&0xff0000),
(cG1>>16)|((cG1+difG)&0xff0000),
(cR1>>16)|((cR1+difR)&0xff0000));
@@ -5697,7 +5691,7 @@ void drawPoly3TGEx4_TW(short x1, short y1, short x2, short y2, short x3, short y
void drawPoly4TGEx4_TRI_IL(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4,
short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,
short clX, short clY,
- long col1, long col2, long col3, long col4)
+ int col1, int col2, int col3, int col4)
{
drawPoly3TGEx4_IL(x2,y2,x3,y3,x4,y4,
tx2,ty2,tx3,ty3,tx4,ty4,
@@ -5714,7 +5708,7 @@ void drawPoly4TGEx4_TRI_IL(short x1, short y1, short x2, short y2, short x3, sho
void drawPoly4TGEx4_TRI(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4,
short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,
short clX, short clY,
- long col1, long col2, long col3, long col4)
+ int col1, int col2, int col3, int col4)
{
drawPoly3TGEx4(x2,y2,x3,y3,x4,y4,
tx2,ty2,tx3,ty3,tx4,ty4,
@@ -5733,14 +5727,14 @@ void drawPoly4TGEx4_TRI(short x1, short y1, short x2, short y2, short x3, short
void drawPoly4TGEx4(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4,
short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,
short clX, short clY,
- long col1, long col2, long col4, long col3)
+ int col1, int col2, int col4, int col3)
{
- long num;
- long i,j,xmin,xmax,ymin,ymax;
- long cR1,cG1,cB1;
- long difR,difB,difG,difR2,difB2,difG2;
- long difX, difY, difX2, difY2;
- long posX,posY,YAdjust,clutP,XAdjust;
+ int num;
+ int i,j,xmin,xmax,ymin,ymax;
+ int cR1,cG1,cB1;
+ int difR,difB,difG,difR2,difB2,difG2;
+ int difX, difY, difX2, difY2;
+ int posX,posY,YAdjust,clutP,XAdjust;
short tC1,tC2;
if(x1>drawW && x2>drawW && x3>drawW && x4>drawW) return;
@@ -5807,9 +5801,9 @@ void drawPoly4TGEx4(short x1, short y1, short x2, short y2, short x3, short y3,
(XAdjust>>1)];
tC2=(tC2>>((XAdjust&1)<<2))&0xf;
- GetTextureTransColGX32_S((unsigned long *)&psxVuw[(i<<10)+j],
+ GetTextureTransColGX32_S((uint32_t *)&psxVuw[(i<<10)+j],
psxVuw[clutP+tC1]|
- ((long)psxVuw[clutP+tC2])<<16,
+ ((int)psxVuw[clutP+tC2])<<16,
(cB1>>16)|((cB1+difB)&0xff0000),
(cG1>>16)|((cG1+difG)&0xff0000),
(cR1>>16)|((cR1+difR)&0xff0000));
@@ -5899,7 +5893,7 @@ void drawPoly4TGEx4(short x1, short y1, short x2, short y2, short x3, short y3,
void drawPoly4TGEx4_TW(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4,
short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,
short clX, short clY,
- long col1, long col2, long col3, long col4)
+ int col1, int col2, int col3, int col4)
{
drawPoly3TGEx4_TW(x2,y2,x3,y3,x4,y4,
tx2,ty2,tx3,ty3,tx4,ty4,
@@ -5916,13 +5910,13 @@ void drawPoly4TGEx4_TW(short x1, short y1, short x2, short y2, short x3, short y
// POLY 3/4 G-SHADED TEX PAL8
////////////////////////////////////////////////////////////////////////
-void drawPoly3TGEx8(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,long col1, long col2, long col3)
+void drawPoly3TGEx8(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, int col1, int col2, int col3)
{
int i,j,xmin,xmax,ymin,ymax;
- long cR1,cG1,cB1;
- long difR,difB,difG,difR2,difB2,difG2;
- long difX, difY,difX2, difY2;
- long posX,posY,YAdjust,clutP;
+ int cR1,cG1,cB1;
+ int difR,difB,difG,difR2,difB2,difG2;
+ int difX, difY,difX2, difY2;
+ int posX,posY,YAdjust,clutP;
short tC1,tC2;
if(x1>drawW && x2>drawW && x3>drawW) return;
@@ -5978,9 +5972,9 @@ void drawPoly3TGEx8(short x1, short y1, short x2, short y2, short x3, short y3,
tC1 = psxVub[((posY>>5)&0xFFFFF800)+YAdjust+((posX>>16))];
tC2 = psxVub[(((posY+difY)>>5)&0xFFFFF800)+YAdjust+
(((posX+difX)>>16))];
- GetTextureTransColGX32_S((unsigned long *)&psxVuw[(i<<10)+j],
+ GetTextureTransColGX32_S((uint32_t *)&psxVuw[(i<<10)+j],
psxVuw[clutP+tC1]|
- ((long)psxVuw[clutP+tC2])<<16,
+ ((int)psxVuw[clutP+tC2])<<16,
(cB1>>16)|((cB1+difB)&0xff0000),
(cG1>>16)|((cG1+difG)&0xff0000),
(cR1>>16)|((cR1+difR)&0xff0000));
@@ -6052,13 +6046,13 @@ void drawPoly3TGEx8(short x1, short y1, short x2, short y2, short x3, short y3,
////////////////////////////////////////////////////////////////////////
-void drawPoly3TGEx8_IL(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,long col1, long col2, long col3)
+void drawPoly3TGEx8_IL(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, int col1, int col2, int col3)
{
int i,j,xmin,xmax,ymin,ymax,n_xi,n_yi,TXV,TXU;
- long cR1,cG1,cB1;
- long difR,difB,difG,difR2,difB2,difG2;
- long difX, difY,difX2, difY2;
- long posX,posY,YAdjust,clutP;
+ int cR1,cG1,cB1;
+ int difR,difB,difG,difR2,difB2,difG2;
+ int difX, difY,difX2, difY2;
+ int posX,posY,YAdjust,clutP;
short tC1,tC2;
if(x1>drawW && x2>drawW && x3>drawW) return;
@@ -6125,9 +6119,9 @@ void drawPoly3TGEx8_IL(short x1, short y1, short x2, short y2, short x3, short y
tC2= (psxVuw[(n_yi<<10)+YAdjust+n_xi] >> ((TXU & 0x01)<<3)) & 0xff;
- GetTextureTransColGX32_S((unsigned long *)&psxVuw[(i<<10)+j],
+ GetTextureTransColGX32_S((uint32_t *)&psxVuw[(i<<10)+j],
psxVuw[clutP+tC1]|
- ((long)psxVuw[clutP+tC2])<<16,
+ ((int)psxVuw[clutP+tC2])<<16,
(cB1>>16)|((cB1+difB)&0xff0000),
(cG1>>16)|((cG1+difG)&0xff0000),
(cR1>>16)|((cR1+difR)&0xff0000));
@@ -6211,13 +6205,13 @@ void drawPoly3TGEx8_IL(short x1, short y1, short x2, short y2, short x3, short y
////////////////////////////////////////////////////////////////////////
-void drawPoly3TGEx8_TW(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,long col1, long col2, long col3)
+void drawPoly3TGEx8_TW(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, int col1, int col2, int col3)
{
int i,j,xmin,xmax,ymin,ymax;
- long cR1,cG1,cB1;
- long difR,difB,difG,difR2,difB2,difG2;
- long difX, difY,difX2, difY2;
- long posX,posY,YAdjust,clutP;
+ int cR1,cG1,cB1;
+ int difR,difB,difG,difR2,difB2,difG2;
+ int difX, difY,difX2, difY2;
+ int posX,posY,YAdjust,clutP;
short tC1,tC2;
if(x1>drawW && x2>drawW && x3>drawW) return;
@@ -6276,9 +6270,9 @@ void drawPoly3TGEx8_TW(short x1, short y1, short x2, short y2, short x3, short y
tC2 = psxVub[((((posY+difY)>>16)%TWin.Position.y1)<<11)+
YAdjust+(((posX+difX)>>16)%TWin.Position.x1)];
- GetTextureTransColGX32_S((unsigned long *)&psxVuw[(i<<10)+j],
+ GetTextureTransColGX32_S((uint32_t *)&psxVuw[(i<<10)+j],
psxVuw[clutP+tC1]|
- ((long)psxVuw[clutP+tC2])<<16,
+ ((int)psxVuw[clutP+tC2])<<16,
(cB1>>16)|((cB1+difB)&0xff0000),
(cG1>>16)|((cG1+difG)&0xff0000),
(cR1>>16)|((cR1+difR)&0xff0000));
@@ -6357,7 +6351,7 @@ void drawPoly3TGEx8_TW(short x1, short y1, short x2, short y2, short x3, short y
void drawPoly4TGEx8_TRI_IL(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4,
short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,
short clX, short clY,
- long col1, long col2, long col3, long col4)
+ int col1, int col2, int col3, int col4)
{
drawPoly3TGEx8_IL(x2,y2,x3,y3,x4,y4,
tx2,ty2,tx3,ty3,tx4,ty4,
@@ -6374,7 +6368,7 @@ void drawPoly4TGEx8_TRI_IL(short x1, short y1, short x2, short y2, short x3, sho
void drawPoly4TGEx8_TRI(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4,
short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,
short clX, short clY,
- long col1, long col2, long col3, long col4)
+ int col1, int col2, int col3, int col4)
{
drawPoly3TGEx8(x2,y2,x3,y3,x4,y4,
tx2,ty2,tx3,ty3,tx4,ty4,
@@ -6391,14 +6385,14 @@ void drawPoly4TGEx8_TRI(short x1, short y1, short x2, short y2, short x3, short
void drawPoly4TGEx8(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4,
short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,
short clX, short clY,
- long col1, long col2, long col4, long col3)
+ int col1, int col2, int col4, int col3)
{
- long num;
- long i,j,xmin,xmax,ymin,ymax;
- long cR1,cG1,cB1;
- long difR,difB,difG,difR2,difB2,difG2;
- long difX, difY, difX2, difY2;
- long posX,posY,YAdjust,clutP;
+ int num;
+ int i,j,xmin,xmax,ymin,ymax;
+ int cR1,cG1,cB1;
+ int difR,difB,difG,difR2,difB2,difG2;
+ int difX, difY, difX2, difY2;
+ int posX,posY,YAdjust,clutP;
short tC1,tC2;
if(x1>drawW && x2>drawW && x3>drawW && x4>drawW) return;
@@ -6460,9 +6454,9 @@ void drawPoly4TGEx8(short x1, short y1, short x2, short y2, short x3, short y3,
tC2 = psxVub[(((posY+difY)>>5)&0xFFFFF800)+YAdjust+
((posX+difX)>>16)];
- GetTextureTransColGX32_S((unsigned long *)&psxVuw[(i<<10)+j],
+ GetTextureTransColGX32_S((uint32_t *)&psxVuw[(i<<10)+j],
psxVuw[clutP+tC1]|
- ((long)psxVuw[clutP+tC2])<<16,
+ ((int)psxVuw[clutP+tC2])<<16,
(cB1>>16)|((cB1+difB)&0xff0000),
(cG1>>16)|((cG1+difG)&0xff0000),
(cR1>>16)|((cR1+difR)&0xff0000));
@@ -6545,7 +6539,7 @@ void drawPoly4TGEx8(short x1, short y1, short x2, short y2, short x3, short y3,
void drawPoly4TGEx8_TW(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4,
short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,
short clX, short clY,
- long col1, long col2, long col3, long col4)
+ int col1, int col2, int col3, int col4)
{
drawPoly3TGEx8_TW(x2,y2,x3,y3,x4,y4,
tx2,ty2,tx3,ty3,tx4,ty4,
@@ -6561,13 +6555,13 @@ void drawPoly4TGEx8_TW(short x1, short y1, short x2, short y2, short x3, short y
// POLY 3 G-SHADED TEX 15 BIT
////////////////////////////////////////////////////////////////////////
-void drawPoly3TGD(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3,long col1, long col2, long col3)
+void drawPoly3TGD(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, int col1, int col2, int col3)
{
int i,j,xmin,xmax,ymin,ymax;
- long cR1,cG1,cB1;
- long difR,difB,difG,difR2,difB2,difG2;
- long difX, difY,difX2, difY2;
- long posX,posY;
+ int cR1,cG1,cB1;
+ int difR,difB,difG,difR2,difB2,difG2;
+ int difX, difY,difX2, difY2;
+ int posX,posY;
if(x1>drawW && x2>drawW && x3>drawW) return;
if(y1>drawH && y2>drawH && y3>drawH) return;
@@ -6615,8 +6609,8 @@ void drawPoly3TGD(short x1, short y1, short x2, short y2, short x3, short y3, sh
for(j=xmin;j<xmax;j+=2)
{
- GetTextureTransColGX32_S((unsigned long *)&psxVuw[(i<<10)+j],
- (((long)psxVuw[((((posY+difY)>>16)+GlobalTextAddrY)<<10)+((posX+difX)>>16)+GlobalTextAddrX])<<16)|
+ GetTextureTransColGX32_S((uint32_t *)&psxVuw[(i<<10)+j],
+ (((int)psxVuw[((((posY+difY)>>16)+GlobalTextAddrY)<<10)+((posX+difX)>>16)+GlobalTextAddrX])<<16)|
psxVuw[(((posY>>16)+GlobalTextAddrY)<<10)+((posX)>>16)+GlobalTextAddrX],
(cB1>>16)|((cB1+difB)&0xff0000),
(cG1>>16)|((cG1+difG)&0xff0000),
@@ -6685,45 +6679,45 @@ void drawPoly3TGD(short x1, short y1, short x2, short y2, short x3, short y3, sh
////////////////////////////////////////////////////////////////////////
-void drawPoly3TGD_TW(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3,long col1, long col2, long col3)
+void drawPoly3TGD_TW(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, int col1, int col2, int col3)
{
int i,j,xmin,xmax,ymin,ymax;
- long cR1,cG1,cB1;
- long difR,difB,difG,difR2,difB2,difG2;
- long difX, difY,difX2, difY2;
- long posX,posY;
+ int cR1,cG1,cB1;
+ int difR,difB,difG,difR2,difB2,difG2;
+ int difX, difY,difX2, difY2;
+ int posX,posY;
- 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 (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;
+ if (!SetupSections_GT(x1,y1,x2,y2,x3,y3,tx1,ty1,tx2,ty2,tx3,ty3,col1,col2,col3)) return;
- ymax=Ymax;
+ ymax = Ymax;
- for(ymin=Ymin;ymin<drawY;ymin++)
+ for(ymin = Ymin; ymin < drawY; ymin++)
if(NextRow_GT()) return;
- 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;
+ 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)
+ if (!bCheckMask && !DrawSemiTrans && !iDither)
{
- for (i=ymin;i<=ymax;i++)
+ for (i = ymin; i <= ymax; i++)
{
- xmin=(left_x >> 16);
- xmax=(right_x >> 16)-1; //!!!!!!!!!!!!!!!!!!!!
+ xmin = (left_x >> 16);
+ xmax = (right_x >> 16) - 1; //!!!!!!!!!!!!!!!!!!!!
if(drawW<xmax) xmax=drawW;
if(xmax>=xmin)
@@ -6739,8 +6733,8 @@ void drawPoly3TGD_TW(short x1, short y1, short x2, short y2, short x3, short y3,
for(j=xmin;j<xmax;j+=2)
{
- GetTextureTransColGX32_S((unsigned long *)&psxVuw[(i<<10)+j],
- (((long)psxVuw[(((((posY+difY)>>16)%TWin.Position.y1)+GlobalTextAddrY+TWin.Position.y0)<<10)+
+ GetTextureTransColGX32_S((uint32_t *)&psxVuw[(i<<10)+j],
+ (((int)psxVuw[(((((posY+difY)>>16)%TWin.Position.y1)+GlobalTextAddrY+TWin.Position.y0)<<10)+
(((posX+difX)>>16)%TWin.Position.x1)+GlobalTextAddrX+TWin.Position.x0])<<16)|
psxVuw[((((posY>>16)%TWin.Position.y1)+GlobalTextAddrY+TWin.Position.y0)<<10)+
(((posX)>>16)%TWin.Position.x1)+GlobalTextAddrX+TWin.Position.x0],
@@ -6818,7 +6812,7 @@ void drawPoly3TGD_TW(short x1, short y1, short x2, short y2, short x3, short y3,
#ifdef POLYQUAD3GT
-void drawPoly4TGD_TRI(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4, long col1, long col2, long col3, long col4)
+void drawPoly4TGD_TRI(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4, int col1, int col2, int col3, int col4)
{
drawPoly3TGD(x2,y2,x3,y3,x4,y4,
tx2,ty2,tx3,ty3,tx4,ty4,
@@ -6830,14 +6824,14 @@ void drawPoly4TGD_TRI(short x1, short y1, short x2, short y2, short x3, short y3
#endif
-void drawPoly4TGD(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4, long col1, long col2, long col4, long col3)
+void drawPoly4TGD(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4, int col1, int col2, int col4, int col3)
{
- long num;
- long i,j,xmin,xmax,ymin,ymax;
- long cR1,cG1,cB1;
- long difR,difB,difG,difR2,difB2,difG2;
- long difX, difY, difX2, difY2;
- long posX,posY;
+ int num;
+ int i,j,xmin,xmax,ymin,ymax;
+ int cR1,cG1,cB1;
+ int difR,difB,difG,difR2,difB2,difG2;
+ int difX, difY, difX2, difY2;
+ int posX,posY;
if(x1>drawW && x2>drawW && x3>drawW && x4>drawW) return;
if(y1>drawH && y2>drawH && y3>drawH && y4>drawH) return;
@@ -6848,26 +6842,26 @@ void drawPoly4TGD(short x1, short y1, short x2, short y2, short x3, short y3, sh
if(!SetupSections_GT4(x1,y1,x2,y2,x3,y3,x4,y4,tx1,ty1,tx2,ty2,tx3,ty3,tx4,ty4,col1,col2,col3,col4)) return;
- ymax=Ymax;
+ ymax = Ymax;
- for(ymin=Ymin;ymin<drawY;ymin++)
- if(NextRow_GT4()) return;
+ for (ymin = Ymin; ymin < drawY; ymin++)
+ if (NextRow_GT4()) return;
#ifdef FASTSOLID
if(!bCheckMask && !DrawSemiTrans && !iDither)
{
- for (i=ymin;i<=ymax;i++)
+ for (i = ymin; i <= ymax; i++)
{
- xmin=(left_x >> 16);
- xmax=(right_x >> 16);
+ xmin = (left_x >> 16);
+ xmax = (right_x >> 16);
- if(xmax>=xmin)
+ if(xmax >= xmin)
{
- posX=left_u;
- posY=left_v;
+ posX = left_u;
+ posY = left_v;
- num=(xmax-xmin);
+ num = (xmax-xmin);
if(num==0) num=1;
difX=(right_u-posX)/num;
difY=(right_v-posY)/num;
@@ -6890,8 +6884,8 @@ void drawPoly4TGD(short x1, short y1, short x2, short y2, short x3, short y3, sh
for(j=xmin;j<xmax;j+=2)
{
- GetTextureTransColGX32_S((unsigned long *)&psxVuw[(i<<10)+j],
- (((long)psxVuw[((((posY+difY)>>16)+GlobalTextAddrY)<<10)+((posX+difX)>>16)+GlobalTextAddrX])<<16)|
+ GetTextureTransColGX32_S((uint32_t *)&psxVuw[(i<<10)+j],
+ (((int)psxVuw[((((posY+difY)>>16)+GlobalTextAddrY)<<10)+((posX+difX)>>16)+GlobalTextAddrX])<<16)|
psxVuw[(((posY>>16)+GlobalTextAddrY)<<10)+((posX)>>16)+GlobalTextAddrX],
(cB1>>16)|((cB1+difB)&0xff0000),
(cG1>>16)|((cG1+difG)&0xff0000),
@@ -6968,7 +6962,7 @@ void drawPoly4TGD(short x1, short y1, short x2, short y2, short x3, short y3, sh
////////////////////////////////////////////////////////////////////////
-void drawPoly4TGD_TW(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4, long col1, long col2, long col3, long col4)
+void drawPoly4TGD_TW(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4, int col1, int col2, int col3, int col4)
{
drawPoly3TGD_TW(x2,y2,x3,y3,x4,y4,
tx2,ty2,tx3,ty3,tx4,ty4,
@@ -7027,9 +7021,9 @@ __inline BOOL IsNoRect(void)
////////////////////////////////////////////////////////////////////////
-void drawPoly3FT(unsigned char * baseAddr)
+void drawPoly3FT(unsigned char *baseAddr)
{
- unsigned long *gpuData = ((unsigned long *) baseAddr);
+ uint32_t *gpuData = ((uint32_t *) baseAddr);
if(GlobalTextIL && GlobalTextTP<2)
{
@@ -7085,9 +7079,9 @@ void drawPoly3FT(unsigned char * baseAddr)
////////////////////////////////////////////////////////////////////////
-void drawPoly4FT(unsigned char * baseAddr)
+void drawPoly4FT(unsigned char *baseAddr)
{
- unsigned long *gpuData = ((unsigned long *) baseAddr);
+ uint32_t *gpuData = ((uint32_t *) baseAddr);
if(GlobalTextIL && GlobalTextTP<2)
{
@@ -7160,7 +7154,7 @@ void drawPoly4FT(unsigned char * baseAddr)
void drawPoly3GT(unsigned char * baseAddr)
{
- unsigned long *gpuData = ((unsigned long *) baseAddr);
+ uint32_t *gpuData = ((uint32_t *) baseAddr);
if(GlobalTextIL && GlobalTextTP<2)
{
@@ -7224,7 +7218,7 @@ void drawPoly3GT(unsigned char * baseAddr)
void drawPoly4GT(unsigned char *baseAddr)
{
- unsigned long *gpuData = ((unsigned long *) baseAddr);
+ uint32_t *gpuData = ((uint32_t *) baseAddr);
if(GlobalTextIL && GlobalTextTP<2)
{
@@ -7315,9 +7309,9 @@ void drawPoly4GT(unsigned char *baseAddr)
// SPRITE FUNCS
////////////////////////////////////////////////////////////////////////
-void DrawSoftwareSpriteTWin(unsigned char * baseAddr,long w,long h)
+void DrawSoftwareSpriteTWin(unsigned char * baseAddr, int w, int h)
{
- unsigned long *gpuData = (unsigned long *)baseAddr;
+ uint32_t *gpuData = (uint32_t *)baseAddr;
short sx0,sy0,sx1,sy1,sx2,sy2,sx3,sy3;
short tx0,ty0,tx1,ty1,tx2,ty2,tx3,ty3;
@@ -7355,12 +7349,12 @@ void DrawSoftwareSpriteTWin(unsigned char * baseAddr,long w,long h)
////////////////////////////////////////////////////////////////////////
-void DrawSoftwareSpriteMirror(unsigned char * baseAddr,long w,long h)
+void DrawSoftwareSpriteMirror(unsigned char * baseAddr, int w, int h)
{
- long sprtY,sprtX,sprtW,sprtH,lXDir,lYDir;
- long clutY0,clutX0,clutP,textX0,textY0,sprtYa,sprCY,sprCX,sprA;
+ int sprtY,sprtX,sprtW,sprtH,lXDir,lYDir;
+ int clutY0,clutX0,clutP,textX0,textY0,sprtYa,sprCY,sprCX,sprA;
short tC;
- unsigned long *gpuData = (unsigned long *)baseAddr;
+ uint32_t *gpuData = (uint32_t *)baseAddr;
sprtY = ly0;
sprtX = lx0;
sprtH = h;
@@ -7457,10 +7451,10 @@ void DrawSoftwareSpriteMirror(unsigned char * baseAddr,long w,long h)
////////////////////////////////////////////////////////////////////////
-void DrawSoftwareSprite_IL(unsigned char * baseAddr,short w,short h,long tx,long ty)
+void DrawSoftwareSprite_IL(unsigned char * baseAddr,short w,short h,int tx,int ty)
{
- long sprtY,sprtX,sprtW,sprtH,tdx,tdy;
- unsigned long *gpuData = (unsigned long *)baseAddr;
+ int sprtY,sprtX,sprtW,sprtH,tdx,tdy;
+ uint32_t *gpuData = (uint32_t *)baseAddr;
sprtY = ly0;
sprtX = lx0;
@@ -7495,13 +7489,13 @@ void DrawSoftwareSprite_IL(unsigned char * baseAddr,short w,short h,long tx,long
////////////////////////////////////////////////////////////////////////
-void DrawSoftwareSprite(unsigned char * baseAddr,short w,short h,long tx,long ty)
+void DrawSoftwareSprite(unsigned char *baseAddr, short w, short h, int tx, int ty)
{
- long sprtY,sprtX,sprtW,sprtH;
- long clutY0,clutX0,clutP,textX0,textY0,sprtYa,sprCY,sprCX,sprA;
- short tC,tC2;
- unsigned long *gpuData = (unsigned long *)baseAddr;
- unsigned char * pV;
+ int sprtY, sprtX, sprtW, sprtH;
+ int clutY0, clutX0, clutP, textX0, textY0, sprtYa, sprCY, sprCX, sprA;
+ short tC, tC2;
+ uint32_t *gpuData = (uint32_t *)baseAddr;
+ unsigned char *pV;
BOOL bWT,bWS;
if(GlobalTextIL && GlobalTextTP<2)
@@ -7594,8 +7588,8 @@ void DrawSoftwareSprite(unsigned char * baseAddr,short w,short h,long tx,long ty
{
tC=*pV++;
- GetTextureTransColG32_S((unsigned long *)&psxVuw[sprA],
- (((long)psxVuw[clutP+((tC>>4)&0xf)])<<16)|
+ GetTextureTransColG32_S((uint32_t *)&psxVuw[sprA],
+ (((int)psxVuw[clutP+((tC>>4)&0xf)])<<16)|
psxVuw[clutP+(tC&0x0f)]);
}
@@ -7625,8 +7619,8 @@ void DrawSoftwareSprite(unsigned char * baseAddr,short w,short h,long tx,long ty
{
tC=*pV++;
- GetTextureTransColG32_SPR((unsigned long *)&psxVuw[sprA],
- (((long)psxVuw[clutP+((tC>>4)&0xf)])<<16)|
+ GetTextureTransColG32_SPR((uint32_t *)&psxVuw[sprA],
+ (((int)psxVuw[clutP+((tC>>4)&0xf)])<<16)|
psxVuw[clutP+(tC&0x0f)]);
}
@@ -7653,8 +7647,8 @@ void DrawSoftwareSprite(unsigned char * baseAddr,short w,short h,long tx,long ty
for(sprCX=0;sprCX<sprtW;sprCX+=2,sprA+=2)
{
tC = *pV++;tC2 = *pV++;
- GetTextureTransColG32_S((unsigned long *)&psxVuw[sprA],
- (((long)psxVuw[clutP+tC2])<<16)|
+ GetTextureTransColG32_S((uint32_t *)&psxVuw[sprA],
+ (((int)psxVuw[clutP+tC2])<<16)|
psxVuw[clutP+tC]);
}
if(sprCX==sprtW)
@@ -7672,8 +7666,8 @@ void DrawSoftwareSprite(unsigned char * baseAddr,short w,short h,long tx,long ty
for(sprCX=0;sprCX<sprtW;sprCX+=2,sprA+=2)
{
tC = *pV++;tC2 = *pV++;
- GetTextureTransColG32_SPR((unsigned long *)&psxVuw[sprA],
- (((long)psxVuw[clutP+tC2])<<16)|
+ GetTextureTransColG32_SPR((uint32_t *)&psxVuw[sprA],
+ (((int)psxVuw[clutP+tC2])<<16)|
psxVuw[clutP+tC]);
}
if(sprCX==sprtW)
@@ -7696,8 +7690,8 @@ void DrawSoftwareSprite(unsigned char * baseAddr,short w,short h,long tx,long ty
for (sprCX=0;sprCX<sprtW;sprCX+=2,sprA+=2)
{
- GetTextureTransColG32_S((unsigned long *)&psxVuw[sprA],
- (((long)psxVuw[(sprCY<<10) + textX0 + sprCX +1])<<16)|
+ GetTextureTransColG32_S((uint32_t *)&psxVuw[sprA],
+ (((int)psxVuw[(sprCY<<10) + textX0 + sprCX +1])<<16)|
psxVuw[(sprCY<<10) + textX0 + sprCX]);
}
if(sprCX==sprtW)
@@ -7716,8 +7710,8 @@ void DrawSoftwareSprite(unsigned char * baseAddr,short w,short h,long tx,long ty
for (sprCX=0;sprCX<sprtW;sprCX+=2,sprA+=2)
{
- GetTextureTransColG32_SPR((unsigned long *)&psxVuw[sprA],
- (((long)psxVuw[(sprCY<<10) + textX0 + sprCX +1])<<16)|
+ GetTextureTransColG32_SPR((uint32_t *)&psxVuw[sprA],
+ (((int)psxVuw[(sprCY<<10) + textX0 + sprCX +1])<<16)|
psxVuw[(sprCY<<10) + textX0 + sprCX]);
}
if(sprCX==sprtW)
@@ -7742,11 +7736,11 @@ void DrawSoftwareSprite(unsigned char * baseAddr,short w,short h,long tx,long ty
///////////////////////////////////////////////////////////////////////
-void Line_E_SE_Shade(int x0, int y0, int x1, int y1, unsigned long rgb0, unsigned long rgb1)
+void Line_E_SE_Shade(int x0, int y0, int x1, int y1, uint32_t rgb0, uint32_t rgb1)
{
int dx, dy, incrE, incrSE, d;
- unsigned long r0, g0, b0, r1, g1, b1;
- long dr, dg, db;
+ uint32_t r0, g0, b0, r1, g1, b1;
+ int dr, dg, db;
r0 = (rgb0 & 0x00ff0000);
g0 = (rgb0 & 0x0000ff00) << 8;
@@ -7760,15 +7754,15 @@ void Line_E_SE_Shade(int x0, int y0, int x1, int y1, unsigned long rgb0, unsigne
if (dx > 0)
{
- dr = ((long)r1 - (long)r0) / dx;
- dg = ((long)g1 - (long)g0) / dx;
- db = ((long)b1 - (long)b0) / dx;
+ dr = ((int)r1 - (int)r0) / dx;
+ dg = ((int)g1 - (int)g0) / dx;
+ db = ((int)b1 - (int)b0) / dx;
}
else
{
- dr = ((long)r1 - (long)r0);
- dg = ((long)g1 - (long)g0);
- db = ((long)b1 - (long)b0);
+ dr = ((int)r1 - (int)r0);
+ dg = ((int)g1 - (int)g0);
+ db = ((int)b1 - (int)b0);
}
d = 2*dy - dx; /* Initial value of d */
@@ -7801,11 +7795,11 @@ void Line_E_SE_Shade(int x0, int y0, int x1, int y1, unsigned long rgb0, unsigne
///////////////////////////////////////////////////////////////////////
-void Line_S_SE_Shade(int x0, int y0, int x1, int y1, unsigned long rgb0, unsigned long rgb1)
+void Line_S_SE_Shade(int x0, int y0, int x1, int y1, uint32_t rgb0, uint32_t rgb1)
{
int dx, dy, incrS, incrSE, d;
- unsigned long r0, g0, b0, r1, g1, b1;
- long dr, dg, db;
+ uint32_t r0, g0, b0, r1, g1, b1;
+ int dr, dg, db;
r0 = (rgb0 & 0x00ff0000);
g0 = (rgb0 & 0x0000ff00) << 8;
@@ -7819,15 +7813,15 @@ void Line_S_SE_Shade(int x0, int y0, int x1, int y1, unsigned long rgb0, unsigne
if (dy > 0)
{
- dr = ((long)r1 - (long)r0) / dy;
- dg = ((long)g1 - (long)g0) / dy;
- db = ((long)b1 - (long)b0) / dy;
+ dr = ((int)r1 - (int)r0) / dy;
+ dg = ((int)g1 - (int)g0) / dy;
+ db = ((int)b1 - (int)b0) / dy;
}
else
{
- dr = ((long)r1 - (long)r0);
- dg = ((long)g1 - (long)g0);
- db = ((long)b1 - (long)b0);
+ dr = ((int)r1 - (int)r0);
+ dg = ((int)g1 - (int)g0);
+ db = ((int)b1 - (int)b0);
}
d = 2*dx - dy; /* Initial value of d */
@@ -7860,11 +7854,11 @@ void Line_S_SE_Shade(int x0, int y0, int x1, int y1, unsigned long rgb0, unsigne
///////////////////////////////////////////////////////////////////////
-void Line_N_NE_Shade(int x0, int y0, int x1, int y1, unsigned long rgb0, unsigned long rgb1)
+void Line_N_NE_Shade(int x0, int y0, int x1, int y1, uint32_t rgb0, uint32_t rgb1)
{
int dx, dy, incrN, incrNE, d;
- unsigned long r0, g0, b0, r1, g1, b1;
- long dr, dg, db;
+ uint32_t r0, g0, b0, r1, g1, b1;
+ int dr, dg, db;
r0 = (rgb0 & 0x00ff0000);
g0 = (rgb0 & 0x0000ff00) << 8;
@@ -7878,15 +7872,15 @@ void Line_N_NE_Shade(int x0, int y0, int x1, int y1, unsigned long rgb0, unsigne
if (dy > 0)
{
- dr = ((long)r1 - (long)r0) / dy;
- dg = ((long)g1 - (long)g0) / dy;
- db = ((long)b1 - (long)b0) / dy;
+ dr = ((uint32_t)r1 - (uint32_t)r0) / dy;
+ dg = ((uint32_t)g1 - (uint32_t)g0) / dy;
+ db = ((uint32_t)b1 - (uint32_t)b0) / dy;
}
else
{
- dr = ((long)r1 - (long)r0);
- dg = ((long)g1 - (long)g0);
- db = ((long)b1 - (long)b0);
+ dr = ((uint32_t)r1 - (uint32_t)r0);
+ dg = ((uint32_t)g1 - (uint32_t)g0);
+ db = ((uint32_t)b1 - (uint32_t)b0);
}
d = 2*dx - dy; /* Initial value of d */
@@ -7919,11 +7913,11 @@ void Line_N_NE_Shade(int x0, int y0, int x1, int y1, unsigned long rgb0, unsigne
///////////////////////////////////////////////////////////////////////
-void Line_E_NE_Shade(int x0, int y0, int x1, int y1, unsigned long rgb0, unsigned long rgb1)
+void Line_E_NE_Shade(int x0, int y0, int x1, int y1, uint32_t rgb0, uint32_t rgb1)
{
int dx, dy, incrE, incrNE, d;
- unsigned long r0, g0, b0, r1, g1, b1;
- long dr, dg, db;
+ uint32_t r0, g0, b0, r1, g1, b1;
+ int dr, dg, db;
r0 = (rgb0 & 0x00ff0000);
g0 = (rgb0 & 0x0000ff00) << 8;
@@ -7937,15 +7931,15 @@ void Line_E_NE_Shade(int x0, int y0, int x1, int y1, unsigned long rgb0, unsigne
if (dx > 0)
{
- dr = ((long)r1 - (long)r0) / dx;
- dg = ((long)g1 - (long)g0) / dx;
- db = ((long)b1 - (long)b0) / dx;
+ dr = ((int)r1 - (int)r0) / dx;
+ dg = ((int)g1 - (int)g0) / dx;
+ db = ((int)b1 - (int)b0) / dx;
}
else
{
- dr = ((long)r1 - (long)r0);
- dg = ((long)g1 - (long)g0);
- db = ((long)b1 - (long)b0);
+ dr = ((int)r1 - (int)r0);
+ dg = ((int)g1 - (int)g0);
+ db = ((int)b1 - (int)b0);
}
d = 2*dy - dx; /* Initial value of d */
@@ -7978,11 +7972,11 @@ void Line_E_NE_Shade(int x0, int y0, int x1, int y1, unsigned long rgb0, unsigne
///////////////////////////////////////////////////////////////////////
-void VertLineShade(int x, int y0, int y1, unsigned long rgb0, unsigned long rgb1)
+void VertLineShade(int x, int y0, int y1, uint32_t rgb0, uint32_t rgb1)
{
int y, dy;
- unsigned long r0, g0, b0, r1, g1, b1;
- long dr, dg, db;
+ uint32_t r0, g0, b0, r1, g1, b1;
+ int dr, dg, db;
r0 = (rgb0 & 0x00ff0000);
g0 = (rgb0 & 0x0000ff00) << 8;
@@ -7995,15 +7989,15 @@ void VertLineShade(int x, int y0, int y1, unsigned long rgb0, unsigned long rgb1
if (dy > 0)
{
- dr = ((long)r1 - (long)r0) / dy;
- dg = ((long)g1 - (long)g0) / dy;
- db = ((long)b1 - (long)b0) / dy;
+ dr = ((int)r1 - (int)r0) / dy;
+ dg = ((int)g1 - (int)g0) / dy;
+ db = ((int)b1 - (int)b0) / dy;
}
else
{
- dr = ((long)r1 - (long)r0);
- dg = ((long)g1 - (long)g0);
- db = ((long)b1 - (long)b0);
+ dr = ((int)r1 - (int)r0);
+ dg = ((int)g1 - (int)g0);
+ db = ((int)b1 - (int)b0);
}
if (y0 < drawY)
@@ -8028,11 +8022,11 @@ void VertLineShade(int x, int y0, int y1, unsigned long rgb0, unsigned long rgb1
///////////////////////////////////////////////////////////////////////
-void HorzLineShade(int y, int x0, int x1, unsigned long rgb0, unsigned long rgb1)
+void HorzLineShade(int y, int x0, int x1, uint32_t rgb0, uint32_t rgb1)
{
int x, dx;
- unsigned long r0, g0, b0, r1, g1, b1;
- long dr, dg, db;
+ uint32_t r0, g0, b0, r1, g1, b1;
+ int dr, dg, db;
r0 = (rgb0 & 0x00ff0000);
g0 = (rgb0 & 0x0000ff00) << 8;
@@ -8045,15 +8039,15 @@ void HorzLineShade(int y, int x0, int x1, unsigned long rgb0, unsigned long rgb1
if (dx > 0)
{
- dr = ((long)r1 - (long)r0) / dx;
- dg = ((long)g1 - (long)g0) / dx;
- db = ((long)b1 - (long)b0) / dx;
+ dr = ((int)r1 - (int)r0) / dx;
+ dg = ((int)g1 - (int)g0) / dx;
+ db = ((int)b1 - (int)b0) / dx;
}
else
{
- dr = ((long)r1 - (long)r0);
- dg = ((long)g1 - (long)g0);
- db = ((long)b1 - (long)b0);
+ dr = ((int)r1 - (int)r0);
+ dg = ((int)g1 - (int)g0);
+ db = ((int)b1 - (int)b0);
}
if (x0 < drawX)
@@ -8243,10 +8237,10 @@ void HorzLineFlat(int y, int x0, int x1, unsigned short colour)
///////////////////////////////////////////////////////////////////////
/* Bresenham Line drawing function */
-void DrawSoftwareLineShade(long rgb0, long rgb1)
+void DrawSoftwareLineShade(int rgb0, int rgb1)
{
short x0, y0, x1, y1, xt, yt;
- long rgbt;
+ int rgbt;
double m, dy, dx;
if(lx0>drawW && lx1>drawW) return;
@@ -8316,7 +8310,7 @@ void DrawSoftwareLineShade(long rgb0, long rgb1)
///////////////////////////////////////////////////////////////////////
-void DrawSoftwareLineFlat(long rgb)
+void DrawSoftwareLineFlat(int rgb)
{
short x0, y0, x1, y1, xt, yt;
double m, dy, dx;
diff --git a/plugins/peopsxgl/soft.h b/plugins/peopsxgl/soft.h
index b0e540c9..d4a7e3d4 100644
--- a/plugins/peopsxgl/soft.h
+++ b/plugins/peopsxgl/soft.h
@@ -41,18 +41,18 @@ void offsetPSX2(void);
void offsetPSX3(void);
void offsetPSX4(void);
-void FillSoftwareAreaTrans(short x0,short y0,short x1,short y1,unsigned short col);
-void FillSoftwareArea(short x0,short y0,short x1,short y1,unsigned short col);
-void drawPoly3G(long rgb1, long rgb2, long rgb3);
-void drawPoly4G(long rgb1, long rgb2, long rgb3, long rgb4);
-void drawPoly3F(long rgb);
-void drawPoly4F(long rgb);
-void drawPoly4FT(unsigned char * baseAddr);
-void drawPoly4GT(unsigned char * baseAddr);
-void drawPoly3FT(unsigned char * baseAddr);
-void drawPoly3GT(unsigned char * baseAddr);
-void DrawSoftwareSprite(unsigned char * baseAddr,short w,short h,long tx,long ty);
-void DrawSoftwareSpriteTWin(unsigned char * baseAddr,long w,long h);
-void DrawSoftwareSpriteMirror(unsigned char * baseAddr,long w,long h);
+void FillSoftwareAreaTrans(short x0, short y0, short x1, short y1, unsigned short col);
+void FillSoftwareArea(short x0, short y0, short x1, short y1, unsigned short col);
+void drawPoly3G(int rgb1, int rgb2, int rgb3);
+void drawPoly4G(int rgb1, int rgb2, int rgb3, int rgb4);
+void drawPoly3F(int rgb);
+void drawPoly4F(int rgb);
+void drawPoly4FT(unsigned char *baseAddr);
+void drawPoly4GT(unsigned char *baseAddr);
+void drawPoly3FT(unsigned char *baseAddr);
+void drawPoly3GT(unsigned char *baseAddr);
+void DrawSoftwareSprite(unsigned char *baseAddr, short w, short h, int tx, int ty);
+void DrawSoftwareSpriteTWin(unsigned char *baseAddr, int w, int h);
+void DrawSoftwareSpriteMirror(unsigned char *baseAddr, int w, int h);
#endif // _GPU_SOFT_H_
diff --git a/plugins/peopsxgl/texture.c b/plugins/peopsxgl/texture.c
index c41df389..01630dad 100644
--- a/plugins/peopsxgl/texture.c
+++ b/plugins/peopsxgl/texture.c
@@ -78,12 +78,12 @@ GLuint gTexMovieName=0;
GLuint gTexBlurName=0;
GLuint gTexFrameName=0;
int iTexGarbageCollection=1;
-unsigned long dwTexPageComp=0;
+uint32_t dwTexPageComp=0;
int iVRamSize=0;
int iClampType=GL_CLAMP;
void (*LoadSubTexFn) (int,int,short,short);
-unsigned long (*PalTexturedColourFn) (unsigned long);
+uint32_t (*PalTexturedColourFn) (uint32_t);
////////////////////////////////////////////////////////////////////////
// defines
@@ -117,7 +117,7 @@ unsigned long (*PalTexturedColourFn) (unsigned long);
////////////////////////////////////////////////////////////////////////
-unsigned char * CheckTextureInSubSCache(long TextureMode,unsigned long GivenClutId,unsigned short * pCache);
+unsigned char * CheckTextureInSubSCache(int TextureMode, uint32_t GivenClutId, unsigned short *pCache);
void LoadSubTexturePageSort(int pageid, int mode, short cx, short cy);
void LoadPackedSubTexturePageSort(int pageid, int mode, short cx, short cy);
void DefineSubTextureSort(void);
@@ -129,7 +129,7 @@ void DefineSubTextureSort(void);
GLint giWantedRGBA=4;
GLint giWantedFMT=GL_RGBA;
GLint giWantedTYPE=GL_UNSIGNED_BYTE;
-long GlobalTexturePage;
+int GlobalTexturePage;
GLint XTexS;
GLint YTexS;
GLint DXTexS;
@@ -140,7 +140,7 @@ BOOL bUse15bitMdec=FALSE;
int iFrameTexType=0;
int iFrameReadType=0;
-unsigned long (*TCF[2]) (unsigned long);
+uint32_t (*TCF[2]) (uint32_t);
unsigned short (*PTCF[2]) (unsigned short);
////////////////////////////////////////////////////////////////////////
@@ -151,7 +151,7 @@ unsigned short (*PTCF[2]) (unsigned short);
typedef struct textureWndCacheEntryTag
{
- unsigned long ClutID;
+ uint32_t ClutID;
short pageid;
short textureMode;
short Opaque;
@@ -164,7 +164,7 @@ typedef struct textureWndCacheEntryTag
typedef struct textureSubCacheEntryTagS
{
- unsigned long ClutID;
+ uint32_t ClutID;
EXLong pos;
unsigned char posTX;
unsigned char posTY;
@@ -184,16 +184,16 @@ textureSubCacheEntryS * pscSubtexStore[3][MAXTPAGES_MAX];
EXLong * pxSsubtexLeft [MAXSORTTEX_MAX];
GLuint uiStexturePage[MAXSORTTEX_MAX];
-unsigned short usLRUTexPage=0;
+unsigned short usLRUTexPage = 0;
-int iMaxTexWnds=0;
-int iTexWndTurn=0;
-int iTexWndLimit=MAXWNDTEXCACHE/2;
+int iMaxTexWnds = 0;
+int iTexWndTurn = 0;
+int iTexWndLimit = MAXWNDTEXCACHE/2;
-GLubyte * texturepart=NULL;
-GLubyte * texturebuffer=NULL;
-unsigned long g_x1,g_y1,g_x2,g_y2;
-unsigned char ubOpaqueDraw=0;
+GLubyte * texturepart = NULL;
+GLubyte * texturebuffer = NULL;
+uint32_t g_x1,g_y1,g_x2,g_y2;
+unsigned char ubOpaqueDraw = 0;
unsigned short MAXTPAGES = 32;
unsigned short CLUTMASK = 0x7fff;
@@ -205,7 +205,7 @@ unsigned short MAXSORTTEX = 196;
// porting... and honestly: nowadays the speed gain would be pointless
////////////////////////////////////////////////////////////////////////
-unsigned long XP8RGBA(unsigned long BGR)
+uint32_t XP8RGBA(uint32_t BGR)
{
if(!(BGR&0xffff)) return 0x50000000;
if(DrawSemiTrans && !(BGR&0x8000))
@@ -213,7 +213,7 @@ unsigned long XP8RGBA(unsigned long BGR)
return ((((BGR<<3)&0xf8)|((BGR<<6)&0xf800)|((BGR<<9)&0xf80000))&0xffffff)|0xff000000;
}
-unsigned long XP8RGBAEx(unsigned long BGR)
+uint32_t XP8RGBAEx(uint32_t BGR)
{
if(!(BGR&0xffff)) return 0x03000000;
if(DrawSemiTrans && !(BGR&0x8000))
@@ -221,9 +221,9 @@ unsigned long XP8RGBAEx(unsigned long BGR)
return ((((BGR<<3)&0xf8)|((BGR<<6)&0xf800)|((BGR<<9)&0xf80000))&0xffffff)|0xff000000;
}
-unsigned long CP8RGBA(unsigned long BGR)
+uint32_t CP8RGBA(uint32_t BGR)
{
- unsigned long l;
+ uint32_t l;
if(!(BGR&0xffff)) return 0x50000000;
if(DrawSemiTrans && !(BGR&0x8000))
{ubOpaqueDraw=1;return ((((BGR<<3)&0xf8)|((BGR<<6)&0xf800)|((BGR<<9)&0xf80000))&0xffffff);}
@@ -232,9 +232,9 @@ unsigned long CP8RGBA(unsigned long BGR)
return l;
}
-unsigned long CP8RGBAEx(unsigned long BGR)
+uint32_t CP8RGBAEx(uint32_t BGR)
{
- unsigned long l;
+ uint32_t l;
if(!(BGR&0xffff)) return 0x03000000;
if(DrawSemiTrans && !(BGR&0x8000))
{ubOpaqueDraw=1;return ((((BGR<<3)&0xf8)|((BGR<<6)&0xf800)|((BGR<<9)&0xf80000))&0xffffff);}
@@ -243,33 +243,33 @@ unsigned long CP8RGBAEx(unsigned long BGR)
return l;
}
-unsigned long XP8RGBA_0(unsigned long BGR)
+uint32_t XP8RGBA_0(uint32_t BGR)
{
if(!(BGR&0xffff)) return 0x50000000;
return ((((BGR<<3)&0xf8)|((BGR<<6)&0xf800)|((BGR<<9)&0xf80000))&0xffffff)|0xff000000;
}
-unsigned long XP8RGBAEx_0(unsigned long BGR)
+uint32_t XP8RGBAEx_0(uint32_t BGR)
{
if(!(BGR&0xffff)) return 0x03000000;
return ((((BGR<<3)&0xf8)|((BGR<<6)&0xf800)|((BGR<<9)&0xf80000))&0xffffff)|0xff000000;
}
-unsigned long XP8BGRA_0(unsigned long BGR)
+uint32_t XP8BGRA_0(uint32_t BGR)
{
if(!(BGR&0xffff)) return 0x50000000;
return ((((BGR>>7)&0xf8)|((BGR<<6)&0xf800)|((BGR<<19)&0xf80000))&0xffffff)|0xff000000;
}
-unsigned long XP8BGRAEx_0(unsigned long BGR)
+uint32_t XP8BGRAEx_0(uint32_t BGR)
{
if(!(BGR&0xffff)) return 0x03000000;
return ((((BGR>>7)&0xf8)|((BGR<<6)&0xf800)|((BGR<<19)&0xf80000))&0xffffff)|0xff000000;
}
-unsigned long CP8RGBA_0(unsigned long BGR)
+uint32_t CP8RGBA_0(uint32_t BGR)
{
- unsigned long l;
+ uint32_t l;
if(!(BGR&0xffff)) return 0x50000000;
l=((((BGR<<3)&0xf8)|((BGR<<6)&0xf800)|((BGR<<9)&0xf80000))&0xffffff)|0xff000000;
@@ -277,9 +277,9 @@ unsigned long CP8RGBA_0(unsigned long BGR)
return l;
}
-unsigned long CP8RGBAEx_0(unsigned long BGR)
+uint32_t CP8RGBAEx_0(uint32_t BGR)
{
- unsigned long l;
+ uint32_t l;
if(!(BGR&0xffff)) return 0x03000000;
l=((((BGR<<3)&0xf8)|((BGR<<6)&0xf800)|((BGR<<9)&0xf80000))&0xffffff)|0xff000000;
@@ -287,9 +287,9 @@ unsigned long CP8RGBAEx_0(unsigned long BGR)
return l;
}
-unsigned long CP8BGRA_0(unsigned long BGR)
+uint32_t CP8BGRA_0(uint32_t BGR)
{
- unsigned long l;
+ uint32_t l;
if(!(BGR&0xffff)) return 0x50000000;
l=((((BGR>>7)&0xf8)|((BGR<<6)&0xf800)|((BGR<<19)&0xf80000))&0xffffff)|0xff000000;
@@ -297,9 +297,9 @@ unsigned long CP8BGRA_0(unsigned long BGR)
return l;
}
-unsigned long CP8BGRAEx_0(unsigned long BGR)
+uint32_t CP8BGRAEx_0(uint32_t BGR)
{
- unsigned long l;
+ uint32_t l;
if(!(BGR&0xffff)) return 0x03000000;
l=((((BGR>>7)&0xf8)|((BGR<<6)&0xf800)|((BGR<<19)&0xf80000))&0xffffff)|0xff000000;
@@ -307,41 +307,41 @@ unsigned long CP8BGRAEx_0(unsigned long BGR)
return l;
}
-unsigned long XP8RGBA_1(unsigned long BGR)
+uint32_t XP8RGBA_1(uint32_t BGR)
{
if(!(BGR&0xffff)) return 0x50000000;
if(!(BGR&0x8000)) {ubOpaqueDraw=1;return ((((BGR<<3)&0xf8)|((BGR<<6)&0xf800)|((BGR<<9)&0xf80000))&0xffffff);}
return ((((BGR<<3)&0xf8)|((BGR<<6)&0xf800)|((BGR<<9)&0xf80000))&0xffffff)|0xff000000;
}
-unsigned long XP8RGBAEx_1(unsigned long BGR)
+uint32_t XP8RGBAEx_1(uint32_t BGR)
{
if(!(BGR&0xffff)) return 0x03000000;
if(!(BGR&0x8000)) {ubOpaqueDraw=1;return ((((BGR<<3)&0xf8)|((BGR<<6)&0xf800)|((BGR<<9)&0xf80000))&0xffffff);}
return ((((BGR<<3)&0xf8)|((BGR<<6)&0xf800)|((BGR<<9)&0xf80000))&0xffffff)|0xff000000;
}
-unsigned long XP8BGRA_1(unsigned long BGR)
+uint32_t XP8BGRA_1(uint32_t BGR)
{
if(!(BGR&0xffff)) return 0x50000000;
if(!(BGR&0x8000)) {ubOpaqueDraw=1;return ((((BGR>>7)&0xf8)|((BGR<<6)&0xf800)|((BGR<<19)&0xf80000))&0xffffff);}
return ((((BGR>>7)&0xf8)|((BGR<<6)&0xf800)|((BGR<<19)&0xf80000))&0xffffff)|0xff000000;
}
-unsigned long XP8BGRAEx_1(unsigned long BGR)
+uint32_t XP8BGRAEx_1(uint32_t BGR)
{
if(!(BGR&0xffff)) return 0x03000000;
if(!(BGR&0x8000)) {ubOpaqueDraw=1;return ((((BGR>>7)&0xf8)|((BGR<<6)&0xf800)|((BGR<<19)&0xf80000))&0xffffff);}
return ((((BGR>>7)&0xf8)|((BGR<<6)&0xf800)|((BGR<<19)&0xf80000))&0xffffff)|0xff000000;
}
-unsigned long P8RGBA(unsigned long BGR)
+uint32_t P8RGBA(uint32_t BGR)
{
if(!(BGR&0xffff)) return 0;
return ((((BGR<<3)&0xf8)|((BGR<<6)&0xf800)|((BGR<<9)&0xf80000))&0xffffff)|0xff000000;
}
-unsigned long P8BGRA(unsigned long BGR)
+uint32_t P8BGRA(uint32_t BGR)
{
if(!(BGR&0xffff)) return 0;
return ((((BGR>>7)&0xf8)|((BGR<<6)&0xf800)|((BGR<<19)&0xf80000))&0xffffff)|0xff000000;
@@ -699,7 +699,7 @@ void ResetTextureArea(BOOL bDelTex)
// Invalidate tex windows
////////////////////////////////////////////////////////////////////////
-void InvalidateWndTextureArea(long X,long Y,long W, long H)
+void InvalidateWndTextureArea(int X, int Y, int W, int H)
{
int i,px1,px2,py1,py2,iYM=1;
textureWndCacheEntry * tsw=wcWndtexStore;
@@ -790,11 +790,12 @@ void MarkFree(textureSubCacheEntryS * tsx)
}
}
-void InvalidateSubSTextureArea(long X,long Y,long W, long H)
+void InvalidateSubSTextureArea(int X, int Y, int W, int H)
{
- int i,j,k,iMax,px,py,px1,px2,py1,py2,iYM=1;
- EXLong npos;textureSubCacheEntryS * tsb;
- long x1,x2,y1,y2,xa,sw;
+ int i,j,k,iMax,px,py,px1,px2,py1,py2,iYM = 1;
+ EXLong npos;
+ textureSubCacheEntryS *tsb;
+ int x1,x2,y1,y2,xa,sw;
W+=X-1;
H+=Y-1;
@@ -884,9 +885,9 @@ void InvalidateTextureAreaEx(void)
short W=sxmax-sxmin;
short H=symax-symin;
- if(W==0 && H==0) return;
+ if (W == 0 && H == 0) return;
- if(iMaxTexWnds)
+ if (iMaxTexWnds)
InvalidateWndTextureArea(sxmin,symin,W,H);
InvalidateSubSTextureArea(sxmin,symin,W,H);
@@ -894,13 +895,13 @@ void InvalidateTextureAreaEx(void)
////////////////////////////////////////////////////////////////////////
-void InvalidateTextureArea(long X,long Y,long W, long H)
+void InvalidateTextureArea(int X, int Y, int W, int H)
{
- if(W==0 && H==0) return;
+ if (W == 0 && H == 0) return;
- if(iMaxTexWnds) InvalidateWndTextureArea(X,Y,W,H);
+ if (iMaxTexWnds) InvalidateWndTextureArea(X, Y, W, H);
- InvalidateSubSTextureArea(X,Y,W,H);
+ InvalidateSubSTextureArea(X, Y, W, H);
}
@@ -910,7 +911,7 @@ void InvalidateTextureArea(long X,long Y,long W, long H)
void DefineTextureWnd(void)
{
- if(gTexName==0)
+ if (gTexName == 0)
glGenTextures(1, &gTexName);
glBindTexture(GL_TEXTURE_2D, gTexName);
@@ -941,27 +942,28 @@ void DefineTextureWnd(void)
void LoadStretchPackedWndTexturePage(int pageid, int mode, short cx, short cy)
{
- unsigned long start,row,column,j,sxh,sxm,ldx,ldy,ldxo;
- unsigned int palstart;
- unsigned short *px,*pa,*ta;
+ uint32_t start, row, column, j, sxh, sxm, ldx, ldy, ldxo;
+ unsigned int palstart;
+ unsigned short *px, *pa, *ta;
unsigned char *cSRCPtr,*cOSRCPtr;
unsigned short *wSRCPtr,*wOSRCPtr;
- unsigned long LineOffset;unsigned short s;
- int pmult=pageid/16;
+ uint32_t LineOffset;
+ unsigned short s;
+ int pmult = pageid / 16;
unsigned short (*LPTCOL)(unsigned short);
- LPTCOL=PTCF[DrawSemiTrans];
+ LPTCOL = PTCF[DrawSemiTrans];
- ldxo=TWin.Position.x1-TWin.OPosition.x1;
- ldy =TWin.Position.y1-TWin.OPosition.y1;
+ ldxo = TWin.Position.x1-TWin.OPosition.x1;
+ ldy = TWin.Position.y1-TWin.OPosition.y1;
- pa=px=(unsigned short *)ubPaletteBuffer;
- ta=(unsigned short *)texturepart;
- palstart=cx+(cy*1024);
+ pa = px = (unsigned short *)ubPaletteBuffer;
+ ta = (unsigned short *)texturepart;
+ palstart = cx + (cy * 1024);
- ubOpaqueDraw=0;
+ ubOpaqueDraw = 0;
- switch(mode)
+ switch (mode)
{
//--------------------------------------------------//
// 4bit texture load ..
@@ -1133,27 +1135,27 @@ void LoadStretchPackedWndTexturePage(int pageid, int mode, short cx, short cy)
void LoadStretchWndTexturePage(int pageid, int mode, short cx, short cy)
{
- unsigned long start,row,column,j,sxh,sxm,ldx,ldy,ldxo,s;
+ uint32_t start,row,column,j,sxh,sxm,ldx,ldy,ldxo,s;
unsigned int palstart;
- unsigned long *px,*pa,*ta;
+ uint32_t *px,*pa,*ta;
unsigned char *cSRCPtr,*cOSRCPtr;
unsigned short *wSRCPtr,*wOSRCPtr;
- unsigned long LineOffset;
- int pmult=pageid/16;
- unsigned long (*LTCOL)(unsigned long);
+ uint32_t LineOffset;
+ int pmult = pageid / 16;
+ uint32_t (*LTCOL)(uint32_t);
- LTCOL=TCF[DrawSemiTrans];
+ LTCOL = TCF[DrawSemiTrans];
ldxo=TWin.Position.x1-TWin.OPosition.x1;
ldy =TWin.Position.y1-TWin.OPosition.y1;
- pa=px=(unsigned long *)ubPaletteBuffer;
- ta=(unsigned long *)texturepart;
- palstart=cx+(cy*1024);
+ pa = px = (uint32_t *)ubPaletteBuffer;
+ ta = (uint32_t *)texturepart;
+ palstart = cx + (cy * 1024);
- ubOpaqueDraw=0;
+ ubOpaqueDraw = 0;
- switch(mode)
+ switch (mode)
{
//--------------------------------------------------//
// 4bit texture load ..
@@ -1344,12 +1346,12 @@ void LoadStretchWndTexturePage(int pageid, int mode, short cx, short cy)
void LoadPackedWndTexturePage(int pageid, int mode, short cx, short cy)
{
- unsigned long start,row,column,j,sxh,sxm;
+ uint32_t start,row,column,j,sxh,sxm;
unsigned int palstart;
unsigned short *px,*pa,*ta;
unsigned char *cSRCPtr;
unsigned short *wSRCPtr;
- unsigned long LineOffset;
+ uint32_t LineOffset;
int pmult=pageid/16;
unsigned short (*LPTCOL)(unsigned short);
@@ -1486,24 +1488,24 @@ void LoadPackedWndTexturePage(int pageid, int mode, short cx, short cy)
void LoadWndTexturePage(int pageid, int mode, short cx, short cy)
{
- unsigned long start,row,column,j,sxh,sxm;
+ uint32_t start,row,column,j,sxh,sxm;
unsigned int palstart;
- unsigned long *px,*pa,*ta;
+ uint32_t *px,*pa,*ta;
unsigned char *cSRCPtr;
unsigned short *wSRCPtr;
- unsigned long LineOffset;
- int pmult=pageid/16;
- unsigned long (*LTCOL)(unsigned long);
+ uint32_t LineOffset;
+ int pmult = pageid / 16;
+ uint32_t (*LTCOL)(uint32_t);
LTCOL=TCF[DrawSemiTrans];
- pa=px=(unsigned long *)ubPaletteBuffer;
- ta=(unsigned long *)texturepart;
- palstart=cx+(cy*1024);
+ pa = px = (uint32_t *)ubPaletteBuffer;
+ ta = (uint32_t *)texturepart;
+ palstart = cx + (cy * 1024);
- ubOpaqueDraw=0;
+ ubOpaqueDraw = 0;
- switch(mode)
+ switch (mode)
{
//--------------------------------------------------//
// 4bit texture load ..
@@ -1647,13 +1649,13 @@ void LoadWndTexturePage(int pageid, int mode, short cx, short cy)
void UploadTexWndPal(int mode,short cx,short cy)
{
unsigned int i,iSize;
- unsigned short * wSrcPtr;
- unsigned long * ta=(unsigned long *)texturepart;
+ unsigned short *wSrcPtr;
+ uint32_t *ta = (uint32_t *)texturepart;
- wSrcPtr=psxVuw+cx+(cy*1024);
- if(mode==0) i=4; else i=64;
- iSize=i<<2;
- ubOpaqueDraw=0;
+ wSrcPtr = psxVuw + cx + (cy * 1024);
+ if (mode == 0) i = 4; else i = 64;
+ iSize = i << 2;
+ ubOpaqueDraw = 0;
do
{
@@ -1702,15 +1704,15 @@ void DefinePalTextureWnd(void)
void LoadPalWndTexturePage(int pageid, int mode, short cx, short cy)
{
- unsigned long start,row,column,j,sxh,sxm;
+ uint32_t start,row,column,j,sxh,sxm;
unsigned char *ta;
unsigned char *cSRCPtr;
- unsigned long LineOffset;
- int pmult=pageid/16;
+ uint32_t LineOffset;
+ int pmult = pageid / 16;
- ta=(unsigned char *)texturepart;
+ ta = (unsigned char *)texturepart;
- switch(mode)
+ switch (mode)
{
//--------------------------------------------------//
// 4bit texture load ..
@@ -1762,18 +1764,18 @@ void LoadPalWndTexturePage(int pageid, int mode, short cx, short cy)
void LoadStretchPalWndTexturePage(int pageid, int mode, short cx, short cy)
{
- unsigned long start,row,column,j,sxh,sxm,ldx,ldy,ldxo;
+ uint32_t start,row,column,j,sxh,sxm,ldx,ldy,ldxo;
unsigned char *ta,s;
unsigned char *cSRCPtr,*cOSRCPtr;
- unsigned long LineOffset;
- int pmult=pageid/16;
+ uint32_t LineOffset;
+ int pmult = pageid / 16;
- ldxo=TWin.Position.x1-TWin.OPosition.x1;
- ldy =TWin.Position.y1-TWin.OPosition.y1;
+ ldxo = TWin.Position.x1-TWin.OPosition.x1;
+ ldy = TWin.Position.y1-TWin.OPosition.y1;
- ta=(unsigned char *)texturepart;
+ ta = (unsigned char *)texturepart;
- switch(mode)
+ switch (mode)
{
//--------------------------------------------------//
// 4bit texture load ..
@@ -1840,30 +1842,32 @@ void LoadStretchPalWndTexturePage(int pageid, int mode, short cx, short cy)
// tex window: main selecting, cache handler included
////////////////////////////////////////////////////////////////////////
-GLuint LoadTextureWnd(long pageid,long TextureMode,unsigned long GivenClutId)
+GLuint LoadTextureWnd(int pageid, int TextureMode, uint32_t GivenClutId)
{
- textureWndCacheEntry * ts, * tsx=NULL;
- int i;short cx,cy;
+ textureWndCacheEntry *ts, *tsx = NULL;
+ int i;
+ short cx,cy;
EXLong npos;
- npos.c[3]=TWin.Position.x0;
- npos.c[2]=TWin.OPosition.x1;
- npos.c[1]=TWin.Position.y0;
- npos.c[0]=TWin.OPosition.y1;
+ npos.c[3] = TWin.Position.x0;
+ npos.c[2] = TWin.OPosition.x1;
+ npos.c[1] = TWin.Position.y0;
+ npos.c[0] = TWin.OPosition.y1;
- g_x1=TWin.Position.x0;g_x2=g_x1+TWin.Position.x1-1;
- g_y1=TWin.Position.y0;g_y2=g_y1+TWin.Position.y1-1;
+ g_x1 = TWin.Position.x0; g_x2 = g_x1 + TWin.Position.x1 - 1;
+ g_y1 = TWin.Position.y0; g_y2 = g_y1 + TWin.Position.y1 - 1;
- if(TextureMode==2) {GivenClutId=0;cx=cy=0;}
+ if (TextureMode == 2) { GivenClutId = 0; cx = cy = 0; }
else
{
- cx=((GivenClutId << 4) & 0x3F0);cy=((GivenClutId >> 6) & CLUTYMASK);
- GivenClutId=(GivenClutId&CLUTMASK)|(DrawSemiTrans<<30);
+ cx = ((GivenClutId << 4) & 0x3F0);
+ cy = ((GivenClutId >> 6) & CLUTYMASK);
+ GivenClutId = (GivenClutId & CLUTMASK) | (DrawSemiTrans << 30);
// palette check sum
{
- unsigned long l=0,row;
- unsigned long * lSRCPtr=(unsigned long *)(psxVuw+cx+(cy*1024));
+ uint32_t l = 0,row;
+ uint32_t *lSRCPtr = (uint32_t *)(psxVuw + cx + (cy * 1024));
if(TextureMode==1) for(row=1;row<129;row++) l+=((*lSRCPtr++)-1)*row;
else for(row=1;row<9;row++) l+=((*lSRCPtr++)-1)<<row;
l=(l+HIWORD(l))&0x3fffL;
@@ -2056,10 +2060,10 @@ void DefineTextureMovie(void)
unsigned char * LoadDirectMovieFast(void)
{
- long row,column;
+ int row,column;
unsigned int startxy;
- unsigned long * ta=(unsigned long *)texturepart;
+ uint32_t *ta=(uint32_t *)texturepart;
if(PSXDisplay.RGB24)
{
@@ -2072,14 +2076,14 @@ unsigned char * LoadDirectMovieFast(void)
pD=(unsigned char *)&psxVuw[startxy];
for(row=xrMovieArea.x0;row<xrMovieArea.x1;row++)
{
- *ta++=*((unsigned long *)pD)|0xff000000;
+ *ta++=*((uint32_t *)pD)|0xff000000;
pD+=3;
}
}
}
else
{
- unsigned long (*LTCOL)(unsigned long);
+ uint32_t (*LTCOL)(uint32_t);
LTCOL=XP8RGBA_0;//TCF[0];
@@ -2100,14 +2104,14 @@ unsigned char * LoadDirectMovieFast(void)
GLuint LoadTextureMovieFast(void)
{
- long row,column;
+ int row,column;
unsigned int start,startxy;
if(bGLFastMovie)
{
if(PSXDisplay.RGB24)
{
- unsigned char * pD;unsigned long lu1,lu2;
+ unsigned char * pD; uint32_t lu1,lu2;
unsigned short * ta=(unsigned short *)texturepart;
short sx0=xrMovieArea.x1-1;
@@ -2121,17 +2125,17 @@ GLuint LoadTextureMovieFast(void)
for(row=xrMovieArea.x0;row<sx0;row+=2)
{
- lu1=*((unsigned long *)pD);pD+=3;
- lu2=*((unsigned long *)pD);pD+=3;
+ lu1=*((uint32_t *)pD);pD+=3;
+ lu2=*((uint32_t *)pD);pD+=3;
- *((unsigned long *)ta)=
+ *((uint32_t *)ta)=
(XMBLUE(lu1)|XMGREEN(lu1)|XMRED(lu1)|1)|
((XMBLUE(lu2)|XMGREEN(lu2)|XMRED(lu2)|1)<<16);
ta+=2;
}
if(row==sx0)
{
- lu1=*((unsigned long *)pD);
+ lu1=*((uint32_t *)pD);
*ta++=XMBLUE(lu1)|XMGREEN(lu1)|XMRED(lu1)|1;
}
}
@@ -2139,7 +2143,7 @@ GLuint LoadTextureMovieFast(void)
else
{
unsigned short *ta=(unsigned short *)texturepart;
- unsigned long lc;
+ uint32_t lc;
short sx0=xrMovieArea.x1-1;
for(column=xrMovieArea.y0;column<xrMovieArea.y1;column++)
@@ -2147,8 +2151,8 @@ GLuint LoadTextureMovieFast(void)
startxy=((1024)*column)+xrMovieArea.x0;
for(row=xrMovieArea.x0;row<sx0;row+=2)
{
- lc=*((unsigned long *)&psxVuw[startxy]);
- *((unsigned long *)ta)=
+ lc=*((uint32_t *)&psxVuw[startxy]);
+ *((uint32_t *)ta)=
((lc&0x001f001f)<<11)|((lc&0x03e003e0)<<1)|((lc&0x7c007c00)>>9)|0x00010001;
ta+=2;startxy+=2;
}
@@ -2161,36 +2165,36 @@ GLuint LoadTextureMovieFast(void)
{
if(PSXDisplay.RGB24)
{
- unsigned char * pD;
- unsigned long * ta=(unsigned long *)texturepart;
+ unsigned char *pD;
+ uint32_t *ta = (uint32_t *)texturepart;
startxy=((1024)*xrMovieArea.y0)+xrMovieArea.x0;
for(column=xrMovieArea.y0;column<xrMovieArea.y1;column++,startxy+=1024)
{
//startxy=((1024)*column)+xrMovieArea.x0;
- pD=(unsigned char *)&psxVuw[startxy];
+ pD = (unsigned char *)&psxVuw[startxy];
for(row=xrMovieArea.x0;row<xrMovieArea.x1;row++)
{
- *ta++=*((unsigned long *)pD)|0xff000000;
+ *ta++=*((uint32_t *)pD)|0xff000000;
pD+=3;
}
}
}
else
{
- unsigned long (*LTCOL)(unsigned long);
- unsigned long *ta;
+ uint32_t (*LTCOL)(uint32_t);
+ uint32_t *ta;
- LTCOL=XP8RGBA_0;//TCF[0];
+ LTCOL = XP8RGBA_0;//TCF[0];
- ubOpaqueDraw=0;
- ta=(unsigned long *)texturepart;
+ ubOpaqueDraw = 0;
+ ta = (uint32_t *)texturepart;
- for(column=xrMovieArea.y0;column<xrMovieArea.y1;column++)
+ for (column = xrMovieArea.y0; column < xrMovieArea.y1; column++)
{
- startxy=((1024)*column)+xrMovieArea.x0;
- for(row=xrMovieArea.x0;row<xrMovieArea.x1;row++)
+ startxy = (1024 * column) + xrMovieArea.x0;
+ for (row = xrMovieArea.x0; row < xrMovieArea.x1; row++)
*ta++=LTCOL(psxVuw[startxy++]|0x8000);
}
}
@@ -2220,7 +2224,8 @@ GLuint LoadTextureMovie(void)
if(PSXDisplay.RGB24)
{
- unsigned char * pD;unsigned long lu;
+ unsigned char * pD;
+ uint32_t lu;
unsigned short * ta=(unsigned short *)texturepart;
if(b_X)
@@ -2231,7 +2236,7 @@ GLuint LoadTextureMovie(void)
pD=(unsigned char *)&psxVuw[startxy];
for(row=xrMovieArea.x0;row<xrMovieArea.x1;row++)
{
- lu=*((unsigned long *)pD);pD+=3;
+ lu=*((uint32_t *)pD);pD+=3;
*ta++=XMBLUE(lu)|XMGREEN(lu)|XMRED(lu)|1;
}
*ta++=*(ta-1);
@@ -2252,7 +2257,7 @@ GLuint LoadTextureMovie(void)
pD=(unsigned char *)&psxVuw[startxy];
for(row=xrMovieArea.x0;row<xrMovieArea.x1;row++)
{
- lu=*((unsigned long *)pD);pD+=3;
+ lu=*((uint32_t *)pD);pD+=3;
*ta++=XMBLUE(lu)|XMGREEN(lu)|XMRED(lu)|1;
}
}
@@ -2321,7 +2326,7 @@ GLuint LoadTextureMovie(void)
if(PSXDisplay.RGB24)
{
unsigned char * pD;
- unsigned long * ta=(unsigned long *)texturepart;
+ uint32_t * ta=(uint32_t *)texturepart;
if(b_X)
{
@@ -2331,7 +2336,7 @@ GLuint LoadTextureMovie(void)
pD=(unsigned char *)&psxVuw[startxy];
for(row=xrMovieArea.x0;row<xrMovieArea.x1;row++)
{
- *ta++=*((unsigned long *)pD)|0xff000000;
+ *ta++=*((uint32_t *)pD)|0xff000000;
pD+=3;
}
*ta++=*(ta-1);
@@ -2352,7 +2357,7 @@ GLuint LoadTextureMovie(void)
pD=(unsigned char *)&psxVuw[startxy];
for(row=xrMovieArea.x0;row<xrMovieArea.x1;row++)
{
- *ta++=*((unsigned long *)pD)|0xff000000;
+ *ta++=*((uint32_t *)pD)|0xff000000;
pD+=3;
}
}
@@ -2366,13 +2371,13 @@ GLuint LoadTextureMovie(void)
}
else
{
- unsigned long (*LTCOL)(unsigned long);
- unsigned long *ta;
+ uint32_t (*LTCOL)(uint32_t);
+ uint32_t *ta;
LTCOL=XP8RGBA_0;//TCF[0];
ubOpaqueDraw=0;
- ta=(unsigned long *)texturepart;
+ ta=(uint32_t *)texturepart;
if(b_X)
{
@@ -2423,7 +2428,7 @@ GLuint LoadTextureMovie(void)
GLuint BlackFake15BitTexture(void)
{
- long pmult;short x1,x2,y1,y2;
+ int pmult;short x1,x2,y1,y2;
if(PSXDisplay.InterlacedTest) return 0;
@@ -2471,7 +2476,7 @@ GLuint BlackFake15BitTexture(void)
}
else
{
- unsigned long * ta=(unsigned long *)texturepart;
+ uint32_t *ta=(uint32_t *)texturepart;
for(y1=0;y1<=4;y1++)
for(x1=0;x1<=4;x1++)
*ta++=0xff000000;
@@ -2500,7 +2505,7 @@ int iFTex=512;
GLuint Fake15BitTexture(void)
{
- long pmult;short x1,x2,y1,y2;int iYAdjust;
+ int pmult;short x1,x2,y1,y2;int iYAdjust;
float ScaleX,ScaleY;RECT rSrc;
if(iFrameTexType==1) return BlackFake15BitTexture();
@@ -2685,28 +2690,28 @@ GLuint Fake15BitTexture(void)
void LoadSubTexturePageSort(int pageid, int mode, short cx, short cy)
{
- unsigned long start,row,column,j,sxh,sxm;
+ uint32_t start,row,column,j,sxh,sxm;
unsigned int palstart;
- unsigned long *px,*pa,*ta;
+ uint32_t *px,*pa,*ta;
unsigned char *cSRCPtr;
unsigned short *wSRCPtr;
- unsigned long LineOffset;
- unsigned long x2a,xalign=0;
- unsigned long x1=gl_ux[7];
- unsigned long x2=gl_ux[6];
- unsigned long y1=gl_ux[5];
- unsigned long y2=gl_ux[4];
- unsigned long dx=x2-x1+1;
- unsigned long dy=y2-y1+1;
+ uint32_t LineOffset;
+ uint32_t x2a,xalign=0;
+ uint32_t x1=gl_ux[7];
+ uint32_t x2=gl_ux[6];
+ uint32_t y1=gl_ux[5];
+ uint32_t y2=gl_ux[4];
+ uint32_t dx=x2-x1+1;
+ uint32_t dy=y2-y1+1;
int pmult=pageid/16;
- unsigned long (*LTCOL)(unsigned long);
+ uint32_t (*LTCOL)(uint32_t);
unsigned int a,r,g,b,cnt,h;
- unsigned long scol[8];
+ uint32_t scol[8];
LTCOL=TCF[DrawSemiTrans];
- pa=px=(unsigned long *)ubPaletteBuffer;
- ta=(unsigned long *)texturepart;
+ pa=px=(uint32_t *)ubPaletteBuffer;
+ ta=(uint32_t *)texturepart;
palstart=cx+(cy<<10);
ubOpaqueDraw=0;
@@ -2893,10 +2898,10 @@ void LoadSubTexturePageSort(int pageid, int mode, short cx, short cy)
if(YTexS)
{
- ta=(unsigned long *)texturepart;
- pa=(unsigned long *)texturepart+x2a;
+ ta=(uint32_t *)texturepart;
+ pa=(uint32_t *)texturepart+x2a;
row=x2a;do {*ta++=*pa++;row--;} while(row);
- pa=(unsigned long *)texturepart+dy*x2a;
+ pa=(uint32_t *)texturepart+dy*x2a;
ta=pa+x2a;
row=x2a;do {*ta++=*pa++;row--;} while(row);
YTexS--;
@@ -2905,10 +2910,10 @@ void LoadSubTexturePageSort(int pageid, int mode, short cx, short cy)
if(XTexS)
{
- ta=(unsigned long *)texturepart;
+ ta=(uint32_t *)texturepart;
pa=ta+1;
row=dy;do {*ta=*pa;ta+=x2a;pa+=x2a;row--;} while(row);
- pa=(unsigned long *)texturepart+dx;
+ pa=(uint32_t *)texturepart+dx;
ta=pa+1;
row=dy;do {*ta=*pa;ta+=x2a;pa+=x2a;row--;} while(row);
XTexS--;
@@ -2922,7 +2927,7 @@ void LoadSubTexturePageSort(int pageid, int mode, short cx, short cy)
if((iFilterType==4 || iFilterType==6) && ly0==ly1 && ly2==ly3 && lx0==lx3 && lx1==lx2)
{DefineSubTextureSort();return;}
- ta=(unsigned long *)texturepart;
+ ta=(uint32_t *)texturepart;
x1=dx-1;
y1=dy-1;
@@ -3053,19 +3058,19 @@ void LoadSubTexturePageSort(int pageid, int mode, short cx, short cy)
void LoadPackedSubTexturePageSort(int pageid, int mode, short cx, short cy)
{
- unsigned long start,row,column,j,sxh,sxm;
+ uint32_t start,row,column,j,sxh,sxm;
unsigned int palstart;
unsigned short *px,*pa,*ta;
unsigned char *cSRCPtr;
unsigned short *wSRCPtr;
- unsigned long LineOffset;
- unsigned long x2a,xalign=0;
- unsigned long x1=gl_ux[7];
- unsigned long x2=gl_ux[6];
- unsigned long y1=gl_ux[5];
- unsigned long y2=gl_ux[4];
- unsigned long dx=x2-x1+1;
- unsigned long dy=y2-y1+1;
+ uint32_t LineOffset;
+ uint32_t x2a,xalign=0;
+ uint32_t x1=gl_ux[7];
+ uint32_t x2=gl_ux[6];
+ uint32_t y1=gl_ux[5];
+ uint32_t y2=gl_ux[4];
+ uint32_t dx=x2-x1+1;
+ uint32_t dy=y2-y1+1;
int pmult=pageid/16;
unsigned short (*LPTCOL)(unsigned short);
unsigned int a,r,g,b,cnt,h;
@@ -4119,11 +4124,11 @@ void DefineSubTextureSortHiRes(void)
{
if(DXTexS < 4 || DYTexS < 4 || iHiResTextures==2)
{
- unsigned long * pS,*pD1,*pD2;
+ uint32_t * pS,*pD1,*pD2;
dx2=(DXTexS<<1);
- pS=(unsigned long *)texturepart;
- pD1=(unsigned long *)texturebuffer;
- pD2=(unsigned long *)texturebuffer;
+ pS=(uint32_t *)texturepart;
+ pD1=(uint32_t *)texturebuffer;
+ pD2=(uint32_t *)texturebuffer;
pD2+=dx2;
for(y=0;y<DYTexS;y++)
{
@@ -4245,17 +4250,17 @@ void DoTexGarbageCollection(void)
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
-unsigned char * CheckTextureInSubSCache(long TextureMode,unsigned long GivenClutId,unsigned short * pCache)
+unsigned char * CheckTextureInSubSCache(int TextureMode, uint32_t GivenClutId, unsigned short * pCache)
{
textureSubCacheEntryS * tsx, * tsb, *tsg;//, *tse=NULL;
int i,iMax;EXLong npos;
unsigned char cx,cy;
- int iC,j,k;unsigned long rx,ry,mx,my;
+ int iC,j,k;uint32_t rx,ry,mx,my;
EXLong * ul=0, * uls;
EXLong rfree;
unsigned char cXAdj,cYAdj;
- npos.l=*((unsigned long *)&gl_ux[4]);
+ npos.l=*((uint32_t *)&gl_ux[4]);
//--------------------------------------------------------------//
// find matching texturepart first... speed up...
@@ -4341,7 +4346,7 @@ unsigned char * CheckTextureInSubSCache(long TextureMode,unsigned long GivenClut
if(tsx) // 3. if one or more found, create a new rect with bigger size
{
- *((unsigned long *)&gl_ux[4])=npos.l=rfree.l;
+ *((uint32_t *)&gl_ux[4])=npos.l=rfree.l;
rx=(int)rfree.c[2]-(int)rfree.c[3];
ry=(int)rfree.c[0]-(int)rfree.c[1];
DoTexGarbageCollection();
@@ -4555,7 +4560,7 @@ ENDLOOP:
BOOL GetCompressTexturePlace(textureSubCacheEntryS * tsx)
{
- int i,j,k,iMax,iC;unsigned long rx,ry,mx,my;
+ int i,j,k,iMax,iC;uint32_t rx,ry,mx,my;
EXLong * ul=0, * uls, rfree;
unsigned char cXAdj=1,cYAdj=1;
@@ -4693,11 +4698,11 @@ void CompressTextureSpace(void)
textureSubCacheEntryS * tsx, * tsg, * tsb;
int i,j,k,m,n,iMax;EXLong * ul, r,opos;
short sOldDST=DrawSemiTrans,cx,cy;
- long lOGTP=GlobalTexturePage;
- unsigned long l,row;
- unsigned long * lSRCPtr;
+ int lOGTP=GlobalTexturePage;
+ uint32_t l,row;
+ uint32_t *lSRCPtr;
- opos.l=*((unsigned long *)&gl_ux[4]);
+ opos.l=*((uint32_t *)&gl_ux[4]);
// 1. mark all textures as free
for(i=0;i<iSortTexCnt;i++)
@@ -4750,7 +4755,7 @@ void CompressTextureSpace(void)
if(j!=2)
{
// palette check sum
- l=0;lSRCPtr=(unsigned long *)(psxVuw+cx+(cy*1024));
+ l=0;lSRCPtr=(uint32_t *)(psxVuw+cx+(cy*1024));
if(j==1) for(row=1;row<129;row++) l+=((*lSRCPtr++)-1)*row;
else for(row=1;row<9;row++) l+=((*lSRCPtr++)-1)<<row;
l=((l+HIWORD(l))&0x3fffL)<<16;
@@ -4777,7 +4782,7 @@ void CompressTextureSpace(void)
usLRUTexPage=0;
DrawSemiTrans=sOldDST;
GlobalTexturePage=lOGTP;
- *((unsigned long *)&gl_ux[4])=opos.l;
+ *((uint32_t *)&gl_ux[4])=opos.l;
dwTexPageComp=0;
return;
@@ -4785,7 +4790,7 @@ void CompressTextureSpace(void)
if(tsx->ClutID&(1<<30)) DrawSemiTrans=1;
else DrawSemiTrans=0;
- *((unsigned long *)&gl_ux[4])=r.l;
+ *((uint32_t *)&gl_ux[4])=r.l;
gTexName=uiStexturePage[tsx->cTexID];
LoadSubTexFn(k,j,cx,cy);
@@ -4808,7 +4813,7 @@ void CompressTextureSpace(void)
if(dwTexPageComp==0xffffffff) dwTexPageComp=0;
- *((unsigned long *)&gl_ux[4])=opos.l;
+ *((uint32_t *)&gl_ux[4])=opos.l;
GlobalTexturePage=lOGTP;
DrawSemiTrans=sOldDST;
}
@@ -4823,7 +4828,7 @@ void CompressTextureSpace(void)
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
-GLuint SelectSubTextureS(long TextureMode, unsigned long GivenClutId)
+GLuint SelectSubTextureS(int TextureMode, uint32_t GivenClutId)
{
unsigned char * OPtr;unsigned short iCache;short cx,cy;
@@ -4865,9 +4870,9 @@ GLuint SelectSubTextureS(long TextureMode, unsigned long GivenClutId)
// palette check sum.. removed MMX asm, this easy func works as well
{
- unsigned long l=0,row;
+ uint32_t l=0,row;
- unsigned long * lSRCPtr=(unsigned long *)(psxVuw+cx+(cy*1024));
+ uint32_t *lSRCPtr = (uint32_t *)(psxVuw+cx+(cy*1024));
if(TextureMode==1) for(row=1;row<129;row++) l+=((*lSRCPtr++)-1)*row;
else for(row=1;row<9;row++) l+=((*lSRCPtr++)-1)<<row;
l=(l+HIWORD(l))&0x3fffL;
diff --git a/plugins/peopsxgl/texture.h b/plugins/peopsxgl/texture.h
index 51a897f6..b646af7c 100644
--- a/plugins/peopsxgl/texture.h
+++ b/plugins/peopsxgl/texture.h
@@ -19,42 +19,41 @@
#ifndef _GPU_TEXTURE_H_
#define _GPU_TEXTURE_H_
-#define TEXTUREPAGESIZE 256*256
+#define TEXTUREPAGESIZE 256 * 256
void InitializeTextureStore();
void CleanupTextureStore();
-GLuint LoadTextureWnd(long pageid,long TextureMode,unsigned long GivenClutId);
+GLuint LoadTextureWnd(int pageid, int TextureMode, uint32_t GivenClutId);
GLuint LoadTextureMovie(void);
-void InvalidateTextureArea(long imageX0,long imageY0,long imageX1,long imageY1);
+void InvalidateTextureArea(int imageX0, int imageY0, int imageX1, int imageY1);
void InvalidateTextureAreaEx(void);
void LoadTexturePage(int pageid, int mode, short cx, short cy);
void ResetTextureArea(BOOL bDelTex);
-GLuint SelectSubTextureS(long TextureMode, unsigned long GivenClutId);
+GLuint SelectSubTextureS(int TextureMode, uint32_t GivenClutId);
void CheckTextureMemory(void);
-
void LoadSubTexturePage(int pageid, int mode, short cx, short cy);
void LoadSubTexturePageSort(int pageid, int mode, short cx, short cy);
void LoadPackedSubTexturePage(int pageid, int mode, short cx, short cy);
void LoadPackedSubTexturePageSort(int pageid, int mode, short cx, short cy);
-unsigned long XP8RGBA(unsigned long BGR);
-unsigned long XP8RGBAEx(unsigned long BGR);
-unsigned long XP8RGBA_0(unsigned long BGR);
-unsigned long XP8RGBAEx_0(unsigned long BGR);
-unsigned long XP8BGRA_0(unsigned long BGR);
-unsigned long XP8BGRAEx_0(unsigned long BGR);
-unsigned long XP8RGBA_1(unsigned long BGR);
-unsigned long XP8RGBAEx_1(unsigned long BGR);
-unsigned long XP8BGRA_1(unsigned long BGR);
-unsigned long XP8BGRAEx_1(unsigned long BGR);
-unsigned long P8RGBA(unsigned long BGR);
-unsigned long P8BGRA(unsigned long BGR);
-unsigned long CP8RGBA_0(unsigned long BGR);
-unsigned long CP8RGBAEx_0(unsigned long BGR);
-unsigned long CP8BGRA_0(unsigned long BGR);
-unsigned long CP8BGRAEx_0(unsigned long BGR);
-unsigned long CP8RGBA(unsigned long BGR);
-unsigned long CP8RGBAEx(unsigned long BGR);
+uint32_t XP8RGBA(uint32_t BGR);
+uint32_t XP8RGBAEx(uint32_t BGR);
+uint32_t XP8RGBA_0(uint32_t BGR);
+uint32_t XP8RGBAEx_0(uint32_t BGR);
+uint32_t XP8BGRA_0(uint32_t BGR);
+uint32_t XP8BGRAEx_0(uint32_t BGR);
+uint32_t XP8RGBA_1(uint32_t BGR);
+uint32_t XP8RGBAEx_1(uint32_t BGR);
+uint32_t XP8BGRA_1(uint32_t BGR);
+uint32_t XP8BGRAEx_1(uint32_t BGR);
+uint32_t P8RGBA(uint32_t BGR);
+uint32_t P8BGRA(uint32_t BGR);
+uint32_t CP8RGBA_0(uint32_t BGR);
+uint32_t CP8RGBAEx_0(uint32_t BGR);
+uint32_t CP8BGRA_0(uint32_t BGR);
+uint32_t CP8BGRAEx_0(uint32_t BGR);
+uint32_t CP8RGBA(uint32_t BGR);
+uint32_t CP8RGBAEx(uint32_t BGR);
unsigned short XP5RGBA (unsigned short BGR);
unsigned short XP5RGBA_0 (unsigned short BGR);
unsigned short XP5RGBA_1 (unsigned short BGR);