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

Go to the source code of this file.

Data Structures

struct  UnkStruct
 

Functions

void motion_blur_flame_init (EffectInstance *effect)
 
void motion_blur_flame_update (EffectInstance *effect)
 
void motion_blur_flame_render (EffectInstance *effect)
 
void motion_blur_flame_appendGfx (void *effect)
 
EffectInstancemotion_blur_flame_main (s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5)
 
void func_E00A2234 (void)
 

Variables

Gfx D_09000200_3A35D0 []
 
Gfx D_090002A8_3A3678 []
 
Gfx D_09000358_3A3728 []
 
GfxD_E00A29D0 [] = { D_09000200_3A35D0, D_090002A8_3A3678, D_09000358_3A3728 }
 
UnkStruct D_E00A29DC []
 
s32 D_E00A2A24 [] = { 100, 60, 30, 10, 0, 0, 0 }
 

Data Structure Documentation

◆ UnkStruct

struct UnkStruct
Data Fields
Gfx * displayList
s16 x
s16 y
s16 width
s16 height
s32 unk_00
s32 unk_04
f32 unk_08
f32 unk_0C
s32 unk_10
s32 unk_14
u8 unk_00
u8 unk_01
u8 unk_02
u8 unk_03
Gfx * unk_04
Gfx * unk_08
s32 unk_08
s8 unk_00
s8 unk_01
s16 unk_02
s16 unk_04
s16 unk_06
u8 sizeScale
char unk_09[1]

Function Documentation

◆ motion_blur_flame_init()

void motion_blur_flame_init ( EffectInstance * effect)

Definition at line 75 of file motion_blur_flame.c.

75 {
76}

Referenced by motion_blur_flame_main().

◆ motion_blur_flame_update()

void motion_blur_flame_update ( EffectInstance * effect)

Definition at line 78 of file motion_blur_flame.c.

78 {
80 s32 temp;
81
82 if (effect->flags & FX_INSTANCE_FLAG_DISMISS) {
84 data->unk_50 = 30;
85 }
86 data->unk_54++;
87 if (data->unk_50 < 1000) {
88 data->unk_50--;
89 }
90
91 if (data->unk_50 < 0) {
92 remove_effect(effect);
93 return;
94 }
95 temp = data->unk_50;
96 if (data->unk_54 <= 16) {
97 data->unk_4C = (data->unk_54 * 8) - 1;
98 }
99 if (temp < 16) {
100 data->unk_4C = temp * 8;
101 }
102
103 temp = 0;
104 data->unk_1C[temp] = data->unk_04 + data->pos.x;
105 data->unk_2C[temp] = data->unk_08 + data->pos.y;
106 data->unk_3C[temp] = data->unk_0C + data->pos.z;
107}
BSS s32 PopupMenu_SelectedIndex
#define remove_effect
EffectInstanceDataPtr data
Definition effects.h:2605
struct MotionBlurFlameFXData * motionBlurFlame
Definition effects.h:2545
@ FX_INSTANCE_FLAG_DISMISS
Definition enums.h:3551

Referenced by motion_blur_flame_main().

◆ motion_blur_flame_render()

void motion_blur_flame_render ( EffectInstance * effect)

Definition at line 109 of file motion_blur_flame.c.

109 {
112
114 renderTask.appendGfxArg = effect;
115 renderTask.dist = 100;
117
120}
#define queue_render_task
@ RENDER_TASK_FLAG_REFLECT_FLOOR
Definition enums.h:3352
@ RENDER_MODE_CLOUD_NO_ZCMP
Definition enums.h:3345
void motion_blur_flame_appendGfx(void *effect)
void(* appendGfx)(void *)

Referenced by motion_blur_flame_main().

◆ motion_blur_flame_appendGfx()

void motion_blur_flame_appendGfx ( void * effect)

Definition at line 125 of file motion_blur_flame.c.

125 {
126 MotionBlurFlameFXData* data = ((EffectInstance*)effect)->data.motionBlurFlame;
127 s32 temp_a2 = data->unk_00;
128 f32 sp48;
129 f32 sp4C;
130 s32 sp50 = data->unk_4C;
132 s32 sp54; // declaration must come after sp50
133 s32 envR, envG, envB;
134 s32 sp18[4];
135 f32 sp28[4];
136 f32 sp38[4];
137 s32 i;
138
139 s32 t3;
140 s32 v0;
141 s32 temp_a0;
142 s32 s3;
145 s32 temp_v1;
146 s32 var_a0;
147 s32 var_a1;
148 s32 var_a2;
149 s32 uly;
151 s32 var_t4;
152 s32 t6;
153 s32 var_v1;
154
156 gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->shared->graphics));
158
159 for (i = 0; i < UNK_ARRAY_SIZE_1; i++) {
160 f32 temp_f12 = data->unk_1C[i];
161 f32 temp_f14 = data->unk_2C[i];
162 f32 temp_f0 = data->unk_3C[i];
163 s32 temp_s5 = temp_s1->unk_10;
164 s32 height = temp_s1->unk_14;
165
166 if (i == 0) {
168 } else {
169 var_a2 = temp_f0;
170 sp48 = temp_f12;
171 sp4C = temp_f14;
172 }
173
174 sp18[i] = var_a2;
175 sp28[i] = sp48;
176 sp38[i] = sp4C;
177
178 if ((var_a2 != 0) && !(sp48 < 0.0f) && !(sp4C < 0.0f) && !(sp48 >= 320.0f) && !(sp4C >= 240.0f)) {
179 temp_a0 = (sp50 * D_E00A2A24[i]) / 100;
180 temp_v1 = (data->unk_5C * temp_a0) >> 9;
181 temp_v0_2 = (data->unk_60 * temp_a0) >> 9;
182 temp_v0_3 = (data->unk_64 * temp_a0) >> 9;
183
185 (temp_v1 * temp_a0) >> 8,
186 (temp_v0_2 * temp_a0) >> 8,
187 (temp_v0_3 * temp_a0) >> 8,
188 255
189 );
190
191 envR = temp_v1 + 32;
192 envG = temp_v0_2 + 32;
193 envB = temp_v0_3 + 32;
194 if (envR > 127) {
195 envR = 127;
196 }
197 if (envG > 127) {
198 envG = 127;
199 }
200 if (envB > 127) {
201 envB = 127;
202 }
203
204 gDPSetEnvColor(gMainGfxPos++, envR, envG, envB, 0);
205
206 s3 = sp48 - temp_s5;
207 t6 = s3 + temp_s5 * 2;
208 v0 = sp4C - temp_s5;
209 var_a0 = v0 + 2 * temp_s5;
210 t3 = uly = sp4C - temp_s5;
211
212 if (s3 < 0) {
213 var_a1 = -s3;
214 } else {
215 var_a1 = 0;
216 }
217
218 if (t3 < 0) {
219 var_v1 = -uly;
220 } else {
221 var_v1 = 0;
222 }
223
224 if (t6 > SCREEN_WIDTH) {
225 t6 = SCREEN_WIDTH - 1;
226 }
227 if (var_a0 > SCREEN_HEIGHT) {
228 var_a0 = SCREEN_HEIGHT - 1;
229 }
230
231 var_t2_2 = var_v1 / height;
232 sp54 = (var_a0 - t3) / height;
233
234 while (var_t2_2 < sp54) {
235 uly = t3 + var_t2_2 * height;
236 if (uly + height >= SCREEN_HEIGHT) {
237 break;
238 }
239
241 (s32) (s3 * temp_s1->unk_08) * 4,
242 (s32) (temp_s1->unk_04 * 20 - var_t2_2 * temp_s1->unk_14 * temp_s1->unk_0C) * 4,
243 (s32) (s3 * temp_s1->unk_08 + temp_s1->unk_00) * 4,
244 (s32) (temp_s1->unk_04 * 21 - var_t2_2 * temp_s1->unk_14 * temp_s1->unk_0C) * 4);
245
246 for (var_t4 = 0; var_t4 < 2; var_t4++) {
249 s3 + var_a1,
250 0,
251 t6 - 1,
252 height - 1,
253 0,
255 );
257 (s3 + var_a1) * 4,
258 uly * 4,
259 t6 * 4,
260 (uly + height) * 4,
262 ((u32) (s3 + var_a1) % 0x200) * 32,
263 0,
264 0x0400,
265 0x0400
266 );
268 }
269 var_t2_2++;
270 }
271 }
272 }
273
274 for (i = 0; i < ARRAY_COUNT(data->unk_3C) - 1; i++) {
275 data->unk_3C[i + 1] = sp18[i];
276 data->unk_1C[i + 1] = sp28[i];
277 data->unk_2C[i + 1] = sp38[i];
278 }
279}
u16 * nuGfxCfb_ptr
Definition cam_main.c:13
#define is_point_visible
#define UNK_ARRAY_SIZE_1
Definition effects.h:1366
UnkStruct D_E00A29DC[]
s32 D_E00A2A24[]
Gfx * D_E00A29D0[]
#define SCREEN_WIDTH
Definition macros.h:108
#define ARRAY_COUNT(arr)
Definition macros.h:39
#define SCREEN_HEIGHT
Definition macros.h:109
#define VIRTUAL_TO_PHYSICAL(addr)
Definition macros.h:46
Gfx * gMainGfxPos
Definition cam_main.c:14

Referenced by motion_blur_flame_render().

◆ motion_blur_flame_main()

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

Definition at line 33 of file motion_blur_flame.c.

33 {
35 EffectInstance* effect;
37 s32 numParts = 1;
38
41 bp.renderScene = motion_blur_flame_render;
42 bp.unk_00 = 0;
43 bp.renderUI = nullptr;
45
46 effect = create_effect_instance(&bp);
47 effect->numParts = numParts;
48 data = effect->data.motionBlurFlame = general_heap_malloc(numParts * sizeof(*data));
49 ASSERT(effect->data.motionBlurFlame != nullptr);
50
51 data->unk_00 = arg0;
52 if (arg5 < 0) {
53 data->unk_50 = 1000;
54 } else {
55 data->unk_50 = arg5;
56 }
57 data->unk_4C = 127;
58 data->unk_54 = 0;
59 data->unk_04 = arg1;
60 data->unk_08 = arg2;
61 data->unk_0C = arg3;
62 data->pos.x = 0;
63 data->pos.y = 0;
64 data->pos.z = 0;
65 data->unk_5C = 255;
66 data->unk_60 = 255;
67 data->unk_64 = 255;
68 data->unk_3C[1] = 0;
69 data->unk_3C[2] = 0;
70 data->unk_3C[3] = 0;
71
72 return effect;
73}
#define general_heap_malloc
#define create_effect_instance
#define ASSERT(condition)
void motion_blur_flame_render(EffectInstance *effect)
void motion_blur_flame_init(EffectInstance *effect)
void motion_blur_flame_update(EffectInstance *effect)

◆ func_E00A2234()

void func_E00A2234 ( void )

Definition at line 122 of file motion_blur_flame.c.

122 {
123}

Variable Documentation

◆ D_09000200_3A35D0

Gfx D_09000200_3A35D0[]
extern

◆ D_090002A8_3A3678

Gfx D_090002A8_3A3678[]
extern

◆ D_09000358_3A3728

Gfx D_09000358_3A3728[]
extern

◆ D_E00A29D0

Definition at line 9 of file motion_blur_flame.c.

Gfx D_09000200_3A35D0[]
Gfx D_09000358_3A3728[]
Gfx D_090002A8_3A3678[]

Referenced by motion_blur_flame_appendGfx().

◆ D_E00A29DC

UnkStruct D_E00A29DC[]
Initial value:
= {
{ 16, 16, 1.0f, 1.0f, 8, 8 },
{ 16, 16, 1.0f, 1.0f, 8, 8 },
{ 16, 16, 1.0f, 1.0f, 8, 8 },
}

Definition at line 20 of file motion_blur_flame.c.

20 {
21 { 16, 16, 1.0f, 1.0f, 8, 8 },
22 { 16, 16, 1.0f, 1.0f, 8, 8 },
23 { 16, 16, 1.0f, 1.0f, 8, 8 },
24};

Referenced by motion_blur_flame_appendGfx().

◆ D_E00A2A24

s32 D_E00A2A24[] = { 100, 60, 30, 10, 0, 0, 0 }

Definition at line 26 of file motion_blur_flame.c.

26{ 100, 60, 30, 10, 0, 0, 0 };

Referenced by motion_blur_flame_appendGfx().