SSBM Decomp
Loading...
Searching...
No Matches
psdisp.c File Reference
#include "psdisp.h"
#include <string.h>
#include "cobj.h"
#include "fog.h"
#include "forward.h"
#include "lobj.h"
#include "mtx.h"
#include "particle.h"
#include "psdisptev.h"
#include "psstructs.h"
#include "state.h"
#include "util.h"
#include <dolphin/gx.h>

Data Structures

struct  psdisp_ParticleSortBucket
struct  psdisp_Tlut
struct  psdisp_Mtx

Macros

#define FLT_EPSILON   1.19209290e-07F

Functions

static void calcTornadoLastPos (HSD_Particle *, f32 *, f32 *, f32 *)
static void getColorPrimEnv (HSD_Particle *, GXColor *, GXColor *)
static void getColorMatAmb (HSD_Particle *, GXColor *, GXColor *)
 ASSERT_SIZE (HSD_PSDisp_8040C340, 0x20)
 ASSERT_SIZE (HSD_PSDisp_8040C360, 0x10)
void setVtxDesc (s32 fmt)
static void getClrTrail (HSD_Particle *pp, GXColor *color)
static void psSetColor (GXColor *color, u8 value)
static void psSetupVtxFormat (GXVtxFmt format, bool has_color, bool has_texture, GXCompType texture_type)
static void setupChanCtrl (HSD_Particle *pp)
static void setupChanReg (HSD_Particle *pp)
static void setupTevReg (HSD_Particle *pp)
HSD_ParticleparticleSort (s32 arg0, u8 arg1, HSD_Particle **arg2, HSD_Particle **arg3)
static HSD_ParticlepsDispSubPoint (HSD_Particle *pp)
static HSD_ParticlepsDispSubPointTrail (HSD_Particle *pp)
static void setBlendMode (int blend_mode)
static void psSetCurrentMtx (GXPosNrmMtx idx)
static void psDispSubMakePolygon (HSD_Particle *pp, u8 *texform, f32 x, f32 y, f32 z, f32 x0, f32 y0, f32 z0, f32 x1, f32 y1, f32 z1, GXColor *color, f32 *prev_x, f32 *prev_y, f32 *prev_z)
static void psMaskAbsF32 (f32 *value)
static bool psMaskAbsLtF32 (f32 value, f32 limit)
static bool psMaskAbsGtF32 (f32 value, f64 limit)
static bool psAbsLtF32 (f32 value, f32 limit)
static bool psAbsGtF32 (f32 value, f64 limit)
static bool psDispSubAbsLtF32 (f32 value, f32 limit)
static bool psDispSubAbsGtF32 (f32 value, f64 limit)
static void psDispSub (HSD_Particle *pp, u8 *texform)
static void psScaleAppSRTAxes (HSD_Particle *pp, Mtx mtx)
static void psDispSubAPPSRTPoint (HSD_Particle *pp)
static void psDispSubAppSRT (HSD_Particle *pp, u8 *texform)
static void psUpdateBillboardAxes (const Mtx inv_view)
void psDispParticles (u32 target_link, u32 sw)

Variables

static const psdisp_Mtx HSD_PSDisp_803B9628
static char HSD_PSDisp_8040C300 [] = "object.h"
static char HSD_PSDisp_8040C30C []
static u8 HSD_PSDisp_8040C334 [0xC] = { 0 }
static u8 HSD_PSDisp_8040C340 [0x20]
static u8 HSD_PSDisp_8040C360 [0x10] = { 0 }
static u8 psFrameNum = 0x7B
HSD_Particlehsd_804D0908 [16]
static Mtx vmtx
static Mtx rvmtx
static f32 prj [GX_PROJECTION_SZ]
static Mtx pvmtx
static HSD_Particleparticle_list [17]
static HSD_FogHSD_PSDisp_804D7908
static s32 prevPointSize
static s32 prevLineWidth
static f32 HSD_PSDisp_804D7914
static f32 HSD_PSDisp_804D7918
static f32 HSD_PSDisp_804D791C
static f32 HSD_PSDisp_804D7920
static f32 HSD_PSDisp_804D7924
static f32 HSD_PSDisp_804D7928
static s32 HSD_PSDisp_804D792C
static s32 prevChanCtrl
static GXColor prevChanMat
static GXColor prevChanAmb
static GXColor prevColorPrim
static GXColor prevColorEnv
static GXColor prevColorMat
static s32 HSD_PSDisp_804D7948 [2]

Macro Definition Documentation

◆ FLT_EPSILON

#define FLT_EPSILON   1.19209290e-07F

Function Documentation

◆ calcTornadoLastPos()

void calcTornadoLastPos ( HSD_Particle * pp,
f32 * x,
f32 * y,
f32 * z )
static
Bug
The following should be accessing pp not gp

◆ getColorPrimEnv()

void getColorPrimEnv ( HSD_Particle * pp,
GXColor * primCol,
GXColor * envCol )
static

◆ getColorMatAmb()

void getColorMatAmb ( HSD_Particle * pp,
GXColor * matCol,
GXColor * ambCol )
static

◆ ASSERT_SIZE() [1/2]

ASSERT_SIZE ( HSD_PSDisp_8040C340 ,
0x20  )

◆ ASSERT_SIZE() [2/2]

ASSERT_SIZE ( HSD_PSDisp_8040C360 ,
0x10  )

◆ setVtxDesc()

void setVtxDesc ( s32 fmt)

◆ getClrTrail()

void getClrTrail ( HSD_Particle * pp,
GXColor * color )
inlinestatic

◆ psSetColor()

void psSetColor ( GXColor * color,
u8 value )
inlinestatic

◆ psSetupVtxFormat()

void psSetupVtxFormat ( GXVtxFmt format,
bool has_color,
bool has_texture,
GXCompType texture_type )
inlinestatic

◆ setupChanCtrl()

void setupChanCtrl ( HSD_Particle * pp)
inlinestatic

◆ setupChanReg()

void setupChanReg ( HSD_Particle * pp)
inlinestatic

◆ setupTevReg()

void setupTevReg ( HSD_Particle * pp)
inlinestatic

◆ particleSort()

HSD_Particle * particleSort ( s32 arg0,
u8 arg1,
HSD_Particle ** arg2,
HSD_Particle ** arg3 )

◆ psDispSubPoint()

HSD_Particle * psDispSubPoint ( HSD_Particle * pp)
inlinestatic

◆ psDispSubPointTrail()

HSD_Particle * psDispSubPointTrail ( HSD_Particle * pp)
inlinestatic

◆ setBlendMode()

void setBlendMode ( int blend_mode)
inlinestatic

◆ psSetCurrentMtx()

void psSetCurrentMtx ( GXPosNrmMtx idx)
inlinestatic

◆ psDispSubMakePolygon()

void psDispSubMakePolygon ( HSD_Particle * pp,
u8 * texform,
f32 x,
f32 y,
f32 z,
f32 x0,
f32 y0,
f32 z0,
f32 x1,
f32 y1,
f32 z1,
GXColor * color,
f32 * prev_x,
f32 * prev_y,
f32 * prev_z )
inlinestatic

◆ psMaskAbsF32()

void psMaskAbsF32 ( f32 * value)
inlinestatic

◆ psMaskAbsLtF32()

bool psMaskAbsLtF32 ( f32 value,
f32 limit )
inlinestatic

◆ psMaskAbsGtF32()

bool psMaskAbsGtF32 ( f32 value,
f64 limit )
inlinestatic

◆ psAbsLtF32()

bool psAbsLtF32 ( f32 value,
f32 limit )
inlinestatic

◆ psAbsGtF32()

bool psAbsGtF32 ( f32 value,
f64 limit )
inlinestatic

◆ psDispSubAbsLtF32()

bool psDispSubAbsLtF32 ( f32 value,
f32 limit )
inlinestatic

◆ psDispSubAbsGtF32()

bool psDispSubAbsGtF32 ( f32 value,
f64 limit )
inlinestatic

◆ psDispSub()

void psDispSub ( HSD_Particle * pp,
u8 * texform )
inlinestatic

◆ psScaleAppSRTAxes()

void psScaleAppSRTAxes ( HSD_Particle * pp,
Mtx mtx )
inlinestatic

◆ psDispSubAPPSRTPoint()

void psDispSubAPPSRTPoint ( HSD_Particle * pp)
inlinestatic

◆ psDispSubAppSRT()

void psDispSubAppSRT ( HSD_Particle * pp,
u8 * texform )
inlinestatic
Todo
Later HSD shares this emission with the polygon path; Melee's emitted code keeps the two separate.
Remarks
Positions here stay raw GXWGFifo stores, not GXPosition3f32: the inline's argument evaluation forces an extra live FP register here and grows the frame past the target.

◆ psUpdateBillboardAxes()

void psUpdateBillboardAxes ( const Mtx inv_view)
inlinestatic

◆ psDispParticles()

void psDispParticles ( u32 target_link,
u32 sw )
Todo
Passing rvmtx directly swaps the first two axis loads.

Variable Documentation

◆ HSD_PSDisp_803B9628

const psdisp_Mtx HSD_PSDisp_803B9628
static
Initial value:
= {
{ { 1.0F, 0.0F, 0.0F, 0.0F },
{ 0.0F, 1.0F, 0.0F, 0.0F },
{ 0.0F, 0.0F, 1.0F, 0.0F } },
}

◆ HSD_PSDisp_8040C300

char HSD_PSDisp_8040C300[] = "object.h"
static
Remarks
Orphaned ref_INC assertion literals: no caller survives in this unit, but GNT4 emits the live #psSetBillboardCamera body in its generator unit with the same __assert strings.

◆ HSD_PSDisp_8040C30C

char HSD_PSDisp_8040C30C[]
static
Initial value:
=
"HSD_OBJ(o)->ref_count != HSD_OBJ_NOREF"

◆ HSD_PSDisp_8040C334

u8 HSD_PSDisp_8040C334[0xC] = { 0 }
static

◆ HSD_PSDisp_8040C340

u8 HSD_PSDisp_8040C340[0x20]
static
Initial value:
= {
0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1,
0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0,
}

◆ HSD_PSDisp_8040C360

u8 HSD_PSDisp_8040C360[0x10] = { 0 }
static

◆ psFrameNum

u8 psFrameNum = 0x7B
static

◆ hsd_804D0908

HSD_Particle* hsd_804D0908[16]
extern

◆ vmtx

Mtx vmtx
static

◆ rvmtx

Mtx rvmtx
static

◆ prj

f32 prj[GX_PROJECTION_SZ]
static

◆ pvmtx

Mtx pvmtx
static

◆ particle_list

HSD_Particle* particle_list[17]
static

◆ HSD_PSDisp_804D7908

HSD_Fog* HSD_PSDisp_804D7908
static

◆ prevPointSize

s32 prevPointSize
static

◆ prevLineWidth

s32 prevLineWidth
static

◆ HSD_PSDisp_804D7914

f32 HSD_PSDisp_804D7914
static

◆ HSD_PSDisp_804D7918

f32 HSD_PSDisp_804D7918
static

◆ HSD_PSDisp_804D791C

f32 HSD_PSDisp_804D791C
static

◆ HSD_PSDisp_804D7920

f32 HSD_PSDisp_804D7920
static

◆ HSD_PSDisp_804D7924

f32 HSD_PSDisp_804D7924
static

◆ HSD_PSDisp_804D7928

f32 HSD_PSDisp_804D7928
static

◆ HSD_PSDisp_804D792C

s32 HSD_PSDisp_804D792C
static

◆ prevChanCtrl

s32 prevChanCtrl
static

◆ prevChanMat

GXColor prevChanMat
static

◆ prevChanAmb

GXColor prevChanAmb
static

◆ prevColorPrim

GXColor prevColorPrim
static

◆ prevColorEnv

GXColor prevColorEnv
static

◆ prevColorMat

GXColor prevColorMat
static

◆ HSD_PSDisp_804D7948

s32 HSD_PSDisp_804D7948[2]
static