Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
effect_86.c File Reference

Go to the source code of this file.

Functions

void effect_86_init (EffectInstance *effect)
 
void effect_86_update (EffectInstance *effect)
 
void effect_86_render (EffectInstance *effect)
 
void effect_86_appendGfx (void *effect)
 
EffectInstanceeffect_86_main (s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5)
 

Variables

Gfx D_09000800_415860 []
 
Gfx D_09000BA8_415C08 []
 
Gfx D_09000BC8_415C28 []
 
Gfx D_09000BE8_415C48 []
 
Gfx D_09000C08_415C68 []
 
Gfx D_09000C28_415C88 []
 
Gfx D_09000C48_415CA8 []
 
Gfx D_09000C68_415CC8 []
 
Gfx D_09000C88_415CE8 []
 
Gfx D_09000CA8_415D08 []
 
Gfx D_09000CC8_415D28 []
 
Gfx D_09000CE8_415D48 []
 
Gfx D_09000D08_415D68 []
 
Gfx * D_E0128480 [12]
 
Gfx * D_E01284B0 [] = { D_09000800_415860 }
 

Function Documentation

◆ effect_86_init()

void effect_86_init ( EffectInstance * effect)

Definition at line 76 of file effect_86.c.

76 {
77}

Referenced by effect_86_main().

◆ effect_86_update()

void effect_86_update ( EffectInstance * effect)

Definition at line 79 of file effect_86.c.

79 {
80 Effect86FXData* data = effect->data.unk_86;
81
82 if (effect->flags & FX_INSTANCE_FLAG_DISMISS) {
83 effect->flags &= ~FX_INSTANCE_FLAG_DISMISS;
84 data->unk_10 = 0x10;
85 }
86
87 if (data->unk_10 < 1000) {
88 data->unk_10--;
89 }
90
91 data->unk_14++;
92 if (data->unk_10 < 0) {
93 remove_effect(effect);
94 }
95}
#define remove_effect
struct Effect86FXData * unk_86
Definition effects.h:2598
EffectData data
Definition effects.h:2605
@ FX_INSTANCE_FLAG_DISMISS
Definition enums.h:3517

Referenced by effect_86_main().

◆ effect_86_render()

void effect_86_render ( EffectInstance * effect)

Definition at line 97 of file effect_86.c.

97 {
98 RenderTask renderTask;
99 RenderTask* retTask;
100
101 renderTask.appendGfx = effect_86_appendGfx;
102 renderTask.appendGfxArg = effect;
103 renderTask.dist = 10;
105
106 retTask = queue_render_task(&renderTask);
108}
void effect_86_appendGfx(void *effect)
Definition effect_86.c:110
#define queue_render_task
@ RENDER_TASK_FLAG_REFLECT_FLOOR
Definition enums.h:3318
@ RENDER_MODE_CLOUD_NO_ZCMP
Definition enums.h:3311
void * appendGfxArg
void(* appendGfx)(void *)

Referenced by effect_86_main().

◆ effect_86_appendGfx()

void effect_86_appendGfx ( void * effect)

Definition at line 110 of file effect_86.c.

110 {
111 Matrix4f sp10;
112 Matrix4f sp50;
113 Effect86FXData* part = ((EffectInstance*)effect)->data.unk_86;
114 Camera* camera = &gCameras[gCurrentCameraID];
115 s32 primAlpha = part->unk_24;
116 s32 dlistIdx = part->unk_00;
117
118 gDPPipeSync(gMainGfxPos++);
119 gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
120
121 guTranslateF(sp10, part->unk_04, part->unk_08, part->unk_0C);
122 guScaleF(sp50, part->unk_34, part->unk_34, part->unk_34);
123 guMtxCatF(sp50, sp10, sp10);
125
126 gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
127 gSPMatrix(gMainGfxPos++, camera->mtxBillboard, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
128 gDPSetPrimColor(gMainGfxPos++, 0, 0, part->unk_18, part->unk_1C, part->unk_20, primAlpha);
129 gDPSetEnvColor(gMainGfxPos++, part->unk_28, part->unk_2C, part->unk_30, 0);
130 gSPDisplayList(gMainGfxPos++, D_E01284B0[0]);
131 gSPDisplayList(gMainGfxPos++, D_E0128480[dlistIdx % ARRAY_COUNT(D_E0128480)]);
132 gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
133}
Mtx matrixStack[0x200]
f32 Matrix4f[4][4]
Gfx * D_E01284B0[]
Definition effect_86.c:24
Gfx * D_E0128480[12]
Definition effect_86.c:18
#define guMtxF2L
#define guTranslateF
#define guMtxCatF
#define guScaleF
#define ARRAY_COUNT(arr)
Definition macros.h:40
#define VIRTUAL_TO_PHYSICAL(addr)
Definition macros.h:47
Mtx * mtxBillboard
Camera gCameras[4]
Definition cam_main.c:17
Gfx * gMainGfxPos
Definition cam_main.c:15
u16 gMatrixListPos
Definition main_loop.c:45
s32 gCurrentCameraID
Definition cam_math.c:4
DisplayContext * gDisplayContext
Definition cam_main.c:16

Referenced by effect_86_render().

◆ effect_86_main()

EffectInstance * effect_86_main ( s32 arg0,
f32 arg1,
f32 arg2,
f32 arg3,
f32 arg4,
s32 arg5 )

Definition at line 31 of file effect_86.c.

31 {
33 EffectInstance* effect;
34 Effect86FXData* data;
35 Effect86FXData* part;
36 s32 numParts = 1;
37
41 bp.unk_00 = 0;
42 bp.renderUI = NULL;
43 bp.effectID = EFFECT_86;
44
45 effect = create_effect_instance(&bp);
46 effect->numParts = numParts;
47
48 data = general_heap_malloc(numParts * sizeof(*data));
49 effect->data.unk_86 = data;
50 part = data;
51
52 ASSERT(data != NULL);
53
54 part->unk_00 = arg0;
55 part->unk_14 = 0;
56 if (arg5 <= 0) {
57 part->unk_10 = 1000;
58 } else {
59 part->unk_10 = arg5;
60 }
61 part->unk_24 = 255;
62 part->unk_04 = arg1;
63 part->unk_08 = arg2;
64 part->unk_0C = arg3;
65 part->unk_34 = arg4;
66 part->unk_18 = 70;
67 part->unk_1C = 180;
68 part->unk_20 = 120;
69 part->unk_28 = 20;
70 part->unk_2C = 230;
71 part->unk_30 = 50;
72
73 return effect;
74}
void effect_86_render(EffectInstance *effect)
Definition effect_86.c:97
void effect_86_update(EffectInstance *effect)
Definition effect_86.c:79
void effect_86_init(EffectInstance *effect)
Definition effect_86.c:76
#define general_heap_malloc
#define create_effect_instance
#define ASSERT(condition)
void(* renderUI)(EffectInstance *effectInst)
Definition effects.h:2655
void(* init)(EffectInstance *effectInst)
Definition effects.h:2652
void(* update)(EffectInstance *effectInst)
Definition effects.h:2653
void(* renderWorld)(EffectInstance *effectInst)
Definition effects.h:2654

Variable Documentation

◆ D_09000800_415860

Gfx D_09000800_415860[]
extern

◆ D_09000BA8_415C08

Gfx D_09000BA8_415C08[]
extern

◆ D_09000BC8_415C28

Gfx D_09000BC8_415C28[]
extern

◆ D_09000BE8_415C48

Gfx D_09000BE8_415C48[]
extern

◆ D_09000C08_415C68

Gfx D_09000C08_415C68[]
extern

◆ D_09000C28_415C88

Gfx D_09000C28_415C88[]
extern

◆ D_09000C48_415CA8

Gfx D_09000C48_415CA8[]
extern

◆ D_09000C68_415CC8

Gfx D_09000C68_415CC8[]
extern

◆ D_09000C88_415CE8

Gfx D_09000C88_415CE8[]
extern

◆ D_09000CA8_415D08

Gfx D_09000CA8_415D08[]
extern

◆ D_09000CC8_415D28

Gfx D_09000CC8_415D28[]
extern

◆ D_09000CE8_415D48

Gfx D_09000CE8_415D48[]
extern

◆ D_09000D08_415D68

Gfx D_09000D08_415D68[]
extern

◆ D_E0128480

Gfx* D_E0128480[12]

◆ D_E01284B0

Gfx* D_E01284B0[] = { D_09000800_415860 }

Definition at line 24 of file effect_86.c.

Gfx D_09000800_415860[]

Referenced by effect_86_appendGfx().