mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-04 10:03:36 +00:00
Code cleanup in gSP.
This commit is contained in:
parent
a6056d4c3c
commit
87695ac8a7
27
gSP.cpp
27
gSP.cpp
|
@ -23,12 +23,11 @@
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
#ifdef DEBUG
|
void gSPCombineMatrices()
|
||||||
extern u32 uc_crc, uc_dcrc;
|
{
|
||||||
extern char uc_str[256];
|
MultMatrix(gSP.matrix.projection, gSP.matrix.modelView[gSP.matrix.modelViewi], gSP.matrix.combined);
|
||||||
#endif
|
gSP.changed &= ~CHANGED_MATRIX;
|
||||||
|
}
|
||||||
void gSPCombineMatrices();
|
|
||||||
|
|
||||||
void gSPTriangle(s32 v0, s32 v1, s32 v2)
|
void gSPTriangle(s32 v0, s32 v1, s32 v2)
|
||||||
{
|
{
|
||||||
|
@ -285,12 +284,6 @@ static void gSPBillboardVertex_default(u32 v, u32 i)
|
||||||
vtx.w += vtx0.w;
|
vtx.w += vtx0.w;
|
||||||
}
|
}
|
||||||
|
|
||||||
void gSPCombineMatrices()
|
|
||||||
{
|
|
||||||
MultMatrix(gSP.matrix.projection, gSP.matrix.modelView[gSP.matrix.modelViewi], gSP.matrix.combined);
|
|
||||||
gSP.changed &= ~CHANGED_MATRIX;
|
|
||||||
}
|
|
||||||
|
|
||||||
void gSPClipVertex(u32 v)
|
void gSPClipVertex(u32 v)
|
||||||
{
|
{
|
||||||
SPVertex & vtx = video().getRender().getVertex(v);
|
SPVertex & vtx = video().getRender().getVertex(v);
|
||||||
|
@ -1278,7 +1271,7 @@ void gSPNumLights( s32 n )
|
||||||
|
|
||||||
void gSPLightColor( u32 lightNum, u32 packedColor )
|
void gSPLightColor( u32 lightNum, u32 packedColor )
|
||||||
{
|
{
|
||||||
lightNum--;
|
--lightNum;
|
||||||
|
|
||||||
if (lightNum < 8)
|
if (lightNum < 8)
|
||||||
{
|
{
|
||||||
|
@ -1338,7 +1331,7 @@ void gSPTexture( f32 sc, f32 tc, s32 level, s32 tile, s32 on )
|
||||||
void gSPEndDisplayList()
|
void gSPEndDisplayList()
|
||||||
{
|
{
|
||||||
if (RSP.PCi > 0)
|
if (RSP.PCi > 0)
|
||||||
RSP.PCi--;
|
--RSP.PCi;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
@ -1640,10 +1633,8 @@ void gSPObjLoadTxtr( u32 tx )
|
||||||
u32 address = RSP_SegmentToPhysical( tx );
|
u32 address = RSP_SegmentToPhysical( tx );
|
||||||
uObjTxtr *objTxtr = (uObjTxtr*)&RDRAM[address];
|
uObjTxtr *objTxtr = (uObjTxtr*)&RDRAM[address];
|
||||||
|
|
||||||
if ((gSP.status[objTxtr->block.sid >> 2] & objTxtr->block.mask) != objTxtr->block.flag)
|
if ((gSP.status[objTxtr->block.sid >> 2] & objTxtr->block.mask) != objTxtr->block.flag) {
|
||||||
{
|
switch (objTxtr->block.type) {
|
||||||
switch (objTxtr->block.type)
|
|
||||||
{
|
|
||||||
case G_OBJLT_TXTRBLOCK:
|
case G_OBJLT_TXTRBLOCK:
|
||||||
gDPSetTextureImage( 0, 1, 0, objTxtr->block.image );
|
gDPSetTextureImage( 0, 1, 0, objTxtr->block.image );
|
||||||
gDPSetTile( 0, 1, 0, objTxtr->block.tmem, 7, 0, 0, 0, 0, 0, 0, 0 );
|
gDPSetTile( 0, 1, 0, objTxtr->block.tmem, 7, 0, 0, 0, 0, 0, 0, 0 );
|
||||||
|
|
18
gSP.h
18
gSP.h
|
@ -13,7 +13,7 @@
|
||||||
#define CHANGED_FOGPOSITION 0x20
|
#define CHANGED_FOGPOSITION 0x20
|
||||||
#define CHANGED_LIGHT 0x40
|
#define CHANGED_LIGHT 0x40
|
||||||
#define CHANGED_CPU_FB_WRITE 0x80
|
#define CHANGED_CPU_FB_WRITE 0x80
|
||||||
#define CHANGED_TEXTURESCALE 0x100
|
#define CHANGED_TEXTURESCALE 0x100
|
||||||
|
|
||||||
#define gSPFlushTriangles() \
|
#define gSPFlushTriangles() \
|
||||||
if \
|
if \
|
||||||
|
@ -67,14 +67,14 @@ if \
|
||||||
|
|
||||||
struct SPVertex
|
struct SPVertex
|
||||||
{
|
{
|
||||||
f32 x, y, z, w;
|
f32 x, y, z, w;
|
||||||
f32 nx, ny, nz, __pad0;
|
f32 nx, ny, nz, __pad0;
|
||||||
f32 r, g, b, a;
|
f32 r, g, b, a;
|
||||||
f32 s, t;
|
f32 s, t;
|
||||||
u8 st_scaled;
|
u8 st_scaled;
|
||||||
u8 HWLight;
|
u8 HWLight;
|
||||||
s16 flag;
|
s16 flag;
|
||||||
u32 clip;
|
u32 clip;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef SPVertex SPTriangle[3];
|
typedef SPVertex SPTriangle[3];
|
||||||
|
@ -220,9 +220,5 @@ extern void (*gSPTransformVertex)(float vtx[4], float mtx[4][4]);
|
||||||
extern void (*gSPLightVertex)(u32 v);
|
extern void (*gSPLightVertex)(u32 v);
|
||||||
extern void (*gSPBillboardVertex)(u32 v, u32 i);
|
extern void (*gSPBillboardVertex)(u32 v, u32 i);
|
||||||
|
|
||||||
#ifdef __NEON_OPT
|
|
||||||
void gSPInitNeon();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user