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

Go to the source code of this file.

Data Structures

struct  Unk8a160
 
struct  Unk8a160Outer
 

Functions

 INCLUDE_IMG ("A2960.png", D_801094B0)
 
void func_800F0CB0 (s32 arg0, f32 x, f32 y, f32 scale)
 
void func_800F0D5C (void)
 
void func_800F0D80 (void)
 
void func_800F102C (void)
 

Variables

Vp D_801096B0
 
u8 D_80109800 [32]
 
Vec2b D_80109820 [56]
 
BSS Unk8a160Outer D_8010D000 [1]
 

Data Structure Documentation

◆ Unk8a160

struct Unk8a160
Data Fields
u8 alive
s8 timeLeft
u8 lifetime
Color_RGBA8 rgba
s8 lodVal
f32 x
f32 y
Vec2f vel
f32 scale

◆ Unk8a160Outer

struct Unk8a160Outer
Data Fields
Unk8a160 subs[57]

Function Documentation

◆ INCLUDE_IMG()

INCLUDE_IMG ( "A2960.png" ,
D_801094B0  )

◆ func_800F0CB0()

void func_800F0CB0 ( s32 arg0,
f32 x,
f32 y,
f32 scale )

Definition at line 50 of file 8a160_len_700.c.

50 {
51 Unk8a160Outer* outer = &D_8010D000[arg0];
52 Unk8a160* sub = &outer->subs[0];
53 s32 numSubstructs = ARRAY_COUNT(outer->subs);
54 s32 i;
55
56 if (arg0 <= 0) {
57 sub->alive = TRUE;
58 sub->x = x;
59 sub->y = y;
60 sub->scale = scale;
61 sub->timeLeft = 40;
62 sub->lifetime = 0;
63 sub = &outer->subs[1];
64
65 for (i = 1; i < numSubstructs; i++, sub++) {
66 sub->lodVal = (s32) (-((f32) i) * 0.0f) - 1;
67 }
68 }
69}
Unk8a160 subs[57]
BSS Unk8a160Outer D_8010D000[1]
#define ARRAY_COUNT(arr)
Definition macros.h:40

Referenced by update_status_bar().

◆ func_800F0D5C()

void func_800F0D5C ( void )

Definition at line 71 of file 8a160_len_700.c.

71 {
72 Unk8a160Outer* outer = &D_8010D000[0];
73 s32 i;
74
75 for (i = 0; i < ARRAY_COUNT(D_8010D000); i++) {
76 outer[i].subs[0].alive = FALSE;
77 }
78}

Referenced by initialize_status_bar().

◆ func_800F0D80()

void func_800F0D80 ( void )

Definition at line 80 of file 8a160_len_700.c.

80 {
81 Unk8a160Outer* outer;
82 s32 i;
83 s32 j;
84
85 for (i = 0; i < ARRAY_COUNT(D_8010D000); i++, outer++) {
86 outer = &D_8010D000[i];
87
88 if (outer->subs[0].alive) {
89 outer->subs[0].timeLeft--;
90 outer->subs[0].lifetime++;
91
92 if (outer->subs[0].timeLeft < 0) {
93 outer->subs[0].alive = FALSE;
94 } else {
95 Unk8a160* sub = &outer->subs[0];
96 s32 baseTimeLeft = sub->timeLeft;
97 f32 baseX = sub->x;
98 f32 baseY = sub->y;
99
100 sub++;
101 for (j = 1; j < ARRAY_COUNT(outer->subs); j++, sub++) {
102 sub->lodVal++;
103 if (sub->lodVal >= 30) {
104 if (baseTimeLeft < 30) {
105 sub->lodVal = -31;
106 } else {
107 sub->lodVal = 0;
108 }
109 }
110
111 if (sub->lodVal >= 0) {
112 if (sub->lodVal == 0) {
113 f32 tx = D_80109820[j - 1].x;
114 f32 ty = D_80109820[j - 1].y;
115 u8 t = 127;
116
117 sub->vel.x = tx * 0.1;
118 sub->vel.y = -ty * 0.1;
119 sub->x = baseX;
120 sub->y = baseY;
121 sub->scale = 1.0f;
122 sub->rgba.r = rand_int(t);
123 sub->rgba.g = rand_int(t - sub->rgba.r);
124 sub->rgba.b = rand_int(t - sub->rgba.g - sub->rgba.r);
125 sub->rgba.a = 255;
126 sub->rgba.r += 128;
127 sub->rgba.g += 128;
128 sub->rgba.b += 128;
129 }
130 sub->x += sub->vel.x;
131 sub->y += sub->vel.y;
132 sub->vel.x *= 0.92;
133 sub->vel.y *= 0.92;
134 sub->scale = (f32) D_80109800[sub->lodVal] * 0.04;
135 }
136 }
137 }
138 }
139 }
140}
u8 D_80109800[32]
Vec2b D_80109820[56]
Color_RGBA8 rgba
#define rand_int

Referenced by update_status_bar().

◆ func_800F102C()

void func_800F102C ( void )

Definition at line 142 of file 8a160_len_700.c.

142 {
143 Matrix4f sp20, sp60;
144 Unk8a160Outer* outer;
145 s32 i;
146 s32 j;
147
148 gDPPipeSync(gMainGfxPos++);
149 gSPSegment(gMainGfxPos++, 0x00, 0x00000000);
150 gDPSetScissor(gMainGfxPos++, G_SC_NON_INTERLACE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
151 gSPViewport(gMainGfxPos++, &D_801096B0);
152
153 guOrthoF(sp20, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT, 0.0f, -100.0f, 100.0f, 1.0f);
155
156 gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
157 gSPDisplayList(gMainGfxPos++, D_80109710);
158 gDPSetEnvColor(gMainGfxPos++, 127, 127, 127, 127);
159
160 for (i = 0; i < ARRAY_COUNT(D_8010D000); i++, outer++) {
161 outer = &D_8010D000[i];
162
163 if (outer->subs[0].alive) {
164 Unk8a160* it = &outer->subs[0];
165 f32 baseScale = it->scale;
166
167 it++;
168 for (j = 1; j < ARRAY_COUNT(outer->subs); j++, it++) {
169 if (it->lodVal >= 0) {
170 guPositionF(sp60, 0.0f, 0.0f, gGameStatusPtr->frameCounter * 10, it->scale * baseScale,
171 it->x, it->y, 0.0f);
173
175 G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
176 gDPSetPrimColor(gMainGfxPos++, 0, 80 - it->lodVal, it->rgba.r, it->rgba.g, it->rgba.b, it->rgba.a);
177 gSPDisplayList(gMainGfxPos++, D_801097D8);
178 gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
179 }
180 }
181 }
182 }
183}
Vp D_801096B0
Mtx matrixStack[0x200]
f32 Matrix4f[4][4]
#define guOrthoF
#define guMtxF2L
#define guPositionF
#define SCREEN_WIDTH
Definition macros.h:105
#define SCREEN_HEIGHT
Definition macros.h:106
GameStatus * gGameStatusPtr
Definition main_loop.c:32
Gfx * gMainGfxPos
Definition cam_main.c:15
u16 gMatrixListPos
Definition main_loop.c:45
DisplayContext * gDisplayContext
Definition cam_main.c:16

Referenced by update_status_bar().

Variable Documentation

◆ D_801096B0

Vp D_801096B0
Initial value:
= {
.vp = {
.vscale = { 640, 480, 511, 0 },
.vtrans = { 640, 480, 511, 0 }
}
}

Definition at line 6 of file 8a160_len_700.c.

6 {
7 .vp = {
8 .vscale = { 640, 480, 511, 0 },
9 .vtrans = { 640, 480, 511, 0 }
10 }
11};

Referenced by func_800F102C().

◆ D_80109800

u8 D_80109800[32]
Initial value:
= {
40, 90, 81, 72, 65, 59, 53, 47, 43, 38, 34, 31, 28, 25, 22, 20, 18, 16, 15, 13, 12, 10, 9, 8, 7, 7, 6, 5, 5, 4, 0, 0
}

Definition at line 18 of file 8a160_len_700.c.

18 {
19 40, 90, 81, 72, 65, 59, 53, 47, 43, 38, 34, 31, 28, 25, 22, 20, 18, 16, 15, 13, 12, 10, 9, 8, 7, 7, 6, 5, 5, 4, 0, 0
20};

Referenced by func_800F0D80().

◆ D_80109820

Vec2b D_80109820[56]
Initial value:
= {
{ 247, 105 }, { 239, 87 }, { 17, 87 }, { 9, 105 }, { 0, 122 }, { 230, 69 }, { 26, 69 }, { 221, 52 }, { 35, 52 },
{ 202, 49 }, { 186, 255 }, { 200, 241 }, { 0, 200 }, { 56, 241 }, { 70, 255 }, { 54, 49 }, { 196, 222 },
{ 239, 191 }, { 17, 191 }, { 60, 222 }, { 85, 13 }, { 74, 46 }, { 99, 27 }, { 93, 43 }, { 12, 33 }, { 12, 22 },
{ 24, 22 }, { 24, 33 }, { 12, 10 }, { 24, 10 }, { 24, 45 }, { 232, 33 }, { 232, 22 }, { 232, 45 }, { 113, 40 },
{ 193, 203 }, { 190, 183 }, { 182, 46 }, { 163, 43 }, { 35, 182 }, { 52, 173 }, { 12, 45 }, { 244, 22 },
{ 244, 33 }, { 232, 10 }, { 244, 10 }, { 244, 45 }, { 204, 173 }, { 221, 182 }, { 186, 164 }, { 171, 13 },
{ 157, 27 }, { 143, 40 }, { 63, 203 }, { 66, 183 }, { 70, 164 }
}

Definition at line 22 of file 8a160_len_700.c.

22 {
23 { 247, 105 }, { 239, 87 }, { 17, 87 }, { 9, 105 }, { 0, 122 }, { 230, 69 }, { 26, 69 }, { 221, 52 }, { 35, 52 },
24 { 202, 49 }, { 186, 255 }, { 200, 241 }, { 0, 200 }, { 56, 241 }, { 70, 255 }, { 54, 49 }, { 196, 222 },
25 { 239, 191 }, { 17, 191 }, { 60, 222 }, { 85, 13 }, { 74, 46 }, { 99, 27 }, { 93, 43 }, { 12, 33 }, { 12, 22 },
26 { 24, 22 }, { 24, 33 }, { 12, 10 }, { 24, 10 }, { 24, 45 }, { 232, 33 }, { 232, 22 }, { 232, 45 }, { 113, 40 },
27 { 193, 203 }, { 190, 183 }, { 182, 46 }, { 163, 43 }, { 35, 182 }, { 52, 173 }, { 12, 45 }, { 244, 22 },
28 { 244, 33 }, { 232, 10 }, { 244, 10 }, { 244, 45 }, { 204, 173 }, { 221, 182 }, { 186, 164 }, { 171, 13 },
29 { 157, 27 }, { 143, 40 }, { 63, 203 }, { 66, 183 }, { 70, 164 }
30};

Referenced by func_800F0D80().

◆ D_8010D000

BSS Unk8a160Outer D_8010D000[1]

Definition at line 48 of file 8a160_len_700.c.

Referenced by func_800F0CB0(), func_800F0D5C(), func_800F0D80(), and func_800F102C().