diff options
| author | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2009-07-27 04:54:58 +0000 |
|---|---|---|
| committer | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2009-07-27 04:54:58 +0000 |
| commit | 490883f1ee71bd58b52719ad6d3337b5122a3127 (patch) | |
| tree | 532ab29706fd2972cea8dd2a5cf12e105a5e49c2 /plugins | |
| parent | 3a8bbe1d897e07a695a2d580ffa575f8263ebd06 (diff) | |
| download | pcsxr-490883f1ee71bd58b52719ad6d3337b5122a3127.tar.gz | |
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@24073 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/dfxvideo/prim.c | 30 | ||||
| -rw-r--r-- | plugins/dfxvideo/soft.c | 6 | ||||
| -rw-r--r-- | plugins/peopsxgl/soft.c | 6 |
3 files changed, 29 insertions, 13 deletions
diff --git a/plugins/dfxvideo/prim.c b/plugins/dfxvideo/prim.c index d1f8c7b0..883bf1af 100644 --- a/plugins/dfxvideo/prim.c +++ b/plugins/dfxvideo/prim.c @@ -569,6 +569,33 @@ void primStoreImage(unsigned char * baseAddr) } //////////////////////////////////////////////////////////////////////// +// Used in Blk Fill +//////////////////////////////////////////////////////////////////////// + +void ClampToPSXScreenOffset(short *x0, short *y0, short *x1, short *y1) +{ + if (*x0 < 0) + { *x1 += *x0; *x0 = 0; } + else + if (*x0 > 1023) + { *x0 = 1023; *x1 = 0; } + + if (*y0 < 0) + { *y1 += *y0; *y0 = 0; } + else + if (*y0 > iGPUHeightMask) + { *y0 = iGPUHeightMask; *y1 = 0; } + + if (*x1 < 0) *x1 = 0; + + if ((*x1 + *x0) > 1024) *x1 = (1024 - *x0); + + if (*y1 < 0) *y1 = 0; + + if ((*y1 + *y0) > iGPUHeight) *y1 = (iGPUHeight - *y0); +} + +//////////////////////////////////////////////////////////////////////// // cmd: blkfill - NO primitive! Doesn't care about draw areas... //////////////////////////////////////////////////////////////////////// @@ -587,11 +614,12 @@ void primBlkFill(unsigned char * baseAddr) // Increase H & W if they are one short of full values, because they never can be full values if (sH >= 1023) sH=1024; if (sW >= 1023) sW=1024; - + // x and y of end pos sW+=sX; sH+=sY; + ClampToPSXScreenOffset(&sX, &sY, &sW, &sH); FillSoftwareArea(sX, sY, sW, sH, BGR24to16(GETLE32(&gpuData[0]))); bDoVSyncUpdate=TRUE; diff --git a/plugins/dfxvideo/soft.c b/plugins/dfxvideo/soft.c index 04a4fbf4..0a55693a 100644 --- a/plugins/dfxvideo/soft.c +++ b/plugins/dfxvideo/soft.c @@ -1038,9 +1038,6 @@ void FillSoftwareAreaTrans(short x0,short y0,short x1, // FILL AREA TRANS { short j,i,dx,dy; - if(y0<0) y0=0; - if(x0<0) x0=0; - if(y0>y1) return; if(x0>x1) return; @@ -1132,9 +1129,6 @@ void FillSoftwareArea(short x0,short y0,short x1, // FILL AREA (BLK FILL) { short j,i,dx,dy; - if(y0<0) y0=0; - if(x0<0) x0=0; - if(y0>y1) return; if(x0>x1) return; diff --git a/plugins/peopsxgl/soft.c b/plugins/peopsxgl/soft.c index e577be8f..e0bd7cc9 100644 --- a/plugins/peopsxgl/soft.c +++ b/plugins/peopsxgl/soft.c @@ -1035,9 +1035,6 @@ void FillSoftwareAreaTrans(short x0,short y0,short x1, // FILL AREA TRANS {
short j,i,dx,dy;
- if(y0<0) y0=0;
- if(x0<0) x0=0;
-
if(y0>y1) return;
if(x0>x1) return;
@@ -1128,9 +1125,6 @@ void FillSoftwareArea(short x0,short y0,short x1, // FILL AREA (BLK FILL) {
short j,i,dx,dy;
- if(y0<0) y0=0;
- if(x0<0) x0=0;
-
if(y0>y1) return;
if(x0>x1) return;
|
