Skip to content

Commit 233569c

Browse files
committed
good luck
1 parent 5a30693 commit 233569c

25 files changed

+482
-564
lines changed

decompile/General/230/D230.c

Lines changed: 113 additions & 127 deletions
Large diffs are not rendered by default.

decompile/General/231/231_020_RB_TNT_ThTick_ThrowOnHead.c

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,39 @@
11
#include <common.h>
22

3-
void RB_TNT_ThTick_SitOnHead();
4-
53
void DECOMP_RB_TNT_ThTick_ThrowOnHead(struct Thread* t)
64
{
75
struct MineWeapon* mw;
86
struct Instance* inst;
97
short* array;
108
struct GameTracker* gGT;
11-
9+
1210
short rot[3];
1311
short distHead;
14-
12+
1513
// matrix?
1614
short auStack48 [32];
17-
15+
1816
gGT = sdata->gGT;
19-
17+
2018
inst = t->inst;
21-
19+
2220
// object
2321
mw = inst->thread->object;
24-
22+
2523
// alter height of TNT as it flies onto a driver's head,
2624
// do NOT use parenthesis
2725
mw->deltaPos[1] += (mw->velocity[1] * gGT->elapsedTimeMS) >> 5;
28-
26+
2927
// if TNT is moving downward
30-
if (mw->velocity[1] < 0)
28+
if (mw->velocity[1] < 0)
3129
{
3230
// 0x800b2ac4
3331
// BSS before Baron_ThTick,
3432
// determines height of TNT for each player
3533
array = (short*)0x800b2ac4; //TODO: access named memory instead (D231?)
36-
34+
3735
distHead = array[data.characterIDs[mw->driverTarget->driverID]];
38-
36+
3937
// if TNT landed on head
4038
if (
4139
(mw->deltaPos[1] < distHead) &&
@@ -45,55 +43,55 @@ void DECOMP_RB_TNT_ThTick_ThrowOnHead(struct Thread* t)
4543
{
4644
// Set TNT timer to 0, it blows up at 0x5a
4745
mw->numFramesOnHead = 0;
48-
46+
4947
// number of jumps is 7 or 8
5048
mw->jumpsRemaining = 8 - (DECOMP_MixRNG_Scramble() & 1);
51-
49+
5250
// play sound that you hit a TNT
5351
PlaySound3D(0x51,inst);
54-
52+
5553
inst->unk50 = mw->driverTarget->instSelf->unk50 + -1;
5654
inst->unk51 = mw->driverTarget->instSelf->unk51 + -1;
57-
58-
// assign
59-
ThTick_SetAndExec(t,RB_TNT_ThTick_SitOnHead);
55+
56+
// assign
57+
ThTick_SetAndExec(t,DECOMP_RB_TNT_ThTick_SitOnHead);
6058
return;
6159
}
6260
}
63-
61+
6462
// CopyMatrix
6563
LHMatrix_Parent(inst,mw->driverTarget->instSelf,(SVECTOR*)&mw->deltaPos[0]);
66-
64+
6765
// rotation
6866
rot[0] = 0;
6967
rot[1] = mw->tntSpinY;
7068
rot[2] = 0;
71-
69+
7270
// convert 3 rotation shorts into rotation matrix
7371
ConvertRotToMatrix((MATRIX*)auStack48,&rot[0]);
74-
72+
7573
MatrixRotate(&inst->matrix,&inst->matrix,(MATRIX*)auStack48);
76-
74+
7775
// reduce time remaining until TNT lands on head
7876
mw->velocity[1] -= ((gGT->elapsedTimeMS << 2) >> 5);
79-
77+
8078
// set a minimum value (-0x60)
8179
if(mw->velocity[1] < -0x60) mw->velocity[1] = -0x60;
82-
80+
8381
// rotation
8482
mw->tntSpinY += FPS_HALF(0x100);
85-
83+
8684
// if scale is small
87-
if (inst->scale[0] < 0x801)
85+
if (inst->scale[0] < 0x801)
8886
{
8987
// set min scale
9088
inst->scale [0] = 0x800;
9189
inst->scale [1] = 0x800;
9290
inst->scale [2] = 0x800;
9391
}
94-
92+
9593
// if scale is large
96-
else
94+
else
9795
{
9896
// reduce scale
9997
inst->scale [0] -= FPS_HALF(0x100);

decompile/General/231/231_027_RB_Warpball_Death.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,19 @@
33
void DECOMP_RB_Warpball_Death(struct Thread* t)
44
{
55
struct TrackerWeapon* tw;
6-
6+
77
tw = t->object;
88
tw->ptrParticle->framesLeftInLife = 0;
99
tw->fadeAway_frameCount5 = 0;
10-
10+
1111
// play sound of warpball death
1212
struct Instance* inst = t->inst;
1313
tw->distFromGround = inst->matrix.t[1];
1414
PlaySound3D(0x4f, inst);
15-
15+
1616
// stop audio of moving
1717
OtherFX_RecycleMute(&tw->audioPtr);
18-
19-
void RB_Warpball_FadeAway();
20-
ThTick_SetAndExec(t,&RB_Warpball_FadeAway);
18+
19+
ThTick_SetAndExec(t,&DECOMP_RB_Warpball_FadeAway);
2120
return;
2221
}
23-

decompile/General/231/231_038_RB_ShieldDark_ThTick_Grow.c

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ void DECOMP_RB_ShieldDark_ThTick_Grow(struct Thread *th)
7878
highlightIdpp[i].pushBuffer = pb;
7979
}
8080
}
81-
81+
8282
// if driver is not invisible
8383
else
8484
{
@@ -94,8 +94,8 @@ void DECOMP_RB_ShieldDark_ThTick_Grow(struct Thread *th)
9494
}
9595

9696
short pos[3];
97-
pos[0] = 0;
98-
pos[1] = 0;
97+
pos[0] = 0;
98+
pos[1] = 0;
9999
pos[2] = 0;
100100

101101
// Copy matrix
@@ -130,7 +130,7 @@ void DECOMP_RB_ShieldDark_ThTick_Grow(struct Thread *th)
130130
{
131131
scaleXZ = ((int *)0x800b2cf4)[shield->animFrame*2+0];
132132
scaleY = ((int *)0x800b2cf4)[shield->animFrame*2+1];
133-
133+
134134
// set scale
135135
shieldInst->scale[0] = WIDE_34(scaleXZ);
136136
shieldInst->scale[1] = scaleY;
@@ -140,18 +140,18 @@ void DECOMP_RB_ShieldDark_ThTick_Grow(struct Thread *th)
140140
colorInst->scale[0] = WIDE_34(scaleXZ);
141141
colorInst->scale[1] = scaleY;
142142
colorInst->scale[2] = scaleXZ;
143-
143+
144144
#ifdef USE_60FPS
145145
if(sdata->gGT->timer & 1)
146146
#endif
147147
// next frame
148148
shield->animFrame++;
149149
}
150-
150+
151151
// if animation is done
152152
else
153153
{
154-
short timerIndex =
154+
short timerIndex =
155155
(
156156
(gGT->timer >> FPS_RIGHTSHIFT(0))
157157
% 6
@@ -211,9 +211,9 @@ void DECOMP_RB_ShieldDark_ThTick_Grow(struct Thread *th)
211211
shieldFlags = shield->flags;
212212

213213
if (
214-
((shieldFlags & 1) != 0) ||
214+
((shieldFlags & 1) != 0) ||
215215
((shieldFlags & 8) != 0) ||
216-
216+
217217
// if race ended for this driver
218218
((player->actionsFlagSet & 0x2000000) != 0) ||
219219

@@ -235,8 +235,7 @@ void DECOMP_RB_ShieldDark_ThTick_Grow(struct Thread *th)
235235
player->instBubbleHold = NULL;
236236

237237
// execute, then assign per-frame funcPtr to thread
238-
void RB_ShieldDark_ThTick_Pop();
239-
ThTick_SetAndExec(th, RB_ShieldDark_ThTick_Pop);
238+
ThTick_SetAndExec(th, DECOMP_RB_ShieldDark_ThTick_Pop);
240239
return;
241240
}
242241

@@ -259,13 +258,13 @@ void DECOMP_RB_ShieldDark_ThTick_Grow(struct Thread *th)
259258
}
260259

261260
// create a thread, get an instance
262-
struct Instance *bombInst =
261+
struct Instance *bombInst =
263262
DECOMP_INSTANCE_BirthWithThread(
264-
model, 0, MEDIUM, OTHER,
265-
DECOMP_RB_MovingExplosive_ThTick,
263+
model, 0, MEDIUM, OTHER,
264+
DECOMP_RB_MovingExplosive_ThTick,
266265
sizeof(struct TrackerWeapon),
267266
playerTh);
268-
267+
269268
struct Thread* bombTh = bombInst->thread;
270269
bombTh->funcThDestroy = DECOMP_PROC_DestroyInstance;
271270

@@ -280,7 +279,7 @@ void DECOMP_RB_ShieldDark_ThTick_Grow(struct Thread *th)
280279
Voiceline_RequestPlay(13, data.characterIDs[player->driverID], 0x10);
281280
}
282281

283-
// copy position and rotation from one instance to another
282+
// copy position and rotation from one instance to another
284283
*(int*)&bombInst->matrix.m[0][0] = *(int*)&shieldInst->matrix.m[0][0];
285284
*(int*)&bombInst->matrix.m[0][2] = *(int*)&shieldInst->matrix.m[0][2];
286285
*(int*)&bombInst->matrix.m[1][1] = *(int*)&shieldInst->matrix.m[1][1];
@@ -304,16 +303,16 @@ void DECOMP_RB_ShieldDark_ThTick_Grow(struct Thread *th)
304303
tw->timeAlive = 0;
305304
tw->audioPtr = 0;
306305
tw->frameCount_Blind = 0;
307-
306+
308307
tw->driverParent = player;
309308
tw->instParent = driverInst;
310-
309+
311310
// do NOT patch for 60fps,
312311
// velocity uses elapsedTime
313312
tw->vel[1] = 0;
314313
tw->vel[0] = (driverInst->matrix.m[0][2] * 3) >> 7;
315314
tw->vel[2] = (driverInst->matrix.m[2][2] * 3) >> 7;
316-
315+
317316
tw->rotY = player->angle;
318317
tw->frameCount_DontHurtParent = FPS_DOUBLE(10);
319318

@@ -330,4 +329,3 @@ void DECOMP_RB_ShieldDark_ThTick_Grow(struct Thread *th)
330329
th->flags |= 0x800;
331330
}
332331

333-

0 commit comments

Comments
 (0)