Skip to content

Commit

Permalink
ok document drifting effect and player particle
Browse files Browse the repository at this point in the history
  • Loading branch information
coco875 committed Jan 12, 2025
1 parent 1537ac2 commit b3ec33b
Show file tree
Hide file tree
Showing 15 changed files with 1,563 additions and 1,515 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ glabel D_800E48C8

.section .text

glabel func_80065AB0
glabel render_drift_particle
/* 0666B0 80065AB0 27BDFF40 */ addiu $sp, $sp, -0xc0
/* 0666B4 80065AB4 AFA600C8 */ sw $a2, 0xc8($sp)
/* 0666B8 80065AB8 00067400 */ sll $t6, $a2, 0x10
Expand Down
2 changes: 1 addition & 1 deletion assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@
"textures/raw/7F1604.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F1604", "0x0"]}},
"textures/raw/7F16D4.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F16D4", "0x0"]}},
"textures/raw/7F17A4.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F17A4", "0x0"]}},
"textures/raw/7F1874.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F1874", "0x0"]}},
"textures/raw/gTextureFontNumberZero.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F1874", "0x0"]}},
"textures/raw/gTextureFontNumberOne.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F1944", "0x0"]}},
"textures/raw/gTextureFontNumberTwo.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F1A14", "0x0"]}},
"textures/raw/gTextureFontNumberThree.i4.png": {"meta":{"dims":[26,16]}, "offsets": {"us":["0x7F1AE4", "0x0"]}},
Expand Down
7 changes: 5 additions & 2 deletions include/common_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ typedef struct {
/* 0x01F8 */ f32 unk_1F8;
/* 0x01FC */ f32 unk_1FC;
/* 0x0200 */ u32 unk_200; // May be s32. but less casting required if u32
/* 0x0204 */ s16 unk_204;
/* 0x0204 */ s16 driftDuration;
/* 0x0206 */ s16 unk_206;
/* 0x0208 */ f32 unk_208;
/* 0x020C */ f32 unk_20C;
Expand All @@ -353,7 +353,10 @@ typedef struct {
/* 0x024C */ u16 animGroupSelector[4];
/* 0x0254 */ u16 characterId;
/* 0x0256 */ u16 unk_256;
/* 0x0258 */ UnkPlayerStruct258 unk_258[40];
/* 0x0258 */ UnkPlayerStruct258 playerPacticlePool0[10];
/* 0x0258 */ UnkPlayerStruct258 playerPacticlePool1[10];
/* 0x0258 */ UnkPlayerStruct258 playerPacticlePool2[10];
/* 0x0258 */ UnkPlayerStruct258 playerPacticlePool3[10];
/* 0x0D98 */ s16 unk_D98;
/* 0x0D9A */ s16 unk_D9A;
/* 0x0D9C */ f32 unk_D9C;
Expand Down
1 change: 1 addition & 0 deletions include/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ enum DIRECTION { NORTH, EAST, SOUTH, WEST };
* for effects
*/
#define BOOST_RAMP_WOOD_EFFECT 0x4 // being boosted by a ramp
#define DRIFTING_EFFECT 0x10 // drifting
#define STAR_EFFECT 0x200 // being a star
#define BOOST_EFFECT 0x2000 // being boosted by trigger a mushroom
#define BOOST_RAMP_ASPHALT_EFFECT 0x100000 // being boosted by a boost pad
Expand Down
6 changes: 3 additions & 3 deletions src/audio/external.c
Original file line number Diff line number Diff line change
Expand Up @@ -1880,7 +1880,7 @@ void func_800C6108(u8 playerId) {
} else {
D_800E9E54[playerId] = (f32) -player->unk_0C0;
}
if ((player->effects & 0x10) == 0x10) {
if ((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) {
D_800E9EB4[playerId] = D_800E9E64[playerId] + D_800E9DE4[playerId];
} else {
D_800E9EB4[playerId] = D_800E9E64[playerId] + D_800E9DE4[playerId] - (D_800E9E54[playerId] / 12000.0f);
Expand Down Expand Up @@ -2150,7 +2150,7 @@ void func_800C683C(u8 cameraId) {
void func_800C70A8(u8 playerId) {
if (D_800EA0EC[playerId] == 0) {
D_800E9E74[playerId] = 0;
if ((D_800E9E54[playerId] > 3500.0f) || ((gPlayers[playerId].effects & 0x10) == 0x10)) {
if ((D_800E9E54[playerId] > 3500.0f) || ((gPlayers[playerId].effects & DRIFTING_EFFECT) == DRIFTING_EFFECT)) {
D_800E9E74[playerId] = 1;
switch (gPlayers[playerId].tyres[AUDIO_LEFT_TYRE].surfaceType) {
case DIRT: /* switch 1 */
Expand Down Expand Up @@ -2182,7 +2182,7 @@ void func_800C70A8(u8 playerId) {
break;
}
}
if ((gPlayers[playerId].effects & 0x10) == 0x10) {
if ((gPlayers[playerId].effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) {
D_800E9E74[playerId] = 2;
switch (gPlayers[playerId].tyres[AUDIO_LEFT_TYRE].surfaceType) { /* switch 2 */
case DIRT: /* switch 2 */
Expand Down
4 changes: 2 additions & 2 deletions src/camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ void func_8001E45C(Camera* camera, Player* player, s8 arg2) {
UNUSED s16 pad6;
s16 temp;

if ((player->effects & 0x10) == 0x10) {
if ((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) {
var_a3 = 100;
if (player->unk_078 == 0) {
camera->unk_B0 = 0;
Expand Down Expand Up @@ -826,7 +826,7 @@ void func_8001EA0C(Camera* camera, Player* player, s8 arg2) {
UNUSED s16 pad6;
s16 temp;

if ((player->effects & 0x10) == 0x10) {
if ((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) {
var_a3 = 100;
if (player->unk_078 == 0) {
camera->unk_B0 = 0;
Expand Down
6 changes: 3 additions & 3 deletions src/code_80005FD0.c
Original file line number Diff line number Diff line change
Expand Up @@ -1803,7 +1803,7 @@ void func_80009B60(s32 playerId) {
return;
}
if ((D_801630E8[playerId] == 1) || (D_801630E8[playerId] == -1)) {
player->effects |= 0x10;
player->effects |= DRIFTING_EFFECT;
}
if (D_801630E8[playerId] != 0) {
D_80163300[playerId] = -get_angle_between_two_vectors(&player->oldPos[0], player->pos);
Expand Down Expand Up @@ -4310,7 +4310,7 @@ void func_80011EC0(s32 arg0, Player* player, s32 arg2, UNUSED u16 arg3) {
if ((arg2 >= -9) && (D_80162FF8[arg0] == 0)) {
if ((D_80163068[arg0] > -0.8) && (D_80163068[arg0] < 0.5)) {
kart_hop(player);
player->effects |= 0x10;
player->effects |= DRIFTING_EFFECT;
D_801630E8[arg0] = 1;
break;
}
Expand All @@ -4322,7 +4322,7 @@ void func_80011EC0(s32 arg0, Player* player, s32 arg2, UNUSED u16 arg3) {
if ((arg2 < 0xA) && (D_80162FF8[arg0] == 0)) {
if ((D_80163068[arg0] > -0.5) && (D_80163068[arg0] < 0.8)) {
kart_hop(player);
player->effects |= 0x10;
player->effects |= DRIFTING_EFFECT;
D_801630E8[arg0] = -1;
break;
}
Expand Down
Loading

0 comments on commit b3ec33b

Please sign in to comment.