Skip to content

Commit

Permalink
Use F3D_TRIX instead of F3D_Tri4.
Browse files Browse the repository at this point in the history
Fixed #1307
  • Loading branch information
gonetz committed Dec 22, 2016
1 parent b4a0d18 commit e8c47c0
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 27 deletions.
9 changes: 0 additions & 9 deletions src/F3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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 );
}
1 change: 0 additions & 1 deletion src/F3D.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

1 change: 0 additions & 1 deletion src/F3DDKR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
Expand Down
6 changes: 2 additions & 4 deletions src/F3DGOLDEN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 );
}
4 changes: 4 additions & 0 deletions src/F3DGOLDEN.h
Original file line number Diff line number Diff line change
@@ -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

9 changes: 4 additions & 5 deletions src/F3DPD.cpp
Original file line number Diff line number Diff line change
@@ -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 )
{
Expand Down Expand Up @@ -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 );
}
Expand Down
3 changes: 1 addition & 2 deletions src/F3DPD.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#ifndef F3DPD_H
#define F3DPD_H

#define F3DPD_VTXCOLORBASE 0x07

void F3DPD_Init();

#endif

1 change: 0 additions & 1 deletion src/F3DSETA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
4 changes: 2 additions & 2 deletions src/GBI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/GBI.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/gSP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit e8c47c0

Please sign in to comment.