diff options
| author | iCatButler <i.am.catbutler@gmail.com> | 2016-03-25 16:25:15 +0000 |
|---|---|---|
| committer | iCatButler <i.am.catbutler@gmail.com> | 2016-03-25 16:25:15 +0000 |
| commit | 7767ea4acbae995cd8e6302bdb7c97e89748dfd8 (patch) | |
| tree | b4a3025b703f8f3f383626aa5a651b2954c3a512 /plugins | |
| parent | 106f6594c9e2ad601deb7ad9bdf5eab8a568c01b (diff) | |
Initial upload of PGXP.
Diffstat (limited to 'plugins')
| -rwxr-xr-x | plugins/peopsxgl/draw.c | 17 | ||||
| -rwxr-xr-x | plugins/peopsxgl/draw.h | 8 | ||||
| -rwxr-xr-x | plugins/peopsxgl/gpu.c | 7 | ||||
| -rwxr-xr-x | plugins/peopsxgl/prim.c | 24 |
4 files changed, 35 insertions, 21 deletions
diff --git a/plugins/peopsxgl/draw.c b/plugins/peopsxgl/draw.c index cb838d33..c3fed1cf 100755 --- a/plugins/peopsxgl/draw.c +++ b/plugins/peopsxgl/draw.c @@ -28,6 +28,7 @@ #include "menu.h" #include "gte_accuracy.h" +#include "pgxp_gpu.h" #if defined(_MACGL) // if you use it, you must include it @@ -943,7 +944,7 @@ void offsetline(void) #define VERTEX_OFFX 0.2f #define VERTEX_OFFY 0.2f -BOOL offsetline(void) +BOOL offsetline(unsigned int* addr) { short x0,x1,y0,y1,dx,dy;float px,py; @@ -1004,6 +1005,8 @@ BOOL offsetline(void) else py= 0.0f; } } + + PGXP_GetVertices(addr, vertex); vertex[0].x=(short)((float)x0-px); vertex[3].x=(short)((float)x0+py); @@ -1040,7 +1043,7 @@ BOOL offsetline(void) ///////////////////////////////////////////////////////// -BOOL offset2(void) +BOOL offset2(unsigned int* addr) { if(bDisplayNotSet) SetOGLDisplaySettings(1); @@ -1066,6 +1069,8 @@ BOOL offset2(void) vertex[1].y=ly1; } + PGXP_GetVertices(addr, vertex); + vertex[0].x+=PSXDisplay.CumulOffset.x; vertex[1].x+=PSXDisplay.CumulOffset.x; vertex[0].y+=PSXDisplay.CumulOffset.y; @@ -1076,7 +1081,7 @@ BOOL offset2(void) ///////////////////////////////////////////////////////// -BOOL offset3(void) +BOOL offset3(unsigned int* addr) { if(bDisplayNotSet) SetOGLDisplaySettings(1); @@ -1109,6 +1114,8 @@ BOOL offset3(void) vertex[2].y=ly2; } + PGXP_GetVertices(addr, vertex); + vertex[0].x+=PSXDisplay.CumulOffset.x; vertex[1].x+=PSXDisplay.CumulOffset.x; vertex[2].x+=PSXDisplay.CumulOffset.x; @@ -1121,7 +1128,7 @@ BOOL offset3(void) ///////////////////////////////////////////////////////// -BOOL offset4(void) +BOOL offset4(unsigned int* addr) { if(bDisplayNotSet) SetOGLDisplaySettings(1); @@ -1161,6 +1168,8 @@ BOOL offset4(void) vertex[3].y=ly3; } + PGXP_GetVertices(addr, vertex); + vertex[0].x+=PSXDisplay.CumulOffset.x; vertex[1].x+=PSXDisplay.CumulOffset.x; vertex[2].x+=PSXDisplay.CumulOffset.x; diff --git a/plugins/peopsxgl/draw.h b/plugins/peopsxgl/draw.h index 10501d37..2f524904 100755 --- a/plugins/peopsxgl/draw.h +++ b/plugins/peopsxgl/draw.h @@ -35,10 +35,10 @@ BOOL bSetupPixelFormat(HDC hDC); int GLinitialize(); void GLcleanup(); -BOOL offset2(void); -BOOL offset3(void); -BOOL offset4(void); -BOOL offsetline(void); +BOOL offset2(unsigned int* addr); +BOOL offset3(unsigned int* addr); +BOOL offset4(unsigned int* addr); +BOOL offsetline(unsigned int* addr); void offsetST(void); void offsetBlk(void); void offsetScreenUpload(int Position); diff --git a/plugins/peopsxgl/gpu.c b/plugins/peopsxgl/gpu.c index d5af3330..65e074d5 100755 --- a/plugins/peopsxgl/gpu.c +++ b/plugins/peopsxgl/gpu.c @@ -48,6 +48,7 @@ static int iOldMode=0; #include "fps.h" #include "key.h" #include "gte_accuracy.h" +#include "PGXP_gpu.h" #ifdef _WINDOWS #include "resource.h" #include "ssave.h" @@ -3145,7 +3146,11 @@ long CALLBACK GPUdmaChain(uint32_t *baseAddrL, uint32_t addr) dmaMem=addr+4; - if(count>0) GPUwriteDataMem(&baseAddrL[dmaMem>>2],count); + if (count > 0) + { + PGXP_SetAddress(dmaMem >> 2); + GPUwriteDataMem(&baseAddrL[dmaMem >> 2], count); + } addr = baseAddrL[addr>>2]&0xffffff; } diff --git a/plugins/peopsxgl/prim.c b/plugins/peopsxgl/prim.c index 6a06a9be..0c78145d 100755 --- a/plugins/peopsxgl/prim.c +++ b/plugins/peopsxgl/prim.c @@ -3105,7 +3105,7 @@ void primPolyF4(unsigned char *baseAddr) lx3 = sgpuData[8]; ly3 = sgpuData[9]; - if(offset4()) return; + if(offset4(baseAddr)) return; bDrawTextured = FALSE; bDrawSmoothShaded = FALSE; @@ -3214,7 +3214,7 @@ void primPolyG4(unsigned char * baseAddr) lx3 = sgpuData[14]; ly3 = sgpuData[15]; - if(offset4()) return; + if(offset4(baseAddr)) return; bDrawTextured = FALSE; bDrawSmoothShaded = TRUE; @@ -3430,7 +3430,7 @@ void primPolyFT3(unsigned char * baseAddr) lx2 = sgpuData[10]; ly2 = sgpuData[11]; - if(offset3()) return; + if(offset3(baseAddr)) return; // do texture UV coordinates stuff gl_ux[0]=gl_ux[3]=baseAddr[8];//gpuData[2]&0xff; @@ -3868,7 +3868,7 @@ void primPolyFT4(unsigned char * baseAddr) lx3 = sgpuData[14]; ly3 = sgpuData[15]; - if(offset4()) return; + if(offset4(baseAddr)) return; gl_vy[0]=baseAddr[9];//((gpuData[2]>>8)&0xff); gl_vy[1]=baseAddr[17];//((gpuData[4]>>8)&0xff); @@ -3953,7 +3953,7 @@ void primPolyGT3(unsigned char *baseAddr) lx2 = sgpuData[14]; ly2 = sgpuData[15]; - if(offset3()) return; + if(offset3(baseAddr)) return; // do texture stuff gl_ux[0]=gl_ux[3]=baseAddr[8];//gpuData[2]&0xff; @@ -4062,7 +4062,7 @@ void primPolyG3(unsigned char *baseAddr) lx2 = sgpuData[10]; ly2 = sgpuData[11]; - if(offset3()) return; + if(offset3(baseAddr)) return; bDrawTextured = FALSE; bDrawSmoothShaded = TRUE; @@ -4109,7 +4109,7 @@ void primPolyGT4(unsigned char *baseAddr) lx3 = sgpuData[20]; ly3 = sgpuData[21]; - if(offset4()) return; + if(offset4(baseAddr)) return; // do texture stuff gl_ux[0]=baseAddr[8];//gpuData[2]&0xff; @@ -4227,7 +4227,7 @@ void primPolyF3(unsigned char *baseAddr) lx2 = sgpuData[6]; ly2 = sgpuData[7]; - if(offset3()) return; + if(offset3(baseAddr)) return; bDrawTextured = FALSE; bDrawSmoothShaded = FALSE; @@ -4318,7 +4318,7 @@ void primLineGEx(unsigned char *baseAddr) ly1 = (short)((gpuData[i]>>16) & 0xffff); lx1 = (short)(gpuData[i] & 0xffff); - if(offsetline()) bDraw=FALSE; else bDraw=TRUE; + if(offsetline(baseAddr)) bDraw=FALSE; else bDraw=TRUE; if (bDraw && ((lx0 != lx1) || (ly0 != ly1))) { @@ -4367,7 +4367,7 @@ void primLineG2(unsigned char *baseAddr) if((lx0 == lx1) && (ly0 == ly1)) return; - if(offsetline()) return; + if(offsetline(baseAddr)) return; SetRenderState(gpuData[0]); SetRenderMode(gpuData[0], FALSE); @@ -4445,7 +4445,7 @@ void primLineFEx(unsigned char *baseAddr) ly1 = (short)((gpuData[i]>>16) & 0xffff); lx1 = (short)(gpuData[i] & 0xffff); - if(!offsetline()) + if(!offsetline(baseAddr)) { if(iOffscreenDrawing) { @@ -4481,7 +4481,7 @@ void primLineF2(unsigned char *baseAddr) lx1 = sgpuData[4]; ly1 = sgpuData[5]; - if(offsetline()) return; + if(offsetline(baseAddr)) return; bDrawTextured = FALSE; bDrawSmoothShaded = FALSE; |
