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

Go to the source code of this file.

Data Structures

struct  UnkStruct
 

Macros

#define X_VAR   128
 
#define Y_VAR   -33
 

Functions

void chapter_change_init (EffectInstance *effect)
 
void chapter_change_update (EffectInstance *effect)
 
void chapter_change_render (EffectInstance *effect)
 
void chapter_change_appendGfx (void *effect)
 
void func_E010E000 (ChapterChangeFXData *data, s32 arg1, UnkStruct *arg2)
 
EffectInstancechapter_change_main (s32 arg0, f32 posX, f32 posY, f32 arg3, f32 arg4, s32 duration)
 

Variables

Gfx D_0900BE40_3F7CA0 []
 
Gfx D_0900BE88_3F7CE8 []
 
Gfx D_0900BED0_3F7D30 []
 
Gfx D_0900BF18_3F7D78 []
 
Gfx D_0900BF60_3F7DC0 []
 
Gfx D_0900BFA8_3F7E08 []
 
Gfx D_0900BFF0_3F7E50 []
 
Gfx D_0900C038_3F7E98 []
 
Gfx D_0900C080_3F7EE0 []
 
Gfx D_0900C168_3F7FC8 []
 
Gfx D_0900C1B0_3F8010 []
 
Gfx D_0900C1F8_3F8058 []
 
Gfx D_0900C240_3F80A0 []
 
Gfx D_0900C328_3F8188 []
 
Gfx D_0900C370_3F81D0 []
 
Gfx D_0900C458_3F82B8 []
 
Gfx D_0900C540_3F83A0 []
 
s32 D_E010E750 []
 
UnkStruct D_E010E79C []
 
UnkStruct D_E010E7D8 []
 
UnkStruct D_E010E7FC []
 
UnkStruct D_E010E838 []
 
UnkStruct D_E010E868 []
 

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]

Macro Definition Documentation

◆ X_VAR

#define X_VAR   128

Definition at line 115 of file chapter_change.c.

◆ Y_VAR

#define Y_VAR   -33

Definition at line 116 of file chapter_change.c.

Function Documentation

◆ chapter_change_init()

void chapter_change_init ( EffectInstance * effect)

Definition at line 228 of file chapter_change.c.

228 {
229}

Referenced by chapter_change_main().

◆ chapter_change_update()

void chapter_change_update ( EffectInstance * effect)

Definition at line 231 of file chapter_change.c.

231 {
232 ChapterChangeFXData* data = effect->data.chapterChange;
233
234 if (effect->flags & FX_INSTANCE_FLAG_DISMISS) {
235 effect->flags &= ~FX_INSTANCE_FLAG_DISMISS;
236 data->timeLeft = 16;
237 }
238
239 if (data->timeLeft < 1000) {
240 data->timeLeft--;
241 }
242
243 data->lifetime++;
244
245 if (data->timeLeft < 0) {
246 remove_effect(effect);
247 }
248}
#define remove_effect
struct ChapterChangeFXData * chapterChange
Definition effects.h:2585
EffectData data
Definition effects.h:2605
@ FX_INSTANCE_FLAG_DISMISS
Definition enums.h:3517

Referenced by chapter_change_main().

◆ chapter_change_render()

void chapter_change_render ( EffectInstance * effect)

Definition at line 250 of file chapter_change.c.

250 {
251 RenderTask renderTask;
252 RenderTask* retTask;
253
255 renderTask.appendGfxArg = effect;
256 renderTask.dist = 10;
258
259 retTask = queue_render_task(&renderTask);
261}
void chapter_change_appendGfx(void *effect)
#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 chapter_change_main().

◆ chapter_change_appendGfx()

void chapter_change_appendGfx ( void * effect)

Definition at line 263 of file chapter_change.c.

263 {
264 ChapterChangeFXData* data = ((EffectInstance*)effect)->data.chapterChange;
265 s32 unk_2C = data->unk_2C;
266 u32 unk_00 = data->unk_00;
267 UnkStruct* ptr0;
268 UnkStruct* ptr1;
269
270 gDPPipeSync(gMainGfxPos++);
271 gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
272
273 switch (unk_00) {
274 case 1:
275 case 2:
276 case 3:
277 case 4:
278 case 5:
279 case 6:
280 case 7:
281 case 8:
282 ptr0 = D_E010E7FC;
283 ptr1 = &D_E010E868[(unk_00 - 1) * 2];
284 break;
285 case 9:
286 ptr0 = D_E010E7D8;
287 ptr1 = NULL;
288 break;
289 case 0:
290 case 10:
291 case 11:
292 case 12:
293 case 13:
294 case 14:
295 case 15:
296 case 16:
297 case 17:
298 case 18:
299#if VERSION_PAL
301 ptr0 = D_E010E838_b;
302 ptr1 = D_E010E838_c;
303 break;
304 }
305#endif
306 ptr0 = D_E010E79C;
307 ptr1 = D_E010E838;
308 break;
309 default:
310 ptr1 = NULL;
311 ptr0 = NULL;
312 break;
313 }
314
315 gDPSetPrimColor(gMainGfxPos++, 0, 0, data->unk_20, data->unk_24, data->unk_28, unk_2C);
316 gDPSetEnvColor(gMainGfxPos++, data->unk_30, data->unk_34, data->unk_38, data->unk_3C);
317
318 func_E010E000(data, 0, ptr0);
319 func_E010E000(data, 1, ptr1);
320
321 if (data->unk_54 >= 0) {
322 draw_msg(data->unk_54, data->unk_40 - data->unk_48, data->unk_44, 255, 21, 0);
323 }
324
325 gDPPipeSync(gMainGfxPos++);
326}
UnkStruct D_E010E7D8[]
UnkStruct D_E010E868[]
void func_E010E000(ChapterChangeFXData *data, s32 arg1, UnkStruct *arg2)
UnkStruct D_E010E7FC[]
UnkStruct D_E010E79C[]
UnkStruct D_E010E838[]
#define draw_msg
@ LANGUAGE_DE
Definition enums.h:6401
#define VIRTUAL_TO_PHYSICAL(addr)
Definition macros.h:47
#define gCurrentLanguage
Definition variables.h:115
Gfx * gMainGfxPos
Definition cam_main.c:15

Referenced by chapter_change_render().

◆ func_E010E000()

void func_E010E000 ( ChapterChangeFXData * data,
s32 arg1,
UnkStruct * arg2 )

Definition at line 143 of file chapter_change.c.

143 {
144 s32 unk_1C = data->lifetime;
145 UnkStruct* it;
146 f32 posX;
147 f32 posY;
148 s32 temp;
149
150 if (arg1 == 0) {
151 posX = data->chapterPos.x;
152 posY = data->chapterPos.y;
153 } else {
154 posX = data->endOfPos.x;
155 posY = data->endOfPos.y;
156 }
157
158 if (arg2 != NULL) {
159 for (it = arg2; it->displayList != NULL; it++) {
160 gSPDisplayList(gMainGfxPos++, it->displayList);
161
162 temp = it->x - 384;
163 gDPSetTileSize(gMainGfxPos++, 1, (unk_1C * 4 - temp) * 4, 0, (unk_1C * 4 - it->x + 511) * 4, 0);
164 gSPScisTextureRectangle(gMainGfxPos++,
165 (posX + it->x) * 4,
166 (posY + it->y) * 4,
167 (posX + it->x + it->width) * 4,
168 (posY + it->y + it->height) * 4,
169 G_TX_RENDERTILE, 0, 0, 1024, 1024);
170 }
171
172 gDPPipeSync(gMainGfxPos++);
173 }
174}
Gfx * displayList

Referenced by chapter_change_appendGfx().

◆ chapter_change_main()

EffectInstance * chapter_change_main ( s32 arg0,
f32 posX,
f32 posY,
f32 arg3,
f32 arg4,
s32 duration )

Definition at line 176 of file chapter_change.c.

176 {
179 EffectInstance* effect;
180 s32 numParts = 1;
181
185 bp.unk_00 = 0;
186 bp.renderUI = NULL;
187 bp.effectID = EFFECT_CHAPTER_CHANGE;
188
189 effect = create_effect_instance(&bp);
190 effect->numParts = numParts;
191 data = effect->data.chapterChange = general_heap_malloc(numParts * sizeof(*data));
192 ASSERT(effect->data.chapterChange != NULL);
193
194 data->unk_00 = arg0;
195 data->lifetime = 0;
196 if (duration <= 0) {
197 data->timeLeft = 1000;
198 } else {
199 data->timeLeft = duration;
200 }
201 data->chapterPos.x = data->endOfPos.x = posX;
202 data->chapterPos.y = data->endOfPos.y = posY;
203 data->unk_0C = arg3;
204 data->unk_50 = arg4;
205 data->unk_20 = 255;
206 data->unk_24 = 255;
207 data->unk_28 = 255;
208 data->unk_2C = 255;
209 data->unk_30 = 0;
210 data->unk_34 = 0;
211 data->unk_38 = 0;
212 if (arg0 == 0 || (arg0 >= 10 && arg0 <= 18)) {
213 data->unk_3C = 0;
214 } else {
215 data->unk_3C = 255;
216 }
217 data->unk_54 = D_E010E750[arg0];
218 if (data->unk_54 >= 0) {
219 data->unk_40 = 160;
220 data->unk_44 = 160;
221 data->unk_48 = get_msg_width(data->unk_54, 0);
222 data->unk_4C = 24;
223 }
224
225 return effect;
226}
void chapter_change_render(EffectInstance *effect)
void chapter_change_init(EffectInstance *effect)
s32 D_E010E750[]
void chapter_change_update(EffectInstance *effect)
#define general_heap_malloc
#define get_msg_width
#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_0900BE40_3F7CA0

Gfx D_0900BE40_3F7CA0[]
extern

◆ D_0900BE88_3F7CE8

Gfx D_0900BE88_3F7CE8[]
extern

◆ D_0900BED0_3F7D30

Gfx D_0900BED0_3F7D30[]
extern

◆ D_0900BF18_3F7D78

Gfx D_0900BF18_3F7D78[]
extern

◆ D_0900BF60_3F7DC0

Gfx D_0900BF60_3F7DC0[]
extern

◆ D_0900BFA8_3F7E08

Gfx D_0900BFA8_3F7E08[]
extern

◆ D_0900BFF0_3F7E50

Gfx D_0900BFF0_3F7E50[]
extern

◆ D_0900C038_3F7E98

Gfx D_0900C038_3F7E98[]
extern

◆ D_0900C080_3F7EE0

Gfx D_0900C080_3F7EE0[]
extern

◆ D_0900C168_3F7FC8

Gfx D_0900C168_3F7FC8[]
extern

◆ D_0900C1B0_3F8010

Gfx D_0900C1B0_3F8010[]
extern

◆ D_0900C1F8_3F8058

Gfx D_0900C1F8_3F8058[]
extern

◆ D_0900C240_3F80A0

Gfx D_0900C240_3F80A0[]
extern

◆ D_0900C328_3F8188

Gfx D_0900C328_3F8188[]
extern

Definition at line 62 of file chapter_change.c.

62 {
63 gsDPSetTextureLUT(G_TT_NONE),
64 gsDPLoadTextureTile(&D_09002A80_3EE8E0[0x820], G_IM_FMT_IA, G_IM_SIZ_8b, 104, 0, 0, 0, 103, 19, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 7, 6, G_TX_NOLOD, G_TX_NOLOD),
65 gsSPEndDisplayList(),
66};

◆ D_0900C370_3F81D0

Gfx D_0900C370_3F81D0[]
extern

◆ D_0900C458_3F82B8

Gfx D_0900C458_3F82B8[]
extern

◆ D_0900C540_3F83A0

Gfx D_0900C540_3F83A0[]
extern

◆ D_E010E750

s32 D_E010E750[]
Initial value:
= {
-1,
MSG_Menus_019D, MSG_Menus_019E, MSG_Menus_019F,
MSG_Menus_01A0, MSG_Menus_01A1, MSG_Menus_01A2,
MSG_Menus_01A3, MSG_Menus_01A4, MSG_Menus_019C,
-1, -1, -1, -1, -1, -1, -1, -1, -1
}

Definition at line 38 of file chapter_change.c.

38 {
39 -1,
40 MSG_Menus_019D, MSG_Menus_019E, MSG_Menus_019F,
41 MSG_Menus_01A0, MSG_Menus_01A1, MSG_Menus_01A2,
42 MSG_Menus_01A3, MSG_Menus_01A4, MSG_Menus_019C,
43 -1, -1, -1, -1, -1, -1, -1, -1, -1
44};

Referenced by chapter_change_main().

◆ D_E010E79C

UnkStruct D_E010E79C[]
Initial value:
= {
{ D_0900C080_3F7EE0, 104, 0, 128, 10 },
{ D_0900C168_3F7FC8, 104, 10, 128, 10 },
{ D_0900C1B0_3F8010, 104, 20, 128, 10 },
{ D_0900C1F8_3F8058, 104, 30, 128, 10 },
{ NULL, 0, 0, 0, 0 }
}
Gfx D_0900C168_3F7FC8[]
Gfx D_0900C1F8_3F8058[]
Gfx D_0900C080_3F7EE0[]
Gfx D_0900C1B0_3F8010[]

Definition at line 46 of file chapter_change.c.

46 {
47#if VERSION_JP
48 { D_0900B900_3FFA20, 0, 0, 104, 20 },
49 { D_0900B9E8_3FFB08, 0, 20, 104, 20 },
50#else
51 { D_0900C080_3F7EE0, 104, 0, 128, 10 },
52 { D_0900C168_3F7FC8, 104, 10, 128, 10 },
53 { D_0900C1B0_3F8010, 104, 20, 128, 10 },
54 { D_0900C1F8_3F8058, 104, 30, 128, 10 },
55#endif
56 { NULL, 0, 0, 0, 0 }
57};

Referenced by chapter_change_appendGfx().

◆ D_E010E7D8

UnkStruct D_E010E7D8[]
Initial value:
= {
{ D_0900C458_3F82B8, -16, -6, 144, 20 },
{ D_0900C540_3F83A0, -16, 14, 144, 20 },
{ NULL, 0, 0, 0, 0 }
}
Gfx D_0900C540_3F83A0[]
Gfx D_0900C458_3F82B8[]

Definition at line 59 of file chapter_change.c.

59 {
60 { D_0900C458_3F82B8, -16, -6, 144, 20 },
61 { D_0900C540_3F83A0, -16, 14, 144, 20 },
62 { NULL, 0, 0, 0, 0 }
63};

Referenced by chapter_change_appendGfx().

◆ D_E010E7FC

UnkStruct D_E010E7FC[]
Initial value:
= {
{ D_0900C080_3F7EE0, 0, -6, 128, 10 },
{ D_0900C168_3F7FC8, 0, 4, 128, 10 },
{ D_0900C1B0_3F8010, 0, 14, 128, 10 },
{ D_0900C1F8_3F8058, 0, 24, 128, 10 },
{ NULL, 0, 0, 0, 0 }
}

Definition at line 65 of file chapter_change.c.

65 {
66#if VERSION_JP
67 { D_0900B900_3FFA20, 24, -6, 104, 20 },
68 { D_0900B9E8_3FFB08, 24, 14, 104, 20 },
69#else
70 { D_0900C080_3F7EE0, 0, -6, 128, 10 },
71 { D_0900C168_3F7FC8, 0, 4, 128, 10 },
72 { D_0900C1B0_3F8010, 0, 14, 128, 10 },
73 { D_0900C1F8_3F8058, 0, 24, 128, 10 },
74#endif
75 { NULL, 0, 0, 0, 0 }
76};

Referenced by chapter_change_appendGfx().

◆ D_E010E838

UnkStruct D_E010E838[]
Initial value:
= {
{ D_0900C240_3F80A0, 0, 0, 104, 20 },
{ D_0900C328_3F8188, 0, 20, 104, 20 },
{ D_0900C370_3F81D0, 232, 0, 16, 40 },
{ NULL, 0, 0, 0, 0 }
}
Gfx D_0900C328_3F8188[]
Gfx D_0900C240_3F80A0[]
Gfx D_0900C370_3F81D0[]

Definition at line 78 of file chapter_change.c.

78 {
79#if VERSION_IQUE
80 { D_0900C240_3F80A0, 70, 0, 104, 20 },
81 { D_0900C328_3F8188, 70, 20, 104, 20 },
82 { D_0900C370_3F81D0, 172, 0, 16, 40 },
83#elif VERSION_JP
84 { D_0900BA30_3FFB50, 96, 0, 96, 20 },
85 { D_0900BB18_3FFC38, 96, 20, 96, 20 },
86#else
87 { D_0900C240_3F80A0, 0, 0, 104, 20 },
88 { D_0900C328_3F8188, 0, 20, 104, 20 },
89 { D_0900C370_3F81D0, 232, 0, 16, 40 },
90#endif
91 { NULL, 0, 0, 0, 0 }
92};

Referenced by chapter_change_appendGfx().

◆ D_E010E868

UnkStruct D_E010E868[]
Initial value:
= {
{ D_0900BE40_3F7CA0, 128 , -33 , 64, 64 },
{ NULL, 0, 0, 0, 0 },
{ D_0900BE88_3F7CE8, 128 , -33 , 64, 64 },
{ NULL, 0, 0, 0, 0 },
{ D_0900BED0_3F7D30, 128 , -33 , 64, 64 },
{ NULL, 0, 0, 0, 0 },
{ D_0900BF18_3F7D78, 128 , -33 , 64, 64 },
{ NULL, 0, 0, 0, 0 },
{ D_0900BF60_3F7DC0, 128 , -33 , 64, 64 },
{ NULL, 0, 0, 0, 0 },
{ D_0900BFA8_3F7E08, 128 , -33 , 64, 64 },
{ NULL, 0, 0, 0, 0 },
{ D_0900BFF0_3F7E50, 128 , -33 , 64, 64 },
{ NULL, 0, 0, 0, 0 },
{ D_0900C038_3F7E98, 128 , -33 , 64, 64 },
{ NULL, 0, 0, 0, 0 }
}
Gfx D_0900BE40_3F7CA0[]
Gfx D_0900BF60_3F7DC0[]
Gfx D_0900C038_3F7E98[]
Gfx D_0900BE88_3F7CE8[]
Gfx D_0900BED0_3F7D30[]
Gfx D_0900BFF0_3F7E50[]
Gfx D_0900BFA8_3F7E08[]
Gfx D_0900BF18_3F7D78[]

Definition at line 119 of file chapter_change.c.

119 {
120 { D_0900BE40_3F7CA0, X_VAR, Y_VAR, 64, 64 },
121 { NULL, 0, 0, 0, 0 },
122 { D_0900BE88_3F7CE8, X_VAR, Y_VAR, 64, 64 },
123 { NULL, 0, 0, 0, 0 },
124 { D_0900BED0_3F7D30, X_VAR, Y_VAR, 64, 64 },
125 { NULL, 0, 0, 0, 0 },
126 { D_0900BF18_3F7D78, X_VAR, Y_VAR, 64, 64 },
127 { NULL, 0, 0, 0, 0 },
128 { D_0900BF60_3F7DC0, X_VAR, Y_VAR, 64, 64 },
129 { NULL, 0, 0, 0, 0 },
130 { D_0900BFA8_3F7E08, X_VAR, Y_VAR, 64, 64 },
131 { NULL, 0, 0, 0, 0 },
132 { D_0900BFF0_3F7E50, X_VAR, Y_VAR, 64, 64 },
133 { NULL, 0, 0, 0, 0 },
134 { D_0900C038_3F7E98, X_VAR, Y_VAR, 64, 64 },
135 { NULL, 0, 0, 0, 0 }
136};
#define Y_VAR
#define X_VAR

Referenced by chapter_change_appendGfx().