From e8c47c0316f829dc81be076b80742dbf60b6b4dd Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Thu, 22 Dec 2016 18:39:00 +0700 Subject: [PATCH] Use F3D_TRIX instead of F3D_Tri4. Fixed #1307 --- src/F3D.cpp | 9 --------- src/F3D.h | 1 - src/F3DDKR.cpp | 1 - src/F3DGOLDEN.cpp | 6 ++---- src/F3DGOLDEN.h | 4 ++++ src/F3DPD.cpp | 9 ++++----- src/F3DPD.h | 3 +-- src/F3DSETA.cpp | 1 - src/GBI.cpp | 4 ++-- src/GBI.h | 2 +- src/gSP.cpp | 2 +- 11 files changed, 15 insertions(+), 27 deletions(-) diff --git a/src/F3D.cpp b/src/F3D.cpp index e8f28ee8c..cc6c06c68 100644 --- a/src/F3D.cpp +++ b/src/F3D.cpp @@ -254,14 +254,6 @@ void F3D_RDPHalf_Cont( u32 w0, u32 w1 ) { } -void F3D_Tri4( u32 w0, u32 w1 ) -{ - gSP4Triangles( _SHIFTR( w1, 28, 4 ), _SHIFTR( w0, 12, 4 ), _SHIFTR( w1, 24, 4 ), - _SHIFTR( w1, 20, 4 ), _SHIFTR( w0, 8, 4 ), _SHIFTR( w1, 16, 4 ), - _SHIFTR( w1, 12, 4 ), _SHIFTR( w0, 4, 4 ), _SHIFTR( w1, 8, 4 ), - _SHIFTR( w1, 4, 4 ), _SHIFTR( w0, 0, 4 ), _SHIFTR( w1, 0, 4 ) ); -} - void F3D_Init() { gSPSetupFunctions(); @@ -296,5 +288,4 @@ void F3D_Init() GBI_SetGBI( G_RDPHALF_1, F3D_RDPHALF_1, F3D_RDPHalf_1 ); GBI_SetGBI( G_RDPHALF_2, F3D_RDPHALF_2, F3D_RDPHalf_2 ); GBI_SetGBI( G_RDPHALF_CONT, F3D_RDPHALF_CONT, F3D_RDPHalf_Cont ); - GBI_SetGBI( G_TRI4, F3D_TRI4, F3D_Tri4 ); } diff --git a/src/F3D.h b/src/F3D.h index 03b48df9a..85ab9c058 100644 --- a/src/F3D.h +++ b/src/F3D.h @@ -91,7 +91,6 @@ void F3D_Quad( u32 w0, u32 w1 ); void F3D_RDPHalf_1( u32 w0, u32 w1 ); void F3D_RDPHalf_2( u32 w0, u32 w1 ); void F3D_RDPHalf_Cont( u32 w0, u32 w1 ); -void F3D_Tri4( u32 w0, u32 w1 ); void F3D_Init(); #endif diff --git a/src/F3DDKR.cpp b/src/F3DDKR.cpp index 3c96c3798..d334857ed 100644 --- a/src/F3DDKR.cpp +++ b/src/F3DDKR.cpp @@ -130,7 +130,6 @@ void F3DDKR_Init() GBI_SetGBI( G_RDPHALF_1, F3D_RDPHALF_1, F3D_RDPHalf_1 ); GBI_SetGBI( G_RDPHALF_2, F3D_RDPHALF_2, F3D_RDPHalf_2 ); GBI_SetGBI( G_RDPHALF_CONT, F3D_RDPHALF_CONT, F3D_RDPHalf_Cont ); - GBI_SetGBI( G_TRI4, F3D_TRI4, F3D_Tri4 ); gSPSetDMAOffsets( 0, 0 ); } diff --git a/src/F3DGOLDEN.cpp b/src/F3DGOLDEN.cpp index b5cbbfb5b..b52a926a9 100644 --- a/src/F3DGOLDEN.cpp +++ b/src/F3DGOLDEN.cpp @@ -10,13 +10,11 @@ #include "gDP.h" #include "GBI.h" -#define F3DGOLDEN_TRIX 0xB1 #define F3DGOLDEN_MOVEWORD 0xBD -u32 G_GOLDEN_TRIX; u32 G_GOLDEN_MOVEWORD; -void F3DGOLDEN_TriX(u32 w0, u32 w1) +void F3D_TriX(u32 w0, u32 w1) { while(w1 != 0) { s32 v0 = w1 & 0xf; @@ -67,5 +65,5 @@ void F3DGOLDEN_Init() GBI_SetGBI( G_RDPHALF_1, F3D_RDPHALF_1, F3D_RDPHalf_1 ); GBI_SetGBI( G_RDPHALF_2, F3D_RDPHALF_2, F3D_RDPHalf_2 ); GBI_SetGBI( G_RDPHALF_CONT, F3D_RDPHALF_CONT, F3D_RDPHalf_Cont ); - GBI_SetGBI( G_GOLDEN_TRIX, F3DGOLDEN_TRIX, F3DGOLDEN_TriX ); + GBI_SetGBI( G_TRIX, F3D_TRIX, F3D_TriX ); } diff --git a/src/F3DGOLDEN.h b/src/F3DGOLDEN.h index 69cd121db..4849b7a3f 100644 --- a/src/F3DGOLDEN.h +++ b/src/F3DGOLDEN.h @@ -1,7 +1,11 @@ #ifndef F3DGOLDEN_H #define F3DGOLDEN_H +#define F3D_TRIX 0xB1 + void F3DGOLDEN_Init(); +void F3D_TriX(u32 w0, u32 w1); + #endif diff --git a/src/F3DPD.cpp b/src/F3DPD.cpp index a7b97675d..b0a24c286 100644 --- a/src/F3DPD.cpp +++ b/src/F3DPD.cpp @@ -1,13 +1,12 @@ #include "GLideN64.h" #include "Debug.h" #include "F3D.h" +#include "F3DGOLDEN.h" #include "F3DPD.h" #include "N64.h" -#include "RSP.h" -#include "RDP.h" #include "gSP.h" -#include "gDP.h" -#include "GBI.h" + +#define F3DPD_VTXCOLORBASE 0x07 void F3DPD_Vtx( u32 w0, u32 w1 ) { @@ -53,7 +52,7 @@ void F3DPD_Init() GBI_SetGBI( G_RDPHALF_1, F3D_RDPHALF_1, F3D_RDPHalf_1 ); GBI_SetGBI( G_RDPHALF_2, F3D_RDPHALF_2, F3D_RDPHalf_2 ); GBI_SetGBI( G_RDPHALF_CONT, F3D_RDPHALF_CONT, F3D_RDPHalf_Cont ); - GBI_SetGBI( G_TRI4, F3D_TRI4, F3D_Tri4 ); + GBI_SetGBI( G_TRIX, F3D_TRIX, F3D_TriX ); gSPSetDMAOffsets( 0, 0 ); } diff --git a/src/F3DPD.h b/src/F3DPD.h index af450169c..27e0dfdb8 100644 --- a/src/F3DPD.h +++ b/src/F3DPD.h @@ -1,8 +1,7 @@ #ifndef F3DPD_H #define F3DPD_H -#define F3DPD_VTXCOLORBASE 0x07 - void F3DPD_Init(); + #endif diff --git a/src/F3DSETA.cpp b/src/F3DSETA.cpp index 3e3b93660..fd95d3a72 100644 --- a/src/F3DSETA.cpp +++ b/src/F3DSETA.cpp @@ -110,5 +110,4 @@ void F3DSETA_Init() GBI_SetGBI( G_RDPHALF_1, F3DSETA_RDPHALF_1, F3D_RDPHalf_1 ); GBI_SetGBI( G_RDPHALF_2, F3DSETA_RDPHALF_2, F3D_RDPHalf_2 ); GBI_SetGBI( G_RDPHALF_CONT, F3DSETA_RDPHALF_CONT, F3D_RDPHalf_Cont ); - GBI_SetGBI( G_TRI4, F3D_TRI4, F3D_Tri4 ); } diff --git a/src/GBI.cpp b/src/GBI.cpp index 968715d36..851663a31 100644 --- a/src/GBI.cpp +++ b/src/GBI.cpp @@ -69,7 +69,7 @@ u32 G_TEXTURE; u32 G_DMA_IO, G_DMA_DL, G_DMA_TRI, G_DMA_MTX, G_DMA_VTX, G_DMA_TEX_OFFSET, G_DMA_OFFSETS; u32 G_SPECIAL_1, G_SPECIAL_2, G_SPECIAL_3; u32 G_VTX, G_MODIFYVTX, G_VTXCOLORBASE; -u32 G_TRI1, G_TRI2, G_TRI4; +u32 G_TRI1, G_TRI2, G_TRIX; u32 G_QUAD, G_LINE3D; u32 G_RESERVED0, G_RESERVED1, G_RESERVED2, G_RESERVED3; u32 G_SPRITE2D_BASE; @@ -166,7 +166,7 @@ void GBIInfo::_makeCurrent(MicrocodeInfo * _pCurrent) RDP_Init(); - G_TRI1 = G_TRI2 = G_TRI4 = G_QUAD = -1; // For correct work of gSPFlushTriangles() + G_TRI1 = G_TRI2 = G_TRIX = G_QUAD = -1; // For correct work of gSPFlushTriangles() switch (m_pCurrent->type) { case F3D: F3D_Init(); break; diff --git a/src/GBI.h b/src/GBI.h index 5b650cb5a..b516da577 100644 --- a/src/GBI.h +++ b/src/GBI.h @@ -588,7 +588,7 @@ extern u32 G_TEXTURE; extern u32 G_DMA_IO, G_DMA_DL, G_DMA_TRI, G_DMA_MTX, G_DMA_VTX, G_DMA_TEX_OFFSET, G_DMA_OFFSETS; extern u32 G_SPECIAL_1, G_SPECIAL_2, G_SPECIAL_3; extern u32 G_VTX, G_MODIFYVTX, G_VTXCOLORBASE; -extern u32 G_TRI1, G_TRI2, G_TRI4; +extern u32 G_TRI1, G_TRI2, G_TRIX; extern u32 G_QUAD, G_LINE3D; extern u32 G_RESERVED0, G_RESERVED1, G_RESERVED2, G_RESERVED3; extern u32 G_SPRITE2D_BASE; diff --git a/src/gSP.cpp b/src/gSP.cpp index f0aedd0ab..8ea7fd25f 100644 --- a/src/gSP.cpp +++ b/src/gSP.cpp @@ -34,7 +34,7 @@ void gSPFlushTriangles() if ( (RSP.nextCmd != G_TRI1) && (RSP.nextCmd != G_TRI2) && - (RSP.nextCmd != G_TRI4) && + (RSP.nextCmd != G_TRIX) && (RSP.nextCmd != G_QUAD) ) video().getRender().drawTriangles();