1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-02 09:03:37 +00:00

Fix compare of vertex Z and test Z in gSPBranchLessZ.

Fixed GT64 - Championship Edition: missing polygon #151
This commit is contained in:
Sergey Lipskiy 2016-09-28 23:24:17 +07:00
parent 25aa8889a8
commit 966b2d0f93
3 changed files with 6 additions and 6 deletions

View File

@ -42,7 +42,7 @@ void F3DEX_Quad( u32 w0, u32 w1 )
void F3DEX_Branch_Z( u32 w0, u32 w1 )
{
gSPBranchLessZ( gDP.half_1, _SHIFTR( w0, 1, 11 ), (s32)w1 / 65535.0f / 1023.0f );
gSPBranchLessZ(gDP.half_1, _SHIFTR(w0, 1, 11), _SHIFTR(w1, 16, 16));
}
void F3DEX_Load_uCode( u32 w0, u32 w1 )

View File

@ -1233,9 +1233,9 @@ void gSPBranchList( u32 dl )
RSP.nextCmd = _SHIFTR( *(u32*)&RDRAM[address], 24, 8 );
}
void gSPBranchLessZ( u32 branchdl, u32 vtx, f32 zval )
void gSPBranchLessZ( u32 branchdl, u32 vtx, u32 zval )
{
u32 address = RSP_SegmentToPhysical( branchdl );
const u32 address = RSP_SegmentToPhysical( branchdl );
if ((address + 8) > RDRAMSize) {
#ifdef DEBUG
@ -1247,8 +1247,8 @@ void gSPBranchLessZ( u32 branchdl, u32 vtx, f32 zval )
}
SPVertex & v = video().getRender().getVertex(vtx);
const float zTest = v.z / v.w;
if (zTest > 1.0f || zTest <= zval || !GBI.isBranchLessZ())
const u32 zTest = u32((v.z / v.w) * 1023.0f);
if (zTest > 0x03FF || zTest <= zval || !GBI.isBranchLessZ())
RSP.PC[RSP.PCi] = address;
#ifdef DEBUG

View File

@ -148,7 +148,7 @@ void gSPDMAVertex( u32 v, u32 n, u32 v0 );
void gSPCBFDVertex( u32 v, u32 n, u32 v0 );
void gSPDisplayList( u32 dl );
void gSPBranchList( u32 dl );
void gSPBranchLessZ( u32 branchdl, u32 vtx, f32 zval );
void gSPBranchLessZ( u32 branchdl, u32 vtx, u32 zval );
void gSPDlistCount(u32 count, u32 v);
void gSPSprite2DBase(u32 _base );
void gSPDMATriangles( u32 tris, u32 n );