diff options
| author | iCatButler <i.am.catbutler@gmail.com> | 2016-05-02 15:01:27 +0100 |
|---|---|---|
| committer | iCatButler <i.am.catbutler@gmail.com> | 2016-05-02 15:01:27 +0100 |
| commit | 216c2ff3aefc9e0295ed9b1486935d65f6c13f55 (patch) | |
| tree | 88791c94e67ac8a5b99b9b39238ca4513077adf6 /libpcsxcore/pgxp_gte.c | |
| parent | 153c8eb4997d21d3b2965cf38d4348f05c29860f (diff) | |
| download | pcsxr-216c2ff3aefc9e0295ed9b1486935d65f6c13f55.tar.gz | |
Fix bugs from previous
Fix stray triangles
- Switch to full floating point RTPS/RTPT
- Clamp w values to near plane
Fix texture corruption in 1.78, copy 2.4 Tweak
- Remove matrix replacement
- Add W component to vertices
- Wrap glVertex3fv calls
- Use counter to call glVertex4fv for PGXP vertices only
Diffstat (limited to 'libpcsxcore/pgxp_gte.c')
| -rw-r--r-- | libpcsxcore/pgxp_gte.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/libpcsxcore/pgxp_gte.c b/libpcsxcore/pgxp_gte.c index d5341dc6..5d681d85 100644 --- a/libpcsxcore/pgxp_gte.c +++ b/libpcsxcore/pgxp_gte.c @@ -306,8 +306,8 @@ void PGXP_RTPS(u32 _n, u32 _v) float MAC2 = TRY + (R21 * VX(_n)) + (R22 * VY(_n)) + (R23 * VZ(_n));
float MAC3 = TRZ + (R31 * VX(_n)) + (R32 * VY(_n)) + (R33 * VZ(_n));
- float SZ3 = MAC3;
float H = psxRegs.CP2C.p[26].sw.l;
+ float SZ3 = max(MAC3, H);
float h_over_sz3 = H / SZ3;
// Offsets with 16-bit shift
@@ -333,26 +333,26 @@ int PGXP_NLCIP_valid() float PGXP_NCLIP()
{
-// float nclip = ((SX0 * SY1) + (SX1 * SY2) + (SX2 * SY0) - (SX0 * SY2) - (SX1 * SY0) - (SX2 * SY1));
+ float nclip = ((SX0 * SY1) + (SX1 * SY2) + (SX2 * SY0) - (SX0 * SY2) - (SX1 * SY0) - (SX2 * SY1));
// ensure fractional values are not incorrectly rounded to 0
- //if ((fabs(nclip) < 1.0f) && (nclip != 0))
- // nclip += (nclip < 0.f ? -1 : 1);
+ if ((fabs(nclip) < 1.0f) && (nclip != 0))
+ nclip += (nclip < 0.f ? -1 : 1);
- float AX = SX1 - SX0;
- float AY = SY1 - SY0;
+ //float AX = SX1 - SX0;
+ //float AY = SY1 - SY0;
- float BX = SX2 - SX0;
- float BY = SY2 - SY0;
+ //float BX = SX2 - SX0;
+ //float BY = SY2 - SY0;
- // normalise A and B
- float mA = sqrt((AX*AX) + (AY*AY));
- float mB = sqrt((BX*BX) + (BY*BY));
+ //// normalise A and B
+ //float mA = sqrt((AX*AX) + (AY*AY));
+ //float mB = sqrt((BX*BX) + (BY*BY));
- // calculate AxB to get Z component of C
- float CZ = ((AX * BY) - (AY * BX)) * (1 << 12);
+ //// calculate AxB to get Z component of C
+ //float CZ = ((AX * BY) - (AY * BX)) * (1 << 12);
- return CZ;// nclip;
+ return nclip;
}
static precise_value PGXP_MFC2_int(u32 reg)
|
