summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcoco875 <59367621+coco875@users.noreply.github.com>2024-04-03 20:44:44 +0200
committerGitHub <noreply@github.com>2024-04-03 12:44:44 -0600
commit12f332614ed9ee8b684d4b0fdae91e5ef14568ff (patch)
treea8684cb916aae03d41b35a57d07b4c70fd4da909
parent705fb6d91579ca6661869ff14a58f7b4145c4104 (diff)
move actors code in actors folder and rename thing related to actor (#584)
* Move actors into their folders * Renamings and documentation
-rw-r--r--asm/non_matchings/code_80005FD0/func_80009B60.s16
-rw-r--r--courses/mario_raceway/course_data.c16
-rw-r--r--courses/mario_raceway/course_data.h6
-rw-r--r--enhancements/flycam.patch2
-rw-r--r--include/actor_types.h42
-rw-r--r--include/defines.h2
-rw-r--r--src/actors/banana/render.inc.c52
-rw-r--r--src/actors/banana/update.inc.c186
-rw-r--r--src/actors/blue_and_red_shells/render.inc.c26
-rw-r--r--src/actors/blue_and_red_shells/update.inc.c467
-rw-r--r--src/actors/box_truck/render.inc.c54
-rw-r--r--src/actors/car/render.inc.c44
-rw-r--r--src/actors/cow/render.inc.c41
-rw-r--r--src/actors/fake_item_box/render.inc.c148
-rw-r--r--src/actors/fake_item_box/update.inc.c92
-rw-r--r--src/actors/falling_rock/render.inc.c47
-rw-r--r--src/actors/falling_rock/update.inc.c (renamed from src/actors/falling_rocks.inc.c)21
-rw-r--r--src/actors/green_shell/render.inc.c16
-rw-r--r--src/actors/green_shell/update.inc.c193
-rw-r--r--src/actors/item_box/render.inc.c158
-rw-r--r--src/actors/item_box/update.inc.c68
-rw-r--r--src/actors/kiwano_fruit/render.inc.c32
-rw-r--r--src/actors/kiwano_fruit/update.inc.c89
-rw-r--r--src/actors/mario_sign/render.inc.c29
-rw-r--r--src/actors/mario_sign/update.inc.c20
-rw-r--r--src/actors/paddle_boat/render.inc.c14
-rw-r--r--src/actors/paddle_boat/update.inc.c4
-rw-r--r--src/actors/palm_tree/render.inc.c60
-rw-r--r--src/actors/piranha_plant/render.inc.c117
-rw-r--r--src/actors/piranha_plant/update.inc.c52
-rw-r--r--src/actors/railroad_crossing/render.inc.c38
-rw-r--r--src/actors/railroad_crossing/update.inc.c24
-rw-r--r--src/actors/school_bus/render.inc.c44
-rw-r--r--src/actors/tanker_truck/render.inc.c43
-rw-r--r--src/actors/train.inc.c19
-rw-r--r--src/actors/train/render.inc.c324
-rw-r--r--src/actors/train/update.inc.c38
-rw-r--r--src/actors/trees/render.inc.c329
-rw-r--r--src/actors/wario_sign/render.inc.c27
-rw-r--r--src/actors/wario_sign/update.inc.c11
-rw-r--r--src/actors/yoshi_egg/render.inc.c59
-rw-r--r--src/actors/yoshi_egg/update.inc.c26
-rw-r--r--src/code_800029B0.c24
-rw-r--r--src/code_800029B0.h13
-rw-r--r--src/code_80005FD0.c52
-rw-r--r--src/code_80005FD0.h10
-rw-r--r--src/code_80057C60.c2
-rw-r--r--src/effects.c56
-rw-r--r--src/effects.h6
-rw-r--r--src/ending/code_80280000.c14
-rw-r--r--src/ending/code_80281780.c12
-rw-r--r--src/main.c8
-rw-r--r--src/player_controller.c22
-rw-r--r--src/racing/actors.c3065
-rw-r--r--src/racing/actors.h102
-rw-r--r--src/racing/actors_extended.c852
-rw-r--r--src/racing/actors_extended.h10
-rw-r--r--src/racing/collision.c198
-rw-r--r--src/racing/collision.h3
-rw-r--r--src/racing/render_courses.c45
-rw-r--r--src/racing/skybox_and_splitscreen.c18
-rw-r--r--src/render_player.c8
-rw-r--r--src/update_objects.c2
-rw-r--r--tools/doxygen_syms.md534
64 files changed, 4335 insertions, 3817 deletions
diff --git a/asm/non_matchings/code_80005FD0/func_80009B60.s b/asm/non_matchings/code_80005FD0/func_80009B60.s
index 33b3c51e1..582a97b69 100644
--- a/asm/non_matchings/code_80005FD0/func_80009B60.s
+++ b/asm/non_matchings/code_80005FD0/func_80009B60.s
@@ -90,18 +90,18 @@ glabel func_80009B60
.L80009C58:
/* 00A858 80009C58 00D81021 */ addu $v0, $a2, $t8
/* 00A85C 80009C5C A4400000 */ sh $zero, ($v0)
-/* 00A860 80009C60 3C198016 */ lui $t9, %hi(D_8015F6EA) # $t9, 0x8016
-/* 00A864 80009C64 8739F6EA */ lh $t9, %lo(D_8015F6EA)($t9)
+/* 00A860 80009C60 3C198016 */ lui $t9, %hi(gCourseMinX) # $t9, 0x8016
+/* 00A864 80009C64 8739F6EA */ lh $t9, %lo(gCourseMinX)($t9)
/* 00A868 80009C68 C4600014 */ lwc1 $f0, 0x14($v1)
/* 00A86C 80009C6C 240A0001 */ li $t2, 1
/* 00A870 80009C70 44994000 */ mtc1 $t9, $f8
-/* 00A874 80009C74 3C0B8016 */ lui $t3, %hi(D_8015F6E8) # $t3, 0x8016
+/* 00A874 80009C74 3C0B8016 */ lui $t3, %hi(gCourseMaxX) # $t3, 0x8016
/* 00A878 80009C78 240C0002 */ li $t4, 2
/* 00A87C 80009C7C 468042A0 */ cvt.s.w $f10, $f8
-/* 00A880 80009C80 3C0D8016 */ lui $t5, %hi(D_8015F6F2) # $t5, 0x8016
+/* 00A880 80009C80 3C0D8016 */ lui $t5, %hi(gCourseMinZ) # $t5, 0x8016
/* 00A884 80009C84 240E0003 */ li $t6, 3
/* 00A888 80009C88 24180004 */ li $t8, 4
-/* 00A88C 80009C8C 3C0F8016 */ lui $t7, %hi(D_8015F6F0) # $t7, 0x8016
+/* 00A88C 80009C8C 3C0F8016 */ lui $t7, %hi(gCourseMaxZ) # $t7, 0x8016
/* 00A890 80009C90 460A003C */ c.lt.s $f0, $f10
/* 00A894 80009C94 00000000 */ nop
/* 00A898 80009C98 45000003 */ bc1f .L80009CA8
@@ -109,7 +109,7 @@ glabel func_80009B60
/* 00A8A0 80009CA0 A44A0000 */ sh $t2, ($v0)
/* 00A8A4 80009CA4 C4600014 */ lwc1 $f0, 0x14($v1)
.L80009CA8:
-/* 00A8A8 80009CA8 856BF6E8 */ lh $t3, %lo(D_8015F6E8)($t3)
+/* 00A8A8 80009CA8 856BF6E8 */ lh $t3, %lo(gCourseMaxX)($t3)
/* 00A8AC 80009CAC 448B8000 */ mtc1 $t3, $f16
/* 00A8B0 80009CB0 00000000 */ nop
/* 00A8B4 80009CB4 468084A0 */ cvt.s.w $f18, $f16
@@ -119,7 +119,7 @@ glabel func_80009B60
/* 00A8C4 80009CC4 00000000 */ nop
/* 00A8C8 80009CC8 A44C0000 */ sh $t4, ($v0)
.L80009CCC:
-/* 00A8CC 80009CCC 85ADF6F2 */ lh $t5, %lo(D_8015F6F2)($t5)
+/* 00A8CC 80009CCC 85ADF6F2 */ lh $t5, %lo(gCourseMinZ)($t5)
/* 00A8D0 80009CD0 C460001C */ lwc1 $f0, 0x1c($v1)
/* 00A8D4 80009CD4 448D2000 */ mtc1 $t5, $f4
/* 00A8D8 80009CD8 00000000 */ nop
@@ -131,7 +131,7 @@ glabel func_80009B60
/* 00A8F0 80009CF0 A44E0000 */ sh $t6, ($v0)
/* 00A8F4 80009CF4 C460001C */ lwc1 $f0, 0x1c($v1)
.L80009CF8:
-/* 00A8F8 80009CF8 85EFF6F0 */ lh $t7, %lo(D_8015F6F0)($t7)
+/* 00A8F8 80009CF8 85EFF6F0 */ lh $t7, %lo(gCourseMaxZ)($t7)
/* 00A8FC 80009CFC 448F4000 */ mtc1 $t7, $f8
/* 00A900 80009D00 00000000 */ nop
/* 00A904 80009D04 468042A0 */ cvt.s.w $f10, $f8
diff --git a/courses/mario_raceway/course_data.c b/courses/mario_raceway/course_data.c
index 1fa2cccc0..1e4901a6e 100644
--- a/courses/mario_raceway/course_data.c
+++ b/courses/mario_raceway/course_data.c
@@ -3654,7 +3654,7 @@ Gfx d_course_mario_raceway_dl_tree[] =
};
// 0x6B08
-Vtx d_course_mario_raceway_sign_model[] = {
+Vtx d_course_mario_sign_model[] = {
{{{ 5, 0, 0 }, 0, { 0, 0 }, {0x00, 0x00, 0xFC, 0xFF }}},
{{{ 5, 24, 0 }, 0, { 0, 0 }, {0x2D, 0x2D, 0xFF, 0xFF }}},
{{{ 0, 28, 5 }, 0, { 0, 0 }, {0x2D, 0x2D, 0xFF, 0xFF }}},
@@ -3762,12 +3762,12 @@ Vtx d_course_mario_raceway_06007008[] ={
};
// 0x7068
-u8 d_course_mario_raceway_sign_left[] = {
+u8 d_course_mario_sign_left[] = {
#include "assets/courses/mario_raceway/gTextureMarioRacewaySignLeft.inc.c"
};
// 8284D0_08068
-u8 d_course_mario_raceway_sign_right[] = {
+u8 d_course_mario_sign_right[] = {
#include "assets/courses/mario_raceway/gTextureMarioRacewaySignRight.inc.c"
};
@@ -3776,7 +3776,7 @@ Gfx d_course_mario_raceway_dl_9068[] =
gsDPPipeSync(),
gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
gsSPTexture(0x0001, 0x0001, 0, G_TX_RENDERTILE, G_OFF),
- gsSPVertex(d_course_mario_raceway_sign_model, 8, 0),
+ gsSPVertex(d_course_mario_sign_model, 8, 0),
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
gsSP2Triangles(4, 5, 1, 0, 4, 1, 0, 0),
gsSP2Triangles(3, 2, 6, 0, 3, 6, 7, 0),
@@ -3829,7 +3829,7 @@ Gfx d_course_mario_raceway_dl_9190[] =
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0000, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, 6, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_CLAMP, 5, G_TX_NOLOD),
gsDPSetTileSize(G_TX_RENDERTILE, 0, 0, 0x007C, 0x00FC),
- gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, d_course_mario_raceway_sign_left),
+ gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, d_course_mario_sign_left),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD),
gsDPLoadSync(),
@@ -3837,7 +3837,7 @@ Gfx d_course_mario_raceway_dl_9190[] =
gsSPVertex(d_course_mario_raceway_06006EE8, 6, 0),
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
gsSP2Triangles(1, 4, 5, 0, 1, 5, 2, 0),
- gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, d_course_mario_raceway_sign_right),
+ gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, d_course_mario_sign_right),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD),
gsDPLoadSync(),
@@ -3857,7 +3857,7 @@ Gfx d_course_mario_raceway_dl_9250[] =
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0000, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, 6, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_CLAMP, 5, G_TX_NOLOD),
gsDPSetTileSize(G_TX_RENDERTILE, 0, 0, 0x007C, 0x00FC),
- gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, d_course_mario_raceway_sign_left),
+ gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, d_course_mario_sign_left),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD),
gsDPLoadSync(),
@@ -3865,7 +3865,7 @@ Gfx d_course_mario_raceway_dl_9250[] =
gsSPVertex(d_course_mario_raceway_06006FA8, 6, 0),
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
gsSP2Triangles(3, 4, 5, 0, 3, 5, 0, 0),
- gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, d_course_mario_raceway_sign_right),
+ gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, d_course_mario_sign_right),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD),
gsDPLoadSync(),
diff --git a/courses/mario_raceway/course_data.h b/courses/mario_raceway/course_data.h
index c7fc5866c..bdc5a137d 100644
--- a/courses/mario_raceway/course_data.h
+++ b/courses/mario_raceway/course_data.h
@@ -83,15 +83,15 @@ extern Vtx d_course_mario_raceway_piranha_plant_model[];
extern Gfx d_course_mario_raceway_dl_piranha_plant[];
extern Vtx d_course_mario_raceway_tree_model[];
extern Gfx d_course_mario_raceway_dl_tree[];
-extern Vtx d_course_mario_raceway_sign_model[];
+extern Vtx d_course_mario_sign_model[];
extern Vtx d_course_mario_raceway_06006B88[];
extern Vtx d_course_mario_raceway_06006D68[];
extern Vtx d_course_mario_raceway_06006EE8[];
extern Vtx d_course_mario_raceway_06006F48[];
extern Vtx d_course_mario_raceway_06006FA8[];
extern Vtx d_course_mario_raceway_06007008[];
-extern u8 d_course_mario_raceway_sign_left[];
-extern u8 d_course_mario_raceway_sign_right[];
+extern u8 d_course_mario_sign_left[];
+extern u8 d_course_mario_sign_right[];
extern Gfx d_course_mario_raceway_dl_9068[];
extern Gfx d_course_mario_raceway_dl_90B0[];
extern Gfx d_course_mario_raceway_dl_90C0[];
diff --git a/enhancements/flycam.patch b/enhancements/flycam.patch
index 1e8b7ef4a..2567ca19e 100644
--- a/enhancements/flycam.patch
+++ b/enhancements/flycam.patch
@@ -421,7 +421,7 @@ index 7c90951..135e98c 100644
gCourseTimer += 0.01666666; // 1 / 60
@@ -585,7 +586,6 @@ void race_logic_loop(void) {
func_802909F0();
- evaluate_player_collision();
+ evaluate_collision_for_players_and_actors();
func_800382DC();
- func_8001EE98(gPlayerOneCopy, camera1, 0);
func_80028F70();
diff --git a/include/actor_types.h b/include/actor_types.h
index 050d96132..3c3d88745 100644
--- a/include/actor_types.h
+++ b/include/actor_types.h
@@ -36,16 +36,18 @@
* exactly what you're doing.
*/
enum ActorType {
- ACTOR_TREE_MARIO_RACEWAY = 0x02,
+ ACTOR_UNKNOWN_0x01 = 0x01,
+ ACTOR_TREE_MARIO_RACEWAY,
ACTOR_TREE_YOSHI_VALLEY,
ACTOR_TREE_ROYAL_RACEWAY,
ACTOR_FALLING_ROCK,
ACTOR_BANANA,
ACTOR_GREEN_SHELL,
ACTOR_RED_SHELL,
- ACTOR_YOSHI_VALLEY_EGG,
+ ACTOR_YOSHI_EGG,
ACTOR_PIRANHA_PLANT,
- ACTOR_ITEM_BOX = 0x0C,
+ ACTOR_UNKNOWN_0x0B,
+ ACTOR_ITEM_BOX,
ACTOR_FAKE_ITEM_BOX,
ACTOR_BANANA_BUNCH,
ACTOR_TRAIN_ENGINE,
@@ -53,18 +55,24 @@ enum ActorType {
ACTOR_TRAIN_PASSENGER_CAR,
ACTOR_COW,
ACTOR_TREE_MOO_MOO_FARM,
- ACTOR_TRIPLE_GREEN_SHELL = 0x15,
+ ACTOR_UNKNOWN_0x14,
+ ACTOR_TRIPLE_GREEN_SHELL,
ACTOR_TRIPLE_RED_SHELL,
ACTOR_MARIO_SIGN,
- ACTOR_PALM_TREE = 0x19,
- ACTOR_TREE_BOWSERS_CASTLE = 0x1C,
+ ACTOR_UNKNOWN_0x18,
+ ACTOR_PALM_TREE,
+ ACTOR_UNKNOWN_0x1A,
+ ACTOR_UNKNOWN_0x1B,
+ ACTOR_TREE_BOWSERS_CASTLE,
ACTOR_TREE_FRAPPE_SNOWLAND,
ACTOR_CACTUS1_KALAMARI_DESERT,
ACTOR_CACTUS2_KALAMARI_DESERT,
ACTOR_CACTUS3_KALAMARI_DESERT,
ACTOR_BUSH_BOWSERS_CASTLE,
- ACTOR_WARIO_SIGN = 0x23,
- ACTOR_BOX_TRUCK = 0x25,
+ ACTOR_UNKNOWN_0x21,
+ ACTOR_WARIO_SIGN,
+ ACTOR_UNKNOWN_0x23,
+ ACTOR_BOX_TRUCK,
ACTOR_PADDLE_BOAT,
ACTOR_RAILROAD_CROSSING,
ACTOR_SCHOOL_BUS,
@@ -91,7 +99,7 @@ enum ShellState {
TRIPLE_RED_SHELL, // Loses triple shell state when shot.
DESTROYED_SHELL, // Collision with the shell.
BLUE_SHELL_LOCK_ON, // A blue shell has found a target and is hastily approaching it.
- BLUE_SHELL_TARGET_ELIMINATED // Mission completed, well done boss.
+ BLUE_SHELL_TARGET_ELIMINATED // Mission completed, well done boss.
};
// Actor banana->state
@@ -101,7 +109,7 @@ enum BananaState {
FIRST_BANANA_BUNCH_BANANA, // The first banana of the banana bunch
BANANA_BUNCH_BANANA, // Every banana of the banana bunch except the first one.
BANANA_ON_GROUND, // A banana sitting on the ground.
- DESTROYED_BANANA // Collision with the banana.
+ DESTROYED_BANANA // Collision with the banana.
};
// Actor fakeItemBox->state
@@ -183,7 +191,7 @@ struct ActorSpawnData {
};
};
-// Required for func_80298AC0 due to diff size.
+// Required for evaluate_collision_player_palm_trees due to diff size.
// members unverified. data located at d_course_dks_jungle_parkway_tree_spawn
/**
* There are nearly 100 trees in DK Jungle Parkway. If they were put into the actor list proper
@@ -261,17 +269,17 @@ struct PiranhaPlant {
/* 0x30 */ Collision unk30;
}; // size = 0x70
-// Copied from PiranhaPlant, may not be accurate.
struct PalmTree {
/* 0x00 */ s16 type;
/* 0x02 */ s16 flags;
- /* 0x04 */ Vec4s visibilityStates; // A per-camera visibilty state tracker
+ /* 0x04 */ s16 variant; // four different types of palm trees
+ /* 0x06 */ s16 state;
+ /* 0x08 */ f32 unk_08;
/* 0x0C */ f32 boundingBoxSize;
- /* 0x10 */ Vec3s unk10;
- /* 0x16 */ s16 unk16;
+ /* 0x10 */ Vec3s rot;
+ /* 0x16 */ s16 unk_16;
/* 0x18 */ Vec3f pos;
- /* 0x24 */ Vec4s timers; // A per-camera timer. Might be more appropriate to call this state
- /* 0x2C */ f32 unk_02C;
+ /* 0x24 */ Vec3f velocity;
/* 0x30 */ Collision unk30;
}; // size = 0x70
diff --git a/include/defines.h b/include/defines.h
index 1ca7e63b9..f84fd92ad 100644
--- a/include/defines.h
+++ b/include/defines.h
@@ -325,6 +325,7 @@ typedef enum {
* @brief sound effect of player's
* for soundEffect
*/
+#define HIT_SOUND_EFFECT 0x100 // hitting an object
#define BOOST_SOUND_EFFECT 0x200 // being boosted by trigger a mushroom
#define BOO_SOUND_EFFECT 0x800 // being a boo
#define STAR_SOUND_EFFECT 0x2000 // being a star
@@ -344,6 +345,7 @@ typedef enum {
#define BOOST_EFFECT 0x2000 // being boosted by trigger a mushroom
#define BOOST_RAMP_ASPHALT_EFFECT 0x100000 // being boosted by a boost pad
#define HIT_BY_ITEM_EFFECT 0x2000000 // being hit by an item
+#define HIT_EFFECT 0x4000000 // hitting an object
#define LIGHTNING_EFFECT 0x40000000 // being hit by lightning
#define BOO_EFFECT 0x80000000 // being a boo
diff --git a/src/actors/banana/render.inc.c b/src/actors/banana/render.inc.c
new file mode 100644
index 000000000..e148cb767
--- /dev/null
+++ b/src/actors/banana/render.inc.c
@@ -0,0 +1,52 @@
+#include <actors.h>
+#include <code_800029B0.h>
+#include <PR/gbi.h>
+
+/**
+ * @brief Render the banana actor
+ *
+ * @param camera
+ * @param arg1
+ * @param banana
+ */
+void render_actor_banana(Camera *camera, UNUSED Mat4 arg1, struct BananaActor *banana) {
+ UNUSED s32 pad[2];
+ s32 maxObjectsReached;
+ Vec3s sp7C;
+ Mat4 sp3C;
+
+ f32 temp = is_within_render_distance(camera->pos, banana->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 490000.0f);
+ if (temp < 0.0f) {
+ actor_not_rendered(camera, (struct Actor *) banana);
+ return;
+ }
+
+ if ((banana->pos[1] > gCourseMaxY + 800.0f)) {
+ actor_not_rendered(camera, (struct Actor *) banana);
+ return;
+ }
+ if (banana->pos[1] < (gCourseMinY - 800.0f)) {
+ actor_not_rendered(camera, (struct Actor *) banana);
+ return;
+ }
+
+ actor_rendered(camera, (struct Actor *) banana);
+
+ if (banana->state == 5) {
+ mtxf_pos_rotation_xyz(sp3C, banana->pos, banana->rot);
+ } else {
+ sp7C[0] = 0;
+ sp7C[1] = 0;
+ sp7C[2] = 0;
+ mtxf_pos_rotation_xyz(sp3C, banana->pos, sp7C);
+ }
+
+ maxObjectsReached = render_set_position(sp3C, 0) == 0;
+ if (maxObjectsReached) { return; }
+
+ if (banana->state != 5) {
+ gSPDisplayList(gDisplayListHead++, &common_model_banana);
+ } else {
+ gSPDisplayList(gDisplayListHead++, &common_model_flat_banana);
+ }
+}
diff --git a/src/actors/banana/update.inc.c b/src/actors/banana/update.inc.c
new file mode 100644
index 000000000..4367d8ea4
--- /dev/null
+++ b/src/actors/banana/update.inc.c
@@ -0,0 +1,186 @@
+#include <actors.h>
+#include <code_800029B0.h>
+#include <defines.h>
+#include <main.h>
+
+/**
+ * @brief Update the banana actor
+ *
+ * @param banana
+ */
+void update_actor_banana(struct BananaActor *banana) {
+ UNUSED f32 pad;
+ Player *player;
+ struct BananaActor *elderBanana;
+ struct Controller *controller;
+ Vec3f someOtherVelocity;
+ Vec3f someVelocity;
+ f32 temp_f0;
+ UNUSED f32 var_f8;
+ UNUSED f32 pad2;
+ UNUSED f32 pad3;
+ UNUSED f32 pad4[2];
+ f32 temp_f12;
+ f32 temp_f2;
+ f32 temp_f14;
+ f32 temp_f16;
+ f32 unkX;
+ f32 unkY;
+ f32 unkZ;
+
+ player = &gPlayers[banana->rot[0]];
+ switch (banana->state) {
+ case HELD_BANANA:
+ temp_f2 = player->pos[0] - banana->pos[0];
+ temp_f14 = player->pos[1] - banana->pos[1];
+ temp_f16 = player->pos[2] - banana->pos[2];
+ temp_f12 = sqrtf((temp_f2 * temp_f2) + (temp_f14 * temp_f14) + (temp_f16 * temp_f16)) / 10.0f;
+ if (temp_f12 == 0.0f) {
+ banana->pos[0] = player->pos[0] + 0.2f;
+ banana->pos[1] = player->pos[1] + 0.2f;
+ banana->pos[2] = player->pos[2] + 0.2f;
+ } else {
+ temp_f2 /= temp_f12;
+ temp_f14 /= temp_f12;
+ temp_f16 /= temp_f12;
+ banana->pos[0] = player->pos[0] - temp_f2;
+ banana->pos[1] = player->pos[1] - temp_f14 - 2.0f;
+ banana->pos[2] = player->pos[2] - temp_f16;
+ }
+ func_802ADDC8(&banana->unk30, banana->boundingBoxSize + 1.0f, banana->pos[0], banana->pos[1], banana->pos[2]);
+ func_802B4E30((struct Actor *) banana);
+ if ((player->type & PLAYER_HUMAN) != 0) {
+ if (gDemoMode) {
+ controller = gControllerOne;
+ } else {
+ controller = &gControllers[banana->rot[0]];
+ }
+ if ((controller->buttonDepressed & Z_TRIG) != 0) {
+ controller->buttonDepressed &= ~Z_TRIG;
+ banana->state = 1;
+ banana->unk_04 = 0x00B4;
+ player->soundEffects &= ~HOLD_BANANA_SOUND_EFFECT;
+ func_800C9060(player - gPlayerOne, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x12));
+ pad3 = controller->rawStickY;
+ if ((pad3 > 30.0f) && (controller->rawStickX < 10) && (controller->rawStickX >= -9)) {
+ pad3 = pad3 - ((f32) 30);
+ pad3 = (pad3 / 20.0f) + 0.5f;
+ if (player->unk_094 < 2.0f) {
+ temp_f0 = 4.0f;
+ } else {
+ temp_f0 = (player->unk_094 * 0.75f) + 3.5f + pad3;
+ }
+ vec3f_set(someVelocity, 0, pad3, temp_f0);
+ func_802B64C4(someVelocity, player->rotation[1] + player->unk_0C0);
+ banana->velocity[0] = someVelocity[0];
+ banana->velocity[1] = someVelocity[1];
+ banana->velocity[2] = someVelocity[2];
+ } else {
+ banana->velocity[0] = 0;
+ banana->velocity[1] = 1.5f;
+ banana->velocity[2] = 0;
+ }
+ }
+ }
+ break;
+ case DROPPED_BANANA:
+ if (banana->unk_04 != 0) {
+ banana->unk_04 -= 1;
+ if (banana->unk_04 == 0) {
+ banana->flags &= ~0x1000;
+ }
+ }
+ banana->pos[0] += banana->velocity[0];
+ banana->pos[2] += banana->velocity[2];
+ if (banana->velocity[1] > -1.0f) {
+ banana->velocity[1] -= 0.15f;
+ }
+ banana->pos[1] += banana->velocity[1];
+ if ((banana->pos[2] < (f32) gCourseMinZ) || ((f32) gCourseMaxZ < banana->pos[2]) || (banana->pos[0] < (f32) gCourseMinX) || ((f32) gCourseMaxX < banana->pos[0]) || (banana->pos[1] < (f32) gCourseMinY)) {
+ destroy_destructable_actor((struct Actor *) banana);
+ } else {
+ func_802ADDC8(&banana->unk30, banana->boundingBoxSize + 1.0f, banana->pos[0], banana->pos[1], banana->pos[2]);
+ banana->unk30.unk34 = 1;
+ if ((banana->unk30.unk34 != 0) && (banana->unk30.unk3C[2] < 0.0f)) {
+ someOtherVelocity[0] = -banana->unk30.orientationVector[0];
+ someOtherVelocity[1] = -banana->unk30.orientationVector[1];
+ someOtherVelocity[2] = -banana->unk30.orientationVector[2];
+ banana->pos[0] += someOtherVelocity[0] * banana->unk30.unk3C[2];
+ banana->pos[1] += someOtherVelocity[1] * banana->unk30.unk3C[2];
+ banana->pos[2] += someOtherVelocity[2] * banana->unk30.unk3C[2];
+ banana->flags &= ~0x1000;
+ banana->state = 4;
+ }
+ }
+ break;
+ case FIRST_BANANA_BUNCH_BANANA:
+ someVelocity[0] = 0.0f;
+ someVelocity[1] = 0.0f;
+ someVelocity[2] = -5.0f;
+ func_802B64C4(someVelocity, player->rotation[1] + player->unk_0C0);
+ unkX = player->pos[0] + someVelocity[0];
+ unkY = player->pos[1] + someVelocity[1];
+ unkZ = player->pos[2] + someVelocity[2];
+ temp_f2 = unkX - banana->pos[0];
+ temp_f14 = unkY - banana->pos[1];
+ temp_f16 = unkZ - banana->pos[2];
+ temp_f0 = sqrtf((temp_f2 * temp_f2) + (temp_f14 * temp_f14) + (temp_f16 * temp_f16));
+ if (temp_f0 == 0.0f) {
+ banana->pos[0] = player->pos[0] + 0.2f;
+ banana->pos[1] = player->pos[1] + 0.2f;
+ banana->pos[2] = player->pos[2] + 0.2f;
+ } else {
+ temp_f2 /= temp_f0;
+ temp_f14 /= temp_f0;
+ temp_f16 /= temp_f0;
+ banana->pos[0] = someVelocity[0] + (unkX - temp_f2);
+ banana->pos[1] = unkY - temp_f14 - 2.0f;
+ banana->pos[2] = unkZ - temp_f16;
+ }
+ func_802ADDC8(&banana->unk30, banana->boundingBoxSize + 1.0f, banana->pos[0], banana->pos[1], banana->pos[2]);
+ func_802B4E30((struct Actor *) banana);
+ break;
+ case BANANA_BUNCH_BANANA:
+ elderBanana = (struct BananaActor*)&gActorList[banana->elderIndex];
+ temp_f2 = elderBanana->pos[0] - banana->pos[0];
+ temp_f14 = elderBanana->pos[1] - banana->pos[1];
+ temp_f16 = elderBanana->pos[2] - banana->pos[2];
+ temp_f12 = sqrtf((temp_f2 * temp_f2) + (temp_f14 * temp_f14) + (temp_f16 * temp_f16)) / 5.0f;
+ if (temp_f12 == 0.0f) {
+ banana->pos[0] = elderBanana->pos[0] + 0.2f;
+ banana->pos[1] = elderBanana->pos[1] + 0.2f;
+ banana->pos[2] = elderBanana->pos[2] + 0.2f;
+ } else {
+ temp_f2 /= temp_f12;
+ temp_f14 /= temp_f12;
+ temp_f16 /= temp_f12;
+ banana->pos[0] = elderBanana->pos[0] - temp_f2;
+ banana->pos[1] = elderBanana->pos[1] - temp_f14 - 2.0f;
+ banana->pos[2] = elderBanana->pos[2] - temp_f16;
+ }
+ var_f8 = banana->pos[2];
+ func_802ADDC8(&banana->unk30, banana->boundingBoxSize + 1.0f, banana->pos[0], banana->pos[1], banana->pos[2]);
+ func_802B4E30((struct Actor *) banana);
+ break;
+ case DESTROYED_BANANA:
+ banana->velocity[1] -= 0.3f;
+ if (banana->velocity[1] < -5.0f) {
+ banana->velocity[1] = -5.0f;
+ }
+ banana->pos[1] += banana->velocity[1];
+ banana->rot[0] += 0x16C;
+ banana->rot[1] -= 0x5B0;
+ banana->rot[2] += 0x38E;
+ banana->unk_04 -= 1;
+ if (banana->unk_04 == 0) {
+ destroy_actor((struct Actor *) banana);
+ }
+ break;
+ case BANANA_ON_GROUND:
+ banana->flags |= 0xC000;
+ banana->flags &= ~0x1000;
+ break;
+ default:
+ break;
+ }
+} \ No newline at end of file
diff --git a/src/actors/blue_and_red_shells/render.inc.c b/src/actors/blue_and_red_shells/render.inc.c
new file mode 100644
index 000000000..42bf7ca82
--- /dev/null
+++ b/src/actors/blue_and_red_shells/render.inc.c
@@ -0,0 +1,26 @@
+#include <actors.h>
+#include <PR/gbi.h>
+
+/**
+ * @brief Render the red shell actor
+ *
+ * @param camera
+ * @param matrix
+ * @param shell
+ */
+void render_actor_red_shell(Camera *camera, Mat4 matrix, struct ShellActor *shell) {
+ gDPLoadTLUT_pal256(gDisplayListHead++, &gTLUTRedShell); // set texture
+ render_actor_shell(camera, matrix, shell);
+}
+
+/**
+ * @brief Render the blue shell actor
+ *
+ * @param camera
+ * @param matrix
+ * @param shell
+ */
+void render_actor_blue_shell(Camera *camera, Mat4 matrix, struct ShellActor *shell) {
+ gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_blue_shell); // set texture
+ render_actor_shell(camera, matrix, shell);
+}
diff --git a/src/actors/blue_and_red_shells/update.inc.c b/src/actors/blue_and_red_shells/update.inc.c
new file mode 100644
index 000000000..493019132
--- /dev/null
+++ b/src/actors/blue_and_red_shells/update.inc.c
@@ -0,0 +1,467 @@
+#include <actors.h>
+#include <waypoints.h>
+#include <defines.h>
+#include <main.h>
+#include <actors_extended.h>
+#include <code_800029B0.h>
+
+void func_802B3B44(struct ShellActor *shell) {
+ u16 currentWaypoint;
+ u16 nextWaypoint;
+ f32 temp_f0;
+ f32 temp_f0_2;
+ f32 temp_f0_3;
+ f32 temp_f12_3;
+ f32 temp_f14_2;
+ f32 temp_f16_2;
+ f32 temp_f2;
+ f32 temp_f12;
+ f32 temp_f28;
+ f32 temp_f20;
+ f32 temp_f22;
+ f32 temp_f24;
+ f32 temp_f12_0;
+ f32 temp_f12_1;
+ f32 temp_f12_2;
+ f32 temp_f18_3;
+ f32 temp_f16_3;
+ f32 temp_f26;
+ Vec3f origPos;
+
+ currentWaypoint = shell->pathIndex;
+ temp_f2 = D_80164490[currentWaypoint].posX;
+ temp_f12 = D_80164490[currentWaypoint].posY;
+ temp_f28 = D_80164490[currentWaypoint].posZ;
+ nextWaypoint = currentWaypoint + 1;
+
+ if (nextWaypoint >= D_80164430) {
+ nextWaypoint -= D_80164430;
+ }
+
+ temp_f20 = temp_f2 - shell->pos[0];
+ temp_f22 = temp_f12 - shell->pos[1];
+ temp_f24 = temp_f28 - shell->pos[2];
+ temp_f0 = (temp_f20 * temp_f20) + (temp_f22 * temp_f22) + (temp_f24 * temp_f24);
+ if (temp_f0 > 400.0f) {
+ temp_f18_3 = D_80164490[nextWaypoint].posX;
+ temp_f16_3 = D_80164490[nextWaypoint].posY;
+ temp_f26 = D_80164490[nextWaypoint].posZ;
+
+ temp_f12_0 = temp_f18_3 - shell->pos[0];
+ temp_f12_1 = temp_f16_3 - shell->pos[1];
+ temp_f12_2 = temp_f26 - shell->pos[2];
+
+ temp_f0_3 = (temp_f12_0 * temp_f12_0) + (temp_f12_1 * temp_f12_1) + (temp_f12_2 * temp_f12_2);
+ if (temp_f0_3 < temp_f0) {
+ shell->pathIndex = nextWaypoint;
+ } else {
+ temp_f0_2 = sqrtf(temp_f0) * 4.0f;
+ temp_f20 /= temp_f0_2;
+ temp_f22 /= temp_f0_2;
+ temp_f24 /= temp_f0_2;
+
+ temp_f12_3 = shell->velocity[0];
+ temp_f14_2 = shell->velocity[1];
+ temp_f16_2 = shell->velocity[2];
+
+ temp_f12_3 += temp_f20;
+ temp_f14_2 += temp_f22;
+ temp_f16_2 += temp_f24;
+ temp_f0 = sqrtf((temp_f12_3 * temp_f12_3) + (temp_f14_2 * temp_f14_2) + (temp_f16_2 * temp_f16_2));
+ if (temp_f0 > 6.0f) {
+ temp_f0 /= 6.0f;
+ temp_f12_3 /= temp_f0;
+ temp_f14_2 /= temp_f0;
+ temp_f16_2 /= temp_f0;
+ }
+ shell->velocity[0] = temp_f12_3;
+ shell->velocity[1] = temp_f14_2;
+ shell->velocity[2] = temp_f16_2;
+
+ origPos[0] = shell->pos[0];
+ origPos[1] = shell->pos[1];
+ origPos[2] = shell->pos[2];
+
+ shell->pos[0] += temp_f12_3;
+ shell->pos[1] += temp_f14_2;
+ shell->pos[2] += temp_f16_2;
+ func_802AD950(&shell->unk30, 4.0f, shell->pos[0], shell->pos[1], shell->pos[2], origPos[0], origPos[1], origPos[2]);
+ func_802B4E30((struct Actor *) shell);
+ }
+ } else {
+ if (temp_f0 > 5.0f) {
+ shell->pos[0] = temp_f2;
+ shell->pos[1] = shell->boundingBoxSize + temp_f12;
+ shell->pos[2] = temp_f28;
+ shell->pathIndex = nextWaypoint;
+ } else {
+ temp_f18_3 = D_80164490[nextWaypoint].posX;
+ temp_f16_3 = D_80164490[nextWaypoint].posY;
+ temp_f26 = D_80164490[nextWaypoint].posZ;
+
+ shell->pos[0] = (temp_f2 + temp_f18_3) * 0.5f;
+ shell->pos[1] = ((temp_f12 + temp_f16_3) * 0.5f) + shell->boundingBoxSize;
+ shell->pos[2] = (temp_f28 + temp_f26) * 0.5f;
+
+ shell->velocity[0] = (temp_f18_3 - temp_f2) * 0.5f;
+ shell->velocity[1] = (temp_f16_3 - temp_f12) * 0.5f;
+ shell->velocity[2] = (temp_f26 - temp_f28) * 0.5f;
+ }
+ }
+}
+
+void func_802B3E7C(struct ShellActor *shell, Player *player) {
+ f32 x_velocity;
+ f32 z_velocity;
+ f32 xz_dist;
+ Vec3f newPosition;
+
+ x_velocity = player->pos[0];
+ x_velocity -= shell->pos[0];
+ z_velocity = player->pos[2];
+ z_velocity -= shell->pos[2];
+ xz_dist = sqrtf((x_velocity * x_velocity) + (z_velocity * z_velocity)) / 8;
+ if (xz_dist == 0.0f) {
+ x_velocity = 0.0f;
+ z_velocity = 0.0f;
+ } else {
+ x_velocity /= xz_dist;
+ z_velocity /= xz_dist;
+ }
+
+ newPosition[0] = shell->pos[0];
+ newPosition[1] = shell->pos[1];
+ newPosition[2] = shell->pos[2];
+ shell->pos[0] += x_velocity;
+ shell->pos[1] -= 2.0f;
+ shell->pos[2] += z_velocity;
+ shell->velocity[0] = x_velocity;
+ shell->velocity[1] = -2.0f;
+ shell->velocity[2] = z_velocity;
+
+ if (player->effects & BOO_EFFECT) {
+ destroy_destructable_actor((struct Actor *) shell);
+ } else {
+ func_802AD950(&shell->unk30, 4.0f, shell->pos[0], shell->pos[1], shell->pos[2], newPosition[0], newPosition[1], newPosition[2]);
+ func_802B4E30((struct Actor *) shell);
+ func_802B4104(shell);
+ }
+}
+
+/**
+ * Only used in Battle mode
+ * Likely trying to find the nearest player that is not the shell's owner and is not dead
+**/
+s16 func_802B3FD0(Player *owner, struct ShellActor *shell) {
+ Player *player;
+ s32 playerIndex;
+ f32 playerToShellDistance;
+ s16 playerId = -1;
+ f32 smallestDistance = 25000000.0f;
+
+ for (playerIndex = 0; playerIndex < 4; playerIndex++) {
+ player = &gPlayers[playerIndex];
+ if ((player->type & PLAYER_EXISTS) == 0) {continue;}
+ if (player == owner) {continue; }
+ if (gPlayerBalloonCount[playerIndex] < 0) { continue; }
+ // func_802B51E8 is not quite a 3D distance function, it doubles (rather than squares) the Z difference of the positions
+ playerToShellDistance = func_802B51E8(player->pos, shell->pos);
+ if (playerToShellDistance < smallestDistance) {
+ smallestDistance = playerToShellDistance;
+ playerId = player - gPlayerOne;
+ }
+
+ }
+
+ return playerId;
+}
+
+void func_802B4104(struct ShellActor *shell) {
+ if ((shell->unk30.unk3C[0] < 0.0f) && ((shell->unk30.unk48[1] < 0.25f) || (shell->unk30.unk48[1] > -0.25f))) {
+ destroy_destructable_actor((struct Actor *) shell);
+ func_800C98B8(shell->pos, shell->velocity, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x54));
+ shell->flags |= 0x80;
+ } else if ((shell->unk30.unk3C[1] < 0.0f) && ((shell->unk30.unk54[1] < 0.25f) || (shell->unk30.unk54[1] < -0.25f))) {
+ destroy_destructable_actor((struct Actor *) shell);
+ func_800C98B8(shell->pos, shell->velocity, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x54));
+ shell->flags |= 0x80;
+ }
+}
+
+/**
+ * @brief Update the red and blue shell actors
+ *
+ * @param shell
+ */
+void update_actor_red_blue_shell(struct ShellActor *shell) {
+ UNUSED f32 pad9;
+ Player *player;
+ f32 temp_f0;
+ UNUSED f32 temp_f14;
+ f32 temp_f2;
+ s16 temp_v0;
+ UNUSED s16 pad3;
+ Vec3f somePosVel;
+ struct Controller *controller;
+ TripleShellParent *parent;
+ UNUSED f32 pad0;
+ UNUSED f32 pad1;
+ UNUSED f32 pad2;
+ UNUSED f32 pad4;
+ UNUSED f32 pad5;
+ UNUSED f32 pad6;
+ UNUSED f32 pad7;
+ UNUSED f32 pad8;
+ UNUSED f32 pad10;
+ UNUSED f32 pad11;
+ UNUSED f32 pad12;
+ UNUSED s16 pad13;
+ UNUSED s16 pad13_2;
+ UNUSED f32 pad14;
+ UNUSED f32 pad15;
+ UNUSED f32 pad16;
+ UNUSED f32 pad17;
+ Vec3f origPos;
+
+ pad1 = shell->pos[0];
+ pad0 = shell->pos[2];
+ pad2 = shell->pos[1];
+ pad13 = shell->type;
+ if ((pad0 < (f32) gCourseMinZ) || ((f32) gCourseMaxZ < pad0) || (pad1 < (f32) gCourseMinX) || ((f32) gCourseMaxX < pad1) || (pad2 < (f32) gCourseMinY)) {
+ destroy_destructable_actor((struct Actor *) shell);
+ }
+
+ shell->rotVelocity += 0x71C;
+ switch (shell->state) {
+ case HELD_SHELL:
+ player = &gPlayers[shell->playerId];
+ copy_collision(&player->unk_110, &shell->unk30);
+ somePosVel[0] = 0.0f;
+ somePosVel[1] = player->boundingBoxSize;
+ somePosVel[2] = -(player->boundingBoxSize + shell->boundingBoxSize + 2.0f);
+ mtxf_translate_vec3f_mat3(somePosVel, player->orientationMatrix);
+ shell->pos[0] = player->pos[0] + somePosVel[0];
+ pad7 = player->pos[1] - somePosVel[1];
+ shell->pos[2] = player->pos[2] + somePosVel[2];
+ temp_f0 = func_802ABE30(shell->pos[0], pad7, shell->pos[2], player->unk_110.unk3A);
+ temp_f2 = pad7 - temp_f0;
+
+ if ((temp_f2 < 5.0f) && (temp_f2 > -5.0f)) {
+ shell->pos[1] = shell->boundingBoxSize + temp_f0;
+ } else {
+ shell->pos[1] = pad7;
+ }
+
+ if ((player->type & PLAYER_HUMAN) != 0) {
+ if (gDemoMode) {
+ controller = gControllerOne;
+ } else {
+ controller = &gControllers[shell->playerId];
+ }
+ } else {
+ controller = gControllerOne;
+ }
+
+ if ((controller->buttonDepressed & Z_TRIG) != 0) {
+ controller->buttonDepressed &= ~Z_TRIG;
+ shell->state = RELEASED_SHELL;
+ if (player->unk_0C0 > 0) {
+ shell->rotAngle = 0x78E3;
+ } else {
+ shell->rotAngle = -0x78E4;
+ }
+ }
+ break;
+ case RELEASED_SHELL:
+ player = &gPlayers[shell->playerId];
+ if (shell->rotAngle > 0) {
+ shell->rotAngle -= 0x71C;
+ if (shell->rotAngle < 0) {
+ shell->state = MOVING_SHELL;
+ func_800C9060(shell->playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x04));
+ func_800C90F4(shell->playerId, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x00));
+ if (pad13 == ACTOR_RED_SHELL) {
+ add_red_shell_in_unexpired_actor_list((struct Actor*)shell - gActorList);
+ } else {
+ add_blue_shell_in_unexpired_actor_list((struct Actor*)shell - gActorList);
+ func_800C9D80(shell->pos, shell->velocity, SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x08));
+ }
+ }
+ } else {
+ shell->rotAngle += 0x71C;
+ if (shell->rotAngle > 0) {
+ shell->state = MOVING_SHELL;
+ func_800C9060(shell->playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x04));
+ func_800C90F4(shell->playerId, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x00));
+ if (pad13 == ACTOR_RED_SHELL) {
+ add_red_shell_in_unexpired_actor_list((struct Actor*)shell - gActorList);
+ } else {
+ add_blue_shell_in_unexpired_actor_list((struct Actor*)shell - gActorList);
+ func_800C9D80(shell->pos, shell->velocity, SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x08));
+ }
+ }
+ }
+ if (shell->state == MOVING_SHELL) {
+ shell->someTimer = 0x001E;
+ temp_f0 = 8.0f;
+ if (player->unk_094 > 8.0f) {
+ temp_f0 = player->unk_094 * 1.2f;
+ }
+ somePosVel[0] = 0.0f;
+ somePosVel[1] = 0.0f;
+ somePosVel[2] = temp_f0;
+ func_802B64C4(somePosVel, (s16) (player->rotation[1] + player->unk_0C0));
+ shell->velocity[0] = somePosVel[0];
+ shell->velocity[1] = somePosVel[1];
+ shell->velocity[2] = somePosVel[2];
+ } else {
+ somePosVel[0] = sins(shell->rotAngle) * 8.0f;
+ somePosVel[1] = shell->boundingBoxSize - player->boundingBoxSize;
+ somePosVel[2] = coss(shell->rotAngle) * 8.0f;
+ mtxf_translate_vec3f_mat3(somePosVel, player->orientationMatrix);
+ shell->pos[0] = player->pos[0] + somePosVel[0];
+ shell->pos[1] = player->pos[1] + somePosVel[1];
+ shell->pos[2] = player->pos[2] + somePosVel[2];
+ }
+ break;
+ case MOVING_SHELL:
+ player = &gPlayers[shell->playerId];
+ shell->someTimer -= 1;
+ if (shell->someTimer == 0) {
+ shell->flags &= 0xEFFF;
+ if (shell->type == ACTOR_BLUE_SPINY_SHELL) {
+ shell->targetPlayer = gPlayerPositionLUT[0];
+ shell->state = BLUE_SHELL_LOCK_ON;
+ shell->shellId = 1000.0f;
+ temp_v0 = gNearestWaypointByPlayerId[player - gPlayerOne] + 8;
+ if ((s32) D_80164430 < temp_v0) {
+ temp_v0 -= D_80164430;
+ }
+ shell->pathIndex = temp_v0;
+ } else if (gModeSelection == BATTLE) {
+ shell->shellId = 1000.0f;
+ shell->targetPlayer = func_802B3FD0(player, shell);
+ if (shell->targetPlayer < 0) {
+ shell->flags = 0x8000;
+ shell->velocity[1] = 3.0f;
+ shell->pathIndex = 0;
+ shell->someTimer = 0x003C;
+ shell->state = DESTROYED_SHELL;
+ } else {
+ shell->state = RED_SHELL_LOCK_ON;
+ }
+ } else {
+ if (player->currentRank == 0) {
+ shell->state = TRIPLE_GREEN_SHELL;
+ shell->someTimer = 0x0258;
+ temp_v0 = gNearestWaypointByPlayerId[player - gPlayerOne] + 8;
+ if ((s32) D_80164430 < temp_v0) {
+ temp_v0 -= D_80164430;
+ }
+ shell->pathIndex = temp_v0;
+ } else if (player->currentRank >= 5) {
+ shell->state = GREEN_SHELL_HIT_A_RACER;
+ shell->shellId = 1000.0f;
+ temp_v0 = gNearestWaypointByPlayerId[player - gPlayerOne] + 8;
+ if ((s32) D_80164430 < temp_v0) {
+ temp_v0 -= D_80164430;
+ }
+ shell->pathIndex = temp_v0;
+ shell->targetPlayer = gPlayerPositionLUT[player->currentRank - 1];
+ } else {
+ shell->state = RED_SHELL_LOCK_ON;
+ shell->shellId = 1000.0f;
+ shell->targetPlayer = gPlayerPositionLUT[player->currentRank - 1];
+ }
+ }
+ }
+ shell->velocity[1] -= 0.5;
+ if (shell->velocity[1] < -2.0f) {
+ shell->velocity[1] = -2.0f;
+ }
+ origPos[0] = shell->pos[0];
+ origPos[1] = shell->pos[1];
+ origPos[2] = shell->pos[2];
+ shell->pos[0] += shell->velocity[0];
+ shell->pos[1] += shell->velocity[1];
+ shell->pos[2] += shell->velocity[2];
+ func_802AD950(&shell->unk30, 4.0f, shell->pos[0], shell->pos[1], shell->pos[2], origPos[0], origPos[1], origPos[2]);
+ func_802B4E30((struct Actor *) shell);
+ func_802B4104(shell);
+ break;
+ case RED_SHELL_LOCK_ON:
+ func_802B3E7C(shell, &gPlayers[shell->targetPlayer]);
+ break;
+ case TRIPLE_GREEN_SHELL:
+ func_802B3B44(shell);
+ if (shell->someTimer == 0) {
+ if ((shell->flags & 0xF) == 0) {
+ destroy_destructable_actor((struct Actor *) shell);
+ } else {
+ shell->someTimer -= 1;
+ }
+ }
+ break;
+ case GREEN_SHELL_HIT_A_RACER:
+ func_802B3B44(shell);
+ player = &gPlayers[shell->targetPlayer];
+ temp_f0 = player->pos[0];
+ temp_f0 -= shell->pos[0];
+ temp_f2 = player->pos[2];
+ temp_f2 -= shell->pos[2];
+ if (((temp_f0 * temp_f0) + (temp_f2 * temp_f2)) < 40000.0f) {
+ shell->state = RED_SHELL_LOCK_ON;
+ }
+ break;
+ case TRIPLE_RED_SHELL:
+ player = &gPlayers[shell->playerId];
+ parent = (TripleShellParent *) &gActorList[shell->parentIndex];
+ if (parent->type != ACTOR_TRIPLE_RED_SHELL) {
+ destroy_destructable_actor((struct Actor *) shell);
+ } else {
+ shell->rotAngle += parent->rotVelocity;
+ somePosVel[0] = sins(shell->rotAngle) * 8.0f;
+ somePosVel[1] = shell->boundingBoxSize - player->boundingBoxSize;
+ somePosVel[2] = coss(shell->rotAngle) * 8.0f;
+ mtxf_translate_vec3f_mat3(somePosVel, player->orientationMatrix);
+ origPos[0] = shell->pos[0];
+ origPos[1] = shell->pos[1];
+ origPos[2] = shell->pos[2];
+ shell->pos[0] = player->pos[0] + somePosVel[0];
+ shell->pos[1] = player->pos[1] + somePosVel[1];
+ shell->pos[2] = player->pos[2] + somePosVel[2];
+ func_802AD950(&shell->unk30, 4.0f, shell->pos[0], shell->pos[1], shell->pos[2], origPos[0], origPos[1], origPos[2]);
+ func_802B4E30((struct Actor *) shell);
+ }
+ break;
+ case DESTROYED_SHELL:
+ shell->velocity[1] -= 0.3f;
+ if (shell->velocity[1] < -5.0f) {
+ shell->velocity[1] = -5.0f;
+ }
+ shell->rotAngle += 0x5B0;
+ shell->someTimer -= 1;
+ shell->pos[1] += shell->velocity[1];
+ if (shell->someTimer == 0) {
+ destroy_actor((struct Actor *) shell);
+ }
+ break;
+ case BLUE_SHELL_LOCK_ON:
+ func_802B3B44(shell);
+ shell->targetPlayer = gPlayerPositionLUT[0];
+ player = &gPlayers[gPlayerPositionLUT[0]];
+ temp_f0 = player->pos[0];
+ temp_f0 -= shell->pos[0];
+ temp_f2 = player->pos[2];
+ temp_f2 -= shell->pos[2];
+ if (((temp_f0 * temp_f0) + (temp_f2 * temp_f2)) < 40000.0f) {
+ shell->state = BLUE_SHELL_TARGET_ELIMINATED;
+ }
+ break;
+ case 9:
+ func_802B3E7C(shell, &gPlayers[shell->targetPlayer]);
+ break;
+ default:
+ break;
+ }
+} \ No newline at end of file
diff --git a/src/actors/box_truck/render.inc.c b/src/actors/box_truck/render.inc.c
new file mode 100644
index 000000000..794dd305e
--- /dev/null
+++ b/src/actors/box_truck/render.inc.c
@@ -0,0 +1,54 @@
+#include <actors.h>
+#include <PR/gbi.h>
+#include <main.h>
+#include <defines.h>
+#include "courses/toads_turnpike/course_data.h"
+
+/**
+ * @brief Renders the box truck actor.
+ * Actor used in Toad's Turnpike.
+ * His update are made in vehicle.
+ *
+ * @param arg0
+ * @param arg1
+ */
+void render_actor_box_truck(Camera *arg0, struct Actor *arg1) {
+ UNUSED s32 pad[6];
+ Mat4 spD8;
+ UNUSED s32 pad2[32];
+ f32 temp_f0 = is_within_render_distance(arg0->pos, arg1->pos, arg0->rot[1], 2500.0f, gCameraZoom[arg0 - camera1], 9000000.0f);
+ if (temp_f0 < 0.0f) { return; }
+
+ gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
+ gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
+
+ mtxf_pos_rotation_xyz(spD8, arg1->pos, arg1->rot);
+ if (render_set_position(spD8, 0) != 0) {
+
+ switch(arg1->state) {
+ case 0:
+ gSPDisplayList(gDisplayListHead++, &d_course_toads_turnpike_dl_23858);
+ break;
+ case 1:
+ gSPDisplayList(gDisplayListHead++, &d_course_toads_turnpike_dl_238A0);
+ break;
+ case 2:
+ gSPDisplayList(gDisplayListHead++, &d_course_toads_turnpike_dl_238E8);
+ break;
+ }
+
+ if (gActiveScreenMode == SCREEN_MODE_1P) {
+ if (temp_f0 < 160000.0f) {
+ gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_0);
+ } else if (temp_f0 < 640000.0f) {
+ gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_1);
+ } else {
+ gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_2);
+ }
+ } else if (temp_f0 < 160000.0f) {
+ gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_1);
+ } else {
+ gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_2);
+ }
+ }
+}
diff --git a/src/actors/car/render.inc.c b/src/actors/car/render.inc.c
new file mode 100644
index 000000000..b8295ef9d
--- /dev/null
+++ b/src/actors/car/render.inc.c
@@ -0,0 +1,44 @@
+#include <actors.h>
+#include <main.h>
+#include <defines.h>
+
+/**
+ * @brief Renders the car actor.
+ * Actor used in Toad's Turnpike.
+ * His update are made in vehicle.
+ *
+ * @param arg0
+ * @param arg1
+ */
+void render_actor_car(Camera *arg0, struct Actor *arg1) {
+ UNUSED s32 pad[6];
+ Mat4 spC8;
+ UNUSED s32 pad2[32];
+ f32 temp_f0 = is_within_render_distance(arg0->pos,arg1->pos, arg0->rot[1], 2500.0f, gCameraZoom[arg0 - camera1], 9000000.0f);
+
+ if (!(temp_f0 < 0.0f)) {
+
+ gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
+ gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
+
+
+ mtxf_pos_rotation_xyz(spC8, arg1->pos, arg1->rot);
+ mtxf_scale(spC8, 0.1f);
+ if (render_set_position(spC8, 0) != 0) {
+
+ if (gActiveScreenMode == SCREEN_MODE_1P) {
+ if (temp_f0 < 160000.0f) {
+ gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_9);
+ } else if (temp_f0 < 640000.0f) {
+ gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_10);
+ } else {
+ gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_11);
+ }
+ } else if (temp_f0 < 160000.0f) {
+ gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_10);
+ } else {
+ gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_11);
+ }
+ }
+ }
+}
diff --git a/src/actors/cow/render.inc.c b/src/actors/cow/render.inc.c
new file mode 100644
index 000000000..3800fbbbc
--- /dev/null
+++ b/src/actors/cow/render.inc.c
@@ -0,0 +1,41 @@
+#include <camera.h>
+#include <actors.h>
+#include <main.h>
+#include <PR/gbi.h>
+#include "courses/moo_moo_farm/course_data.h"
+
+/**
+ * @brief Renders the cow actor.
+ * Actor used in Moo Moo Farm.
+ *
+ * @param camera
+ * @param arg1
+ * @param arg2
+ */
+void render_actor_cow(Camera *camera, Mat4 arg1, struct Actor *arg2) {
+ if (is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f) < 0) { return; }
+
+ arg1[3][0] = arg2->pos[0];
+ arg1[3][1] = arg2->pos[1];
+ arg1[3][2] = arg2->pos[2];
+
+ if (render_set_position(arg1, 0) != 0) {
+ switch (arg2->state) {
+ case 0:
+ gSPDisplayList(gDisplayListHead++, d_course_moo_moo_farm_dl_cow1);
+ break;
+ case 1:
+ gSPDisplayList(gDisplayListHead++, d_course_moo_moo_farm_dl_cow2);
+ break;
+ case 2:
+ gSPDisplayList(gDisplayListHead++, d_course_moo_moo_farm_dl_cow3);
+ break;
+ case 3:
+ gSPDisplayList(gDisplayListHead++, d_course_moo_moo_farm_dl_cow4);
+ break;
+ case 4:
+ gSPDisplayList(gDisplayListHead++, d_course_moo_moo_farm_dl_cow5);
+ break;
+ }
+ }
+}
diff --git a/src/actors/fake_item_box/render.inc.c b/src/actors/fake_item_box/render.inc.c
new file mode 100644
index 000000000..184521575
--- /dev/null
+++ b/src/actors/fake_item_box/render.inc.c
@@ -0,0 +1,148 @@
+#include <actors.h>
+#include <code_800029B0.h>
+#include <PR/gbi.h>
+#include <main.h>
+
+/**
+ * @brief Renders the fake item box actor.
+ *
+ * @param camera
+ * @param fakeItemBox
+ */
+void render_actor_fake_item_box(Camera *camera, struct FakeItemBox *fakeItemBox) {
+ Vec3s someRot;
+ UNUSED s32 pad[3];
+ Vec3f someVec;
+ Mat4 someMatrix2;
+ Mat4 someMatrix3;
+ UNUSED s32 pad2[12];
+ f32 temp_f0_2;
+ f32 temp_f0_3;
+ f32 temp_f12;
+ f32 temp_f2;
+ f32 thing;
+ f32 temp_f2_2;
+ f32 someMultiplier;
+
+ if (is_within_render_distance(camera->pos, fakeItemBox->pos, camera->rot[1], 2500.0f, gCameraZoom[camera - camera1], 1000000.0f) < 0) {
+ actor_not_rendered(camera, (struct Actor *) fakeItemBox);
+ return;
+ }
+ if (((f32) gCourseMaxY + 800.0f) < fakeItemBox->pos[1]) {
+ actor_not_rendered(camera, (struct Actor *) fakeItemBox);
+ return;
+ }
+ if (fakeItemBox->pos[1] < ((f32) gCourseMinY - 800.0f)) {
+ actor_not_rendered(camera, (struct Actor *) fakeItemBox);
+ return;
+ }
+
+ actor_rendered(camera, (struct Actor *) fakeItemBox);
+ someRot[0] = 0;
+ someRot[1] = fakeItemBox->rot[1];
+ someRot[2] = 0;
+ mtxf_pos_rotation_xyz(someMatrix2, fakeItemBox->pos, someRot);
+ mtxf_scale(someMatrix2, fakeItemBox->sizeScaling);
+ if (fakeItemBox->state != 2) {
+
+ if (!render_set_position(someMatrix2, 0)) { return; }
+
+ gSPDisplayList(gDisplayListHead++, common_model_fake_itembox);
+ mtxf_pos_rotation_xyz(someMatrix2, fakeItemBox->pos, fakeItemBox->rot);
+ mtxf_scale(someMatrix2, fakeItemBox->sizeScaling);
+
+ if (!render_set_position(someMatrix2, 0)) { return; }
+
+ gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
+ gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
+ if ((fakeItemBox->rot[1] < 0xAA1) && (fakeItemBox->rot[1] > 0)) {
+ gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
+ } else if ((fakeItemBox->rot[1] >= 0x6AA5) && (fakeItemBox->rot[1] < 0x754E)) {
+ gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
+ } else if ((fakeItemBox->rot[1] >= 0x38E1) && (fakeItemBox->rot[1] < 0x438A)) {
+ gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
+ } else if ((fakeItemBox->rot[1] >= 0xC711) && (fakeItemBox->rot[1] < 0xD1BA)) {
+ gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
+ } else {
+ gDPSetBlendMask(gDisplayListHead++, 0xFF);
+ gDPSetRenderMode(gDisplayListHead++, G_RM_ZB_CLD_SURF, G_RM_ZB_CLD_SURF2);
+ }
+ gSPDisplayList(gDisplayListHead++, D_0D003090);
+ } else {
+ gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
+ gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
+ gDPSetBlendMask(gDisplayListHead++, 0xFF);
+ thing = fakeItemBox->someTimer;
+ mtxf_pos_rotation_xyz(someMatrix2, fakeItemBox->pos, fakeItemBox->rot);
+ if (thing < 10.0f) {
+ someMultiplier = 1.0f;
+ } else {
+ someMultiplier = 1.0f - ((thing - 10.0f) * 0.1f);
+ }
+ mtxf_scale(someMatrix2, someMultiplier);
+ if (fakeItemBox->someTimer & 1) {
+ gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
+ } else {
+ gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_XLU_INTER, G_RM_NOOP2);
+ }
+ temp_f2 = 2.0f * thing;
+ someVec[0] = 0.0f;
+ someVec[1] = temp_f2;
+ someVec[2] = thing;
+ add_translate_mat4_vec3f(someMatrix2, someMatrix3, someVec);
+
+ if (!render_set_position(someMatrix3, 0)) { return; }
+
+ gSPDisplayList(gDisplayListHead++, D_0D003158);
+ temp_f2_2 = 0.8f * thing;
+ temp_f12 = 0.5f * thing;
+ someVec[0] = temp_f2_2;
+ someVec[1] = 2.3f * thing;
+ someVec[2] = temp_f12;
+ add_translate_mat4_vec3f(someMatrix2, someMatrix3, someVec);
+
+ if (!render_set_position(someMatrix3, 0)) { return; }
+
+ gSPDisplayList(gDisplayListHead++, D_0D0031B8);
+ temp_f0_2 = -0.5f * thing;
+ someVec[0] = temp_f2_2;
+ someVec[1] = 1.2f * thing;
+ someVec[2] = temp_f0_2;
+ add_translate_mat4_vec3f(someMatrix2, someMatrix3, someVec);
+
+ if (!render_set_position(someMatrix3, 0)) { return; }
+
+ gSPDisplayList(gDisplayListHead++, D_0D003128);
+ if (!(fakeItemBox->someTimer & 1)) {
+ gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
+ } else {
+ gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_XLU_INTER, G_RM_NOOP2);
+ }
+ someVec[0] = 0.0f;
+ someVec[1] = 1.8f * thing;
+ someVec[2] = -1.0f * thing;
+ add_translate_mat4_vec3f(someMatrix2, someMatrix3, someVec);
+
+ if (!render_set_position(someMatrix3, 0)) { return; }
+
+ gSPDisplayList(gDisplayListHead++, D_0D0031E8);
+ temp_f0_3 = -0.8f * thing;
+ someVec[0] = temp_f0_3;
+ someVec[1] = 0.6f * thing;
+ someVec[2] = temp_f0_2;
+ add_translate_mat4_vec3f(someMatrix2, someMatrix3, someVec);
+
+ if (!render_set_position(someMatrix3, 0)) { return; }
+
+ gSPDisplayList(gDisplayListHead++, D_0D003188);
+ someVec[0] = temp_f0_3;
+ someVec[1] = temp_f2;
+ someVec[2] = temp_f12;
+ add_translate_mat4_vec3f(someMatrix2, someMatrix3, someVec);
+
+ if (!render_set_position(someMatrix3, 0)) { return; }
+
+ gSPDisplayList(gDisplayListHead++, D_0D0030F8);
+ gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
+ }
+} \ No newline at end of file
diff --git a/src/actors/fake_item_box/update.inc.c b/src/actors/fake_item_box/update.inc.c
new file mode 100644
index 000000000..df6d1b5ea
--- /dev/null
+++ b/src/actors/fake_item_box/update.inc.c
@@ -0,0 +1,92 @@
+#include <actors.h>
+#include <main.h>
+
+/**
+ * @brief Updates the fake item box actor.
+ *
+ * @param fake_item_box
+ */
+void update_actor_fake_item_box(struct FakeItemBox *fake_item_box) {
+ u32 temp_v1 = fake_item_box->playerId;
+ Player *temp_v0_4 = &gPlayers[temp_v1];
+ struct Controller *temp_v1_3;
+
+ UNUSED s32 pad[7];
+ f32 temp_f2_2;
+ f32 temp_f14;
+ f32 temp_f16;
+ f32 temp_f18;
+ UNUSED s32 pad2[3];
+
+ switch(fake_item_box->state) {
+ case 0:
+ fake_item_box->boundingBoxSize = fake_item_box->sizeScaling * 5.5f;
+ fake_item_box->rot[0] -= 0xB6;
+ fake_item_box->rot[1] += 0x16C;
+ fake_item_box->rot[2] -= 0xB6;
+
+ temp_f14 = temp_v0_4->pos[0] - fake_item_box->pos[0];
+ temp_f16 = temp_v0_4->pos[1] - fake_item_box->pos[1];
+ temp_f18 = temp_v0_4->pos[2] - fake_item_box->pos[2];
+
+ temp_f2_2 = sqrtf((temp_f14 * temp_f14) + (temp_f16 * temp_f16) + (temp_f18 * temp_f18)) / 10.0f;
+ temp_f14 /= temp_f2_2;
+ temp_f16 /= temp_f2_2;
+ temp_f18 /= temp_f2_2;
+ fake_item_box->pos[0] = temp_v0_4->pos[0] - temp_f14;
+ fake_item_box->pos[1] = (temp_v0_4->pos[1] - temp_f16) - 1.0f;
+ fake_item_box->pos[2] = temp_v0_4->pos[2] - temp_f18;
+ func_802ADDC8(&fake_item_box->unk30, fake_item_box->boundingBoxSize, fake_item_box->pos[0], fake_item_box->pos[1], fake_item_box->pos[2]);
+ func_802B4E30((struct Actor *)fake_item_box);
+ temp_v1_3 = &gControllers[temp_v1];
+ if ((temp_v0_4->type & 0x4000) != 0) {
+
+ if ((temp_v1_3->buttonDepressed & Z_TRIG) != 0) {
+ temp_v1_3->buttonDepressed &= 0xDFFF;
+ func_802A1064(fake_item_box);
+ temp_v0_4->soundEffects &= 0xFFFBFFFF;
+ func_800C9060((u8)(temp_v0_4 - gPlayerOne), SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x12));
+ }
+ }
+ break;
+ case 1:
+ if (fake_item_box->sizeScaling < 1.0f) {
+ fake_item_box->sizeScaling += 0.05f;
+ } else if (fake_item_box->sizeScaling >= 1.0f) {
+ fake_item_box->sizeScaling = 1.0f;
+ }
+
+ fake_item_box->boundingBoxSize = fake_item_box->sizeScaling * 5.5f;
+ if (fake_item_box->targetY <= fake_item_box->pos[1]) {
+ fake_item_box->pos[1] = fake_item_box->targetY;
+ } else {
+ fake_item_box->pos[1] += 0.2f;
+ }
+ if ((fake_item_box->flags & 0x1000) != 0) {
+ if ((fake_item_box->someTimer <= 0) || (fake_item_box->someTimer >= 0x12D)) {
+ fake_item_box->flags &= 0xEFFF;
+ fake_item_box->someTimer = 0;
+ } else {
+ fake_item_box->someTimer--;
+ }
+ }
+ fake_item_box->rot[0] -= 0xB6;
+ fake_item_box->rot[1] += 0x16C;
+ fake_item_box->rot[2] -= 0xB6;
+ break;
+
+ case 2:
+ if ((fake_item_box->someTimer >= 0x14) || (fake_item_box->someTimer < 0)) {
+ destroy_actor((struct Actor *) fake_item_box);
+ } else {
+ fake_item_box->someTimer++;
+ fake_item_box->rot[0] += 0x444;
+ fake_item_box->rot[1] -= 0x2D8;
+ fake_item_box->rot[2] += 0x16C;
+ }
+ break;
+ default:
+ destroy_actor((struct Actor *) fake_item_box);
+ break;
+ }
+} \ No newline at end of file
diff --git a/src/actors/falling_rock/render.inc.c b/src/actors/falling_rock/render.inc.c
new file mode 100644
index 000000000..70854943b
--- /dev/null
+++ b/src/actors/falling_rock/render.inc.c
@@ -0,0 +1,47 @@
+#include <actors.h>
+#include <main.h>
+#include "courses/choco_mountain/course_data.h"
+
+/**
+ * @brief Renders the falling rock actor.
+ * Actor used in Choco Mountain.
+ *
+ * @param camera
+ * @param rock
+ */
+void render_actor_falling_rock(Camera *camera, struct FallingRock *rock) {
+ Vec3s sp98;
+ Vec3f sp8C;
+ Mat4 sp4C;
+ f32 temp_f0;
+ UNUSED s32 pad[4];
+
+ if (rock->respawnTimer != 0) { return; }
+
+ temp_f0 = is_within_render_distance(camera->pos, rock->pos, camera->rot[1], 400.0f, gCameraZoom[camera - camera1], 4000000.0f);
+
+ if (temp_f0 < 0.0f) { return; }
+
+ if (temp_f0 < 250000.0f) {
+
+ if (rock->unk30.unk34 == 1) {
+ sp8C[0] = rock->pos[0];
+ sp8C[2] = rock->pos[2];
+ temp_f0 = func_802ABE30(sp8C[0], rock->pos[1], sp8C[2], rock->unk30.unk3A);
+ sp98[0] = 0;
+ sp98[1] = 0;
+ sp98[2] = 0;
+ sp8C[1] = temp_f0 + 2.0f;
+ mtxf_pos_rotation_xyz(sp4C, sp8C, sp98);
+ if (render_set_position(sp4C, 0) == 0) {
+ return;
+ }
+ gSPDisplayList(gDisplayListHead++, d_course_choco_mountain_dl_6F88);
+ }
+ }
+ mtxf_pos_rotation_xyz(sp4C, rock->pos, rock->rot);
+ if (render_set_position(sp4C, 0) == 0) {
+ return;
+ }
+ gSPDisplayList(gDisplayListHead++, d_course_choco_mountain_dl_falling_rock);
+}
diff --git a/src/actors/falling_rocks.inc.c b/src/actors/falling_rock/update.inc.c
index 0d5985128..b10a9b26f 100644
--- a/src/actors/falling_rocks.inc.c
+++ b/src/actors/falling_rock/update.inc.c
@@ -1,3 +1,8 @@
+#include <actors.h>
+#include <code_800029B0.h>
+#include <main.h>
+#include "courses/choco_mountain/course_data.h"
+
void func_8029CF0C(struct ActorSpawnData *spawnData, struct FallingRock *rock) {
s32 segment = SEGMENT_NUMBER2(spawnData);
s32 offset = SEGMENT_OFFSET(spawnData);
@@ -12,7 +17,13 @@ void func_8029CF0C(struct ActorSpawnData *spawnData, struct FallingRock *rock) {
vec3s_set(rock->rot, 0, 0, 0);
}
-void place_falling_rocks(struct ActorSpawnData *spawnData) {
+/**
+ * @brief Spawns falling rocks.
+ * Used in Choco Mountain.
+ *
+ * @param spawnData
+ */
+void spawn_falling_rocks(struct ActorSpawnData *spawnData) {
s32 addr = SEGMENT_NUMBER2(spawnData);
s32 offset = SEGMENT_OFFSET(spawnData);
// Casting this to prevent warning does not work.
@@ -29,7 +40,7 @@ void place_falling_rocks(struct ActorSpawnData *spawnData) {
startingPos[2] = temp_s0->pos[2];
vec3f_set(startingVelocity, 0, 0, 0);
vec3s_set(startingRot, 0, 0, 0);
- temp = addActorToEmptySlot(startingPos, startingRot, startingVelocity, ACTOR_FALLING_ROCK);
+ temp = add_actor_to_empty_slot(startingPos, startingRot, startingVelocity, ACTOR_FALLING_ROCK);
temp_v1 = (struct FallingRock *) &gActorList[temp];
temp_v1->unk_06 = temp_s0->someId;
@@ -38,6 +49,12 @@ void place_falling_rocks(struct ActorSpawnData *spawnData) {
}
}
+/**
+ * @brief Updates the falling rock actor.
+ * Actor used in Choco Mountain.
+ *
+ * @param rock
+ */
void update_actor_falling_rocks(struct FallingRock *rock) {
Vec3f unkVec;
f32 pad0;
diff --git a/src/actors/green_shell/render.inc.c b/src/actors/green_shell/render.inc.c
new file mode 100644
index 000000000..24cf373cf
--- /dev/null
+++ b/src/actors/green_shell/render.inc.c
@@ -0,0 +1,16 @@
+#include <actors.h>
+#include <PR/gbi.h>
+#include <main.h>
+#include "common_textures.h"
+
+/**
+ * @brief Renders the green shell actor.
+ *
+ * @param camera
+ * @param matrix
+ * @param shell
+ */
+void render_actor_green_shell(Camera *camera, Mat4 matrix, struct ShellActor *shell) {
+ gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_green_shell); // set texture
+ render_actor_shell(camera, matrix, shell);
+}
diff --git a/src/actors/green_shell/update.inc.c b/src/actors/green_shell/update.inc.c
new file mode 100644
index 000000000..9fc34ab6f
--- /dev/null
+++ b/src/actors/green_shell/update.inc.c
@@ -0,0 +1,193 @@
+#include <actors.h>
+#include <main.h>
+#include <types.h>
+#include <code_800029B0.h>
+#include <defines.h>
+
+/**
+ * @brief Updates the green shell actor.
+ *
+ * @param shell
+ */
+void update_actor_green_shell(struct ShellActor *shell) {
+ Player *player;
+ UNUSED f32 pad9;
+ UNUSED f32 padA;
+ Vec3f somePos2;
+ Vec3f somePosVel;
+ f32 var_f2;
+ struct Controller *controller;
+ TripleShellParent *parent;
+ UNUSED f32 pad0;
+ UNUSED f32 pad1;
+ UNUSED f32 pad2;
+ UNUSED f32 pad3;
+ UNUSED f32 pad4;
+ UNUSED f32 pad5;
+ UNUSED f32 pad6;
+ UNUSED f32 pad7;
+ UNUSED f32 pad8;
+
+ pad0 = shell->pos[0];
+ pad6 = shell->pos[1];
+ pad1 = shell->pos[2];
+ if ((pad1 < gCourseMinZ) || (gCourseMaxZ < pad1) || (pad0 < gCourseMinX) || (gCourseMaxX < pad0) || (pad6 < gCourseMinY)) {
+ destroy_destructable_actor((struct Actor *) shell);
+ }
+ shell->rotVelocity += 0x71C;
+ switch (shell->state) {
+ case HELD_SHELL:
+ player = &gPlayers[shell->playerId];
+ copy_collision(&player->unk_110, &shell->unk30);
+ somePosVel[0] = 0.0f;
+ somePosVel[1] = player->boundingBoxSize;
+ somePosVel[2] = -(player->boundingBoxSize + shell->boundingBoxSize + 2.0f);
+ mtxf_translate_vec3f_mat3(somePosVel, player->orientationMatrix);
+ shell->pos[0] = player->pos[0] + somePosVel[0];
+ pad2 = player->pos[1] - somePosVel[1];
+ shell->pos[2] = player->pos[2] + somePosVel[2];
+ pad0 = func_802ABE30(shell->pos[0], pad2, shell->pos[2], player->unk_110.unk3A);
+ pad1 = pad2 - pad0;
+ if ((pad1 < 5.0f) && (pad1 > -5.0f)) {
+ shell->pos[1] = shell->boundingBoxSize + pad0;
+ } else {
+ shell->pos[1] = pad2;
+ }
+ if ((player->type & PLAYER_HUMAN) != 0) {
+ controller = &gControllers[shell->playerId];
+ if ((controller->buttonDepressed & Z_TRIG) != 0) {
+ controller->buttonDepressed &= ~Z_TRIG;
+ if (controller->rawStickY < -0x2D) {
+ var_f2 = 8.0f;
+ if (player->unk_094 > 8.0f) {
+ var_f2 = player->unk_094 * 1.2f;
+ }
+ somePosVel[0] = 0.0f;
+ somePosVel[1] = 0.0f;
+ somePosVel[2] = -var_f2;
+ func_802B64C4(somePosVel, player->rotation[1] + player->unk_0C0);
+ shell->velocity[0] = somePosVel[0];
+ shell->velocity[1] = somePosVel[1];
+ shell->velocity[2] = somePosVel[2];
+ shell->state = 2;
+ func_800C9060(shell->playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x04));
+ func_800C90F4(shell->playerId, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x00));
+ add_green_shell_in_unexpired_actor_list((struct Actor*)shell - gActorList);
+ return;
+ } else {
+ shell->state = 1;
+ if (player->unk_0C0 > 0) {
+ shell->rotAngle = 0x78E3;
+ } else {
+ shell->rotAngle = -0x78E4;
+ }
+ }
+ }
+ }
+ break;
+ case RELEASED_SHELL:
+ player = &gPlayers[shell->playerId];
+ if (shell->rotAngle > 0) {
+ shell->rotAngle -= 0xE38;
+ if (shell->rotAngle < 0) {
+ shell->state = 2;
+ shell->someTimer = 0x001E;
+ func_800C9060(shell->playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x04));
+ func_800C90F4(shell->playerId, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x00));
+ add_green_shell_in_unexpired_actor_list((struct Actor*)shell - gActorList);
+ }
+ } else {
+ shell->rotAngle += 0xE38;
+ if (shell->rotAngle > 0) {
+ shell->state = 2;
+ shell->someTimer = 0x001E;
+ func_800C9060(shell->playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x04));
+ func_800C90F4(shell->playerId, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x00));
+ add_green_shell_in_unexpired_actor_list((struct Actor*)shell - gActorList);
+ }
+ }
+ if (shell->state == 2) {
+ var_f2 = 8.0f;
+ if (player->unk_094 > 8.0f) {
+ var_f2 = player->unk_094 * 1.2f;
+ }
+ somePosVel[0] = 0.0f;
+ somePosVel[1] = 0.0f;
+ somePosVel[2] = var_f2;
+ func_802B64C4(somePosVel, player->rotation[1] + player->unk_0C0);
+ shell->velocity[0] = somePosVel[0];
+ shell->velocity[1] = somePosVel[1];
+ shell->velocity[2] = somePosVel[2];
+ } else {
+ somePosVel[0] = sins(shell->rotAngle) * 6.0f;
+ somePosVel[1] = shell->boundingBoxSize - player->boundingBoxSize;
+ somePosVel[2] = coss(shell->rotAngle) * 6.0f;
+ mtxf_translate_vec3f_mat3(somePosVel, player->orientationMatrix);
+ shell->pos[0] = player->pos[0] + somePosVel[0];
+ shell->pos[1] = player->pos[1] + somePosVel[1];
+ shell->pos[2] = player->pos[2] + somePosVel[2];
+ }
+ break;
+ case MOVING_SHELL:
+ if (shell->parentIndex > 0) {
+ shell->parentIndex -= 1;
+ if (shell->parentIndex == 0) {
+ shell->flags &= ~0x1000;
+ }
+ }
+ shell->velocity[1] -= 0.5f;
+ if (shell->velocity[1] < -2.0f) {
+ shell->velocity[1] = -2.0f;
+ }
+ somePos2[0] = shell->pos[0];
+ somePos2[1] = shell->pos[1];
+ somePos2[2] = shell->pos[2];
+ shell->pos[0] += shell->velocity[0];
+ shell->pos[1] += shell->velocity[1];
+ shell->pos[2] += shell->velocity[2];
+ func_802AD950(&shell->unk30, 4.0f, shell->pos[0], shell->pos[1], shell->pos[2], somePos2[0], somePos2[1], somePos2[2]);
+ func_802B4E30((struct Actor *) shell);
+ if ((shell->unk30.unk3C[0] < 0.0f) || (shell->unk30.unk3C[1] < 0.0f)) {
+ shell_collision(&shell->unk30, shell->velocity);
+ func_800C98B8(shell->pos, shell->velocity, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x54));
+ shell->flags |= 0x80;
+ }
+ break;
+ case TRIPLE_GREEN_SHELL:
+ player = &gPlayers[shell->playerId];
+ parent = (TripleShellParent *) &gActorList[shell->parentIndex];
+ if (parent->type != ACTOR_TRIPLE_GREEN_SHELL) {
+ destroy_destructable_actor((struct Actor *) shell);
+ } else {
+ shell->rotAngle += parent->rotVelocity;
+ somePosVel[0] = sins(shell->rotAngle) * 8.0f;
+ somePosVel[1] = shell->boundingBoxSize - player->boundingBoxSize;
+ somePosVel[2] = coss(shell->rotAngle) * 8.0f;
+ mtxf_translate_vec3f_mat3(somePosVel, player->orientationMatrix);
+ somePos2[0] = shell->pos[0];
+ somePos2[1] = shell->pos[1];
+ somePos2[2] = shell->pos[2];
+ shell->pos[0] = player->pos[0] + somePosVel[0];
+ shell->pos[1] = player->pos[1] + somePosVel[1];
+ shell->pos[2] = player->pos[2] + somePosVel[2];
+ func_802AD950(&shell->unk30, 4.0f, shell->pos[0], shell->pos[1], shell->pos[2], somePos2[0], somePos2[1], somePos2[2]);
+ func_802B4E30((struct Actor *) shell);
+ }
+ break;
+ case GREEN_SHELL_HIT_A_RACER:
+ // Somehow, this fake match affects stack management up in case 2
+ shell->velocity[1] -= (0, 0.3f);
+ if (shell->velocity[1] < -5.0f) {
+ shell->velocity[1] = -5.0f;
+ }
+ shell->rotAngle += 0x5B0;
+ shell->someTimer -= 1;
+ shell->pos[1] += shell->velocity[1];
+ if (shell->someTimer == 0) {
+ destroy_actor((struct Actor *) shell);
+ }
+ break;
+ default:
+ break;
+ }
+} \ No newline at end of file
diff --git a/src/actors/item_box/render.inc.c b/src/actors/item_box/render.inc.c
new file mode 100644
index 000000000..8ccc8bf43
--- /dev/null
+++ b/src/actors/item_box/render.inc.c
@@ -0,0 +1,158 @@
+#include <actors.h>
+#include <main.h>
+#include <macros.h>
+
+/**
+ * @brief Renders the item box actor.
+ *
+ * @param camera
+ * @param item_box
+ */
+void render_actor_item_box(Camera *camera, struct ItemBox *item_box) {
+ UNUSED s32 pad[2];
+ Vec3f someVec1;
+ Vec3f someVec2;
+ Vec3s someRot;
+ f32 thing;
+ UNUSED s32 pad2;
+ Mat4 someMatrix1;
+ Mat4 someMatrix2;
+ UNUSED s32 pad3[4];
+ f32 temp_f0;
+ f32 temp_f0_2;
+ f32 temp_f0_3;
+ f32 temp_f12;
+ f32 temp_f2;
+ f32 temp_f2_2;
+ f32 someMultiplier;
+
+ temp_f0 = is_within_render_distance(camera->pos, item_box->pos, camera->rot[1], 0.0f, gCameraZoom[camera - camera1], 4000000.0f);
+ if (!(temp_f0 < 0.0f) && !(600000.0f < temp_f0)) {
+ if ((item_box->state == 2) && (temp_f0 < 100000.0f)) {
+ someRot[0] = 0;
+ someRot[1] = item_box->rot[1];
+ someRot[2] = 0;
+ someVec2[0] = item_box->pos[0];
+ someVec2[1] = item_box->resetDistance + 2.0f;
+ someVec2[2] = item_box->pos[2];
+ mtxf_pos_rotation_xyz(someMatrix1, someVec2, someRot);
+
+ if (!render_set_position(someMatrix1, 0)) { return; }
+
+ gSPDisplayList(gDisplayListHead++, D_0D002EE8);
+ someRot[1] = item_box->rot[1] * 2;
+ someVec2[1] = item_box->pos[1];
+ mtxf_pos_rotation_xyz(someMatrix1, someVec2, someRot);
+
+ if (!render_set_position(someMatrix1, 0)) { return; }
+
+ gSPDisplayList(gDisplayListHead++, itemBoxQuestionMarkModel);
+ }
+ if (item_box->state == 5) {
+ mtxf_pos_rotation_xyz(someMatrix1, item_box->pos, item_box->rot);
+
+ if (!render_set_position(someMatrix1, 0)) { return; }
+
+ gSPDisplayList(gDisplayListHead++, itemBoxQuestionMarkModel);
+ }
+ if (item_box->state != 3) {
+ mtxf_pos_rotation_xyz(someMatrix1, item_box->pos, item_box->rot);
+
+ if (!render_set_position(someMatrix1, 0)) { return; }
+
+ gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
+ gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
+ if ((item_box->rot[1] < 0xAA1) && (item_box->rot[1] > 0)) {
+ gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
+ } else if ((item_box->rot[1] >= 0x6AA5) && (item_box->rot[1] < 0x754E)) {
+ gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
+ } else if ((item_box->rot[1] >= 0x38E1) && (item_box->rot[1] < 0x438A)) {
+ gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
+ } else if ((item_box->rot[1] >= 0xC711) && (item_box->rot[1] < 0xD1BA)) {
+ gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
+ } else {
+ gDPSetBlendMask(gDisplayListHead++, 0xFF);
+ gDPSetRenderMode(gDisplayListHead++, G_RM_ZB_CLD_SURF, G_RM_ZB_CLD_SURF2);
+ }
+ gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
+ gSPDisplayList(gDisplayListHead++, D_0D003090);
+ } else {
+ gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
+ gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
+ gDPSetBlendMask(gDisplayListHead++, 0xFF);
+ thing = item_box->someTimer;
+ mtxf_pos_rotation_xyz(someMatrix1, item_box->pos, item_box->rot);
+ if (thing < 10.0f) {
+ someMultiplier = 1.0f;
+ } else {
+ someMultiplier = 1.0f - ((thing - 10.0f) * 0.1f);
+ }
+ mtxf_scale(someMatrix1, someMultiplier);
+ if (item_box->someTimer & 1) {
+ gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
+ } else {
+ gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_XLU_INTER, G_RM_NOOP2);
+ }
+ temp_f2 = 2.0f * thing;
+ someVec1[0] = 0.0f;
+ someVec1[1] = temp_f2;
+ someVec1[2] = thing;
+ add_translate_mat4_vec3f(someMatrix1, someMatrix2, someVec1);
+
+ if (!render_set_position(someMatrix2, 0)) { return; }
+
+ gSPDisplayList(gDisplayListHead++, D_0D003158);
+ temp_f2_2 = 0.8f * thing;
+ temp_f12 = 0.5f * thing;
+ someVec1[0] = temp_f2_2;
+ someVec1[1] = 2.3f * thing;
+ someVec1[2] = temp_f12;
+ add_translate_mat4_vec3f(someMatrix1, someMatrix2, someVec1);
+
+ if (!render_set_position(someMatrix2, 0)) { return; }
+
+ gSPDisplayList(gDisplayListHead++, D_0D0031B8);
+ temp_f0_2 = -0.5f * thing;
+ someVec1[0] = temp_f2_2;
+ someVec1[1] = 1.2f * thing;
+ someVec1[2] = temp_f0_2;
+ add_translate_mat4_vec3f(someMatrix1, someMatrix2, someVec1);
+
+ if (!render_set_position(someMatrix2, 0)) { return; }
+
+ gSPDisplayList(gDisplayListHead++, D_0D003128);
+ if (!(item_box->someTimer & 1)) {
+ gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
+ } else {
+ gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_XLU_INTER, G_RM_NOOP2);
+ }
+ someVec1[0] = 0.0f;
+ someVec1[1] = 1.8f * thing;
+ someVec1[2] = -1.0f * thing;
+ add_translate_mat4_vec3f(someMatrix1, someMatrix2, someVec1);
+
+ if (!render_set_position(someMatrix2, 0)) { return; }
+
+ gSPDisplayList(gDisplayListHead++, D_0D0031E8);
+ temp_f0_3 = -0.8f * thing;
+ someVec1[0] = temp_f0_3;
+ someVec1[1] = 0.6f * thing;
+ someVec1[2] = temp_f0_2;
+ add_translate_mat4_vec3f(someMatrix1, someMatrix2, someVec1);
+
+ if (!render_set_position(someMatrix2, 0)) { return; }
+
+ gSPDisplayList(gDisplayListHead++, D_0D003188);
+ someVec1[0] = temp_f0_3;
+ someVec1[1] = temp_f2;
+ someVec1[2] = temp_f12;
+ add_translate_mat4_vec3f(someMatrix1, someMatrix2, someVec1);
+
+ if (!render_set_position(someMatrix2, 0)) { return; }
+
+ gSPDisplayList(gDisplayListHead++, D_0D0030F8);
+ gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
+ }
+ gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
+ }
+} \ No newline at end of file
diff --git a/src/actors/item_box/update.inc.c b/src/actors/item_box/update.inc.c
new file mode 100644
index 000000000..02914498a
--- /dev/null
+++ b/src/actors/item_box/update.inc.c
@@ -0,0 +1,68 @@
+#include <actors.h>
+
+/**
+ * @brief Updates the item box under the hot air balloon object.
+ * It used in Luigi Raceway.
+ * (here it's just update the rotation of the item box not the position, for the position it's in object)
+ *
+ * @param itemBox
+ */
+void update_actor_item_box_hot_air_balloon(struct ItemBox *itemBox) {
+ switch(itemBox->state) {
+ case 5:
+ itemBox->rot[0] += 0xB6;
+ itemBox->rot[1] -= 0x16C;
+ itemBox->rot[2] += 0xB6;
+ break;
+ case 3:
+ if (itemBox->someTimer == 0x14) {
+ itemBox->state = 5;
+ itemBox->flags = -0x4000;
+ } else {
+ itemBox->someTimer++;
+ itemBox->rot[0] += 0x444;
+ itemBox->rot[1] -= 0x2D8;
+ itemBox->rot[2] += 0x16C;
+ }
+ break;
+ }
+}
+
+/**
+ * @brief Updates the item box actor.
+ *
+ * @param itemBox
+ */
+void update_actor_item_box(struct ItemBox *itemBox) {
+ switch (itemBox->state) {
+ case 0:
+ itemBox->state = 1;
+ break;
+ case 1:
+ if ((itemBox->pos[1] - itemBox->origY) < 8.66f) {
+ itemBox->pos[1] += 0.45f;
+ } else {
+ itemBox->pos[1] = itemBox->origY + 8.66f;
+ itemBox->state = 2;
+ itemBox->flags = 0xC000;
+ }
+ break;
+ case 2:
+ itemBox->rot[0] += 0xB6;
+ itemBox->rot[1] -= 0x16C;
+ itemBox->rot[2] += 0xB6;
+ break;
+ case 3:
+ if (itemBox->someTimer == 20) {
+ itemBox->state = 0;
+ itemBox->pos[1] = itemBox->resetDistance - 20.0f;
+ itemBox->flags = 0xC000;
+ } else {
+ itemBox->someTimer++;
+ itemBox->rot[0] += 0x444;
+ itemBox->rot[1] -= 0x2D8;
+ itemBox->rot[2] += 0x16C;
+ }
+ break;
+ }
+} \ No newline at end of file
diff --git a/src/actors/kiwano_fruit/render.inc.c b/src/actors/kiwano_fruit/render.inc.c
new file mode 100644
index 000000000..b6d4c16bd
--- /dev/null
+++ b/src/actors/kiwano_fruit/render.inc.c
@@ -0,0 +1,32 @@
+#include <actors.h>
+#include <PR/gbi.h>
+#include <main.h>
+#include "courses/dks_jungle_parkway/course_data.h"
+
+/**
+ * @brief Renders the kiwano fruit actor.
+ * Actor used in DK's Jungle Parkway.
+ *
+ * @param camera
+ * @param arg1
+ * @param actor
+ */
+void render_actor_kiwano_fruit(UNUSED Camera *camera, Mat4 arg1, struct Actor *actor) {
+ uintptr_t addr;
+ s32 maxObjectsReached;
+
+ if (actor->state == 0) { return; }
+
+ arg1[3][0] = actor->pos[0];
+ arg1[3][1] = actor->pos[1];
+ arg1[3][2] = actor->pos[2];
+
+ maxObjectsReached = render_set_position(arg1, 0) == 0;
+ if (maxObjectsReached) { return; }
+
+ addr = (actor->rot[0] << 0xA) + 0x03009000; // Can this be a real symbol? Doesn't match.
+ gDPLoadTextureBlock(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(addr),
+ G_IM_FMT_CI, G_IM_SIZ_8b, 32, 32, 0, G_TX_NOMIRROR | G_TX_CLAMP,
+ G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
+ gSPDisplayList(gDisplayListHead++, d_course_dks_jungle_parkway_dl_kiwano_fruit);
+}
diff --git a/src/actors/kiwano_fruit/update.inc.c b/src/actors/kiwano_fruit/update.inc.c
new file mode 100644
index 000000000..41c94607e
--- /dev/null
+++ b/src/actors/kiwano_fruit/update.inc.c
@@ -0,0 +1,89 @@
+#include <actors.h>
+#include <main.h>
+#include <defines.h>
+#include <waypoints.h>
+
+/**
+ * @brief Updates the kiwano fruit actor.
+ * Actor used in DK's Jungle Parkway.
+ *
+ * @param fruit
+ */
+void update_actor_kiwano_fruit(struct KiwanoFruit *fruit) {
+ Player *player;
+ f32 temp_f2;
+ f32 temp_f16;
+ f32 temp_f14;
+ f32 temp_f12;
+ s32 nearestWaypoint;
+
+ player = &gPlayers[fruit->targetPlayer];
+ if (((player->type & PLAYER_CPU) != 0) || (player->unk_110.unk34 == 0)) {
+ fruit->state = 0;
+ return;
+ }
+ switch (fruit->state) { /* irregular */
+ case 0:
+ if ((get_surface_type(player->unk_110.unk3A) & 0xFF) != GRASS) {
+ return;
+ }
+ fruit->state = 1;
+ fruit->velocity[0] = 80.0f;
+ case 1:
+ nearestWaypoint = gNearestWaypointByPlayerId[(u16)(player - gPlayerOne)];
+ temp_f2 = player->pos[0] - D_80164490[nearestWaypoint].posX;
+ temp_f16 = player->pos[1] - D_80164490[nearestWaypoint].posY;
+ temp_f14 = player->pos[2] - D_80164490[nearestWaypoint].posZ;
+ temp_f12 = fruit->velocity[0] / sqrtf((temp_f2 * temp_f2) + (temp_f16 * temp_f16) + (temp_f14 * temp_f14));
+ temp_f2 *= temp_f12;
+ temp_f16 *= temp_f12;
+ temp_f14 *= temp_f12;
+ fruit->pos[0] = player->pos[0] + temp_f2;
+ fruit->pos[1] = player->pos[1] + temp_f16;
+ fruit->pos[2] = player->pos[2] + temp_f14;
+ fruit->velocity[0] -= 2.0f;
+ if (fruit->velocity[0] <= 0.0f) {
+ fruit->state = 2;
+ fruit->bonkTimer = 30.0f;
+ fruit->velocity[0] = 0.0f;
+ fruit->velocity[1] = 2.3f;
+ fruit->velocity[2] = 0.0f;
+ if ((player->effects & STAR_EFFECT) != 0) {
+ func_800C9060(player - gPlayerOne, SOUND_ARG_LOAD(0x19, 0x00, 0xA0, 0x52));
+ } else {
+ player->effects |= 0x8000;
+ player->pos[0] -= temp_f2 * 4.0f;
+ player->pos[2] -= temp_f14 * 4.0f;
+ player->velocity[0] -= temp_f2 * 0.7f;
+ player->velocity[2] -= temp_f14 * 0.7f;
+ func_800C9060(player - gPlayerOne, SOUND_ARG_LOAD(0x19, 0x00, 0x70, 0x18));
+ if (gModeSelection != GRAND_PRIX) {
+ D_80162DF8 = 1;
+ }
+ }
+ }
+ break;
+ case 2:
+ fruit->velocity[1] -= 0.3f;
+ fruit->pos[0] += fruit->velocity[0];
+ fruit->pos[1] += fruit->velocity[1];
+ fruit->pos[2] += fruit->velocity[2];
+ fruit->bonkTimer -= 1.0f;
+ if (fruit->bonkTimer < 0.0f) {
+ fruit->state = 0;
+ }
+ break;
+ default:
+ break;
+ }
+ if (fruit->state != 0) {
+ fruit->animTimer += 1;
+ if (fruit->animTimer == 8) {
+ fruit->animTimer = 0;
+ fruit->animState += 1;
+ if (fruit->animState == 3) {
+ fruit->animState = 0;
+ }
+ }
+ }
+}
diff --git a/src/actors/mario_sign/render.inc.c b/src/actors/mario_sign/render.inc.c
new file mode 100644
index 000000000..299470946
--- /dev/null
+++ b/src/actors/mario_sign/render.inc.c
@@ -0,0 +1,29 @@
+#include <actors.h>
+#include <main.h>
+#include "courses/mario_raceway/course_data.h"
+
+/**
+ * @brief Renders the Mario sign actor.
+ * Actor used in Mario Raceway.
+ *
+ * @param arg0
+ * @param arg1
+ * @param arg2
+ */
+void render_actor_mario_sign(Camera *arg0, UNUSED Mat4 arg1, struct Actor *arg2) {
+ Mat4 sp40;
+ f32 unk;
+ s16 temp = arg2->flags;
+
+ if (temp & 0x800) { return; }
+
+ unk = is_within_render_distance(arg0->pos, arg2->pos, arg0->rot[1], 0, gCameraZoom[arg0 - camera1], 16000000.0f);
+ if (!(unk < 0.0f)) {
+ gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
+ gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
+ mtxf_pos_rotation_xyz(sp40, arg2->pos, arg2->rot);
+ if (render_set_position(sp40, 0) != 0) {
+ gSPDisplayList(gDisplayListHead++, d_course_mario_raceway_dl_sign);
+ }
+ }
+}
diff --git a/src/actors/mario_sign/update.inc.c b/src/actors/mario_sign/update.inc.c
new file mode 100644
index 000000000..82ca495f1
--- /dev/null
+++ b/src/actors/mario_sign/update.inc.c
@@ -0,0 +1,20 @@
+#include <actors.h>
+
+/**
+ * @brief Updates the Mario sign actor.
+ *
+ * @param arg0
+ */
+void update_actor_mario_sign(struct Actor *arg0) {
+ if ((arg0->flags & 0x800) == 0) {
+ if ((arg0->flags & 0x400) != 0) {
+ arg0->pos[1] += 4.0f;
+ if (arg0->pos[1] > 800.0f) {
+ arg0->flags |= 0x800;
+ arg0->rot[1] += 1820;
+ }
+ } else {
+ arg0->rot[1] += 182;
+ }
+ }
+}
diff --git a/src/actors/paddle_boat/render.inc.c b/src/actors/paddle_boat/render.inc.c
index bfb20dcb4..40c37b165 100644
--- a/src/actors/paddle_boat/render.inc.c
+++ b/src/actors/paddle_boat/render.inc.c
@@ -7,7 +7,15 @@
#include "courses/all_course_data.h"
#include <PR/gbi.h>
-// This likely attaches the paddle wheel to the boat
+/**
+ * @brief Renders the paddle boat actor.
+ * Actor used in DK's Jungle Parkway.
+ *
+ * @param arg0
+ * @param boat
+ * @param arg2
+ * @param pathCounter
+ */
void render_actor_paddle_boat(Camera *arg0, struct PaddleWheelBoat *boat, UNUSED Mat4 arg2, u16 pathCounter) {
UNUSED s32 pad[3];
Vec3f sp120;
@@ -28,6 +36,7 @@ void render_actor_paddle_boat(Camera *arg0, struct PaddleWheelBoat *boat, UNUSED
mtxf_pos_rotation_xyz(spE0, boat->pos, boat->boatRot);
if (render_set_position(spE0, 1) != 0) {
+ // Render the boat
gSPDisplayList(gDisplayListHead++, &d_course_dks_jungle_parkway_dl_E730);
gSPDisplayList(gDisplayListHead++, &d_course_dks_jungle_parkway_dl_E058);
@@ -36,10 +45,11 @@ void render_actor_paddle_boat(Camera *arg0, struct PaddleWheelBoat *boat, UNUSED
mtxf_translate(spA0, sp120);
mtxf_multiplication(sp60, spE0, spA0);
if (render_set_position(sp60, 3) != 0) {
+ // Render the paddle wheel
gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
gSPDisplayList(gDisplayListHead++, &d_course_dks_jungle_parkway_dl_FC28);
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
}
}
-} \ No newline at end of file
+}
diff --git a/src/actors/paddle_boat/update.inc.c b/src/actors/paddle_boat/update.inc.c
index ddb1f720e..386e634d0 100644
--- a/src/actors/paddle_boat/update.inc.c
+++ b/src/actors/paddle_boat/update.inc.c
@@ -2,7 +2,9 @@
#include <actor_types.h>
/**
- * @brief Rotates paddle boat's wheel.
+ * @brief Updates the paddle boat actor.
+ * Actor used in DK's Jungle Parkway.
+ * Rotate only the paddle wheel, for position and rotation of the boat it's in vehicle.
*
* @param boat
*/
diff --git a/src/actors/palm_tree/render.inc.c b/src/actors/palm_tree/render.inc.c
new file mode 100644
index 000000000..eb0895073
--- /dev/null
+++ b/src/actors/palm_tree/render.inc.c
@@ -0,0 +1,60 @@
+#include <actors.h>
+#include <main.h>
+#include "courses/koopa_troopa_beach/course_data.h"
+
+/**
+ * @brief Renders the palm tree actor.
+ * Actor used in Koopa Troopa Beach.
+ *
+ * @param arg0
+ * @param arg1
+ * @param arg2
+ */
+void render_actor_palm_tree(Camera *arg0, UNUSED Mat4 arg1, struct PalmTree *arg2) {
+ Vec3s spA8 = {0, 0, 0};
+ Mat4 sp68;
+ f32 temp_f0;
+ s16 temp_v0 = arg2->flags;
+
+ if ((temp_v0 & 0x800)) {
+ return;
+ }
+
+ temp_f0 = is_within_render_distance(arg0->pos, arg2->pos, arg0->rot[1], 0.0f, gCameraZoom[arg0 - camera1], 4000000.0f);
+
+ if (!(temp_f0 < 0.0f)) {
+ if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
+ func_8029794C(arg2->pos, arg2->rot, 2.0f);
+ }
+ mtxf_pos_rotation_xyz(sp68, arg2->pos, spA8);
+ if (render_set_position(sp68, 0) != 0) {
+
+ gDPSetTextureLUT(gDisplayListHead++, G_TT_NONE);
+ gSPSetGeometryMode(gDisplayListHead++, G_LIGHTING);
+
+ switch(arg2->variant) {
+ case 0:
+ gSPDisplayList(gDisplayListHead++, &d_course_koopa_troopa_beach_dl_tree_trunk1);
+ gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
+ gSPDisplayList(gDisplayListHead++, &d_course_koopa_troopa_beach_dl_tree_top1);
+ gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
+ break;
+
+ case 1:
+ gSPDisplayList(gDisplayListHead++, &d_course_koopa_troopa_beach_dl_tree_trunk2);
+ gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
+ gSPDisplayList(gDisplayListHead++, &d_course_koopa_troopa_beach_dl_tree_top2);
+ gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
+ break;
+
+ case 2:
+ gSPDisplayList(gDisplayListHead++, &d_course_koopa_troopa_beach_dl_tree_trunk3);
+ gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
+ gSPDisplayList(gDisplayListHead++, &d_course_koopa_troopa_beach_dl_tree_top3);
+ gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
+ break;
+
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/src/actors/piranha_plant/render.inc.c b/src/actors/piranha_plant/render.inc.c
new file mode 100644
index 000000000..525c73b01
--- /dev/null
+++ b/src/actors/piranha_plant/render.inc.c
@@ -0,0 +1,117 @@
+#include <actors.h>
+#include <main.h>
+#include <PR/gbi.h>
+#include "courses/mario_raceway/course_data.h"
+#include "courses/royal_raceway/course_data.h"
+
+/**
+ * @brief Renders the piranha plant actor.
+ * Actor used in Mario Raceway and Royal Raceway.
+ *
+ * @param arg0
+ * @param arg1
+ * @param arg2
+ */
+void render_actor_piranha_plant(Camera *arg0, Mat4 arg1, struct PiranhaPlant *arg2) {
+ UNUSED s32 pad;
+ u8 *addr;
+ s16 temp_lo = arg0 - camera1;
+ s16 animationFrame; // unconfirmed
+ s16 temp = arg2->flags;
+ f32 temp_f0;
+ s32 maxObjectsReached;
+
+ if (temp & 0x800) { return; }
+
+ temp_f0 = is_within_render_distance(arg0->pos, arg2->pos, arg0->rot[1], 0, gCameraZoom[arg0 - camera1], 1000000.0f);
+
+ if (temp_f0 < 0.0f) {
+
+ switch(temp_lo) {
+ case 0:
+ arg2->visibilityStates[0] = -1;
+ break;
+ case 1:
+ arg2->visibilityStates[1] = -1;
+ break;
+ case 2:
+ arg2->visibilityStates[2] = -1;
+ break;
+ case 3:
+ arg2->visibilityStates[3] = -1;
+ break;
+
+ }
+ return;
+ }
+ arg1[3][0] = arg2->pos[0];
+ arg1[3][1] = arg2->pos[1];
+ arg1[3][2] = arg2->pos[2];
+ maxObjectsReached = render_set_position(arg1, 0) == 0;
+ if (maxObjectsReached) { return; }
+
+ if (90000.0f < temp_f0) {
+
+ switch(temp_lo) {
+ case 0:
+ arg2->visibilityStates[0] = 0;
+ break;
+ case 1:
+ arg2->visibilityStates[1] = 0;
+ break;
+ case 2:
+ arg2->visibilityStates[2] = 0;
+ break;
+ case 3:
+ arg2->visibilityStates[3] = 0;
+ break;
+ }
+ animationFrame = 0;
+
+ } else {
+ switch(temp_lo) {
+ case 0:
+ arg2->visibilityStates[0] = 1;
+ break;
+ case 1:
+ arg2->visibilityStates[1] = 1;
+ break;
+ case 2:
+ arg2->visibilityStates[2] = 1;
+ break;
+ case 3:
+ arg2->visibilityStates[3] = 1;
+ break;
+ }
+
+ switch(temp_lo) {
+ case 0:
+ animationFrame = arg2->timers[0];
+ break;
+ case 1:
+ animationFrame = arg2->timers[1];
+ break;
+ case 2:
+ animationFrame = arg2->timers[2];
+ break;
+ case 3:
+ animationFrame = arg2->timers[3];
+ break;
+ }
+ }
+ animationFrame /= 6;
+
+ if (animationFrame > 8) {
+ animationFrame = 8;
+ }
+ addr = D_802BA058 + (animationFrame << 0xB);
+ gDPLoadTextureBlock(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(addr), G_IM_FMT_CI, G_IM_SIZ_8b, 32, 64, 0,
+ G_TX_MIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
+
+
+ if (gCurrentCourseId == COURSE_MARIO_RACEWAY) {
+ gSPDisplayList(gDisplayListHead++, &d_course_mario_raceway_dl_piranha_plant);
+ } else {
+ gSPDisplayList(gDisplayListHead++, &d_course_royal_raceway_dl_piranha_plant);
+ }
+}
diff --git a/src/actors/piranha_plant/update.inc.c b/src/actors/piranha_plant/update.inc.c
new file mode 100644
index 000000000..4c22925f8
--- /dev/null
+++ b/src/actors/piranha_plant/update.inc.c
@@ -0,0 +1,52 @@
+#include <actors.h>
+
+/**
+ * @brief Updates the piranha plant actor.
+ * Actor used in Mario Raceway and Royal Raceway.
+ *
+ * @param arg0
+ */
+void update_actor_piranha_plant(struct PiranhaPlant *arg0) {
+ if ((arg0->flags & 0x800) == 0) {
+ if ((arg0->flags & 0x400) != 0) {
+ arg0->pos[1] += 4.0f;
+ if (arg0->pos[1] > 800.0f) {
+ arg0->flags |= 0x800;
+ }
+ } else {
+ // This has to be an unrolled loop
+ if (arg0->visibilityStates[0] == 1) {
+ arg0->timers[0]++;
+ if (arg0->timers[0] > 60) {
+ arg0->timers[0] = 6;
+ }
+ } else {
+ arg0->timers[0] = 0;
+ }
+ if (arg0->visibilityStates[1] == 1) {
+ arg0->timers[1]++;
+ if (arg0->timers[1] > 60) {
+ arg0->timers[1] = 6;
+ }
+ } else {
+ arg0->timers[1] = 0;
+ }
+ if (arg0->visibilityStates[2] == 1) {
+ arg0->timers[2]++;
+ if (arg0->timers[2] > 60) {
+ arg0->timers[2] = 6;
+ }
+ } else {
+ arg0->timers[2] = 0;
+ }
+ if (arg0->visibilityStates[3] == 1) {
+ arg0->timers[3]++;
+ if (arg0->timers[3] > 60) {
+ arg0->timers[3] = 6;
+ }
+ } else {
+ arg0->timers[3] = 0;
+ }
+ }
+ }
+}
diff --git a/src/actors/railroad_crossing/render.inc.c b/src/actors/railroad_crossing/render.inc.c
new file mode 100644
index 000000000..b87d6a695
--- /dev/null
+++ b/src/actors/railroad_crossing/render.inc.c
@@ -0,0 +1,38 @@
+#include <actors.h>
+#include <PR/gbi.h>
+#include <main.h>
+#include "courses/kalimari_desert/course_data.h"
+
+/**
+ * @brief Renders the railroad crossing actor.
+ * Actor used in Kalimari Desert.
+ *
+ * @param arg0
+ * @param rr_crossing
+ */
+void render_actor_railroad_crossing(Camera *arg0, struct RailroadCrossing *rr_crossing) {
+ UNUSED Vec3s sp80 = {0, 0, 0};
+ Mat4 sp40;
+ f32 unk = is_within_render_distance(arg0->pos, rr_crossing->pos, arg0->rot[1], 0.0f, gCameraZoom[arg0 - camera1], 4000000.0f);
+
+ if (!(unk < 0.0f)) {
+ mtxf_pos_rotation_xyz(sp40, rr_crossing->pos, rr_crossing->rot);
+
+ if (render_set_position(sp40, 0) != 0) {
+ gSPSetGeometryMode(gDisplayListHead++, G_LIGHTING);
+ gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
+
+ if (isCrossingTriggeredByIndex[rr_crossing->crossingId]) {
+
+ if (rr_crossing->someTimer < 20) {
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_crossing_right_active);
+ } else {
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_crossing_left_active);
+ }
+ } else {
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_crossing_both_inactive);
+ }
+ gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
+ }
+ }
+}
diff --git a/src/actors/railroad_crossing/update.inc.c b/src/actors/railroad_crossing/update.inc.c
new file mode 100644
index 000000000..e65068c5a
--- /dev/null
+++ b/src/actors/railroad_crossing/update.inc.c
@@ -0,0 +1,24 @@
+#include <actors.h>
+
+/**
+ * @brief Updates the railroad crossing actor.
+ * Actor used in Kalimari Desert.
+ * Make the sound of the bell when the train is close.
+ *
+ * @param crossing
+ */
+void update_actor_railroad_crossing(struct RailroadCrossing *crossing) {
+ // If train close?
+ if (isCrossingTriggeredByIndex[crossing->crossingId] != 0) {
+ // Timer++
+ crossing->someTimer++;
+ // Reset timer
+ if (crossing->someTimer > 40) {
+ crossing->someTimer = 1;
+ }
+ // Play Bell sound when timer hits 20 or 1.
+ if ((crossing->someTimer == 1) || (crossing->someTimer == 20)) {
+ func_800C98B8(crossing->pos, crossing->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x70, 0x16));
+ }
+ }
+}
diff --git a/src/actors/school_bus/render.inc.c b/src/actors/school_bus/render.inc.c
new file mode 100644
index 000000000..163e258ee
--- /dev/null
+++ b/src/actors/school_bus/render.inc.c
@@ -0,0 +1,44 @@
+#include <actors.h>
+#include <PR/gbi.h>
+#include <main.h>
+#include <defines.h>
+
+/**
+ * @brief Renders the school bus actor.
+ * Actor used in Toad's Turnpike.
+ * His update are made in vehicle.
+ *
+ * @param arg0
+ * @param arg1
+ */
+void render_actor_school_bus(Camera *arg0, struct Actor *arg1) {
+ UNUSED s32 pad[6];
+ Mat4 spC8;
+ UNUSED s32 pad2[32];
+ f32 temp_f0;
+
+ temp_f0 = is_within_render_distance(arg0->pos, arg1->pos, arg0->rot[1], 2500.0f, gCameraZoom[arg0 - camera1], 9000000.0f);
+ if (temp_f0 < 0.0f) { return; }
+
+ gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
+ gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
+
+
+ mtxf_pos_rotation_xyz(spC8, arg1->pos, arg1->rot);
+ if (render_set_position(spC8, 0) != 0) {
+
+ if (gActiveScreenMode == SCREEN_MODE_1P) {
+ if (temp_f0 < 160000.0f) {
+ gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_3);
+ } else if (temp_f0 < 640000.0f) {
+ gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_4);
+ } else {
+ gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_5);
+ }
+ } else if (temp_f0 < 160000.0f) {
+ gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_4);
+ } else {
+ gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_5);
+ }
+ }
+}
diff --git a/src/actors/tanker_truck/render.inc.c b/src/actors/tanker_truck/render.inc.c
new file mode 100644
index 000000000..aa6598500
--- /dev/null
+++ b/src/actors/tanker_truck/render.inc.c
@@ -0,0 +1,43 @@
+#include <actors.h>
+#include <main.h>
+#include <defines.h>
+
+/**
+ * @brief Renders the tanker truck actor.
+ * Actor used in Toad's Turnpike.
+ * His update are made in vehicle.
+ *
+ * @param camera
+ * @param arg1
+ */
+void render_actor_tanker_truck(Camera *camera, struct Actor* arg1) {
+ UNUSED s32 pad[6];
+ Mat4 spC8;
+ UNUSED s32 pad2[32];
+ f32 temp_f0 = is_within_render_distance(camera->pos, arg1->pos, camera->rot[1], 2500.0f, gCameraZoom[camera - camera1], 9000000.0f);
+
+ if (!(temp_f0 < 0.0f)) {
+
+ gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
+ gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
+
+ mtxf_pos_rotation_xyz(spC8, arg1->pos, arg1->rot);
+ if (render_set_position(spC8, 0) != 0) {
+
+ if (gActiveScreenMode == SCREEN_MODE_1P) {
+ if (temp_f0 < 160000.0f) {
+
+ gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_6);
+ } else if (temp_f0 < 640000.0f) {
+ gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_7);
+ } else {
+ gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_8);
+ }
+ } else if (temp_f0 < 160000.0f) {
+ gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_7);
+ } else {
+ gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_8);
+ }
+ }
+ }
+}
diff --git a/src/actors/train.inc.c b/src/actors/train.inc.c
deleted file mode 100644
index 4da4c55bc..000000000
--- a/src/actors/train.inc.c
+++ /dev/null
@@ -1,19 +0,0 @@
-// wheels
-void update_actor_train_engine(struct TrainCar *arg0) {
- arg0->wheelRot -= 0x666;
-
- if (arg0->unk_08 != 0.0f) {
- arg0->unk_08 = 0.0f;
- func_800C9D80(arg0->pos, arg0->velocity, 0x51018000);
- }
-}
-
-// wheels
-void update_actor_train_car1(struct TrainCar *tender) {
- tender->wheelRot -= 0x4FA;
-}
-
-// wheels
-void update_actor_train_car2(struct TrainCar *arg0) {
- arg0->wheelRot -= 0x666;
-}
diff --git a/src/actors/train/render.inc.c b/src/actors/train/render.inc.c
new file mode 100644
index 000000000..d4fab764a
--- /dev/null
+++ b/src/actors/train/render.inc.c
@@ -0,0 +1,324 @@
+#include <actors.h>
+#include <PR/gbi.h>
+#include <main.h>
+#include "courses/kalimari_desert/course_data.h"
+
+/**
+ * @brief Renders the train engine actor.
+ * Actor used in Kalimari Desert.
+ * His update position are made in vehicle.
+ *
+ * @param camera
+ * @param actor
+ */
+void render_actor_train_engine(Camera *camera, struct TrainCar *actor) {
+ UNUSED s32 pad[2];
+ s32 maxObjectsReached;
+ Vec3f sp160;
+ Mat4 sp120;
+ Mat4 spE0;
+ Mat4 spA0;
+
+ f32 distance = is_within_render_distance(camera->pos, actor->pos, camera->rot[1], 2500.0f, gCameraZoom[camera - camera1], 9000000.0f);
+
+ if (distance < 0.0f) { return; }
+
+ gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
+
+ mtxf_pos_rotation_xyz(sp120, actor->pos, actor->rot);
+ maxObjectsReached = render_set_position(sp120, 0) == 0;
+ if (maxObjectsReached) { return; }
+
+ if (distance < 122500.0f) {
+
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1C0F0);
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1B978);
+
+ } else if (distance < 640000.0f) {
+
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1D670);
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1D160);
+ } else {
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1E910);
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1E480);
+ }
+ if (1440000.0f < distance) { return; }
+
+ gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22D28);
+
+ mtxf_rotate_x(sp120, actor->wheelRot);
+ vec3f_set(sp160, 17.0f, 6.0f, 32.0f);
+ mtxf_translate(spE0, sp160);
+ mtxf_multiplication(spA0, sp120, spE0);
+
+ maxObjectsReached = render_set_position(spA0, 3) == 0;
+ if (maxObjectsReached) { return; }
+
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
+ gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
+
+ mtxf_rotate_x(sp120, actor->wheelRot);
+ vec3f_set(sp160, -17.0, 6.0f, 32.0f);
+ mtxf_translate(spE0, sp160);
+ mtxf_multiplication(spA0, sp120, spE0);
+
+ maxObjectsReached = render_set_position(spA0, 3) == 0;
+ if (maxObjectsReached) { return; }
+
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
+ gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
+
+ mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x16C));
+ vec3f_set(sp160, 17.0f, 6.0f, 16.0f);
+ mtxf_translate(spE0, sp160);
+ mtxf_multiplication(spA0, sp120, spE0);
+
+ maxObjectsReached = render_set_position(spA0, 3) == 0;
+ if (maxObjectsReached) { return; }
+
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
+ gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
+
+ mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x16C));
+ vec3f_set(sp160, -17.0f, 6.0f, 16.0f);
+ mtxf_translate(spE0, sp160);
+ mtxf_multiplication(spA0, sp120, spE0);
+
+ maxObjectsReached = render_set_position(spA0, 3) == 0;
+ if (maxObjectsReached) { return; }
+
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
+ gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
+
+ mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x444));
+ vec3f_set(sp160, 17.0f, 12.0f, -12.0f);
+ mtxf_translate(spE0, sp160);
+ mtxf_multiplication(spA0, sp120, spE0);
+
+ maxObjectsReached = render_set_position(spA0, 3) == 0;
+ if (maxObjectsReached) { return; }
+
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22D70);
+ gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
+
+ mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x444));
+ vec3f_set(sp160, -17.0f, 12.0f, -12.0f);
+ mtxf_translate(spE0, sp160);
+ mtxf_multiplication(spA0, sp120, spE0);
+
+ maxObjectsReached = render_set_position(spA0, 3) == 0;
+ if (maxObjectsReached) { return; }
+
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22D70);
+ gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
+
+ mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x2D8));
+ vec3f_set(sp160, 17.0f, 12.0f, -34.0f);
+ mtxf_translate(spE0, sp160);
+ mtxf_multiplication(spA0, sp120, spE0);
+
+ maxObjectsReached = render_set_position(spA0, 3) == 0;
+ if (maxObjectsReached) { return; }
+
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22D70);
+ gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
+
+ mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x2D8));
+ vec3f_set(sp160, -17.0f, 12.0f, -34.0f);
+ mtxf_translate(spE0, sp160);
+ mtxf_multiplication(spA0, sp120, spE0);
+
+ maxObjectsReached = render_set_position(spA0, 3) == 0;
+ if (maxObjectsReached) { return; }
+
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22D70);
+ gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
+ gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
+}
+
+void render_actor_train_tender(Camera *camera, struct TrainCar *actor) {
+ Mat4 sp120;
+ Vec3f sp160;
+ Mat4 spE0;
+ Mat4 spA0;
+
+ f32 temp_f0 = is_within_render_distance(camera->pos, actor->pos, camera->rot[1], 625.0f, gCameraZoom[camera - camera1], 9000000.0f);
+
+ if (temp_f0 < 0.0f) { return; }
+
+ gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
+
+ mtxf_pos_rotation_xyz(sp120, actor->pos, actor->rot);
+ if (render_set_position(sp120, 0) == 0) { return; }
+
+ if (temp_f0 < 250000.0f) {
+
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1F228);
+
+ } else if (temp_f0 < 1000000.0f) {
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1F708);
+ } else {
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1FAF8);
+ }
+ if (1440000.0f < temp_f0) { return; }
+
+ gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22D28);
+
+ mtxf_rotate_x(sp120, actor->wheelRot);
+ vec3f_set(sp160, 17.0f, 6.0f, 8.0f);
+ mtxf_translate(spE0, sp160);
+ mtxf_multiplication(spA0, sp120, spE0);
+
+ if (render_set_position(spA0, 3) == 0) { return; }
+
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
+ gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
+
+ mtxf_rotate_x(sp120, actor->wheelRot);
+ vec3f_set(sp160, -17.0, 6.0f, 8.0f);
+ mtxf_translate(spE0, sp160);
+ mtxf_multiplication(spA0, sp120, spE0);
+
+ if (render_set_position(spA0, 3) == 0) { return; }
+
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
+ gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
+
+ mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x444));
+ vec3f_set(sp160, 17.0f, 6.0f, -8.0f);
+ mtxf_translate(spE0, sp160);
+ mtxf_multiplication(spA0, sp120, spE0);
+
+ if (render_set_position(spA0, 3) == 0) { return; }
+
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
+ gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
+
+ mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x444));
+ vec3f_set(sp160, -17.0f, 6.0f, -8.0f);
+ mtxf_translate(spE0, sp160);
+ mtxf_multiplication(spA0, sp120, spE0);
+
+ if (render_set_position(spA0, 3) == 0) { return; }
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
+ gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
+ gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
+}
+
+void render_actor_train_passenger_car(Camera *camera, struct TrainCar *actor) {
+ Mat4 sp120;
+ Vec3f sp160;
+ Mat4 spE0;
+ Mat4 spA0;
+
+ f32 temp_f0 = is_within_render_distance(camera->pos, actor->pos, camera->rot[1], 2025.0f, gCameraZoom[camera - camera1], 9000000.0f);
+
+ if (temp_f0 < 0.0f) { return; }
+
+ gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
+
+ mtxf_pos_rotation_xyz(sp120, actor->pos, actor->rot);
+
+ if (render_set_position(sp120, 0) == 0) { return; }
+
+ if (temp_f0 < 250000.0f) {
+
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_20A20);
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_20A08);
+
+ } else if (temp_f0 < 1000000.0f) {
+
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_21550);
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_21220);
+ } else {
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_21C90);
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_21A80);
+ }
+ if (1440000.0f < temp_f0) { return; }
+
+ gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22D28);
+
+ mtxf_rotate_x(sp120, actor->wheelRot);
+ vec3f_set(sp160, 17.0f, 6.0f, 28.0f);
+ mtxf_translate(spE0, sp160);
+ mtxf_multiplication(spA0, sp120, spE0);
+
+ if (render_set_position(spA0, 3) == 0) { return; }
+
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
+ gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
+
+ mtxf_rotate_x(sp120, actor->wheelRot);
+ vec3f_set(sp160, -17.0, 6.0f, 28.0f);
+ mtxf_translate(spE0, sp160);
+ mtxf_multiplication(spA0, sp120, spE0);
+
+ if (render_set_position(spA0, 3) == 0) { return; }
+
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
+ gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
+
+ mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x222));
+ vec3f_set(sp160, 17.0f, 6.0f, 12.0f);
+ mtxf_translate(spE0, sp160);
+ mtxf_multiplication(spA0, sp120, spE0);
+
+ if (render_set_position(spA0, 3) == 0) { return; }
+
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
+ gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
+
+ mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x222));
+ vec3f_set(sp160, -17.0f, 6.0f, 12.0f);
+ mtxf_translate(spE0, sp160);
+ mtxf_multiplication(spA0, sp120, spE0);
+
+ if (render_set_position(spA0, 3) == 0) { return; }
+
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
+ gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
+
+ mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x5B0));
+ vec3f_set(sp160, 17.0f, 6.0f, -8.0f);
+ mtxf_translate(spE0, sp160);
+ mtxf_multiplication(spA0, sp120, spE0);
+
+ if (render_set_position(spA0, 3) == 0) { return; }
+
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
+ gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
+
+ mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x5B0));
+ vec3f_set(sp160, -17.0f, 6.0f, -8.0f);
+ mtxf_translate(spE0, sp160);
+ mtxf_multiplication(spA0, sp120, spE0);
+
+ if (render_set_position(spA0, 3) == 0) { return; }
+
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
+ gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
+
+ mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x16C));
+ vec3f_set(sp160, 17.0f, 6.0f, -24.0f);
+ mtxf_translate(spE0, sp160);
+ mtxf_multiplication(spA0, sp120, spE0);
+
+ if (render_set_position(spA0, 3) == 0) { return; }
+
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
+ gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
+
+ mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x16C));
+ vec3f_set(sp160, -17.0f, 6.0f, -24.0f);
+ mtxf_translate(spE0, sp160);
+ mtxf_multiplication(spA0, sp120, spE0);
+
+ if (render_set_position(spA0, 3) == 0) { return; }
+
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
+ gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
+ gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
+}
diff --git a/src/actors/train/update.inc.c b/src/actors/train/update.inc.c
new file mode 100644
index 000000000..024d0c9ab
--- /dev/null
+++ b/src/actors/train/update.inc.c
@@ -0,0 +1,38 @@
+#include <actors.h>
+
+/**
+ * @brief Updates the train engine actor.
+ * Used in Kalimari Desert.
+ * Update wheels and make sound, for his update position it's in vehicle.
+ *
+ * @param arg0
+ */
+void update_actor_train_engine(struct TrainCar *arg0) {
+ arg0->wheelRot -= 0x666;
+
+ if (arg0->unk_08 != 0.0f) {
+ arg0->unk_08 = 0.0f;
+ func_800C9D80(arg0->pos, arg0->velocity, SOUND_ARG_LOAD(0x51,0x01,0x80,0x00));
+ }
+}
+
+/**
+ * @brief Updates the train tender actor.
+ * Used in Kalimari Desert.
+ * Update wheels, for his update position it's in vehicle.
+ * @param tender
+ */
+void update_actor_train_tender(struct TrainCar *tender) {
+ tender->wheelRot -= 0x4FA;
+}
+
+/**
+ * @brief Updates the train passenger car actor.
+ * Used in Kalimari Desert.
+ * Update wheels, for his update position it's in vehicle.
+ *
+ * @param arg0
+ */
+void update_actor_train_passenger_car(struct TrainCar *arg0) {
+ arg0->wheelRot -= 0x666;
+}
diff --git a/src/actors/trees/render.inc.c b/src/actors/trees/render.inc.c
new file mode 100644
index 000000000..6e203645c
--- /dev/null
+++ b/src/actors/trees/render.inc.c
@@ -0,0 +1,329 @@
+#include <actors.h>
+#include <PR/gbi.h>
+#include <main.h>
+#include <common_textures.h>
+#include "courses/all_course_data.h"
+
+/**
+ * @brief Renders the tree actor in Mario rawceay.
+ *
+ * @param camera
+ * @param arg1
+ * @param arg2
+ */
+void render_actor_tree_mario_raceway(Camera *camera, Mat4 arg1, struct Actor *arg2) {
+ f32 temp_f0;
+ s16 temp_v0 = arg2->flags;
+
+ if ((temp_v0 & 0x800) != 0) { return; }
+
+ temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 16000000.0f);
+
+ if (temp_f0 < 0.0f) { return; }
+
+ if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
+ func_8029794C(arg2->pos, arg2->rot, 3.0f);
+ }
+ arg1[3][0] = arg2->pos[0];
+ arg1[3][1] = arg2->pos[1];
+ arg1[3][2] = arg2->pos[2];
+
+ if (render_set_position(arg1, 0) != 0) {
+ gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_trees_import);
+ gSPDisplayList(gDisplayListHead++, d_course_mario_raceway_dl_tree);
+ }
+}
+
+/**
+ * @brief Renders the tree actor in Yoshi Valley.
+ *
+ * @param camera
+ * @param arg1
+ * @param arg2
+ */
+void render_actor_tree_yoshi_valley(Camera *camera, Mat4 arg1, struct Actor *arg2) {
+ f32 temp_f0;
+ s16 temp_v0 = arg2->flags;
+
+ if ((temp_v0 & 0x800) != 0) { return; }
+
+ temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
+
+ if (temp_f0 < 0.0f) { return; }
+
+ if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
+ func_8029794C(arg2->pos, arg2->rot, 2.79999995f);
+ }
+ arg1[3][0] = arg2->pos[0];
+ arg1[3][1] = arg2->pos[1];
+ arg1[3][2] = arg2->pos[2];
+
+ if (render_set_position(arg1, 0) != 0) {
+ gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_trees_import);
+ gSPDisplayList(gDisplayListHead++, d_course_yoshi_valley_dl_tree);
+ }
+}
+
+/**
+ * @brief Renders the tree actor in Royal Raceway.
+ *
+ * @param camera
+ * @param arg1
+ * @param arg2
+ */
+void render_actor_tree_royal_raceway(Camera *camera, Mat4 arg1, struct Actor *arg2) {
+ f32 temp_f0;
+ s16 temp_v0 = arg2->flags;
+
+ if ((temp_v0 & 0x800) != 0) { return; }
+
+ temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
+
+ if (temp_f0 < 0.0f) { return; }
+
+ if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
+ func_8029794C(arg2->pos, arg2->rot, 2.79999995f);
+ }
+ arg1[3][0] = arg2->pos[0];
+ arg1[3][1] = arg2->pos[1];
+ arg1[3][2] = arg2->pos[2];
+
+ if (render_set_position(arg1, 0) != 0) {
+ gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_trees_import);
+ gSPDisplayList(gDisplayListHead++, d_course_royal_raceway_dl_tree);
+ }
+}
+
+/**
+ * @brief Renders the tree actor in Moo Moo Farm.
+ *
+ * @param camera
+ * @param arg1
+ * @param arg2
+ */
+void render_actor_tree_moo_moo_farm(Camera *camera, Mat4 arg1, struct Actor *arg2) {
+ f32 temp_f0;
+ s16 temp_v0 = arg2->flags;
+
+ if ((temp_v0 & 0x800) != 0) { return; }
+
+ temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 6250000.0f);
+
+ if (temp_f0 < 0.0f) { return; }
+
+ if (((temp_v0 & 0x400) == 0) && (temp_f0 < 600.0f)) {
+ func_8029794C(arg2->pos, arg2->rot, 5.0f);
+ }
+ arg1[3][0] = arg2->pos[0];
+ arg1[3][1] = arg2->pos[1];
+ arg1[3][2] = arg2->pos[2];
+
+ if (render_set_position(arg1, 0) != 0) {
+ gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_trees_import);
+ gSPDisplayList(gDisplayListHead++, d_course_moo_moo_farm_dl_tree);
+ }
+}
+
+// have all the properties of the tree
+void func_80299864(Camera *camera, Mat4 arg1, struct Actor *arg2) {
+ f32 temp_f0;
+ s16 temp_v0 = arg2->flags;
+
+ if ((temp_v0 & 0x800) != 0) { return; }
+
+ temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
+
+ if (temp_f0 < 0.0f) { return; }
+
+ if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
+ func_8029794C(arg2->pos, arg2->rot, 2.79999995f);
+ }
+ arg1[3][0] = arg2->pos[0];
+ arg1[3][1] = arg2->pos[1];
+ arg1[3][2] = arg2->pos[2];
+
+ if (render_set_position(arg1, 0) != 0) {
+ gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_trees_import);
+ // Why is a TLUT being used a DL here? That makes no sense
+ // Based on the TLUT being loaded above, this ought to be be another
+ // tree related DL, presumably one found in a course other than Moo Moo farm
+ // 0x0600FC70
+ gSPDisplayList(gDisplayListHead++, d_course_moo_moo_farm_mole_tlut);
+ }
+}
+
+/**
+ * @brief Renders the tree actor in Bowser's Castle.
+ *
+ * @param camera
+ * @param arg1
+ * @param arg2
+ */
+void render_actor_tree_bowser_castle(Camera *camera, Mat4 arg1, struct Actor *arg2) {
+ f32 temp_f0;
+ s16 temp_v0 = arg2->flags;
+
+ if ((temp_v0 & 0x800) != 0) { return; }
+
+ temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
+
+ if (temp_f0 < 0.0f) { return; }
+
+ if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
+ func_8029794C(arg2->pos, arg2->rot, 2.79999995f);
+ }
+ arg1[3][0] = arg2->pos[0];
+ arg1[3][1] = arg2->pos[1];
+ arg1[3][2] = arg2->pos[2];
+
+ if (render_set_position(arg1, 0) != 0) {
+ gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_trees_import);
+ gSPDisplayList(gDisplayListHead++, d_course_royal_raceway_dl_castle_tree);
+ }
+}
+
+/**
+ * @brief Renders the bush actor in Bowser's Castle.
+ *
+ * @param camera
+ * @param arg1
+ * @param arg2
+ */
+void render_actor_bush_bowser_castle(Camera *camera, Mat4 arg1, struct Actor *arg2) {
+ f32 temp_f0;
+ s16 temp_v0 = arg2->flags;
+
+ if ((temp_v0 & 0x800) != 0) { return; }
+
+ temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 640000.0f);
+
+ if (temp_f0 < 0.0f) { return; }
+
+ if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
+ func_8029794C(arg2->pos, arg2->rot, 2.79999995f);
+ }
+ arg1[3][0] = arg2->pos[0];
+ arg1[3][1] = arg2->pos[1];
+ arg1[3][2] = arg2->pos[2];
+
+ if (render_set_position(arg1, 0) != 0) {
+ gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_trees_import);
+ gSPDisplayList(gDisplayListHead++, d_course_bowsers_castle_dl_bush);
+ }
+}
+
+/**
+ * @brief Renders the tree actor in Frappe Snowland.
+ *
+ * @param camera
+ * @param arg1
+ * @param arg2
+ */
+void render_actor_tree_frappe_snowland(Camera *camera, Mat4 arg1, struct Actor *arg2) {
+ f32 temp_f0;
+ s16 temp_v0 = arg2->flags;
+
+ if ((temp_v0 & 0x800) != 0) { return; }
+
+ temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
+
+ if (temp_f0 < 0.0f) { return; }
+
+ if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
+ func_8029794C(arg2->pos, arg2->rot, 2.79999995f);
+ }
+ arg1[3][0] = arg2->pos[0];
+ arg1[3][1] = arg2->pos[1];
+ arg1[3][2] = arg2->pos[2];
+
+ if (render_set_position(arg1, 0) != 0) {
+ gSPDisplayList(gDisplayListHead++, d_course_frappe_snowland_dl_tree);
+ }
+}
+
+/**
+ * @brief Renders the a first variant of cactus in Kalimari Desert.
+ *
+ * @param camera
+ * @param arg1
+ * @param arg2
+ */
+void render_actor_tree_cactus1_kalimari_desert(Camera *camera, Mat4 arg1, struct Actor *arg2) {
+ f32 temp_f0;
+ s16 temp_v0 = arg2->flags;
+
+ if ((temp_v0 & 0x800) != 0) { return; }
+
+ temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
+
+ if (temp_f0 < 0.0f) { return; }
+
+ if (((temp_v0 & 0x400) == 0) && (temp_f0 < 40000.0f)) {
+ func_8029794C(arg2->pos, arg2->rot, 1.0f);
+ }
+ arg1[3][0] = arg2->pos[0];
+ arg1[3][1] = arg2->pos[1];
+ arg1[3][2] = arg2->pos[2];
+
+ if (render_set_position(arg1, 0) != 0) {
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_cactus1);
+ }
+}
+
+/**
+ * @brief Renders the a second variant of cactus in Kalimari Desert.
+ *
+ * @param camera
+ * @param arg1
+ * @param arg2
+ */
+void render_actor_tree_cactus2_kalimari_desert(Camera *camera, Mat4 arg1, struct Actor *arg2) {
+ f32 temp_f0;
+ s16 temp_v0 = arg2->flags;
+
+ if ((temp_v0 & 0x800) != 0) { return; }
+
+ temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
+
+ if (temp_f0 < 0.0f) { return; }
+
+ if (((temp_v0 & 0x400) == 0) && (temp_f0 < 40000.0f)) {
+ func_8029794C(arg2->pos, arg2->rot, 1.0f);
+ }
+ arg1[3][0] = arg2->pos[0];
+ arg1[3][1] = arg2->pos[1];
+ arg1[3][2] = arg2->pos[2];
+
+ if (render_set_position(arg1, 0) != 0) {
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_cactus2);
+ }
+}
+
+/**
+ * @brief Renders the a third variant of cactus in Kalimari Desert.
+ *
+ * @param camera
+ * @param arg1
+ * @param arg2
+ */
+void render_actor_tree_cactus3_kalimari_desert(Camera *camera, Mat4 arg1, struct Actor *arg2) {
+ f32 temp_f0;
+ s16 temp_v0 = arg2->flags;
+
+ if ((temp_v0 & 0x800) != 0) { return; }
+
+ temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
+
+ if (temp_f0 < 0.0f) { return; }
+
+ if (((temp_v0 & 0x400) == 0) && (temp_f0 < 40000.0f)) {
+ func_8029794C(arg2->pos, arg2->rot, 0.80000001f);
+ }
+ arg1[3][0] = arg2->pos[0];
+ arg1[3][1] = arg2->pos[1];
+ arg1[3][2] = arg2->pos[2];
+
+ if (render_set_position(arg1, 0) != 0) {
+ gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_cactus3);
+ }
+}
diff --git a/src/actors/wario_sign/render.inc.c b/src/actors/wario_sign/render.inc.c
new file mode 100644
index 000000000..84216470f
--- /dev/null
+++ b/src/actors/wario_sign/render.inc.c
@@ -0,0 +1,27 @@
+#include <actors.h>
+#include <PR/gbi.h>
+#include <main.h>
+#include "courses/wario_stadium/course_data.h"
+
+/**
+ * @brief Renders the Wario sign actor.
+ * Used in Wario Stadium.
+ *
+ * @param arg0
+ * @param arg1
+ */
+void render_actor_wario_sign(Camera *arg0, struct Actor *arg1) {
+ Mat4 sp38;
+ f32 unk = is_within_render_distance(arg0->pos, arg1->pos, arg0->rot[1], 0, gCameraZoom[arg0 - camera1], 16000000.0f);
+
+ if (!(unk < 0.0f)) {
+ gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
+ gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
+
+ mtxf_pos_rotation_xyz(sp38, arg1->pos, arg1->rot);
+ if (render_set_position(sp38, 0) != 0) {
+
+ gSPDisplayList(gDisplayListHead++, d_course_wario_stadium_dl_sign);
+ }
+ }
+}
diff --git a/src/actors/wario_sign/update.inc.c b/src/actors/wario_sign/update.inc.c
new file mode 100644
index 000000000..8f4bf6d92
--- /dev/null
+++ b/src/actors/wario_sign/update.inc.c
@@ -0,0 +1,11 @@
+#include <actors.h>
+
+/**
+ * @brief Updates the Wario sign actor.
+ * Used in Wario Stadium.
+ *
+ * @param arg0
+ */
+void update_actor_wario_sign(struct Actor *arg0) {
+ arg0->rot[1] += 0xB6;
+}
diff --git a/src/actors/yoshi_egg/render.inc.c b/src/actors/yoshi_egg/render.inc.c
new file mode 100644
index 000000000..4ee09392d
--- /dev/null
+++ b/src/actors/yoshi_egg/render.inc.c
@@ -0,0 +1,59 @@
+#include <camera.h>
+#include <actors.h>
+#include <defines.h>
+#include <main.h>
+#include "courses/yoshi_valley/course_data.h"
+
+/**
+ * @brief Renders the Yoshi egg actor.
+ * Actor used in Yoshi Valley.
+ *
+ * @param arg0
+ * @param arg1
+ * @param egg
+ * @param arg3
+ */
+void render_actor_yoshi_egg(Camera *arg0, Mat4 arg1, struct YoshiValleyEgg *egg, u16 arg3) {
+ Mat4 sp60;
+ Vec3s sp5C;
+ Vec3f sp54;
+ f32 temp_f0;
+
+ if (gGamestate != CREDITS_SEQUENCE) {
+ temp_f0 = is_within_render_distance(arg0->pos, egg->pos, arg0->rot[1], 200.0f, gCameraZoom[arg0 - camera1], 16000000.0f);
+ if (temp_f0 < 0.0f) {
+ return;
+ }
+ } else {
+ arg3 = 15;
+ temp_f0 = 0.0f;
+ }
+
+ gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
+ if ((arg3 > 12) && (arg3 < 20)) {
+ if (temp_f0 < 640000.0f) {
+ sp54[0] = egg->pos[0];
+ sp54[1] = 3.0f;
+ sp54[2] = egg->pos[2];
+ func_802976D8(sp5C);
+ func_8029794C(sp54, sp5C, 10.0f);
+ }
+ sp5C[0] = 0;
+ sp5C[1] = egg->eggRot;
+ sp5C[2] = 0;
+ mtxf_pos_rotation_xyz(sp60, egg->pos, sp5C);
+ if (render_set_position(sp60, 0) == 0) { return; }
+
+ gSPSetGeometryMode(gDisplayListHead++, G_LIGHTING);
+ gSPDisplayList(gDisplayListHead++, d_course_yoshi_valley_dl_16D70);
+ } else {
+ arg1[3][0] = egg->pos[0];
+ arg1[3][1] = egg->pos[1];
+ arg1[3][2] = egg->pos[2];
+
+ if (render_set_position(arg1, 0) != 0) {
+ gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
+ gSPDisplayList(gDisplayListHead++, d_course_yoshi_valley_dl_egg_lod0);
+ }
+ }
+}
diff --git a/src/actors/yoshi_egg/update.inc.c b/src/actors/yoshi_egg/update.inc.c
new file mode 100644
index 000000000..b96f66fa0
--- /dev/null
+++ b/src/actors/yoshi_egg/update.inc.c
@@ -0,0 +1,26 @@
+#include <actors.h>
+
+/**
+ * @brief Updates the Yoshi egg actor.
+ *
+ * @param egg
+ */
+void update_actor_yoshi_egg(struct YoshiValleyEgg *egg) {
+ egg->pathRot += 0x5B;
+ egg->pos[0] = egg->pathCenter[0] + (sins(egg->pathRot) * egg->pathRadius);
+ egg->pos[2] = egg->pathCenter[2] + (coss(egg->pathRot) * egg->pathRadius);
+ if ((egg->flags & 0x400) != 0) {
+ egg->pathCenter[1] -= 0.12;
+ if (egg->pathCenter[1] < -3.0f) {
+ egg->pathCenter[1] = -3.0f;
+ }
+ egg->pos[1] += egg->pathCenter[1];
+ if (egg->pos[1] < 0.0f) {
+ egg->pos[1] = 0.0f;
+ egg->pathCenter[1] = 0.0f;
+ egg->flags &= ~(1 << 10);
+ }
+ egg->eggRot -= 0x4FA;
+ }
+ egg->eggRot -= 0x222;
+}
diff --git a/src/code_800029B0.c b/src/code_800029B0.c
index ec8cc038e..86acf4c63 100644
--- a/src/code_800029B0.c
+++ b/src/code_800029B0.c
@@ -83,13 +83,15 @@ s32 D_8015F5A0;
s32 D_8015F5A4;
s32 code_800029B0_bss_pad[48];
Vtx *vtxBuffer[32];
-s16 D_8015F6E8;
-s16 D_8015F6EA;
-s16 D_8015F6EC; // s16 or u16?
-s16 D_8015F6EE;
-s16 D_8015F6F0;
-s16 D_8015F6F2;
+s16 gCourseMaxX;
+s16 gCourseMinX;
+
+s16 gCourseMaxY; // s16 or u16?
+s16 gCourseMinY;
+
+s16 gCourseMaxZ;
+s16 gCourseMinZ;
s16 D_8015F6F4;
s16 D_8015F6F6;
@@ -210,7 +212,7 @@ void setup_race(void) {
func_802A74BC();
func_802A4D18();
func_80091FA4();
- func_8029E158();
+ init_actors_and_load_textures();
if (gModeSelection != BATTLE) {
D_8015F8D0[1] = (f32) (D_80164490->posY - 15);;
@@ -320,7 +322,7 @@ void func_80003040(void) {
case COURSE_YOSHI_VALLEY:
vec3f_set(position, -2300.0f, 0.0f, 634.0f);
position[0] *= gCourseDirection;
- addActorToEmptySlot(position, rotation, velocity, ACTOR_YOSHI_VALLEY_EGG);
+ add_actor_to_empty_slot(position, rotation, velocity, ACTOR_YOSHI_EGG);
break;
case COURSE_MOO_MOO_FARM:
dma_textures(gTextureTrees4Left, 0x3E8, 0x800);
@@ -353,11 +355,11 @@ void func_80003040(void) {
break;
case COURSE_WARIO_STADIUM:
vec3f_set(position, -131.0f, 83.0f, 286.0f);
- addActorToEmptySlot(position, rotation, velocity, ACTOR_WARIO_SIGN);
+ add_actor_to_empty_slot(position, rotation, velocity, ACTOR_WARIO_SIGN);
vec3f_set(position, -2353.0f, 72.0f, -1608.0f);
- addActorToEmptySlot(position, rotation, velocity, ACTOR_WARIO_SIGN);
+ add_actor_to_empty_slot(position, rotation, velocity, ACTOR_WARIO_SIGN);
vec3f_set(position, -2622.0f, 79.0f, 739.0f);
- addActorToEmptySlot(position, rotation, velocity, ACTOR_WARIO_SIGN);
+ add_actor_to_empty_slot(position, rotation, velocity, ACTOR_WARIO_SIGN);
// d_course_wario_stadium_packed_dl_C50
find_vtx_and_set_colours(0x07000C50, 0x64, 0xFF, 0xFF, 0xFF);
// d_course_wario_stadium_packed_dl_BD8
diff --git a/src/code_800029B0.h b/src/code_800029B0.h
index 24aca26fa..30ee796d7 100644
--- a/src/code_800029B0.h
+++ b/src/code_800029B0.h
@@ -58,13 +58,14 @@ extern s32 D_8015F5A0;
extern s32 D_8015F5A4;
extern Vtx *vtxBuffer[];
-extern s16 D_8015F6E8;
-extern s16 D_8015F6EA;
-extern s16 D_8015F6EC;
-extern s16 D_8015F6EE;
+extern s16 gCourseMaxX;
+extern s16 gCourseMinX;
-extern s16 D_8015F6F0;
-extern s16 D_8015F6F2;
+extern s16 gCourseMaxY;
+extern s16 gCourseMinY;
+
+extern s16 gCourseMaxZ;
+extern s16 gCourseMinZ;
extern s16 D_8015F6F4;
extern s16 D_8015F6F6;
extern u16 D_8015F6F8;
diff --git a/src/code_80005FD0.c b/src/code_80005FD0.c
index e574dc8c7..87e87345c 100644
--- a/src/code_80005FD0.c
+++ b/src/code_80005FD0.c
@@ -1602,7 +1602,7 @@ void func_800098FC(s32 arg0, Player *player) {
}
}
if (D_801633B0[arg0] >= 0xB) {
- if ((player->soundEffects & 0x400000) || (player->soundEffects & 0x01000000) || (player->soundEffects & 2) || (player->soundEffects & 4) || (player->effects & 0x04000000)) {
+ if ((player->soundEffects & 0x400000) || (player->soundEffects & 0x01000000) || (player->soundEffects & 2) || (player->soundEffects & 4) || (player->effects & HIT_EFFECT)) {
func_800C92CC(arg0, 0x2900800BU);
D_801633B0[arg0] = 0;
}
@@ -1640,7 +1640,7 @@ void func_800099EC(s32 playerId, Player *unused) {
// Lots of register allocation differences, but messing around seems to suggest they stem from 2 specific areas
// MISMATCH1: something about the loading of `playerId` is off
// MISMATCH2: something about the handling of the math is off. Not sure exactly what though
-// MISMATCH3: there's a small instruction ordering issue concerning `D_8015F6F0`. No idea what to do about it
+// MISMATCH3: there's a small instruction ordering issue concerning `gCourseMaxX`. No idea what to do about it
// FAKEMATCH1 is the best improvement I've seen yet, MISMATCH2/3 become the only issues.
void func_80009B60(s32 playerId) {
@@ -1698,17 +1698,17 @@ void func_80009B60(s32 playerId) {
return;
}
D_801633E0[playerId] = 0;
- if (player->pos[0] < D_8015F6EA) {
+ if (player->pos[0] < gCourseMinX) {
D_801633E0[playerId] = 1;
}
- if (D_8015F6E8 < player->pos[0]) {
+ if (gCourseMaxX < player->pos[0]) {
D_801633E0[playerId] = 2;
}
- if (player->pos[2] < D_8015F6F2) {
+ if (player->pos[2] < gCourseMinZ) {
D_801633E0[playerId] = 3;
}
// MISMATCH3
- if (D_8015F6F0 < player->pos[2]) {
+ if (gCourseMaxZ < player->pos[2]) {
D_801633E0[playerId] = 4;
}
if (!(player->unk_0CA & 2) && !(player->unk_0CA & 8)) {
@@ -3264,11 +3264,11 @@ void func_8000DF8C(s32 bombKartId) {
}
}
-s32 func_8000ED14(s32 actorIndex, s16 arg1) {
+s32 add_actor_in_unexpired_actor_list(s32 actorIndex, s16 arg1) {
s32 i;
s32 a2 = 0;
- for (i = 0; i < 8; i++) {
+ for (i = 0; i < NUM_PLAYERS; i++) {
if (gUnexpiredActorsList[i].unkC == 0) {
gUnexpiredActorsList[i].unkC = 1;
@@ -3285,31 +3285,31 @@ s32 func_8000ED14(s32 actorIndex, s16 arg1) {
return 0;
}
-s32 func_8000ED80(s32 actorIndex) {
+s32 add_red_shell_in_unexpired_actor_list(s32 actorIndex) {
struct Actor *actor = &gActorList[actorIndex];
- if (actor->type != 8) {
+ if (actor->type != ACTOR_RED_SHELL) {
return -1;
}
- return func_8000ED14(actorIndex, 0);
+ return add_actor_in_unexpired_actor_list(actorIndex, 0);
}
-s32 func_8000EDC8(s32 actorIndex) {
+s32 add_green_shell_in_unexpired_actor_list(s32 actorIndex) {
struct Actor *actor = &gActorList[actorIndex];
- if (actor->type != 7) {
+ if (actor->type != ACTOR_GREEN_SHELL) {
return -1;
}
- return func_8000ED14(actorIndex, 1);
+ return add_actor_in_unexpired_actor_list(actorIndex, 1);
}
-s32 func_8000EE10(s32 arg0) {
+s32 add_blue_shell_in_unexpired_actor_list(s32 arg0) {
struct Actor *actor = &gActorList[arg0];
- if (actor->type != 42) {
+ if (actor->type != ACTOR_BLUE_SPINY_SHELL) {
return -1;
}
- return func_8000ED14(arg0, 2);
+ return add_actor_in_unexpired_actor_list(arg0, 2);
}
-void func_8000EE58(s32 actorIndex) {
+void delete_actor_in_unexpired_actor_list(s32 actorIndex) {
struct unexpiredActors *phi;
s32 i;
@@ -4419,7 +4419,7 @@ void init_course_vehicles(void) {
tempLocomotive->velocity[0] = tempLocomotive->position[0] - origXPos;
tempLocomotive->velocity[2] = tempLocomotive->position[2] - origZPos;
vec3s_set(trainCarRot, 0, trainCarYRot, 0);
- tempLocomotive->actorIndex = addActorToEmptySlot(tempLocomotive->position, trainCarRot, tempLocomotive->velocity, ACTOR_TRAIN_ENGINE);
+ tempLocomotive->actorIndex = add_actor_to_empty_slot(tempLocomotive->position, trainCarRot, tempLocomotive->velocity, ACTOR_TRAIN_ENGINE);
tempTender = &gTrainList[loopIndex].tender;
if (tempTender->isActive == 1) {
@@ -4429,7 +4429,7 @@ void init_course_vehicles(void) {
tempTender->velocity[0] = tempTender->position[0] - origXPos;
tempTender->velocity[2] = tempTender->position[2] - origZPos;
vec3s_set(trainCarRot, 0, trainCarYRot, 0);
- tempTender->actorIndex = addActorToEmptySlot(tempTender->position, trainCarRot, tempTender->velocity, ACTOR_TRAIN_TENDER);
+ tempTender->actorIndex = add_actor_to_empty_slot(tempTender->position, trainCarRot, tempTender->velocity, ACTOR_TRAIN_TENDER);
}
for(loopIndex2 = 0; loopIndex2 < NUM_PASSENGER_CAR_ENTRIES; loopIndex2++) {
@@ -4441,7 +4441,7 @@ void init_course_vehicles(void) {
tempPassengerCar->velocity[0] = tempPassengerCar->position[0] - origXPos;
tempPassengerCar->velocity[2] = tempPassengerCar->position[2] - origZPos;
vec3s_set(trainCarRot, 0, trainCarYRot, 0);
- tempPassengerCar->actorIndex = addActorToEmptySlot(tempPassengerCar->position, trainCarRot, tempPassengerCar->velocity, ACTOR_TRAIN_PASSENGER_CAR);
+ tempPassengerCar->actorIndex = add_actor_to_empty_slot(tempPassengerCar->position, trainCarRot, tempPassengerCar->velocity, ACTOR_TRAIN_PASSENGER_CAR);
}
}
}
@@ -4456,7 +4456,7 @@ void init_course_vehicles(void) {
tempPaddleWheelBoat->velocity[0] = tempPaddleWheelBoat->position[0] - origXPos;
tempPaddleWheelBoat->velocity[2] = tempPaddleWheelBoat->position[2] - origZPos;
vec3s_set(paddleWheelBoatRot, 0, tempPaddleWheelBoat->rotY, 0);
- tempPaddleWheelBoat->actorIndex = addActorToEmptySlot(tempPaddleWheelBoat->position, paddleWheelBoatRot, tempPaddleWheelBoat->velocity, ACTOR_PADDLE_BOAT);
+ tempPaddleWheelBoat->actorIndex = add_actor_to_empty_slot(tempPaddleWheelBoat->position, paddleWheelBoatRot, tempPaddleWheelBoat->velocity, ACTOR_PADDLE_BOAT);
}
}
break;
@@ -4464,22 +4464,22 @@ void init_course_vehicles(void) {
for(loopIndex = 0; loopIndex < NUM_RACE_BOX_TRUCKS; loopIndex++) {
tempBoxTruck = &gBoxTruckList[loopIndex];
func_80012220(tempBoxTruck);
- tempBoxTruck->actorIndex = addActorToEmptySlot(tempBoxTruck->position, tempBoxTruck->rotation, tempBoxTruck->velocity, ACTOR_BOX_TRUCK);
+ tempBoxTruck->actorIndex = add_actor_to_empty_slot(tempBoxTruck->position, tempBoxTruck->rotation, tempBoxTruck->velocity, ACTOR_BOX_TRUCK);
}
for(loopIndex = 0; loopIndex < NUM_RACE_SCHOOL_BUSES; loopIndex++) {
tempSchoolBus = &gSchoolBusList[loopIndex];
func_80012220(tempSchoolBus);
- tempSchoolBus->actorIndex = addActorToEmptySlot(tempSchoolBus->position, tempSchoolBus->rotation, tempSchoolBus->velocity, ACTOR_SCHOOL_BUS);
+ tempSchoolBus->actorIndex = add_actor_to_empty_slot(tempSchoolBus->position, tempSchoolBus->rotation, tempSchoolBus->velocity, ACTOR_SCHOOL_BUS);
}
for(loopIndex = 0; loopIndex < NUM_RACE_TANKER_TRUCKS; loopIndex++) {
tempTankerTruck = &gTankerTruckList[loopIndex];
func_80012220(tempTankerTruck);
- tempTankerTruck->actorIndex = addActorToEmptySlot(tempTankerTruck->position, tempTankerTruck->rotation, tempTankerTruck->velocity, ACTOR_TANKER_TRUCK);
+ tempTankerTruck->actorIndex = add_actor_to_empty_slot(tempTankerTruck->position, tempTankerTruck->rotation, tempTankerTruck->velocity, ACTOR_TANKER_TRUCK);
}
for(loopIndex = 0; loopIndex < NUM_RACE_CARS; loopIndex++) {
tempCar = &gCarList[loopIndex];
func_80012220(tempCar);
- tempCar->actorIndex = addActorToEmptySlot(tempCar->position, tempCar->rotation, tempCar->velocity, ACTOR_CAR);
+ tempCar->actorIndex = add_actor_to_empty_slot(tempCar->position, tempCar->rotation, tempCar->velocity, ACTOR_CAR);
}
break;
}
diff --git a/src/code_80005FD0.h b/src/code_80005FD0.h
index e7920dd97..ffa7d4f23 100644
--- a/src/code_80005FD0.h
+++ b/src/code_80005FD0.h
@@ -117,11 +117,11 @@ s16 func_8000DBAC(Vec3f, s16*, f32);
void set_bomb_kart_spawn_positions(void);
void func_8000DF8C(s32);
-s32 func_8000ED14(s32, s16);
-s32 func_8000ED80(s32);
-s32 func_8000EDC8(s32);
-s32 func_8000EE10(s32);
-void func_8000EE58(s32);
+s32 add_actor_in_unexpired_actor_list(s32, s16);
+s32 add_red_shell_in_unexpired_actor_list(s32);
+s32 add_green_shell_in_unexpired_actor_list(s32);
+s32 add_blue_shell_in_unexpired_actor_list(s32);
+void delete_actor_in_unexpired_actor_list(s32);
void func_8000EEDC(void);
void generate_player_smoke(void);
diff --git a/src/code_80057C60.c b/src/code_80057C60.c
index c2063d198..f89f5ede4 100644
--- a/src/code_80057C60.c
+++ b/src/code_80057C60.c
@@ -1460,7 +1460,7 @@ void func_8005A14C(s32 playerId) {
} else {
f32_step_towards(&gObjectList[objectIndex].sizeScaling, 0.6f, 0.02f);
}
- if (player->effects & 0x04000000) {
+ if (player->effects & HIT_EFFECT) {
u16_step_up_towards(&gObjectList[objectIndex].direction_angle[0], 0x0C00U, 0x0100U);
} else {
u16_step_down_towards(&gObjectList[objectIndex].direction_angle[0], 0, 0x00000100);
diff --git a/src/effects.c b/src/effects.c
index 85aa3d44f..9a4fc17a0 100644
--- a/src/effects.c
+++ b/src/effects.c
@@ -716,10 +716,10 @@ void func_8008D9C0(Player* player) {
}
}
-void func_8008DABC(Player *player, s8 arg1) {
+void apply_hit_sound_effect(Player *player, s8 arg1) {
clean_effect(player, arg1);
- if ((player->effects & 0x4000000) == 0) {
+ if ((player->effects & HIT_EFFECT) == 0) {
player->unk_DB4.unk2 = 0;
player->unk_238 = 0;
player->unk_DB4.unk10 = 4.5f;
@@ -737,18 +737,18 @@ void func_8008DABC(Player *player, s8 arg1) {
player->unk_046 |= 0x80;
}
- if (((player->type & PLAYER_HUMAN) != 0) && ((player->effects & 0x04000000) == 0)) {
- func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008005);
+ if (((player->type & PLAYER_HUMAN) != 0) && ((player->effects & HIT_EFFECT) == 0)) {
+ func_800C90F4(arg1, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x05));
}
- player->effects |= 0x04000000;
+ player->effects |= HIT_EFFECT;
if (((player->type) & 0x1000) != 0) {
func_800098FC(arg1, player);
}
}
}
-void func_8008DC08(Player* player, s8 arg1) {
+void apply_hit_effect(Player* player, s8 arg1) {
player->unk_0C2 = 0;
player->unk_0A8 = 0;
player->unk_07C = 0;
@@ -837,7 +837,7 @@ void func_8008DC08(Player* player, s8 arg1) {
break;
case 3:
player->unk_DB4.unk10 = 3.0f;
- player->effects &= ~0x04000000;
+ player->effects &= ~HIT_EFFECT;
player->unk_DB4.unk2 = 0;
player->effects |= 0x08000000;
player->size = 1.0f;
@@ -889,7 +889,7 @@ void apply_hit_rotating_sound_effect(Player* player, s8 arg1) {
void apply_lightning_effect(Player *player, s8 arg1) {
s16 test;
- if (((player->effects & 0x8000) == 0x8000) && ((player->effects & 0x04000000) != 0x04000000)) {
+ if (((player->effects & 0x8000) == 0x8000) && ((player->effects & HIT_EFFECT) != HIT_EFFECT)) {
player->effects &= ~0x20000;
player->unk_0A8 = 0;
player->unk_07C = 0;
@@ -900,7 +900,7 @@ void apply_lightning_effect(Player *player, s8 arg1) {
D_80165190[1][arg1] = 1;
D_80165190[2][arg1] = 1;
D_80165190[3][arg1] = 1;
- func_8008DABC(player, arg1);
+ apply_hit_sound_effect(player, arg1);
} else if ((player->effects & 0x20000) == 0x20000) {
player->rotation[1] -= 0x5B0;
D_8018D920[arg1] -= 0x5B0;
@@ -1987,10 +1987,28 @@ void func_80090970(Player *player, s8 playerId, s8 arg2) {
}
}
-s32 func_800910E4(Player *player) {
+#define EFFECT_BLACKLIST_USE_ITEM LIGHTNING_EFFECT| \
+ 0x10000000| \
+ 0x8000000| \
+ HIT_EFFECT| \
+ HIT_BY_ITEM_EFFECT| \
+ 0x1000000| \
+ 0x800000| \
+ BOOST_RAMP_ASPHALT_EFFECT|\
+ 0x20000| \
+ 0x10000| \
+ 0x4000| \
+ 0x800| \
+ 0x400| \
+ STAR_EFFECT| \
+ 0x80| \
+ 0x40| \
+ BOOST_RAMP_WOOD_EFFECT
+
+bool prevent_item_use(Player *player) {
s32 phi_v0 = 0;
if ((((((player->unk_0CA & 2) == 2) || ((player->unk_0CA & 8) == 8)) || ((player->type & PLAYER_UNKNOWN_0x40) != 0)) || ((player->type & PLAYER_CINEMATIC_MODE) != 0)) || ((player->type & PLAYER_EXISTS) == 0)) {
- return 1;
+ return TRUE;
}
switch (player->currentItemCopy) {
@@ -1999,20 +2017,20 @@ s32 func_800910E4(Player *player) {
case ITEM_TRIPLE_MUSHROOM:
case ITEM_SUPER_MUSHROOM:
if ((player->effects & 8) != 0) {
- return 1;
+ return TRUE;
}
- phi_v0 = 0x5F934EC4;
- goto func_800910E4_label;
+ phi_v0 = EFFECT_BLACKLIST_USE_ITEM;
+ goto prevent_item_use_label;
case ITEM_STAR:
- phi_v0 = 0xDF934EC4;
+ phi_v0 = BOO_EFFECT| EFFECT_BLACKLIST_USE_ITEM;
case ITEM_BOO:
- phi_v0 = phi_v0 | 0xDF934EC4;
-func_800910E4_label:
+ phi_v0 = phi_v0 | (BOO_EFFECT | EFFECT_BLACKLIST_USE_ITEM);
+prevent_item_use_label:
default:
if ((player->effects & phi_v0) != 0) {
- return 1;
+ return TRUE;
}
- return 0;
+ return FALSE;
}
}
diff --git a/src/effects.h b/src/effects.h
index 3d2d76ff4..bf114cc17 100644
--- a/src/effects.h
+++ b/src/effects.h
@@ -69,8 +69,8 @@ void func_8008D7B0(Player*, s8);
void func_8008D8B4(Player*, s8);
void func_8008D97C(Player*);
void func_8008D9C0(Player*);
-void func_8008DABC(Player*, s8);
-void func_8008DC08(Player*, s8);
+void apply_hit_sound_effect(Player*, s8);
+void apply_hit_effect(Player*, s8);
void apply_hit_rotating_sound_effect(Player*, s8);
void apply_lightning_effect(Player*, s8);
void remove_lightning_effect(Player*, s8);
@@ -111,7 +111,7 @@ void func_80090178(Player*, s8, Vec3f, Vec3f);
void func_80090778(Player*);
void func_80090868(Player*);
void func_80090970(Player*, s8, s8);
-s32 func_800910E4(Player*);
+s32 prevent_item_use(Player*);
void func_800911B4(Player*, s8);
void func_80091298(Player*, s8);
diff --git a/src/ending/code_80280000.c b/src/ending/code_80280000.c
index d3e7a1a8b..d96fcb898 100644
--- a/src/ending/code_80280000.c
+++ b/src/ending/code_80280000.c
@@ -141,12 +141,14 @@ void load_credits(void) {
load_course(gCurrentCourseId);
D_8015F730 = gNextFreeMemoryAddress;
set_segment_base_addr(0xB, (void *) decompress_segments((u8 *) CEREMONY_DATA_ROM_START, (u8 *) CEREMONY_DATA_ROM_END));
- D_8015F6EA = -0x15A1;
- D_8015F6EE = -0x15A1;
- D_8015F6F2 = -0x15A1;
- D_8015F6E8 = 0x15A1;
- D_8015F6EC = 0x15A1;
- D_8015F6F0 = 0x15A1;
+
+ gCourseMinX = -0x15A1;
+ gCourseMinY = -0x15A1;
+ gCourseMinZ = -0x15A1;
+
+ gCourseMaxX = 0x15A1;
+ gCourseMaxY = 0x15A1;
+ gCourseMaxZ = 0x15A1;
D_8015F59C = 0;
D_8015F5A0 = 0;
D_8015F58C = 0;
diff --git a/src/ending/code_80281780.c b/src/ending/code_80281780.c
index f95eb767f..683c72f00 100644
--- a/src/ending/code_80281780.c
+++ b/src/ending/code_80281780.c
@@ -117,13 +117,13 @@ void load_ceremony_cutscene(void) {
set_segment_base_addr(6, (void *) decompress_segments((u8 *) &_course_banshee_boardwalk_dl_mio0SegmentRomStart, (u8 *) &_course_yoshi_valley_dl_mio0SegmentRomStart));
D_8015F8E4 = -2000.0f;
- D_8015F6EA = -0x15A1;
- D_8015F6EE = -0x15A1;
- D_8015F6F2 = -0x15A1;
+ gCourseMinX = -0x15A1;
+ gCourseMinY = -0x15A1;
+ gCourseMinZ = -0x15A1;
- D_8015F6E8 = 0x15A1;
- D_8015F6EC = 0x15A1;
- D_8015F6F0 = 0x15A1;
+ gCourseMaxX = 0x15A1;
+ gCourseMaxY = 0x15A1;
+ gCourseMaxZ = 0x15A1;
D_8015F59C = 0;
D_8015F5A0 = 0;
diff --git a/src/main.c b/src/main.c
index 007944509..6b6296d30 100644
--- a/src/main.c
+++ b/src/main.c
@@ -595,7 +595,7 @@ void race_logic_loop(void) {
gCourseTimer += COURSE_TIMER_ITER;
}
func_802909F0();
- evaluate_player_collision();
+ evaluate_collision_for_players_and_actors();
func_800382DC();
func_8001EE98(gPlayerOneCopy, camera1, 0);
func_80028F70();
@@ -660,7 +660,7 @@ void race_logic_loop(void) {
gCourseTimer += COURSE_TIMER_ITER;
}
func_802909F0();
- evaluate_player_collision();
+ evaluate_collision_for_players_and_actors();
func_800382DC();
func_8001EE98(gPlayerOneCopy, camera1, 0);
func_80029060();
@@ -706,7 +706,7 @@ void race_logic_loop(void) {
gCourseTimer += COURSE_TIMER_ITER;
}
func_802909F0();
- evaluate_player_collision();
+ evaluate_collision_for_players_and_actors();
func_800382DC();
func_8001EE98(gPlayerOneCopy, camera1, 0);
func_80029060();
@@ -774,7 +774,7 @@ void race_logic_loop(void) {
gCourseTimer += COURSE_TIMER_ITER;
}
func_802909F0();
- evaluate_player_collision();
+ evaluate_collision_for_players_and_actors();
func_800382DC();
func_8001EE98(gPlayerOneCopy, camera1, 0);
func_80029158();
diff --git a/src/player_controller.c b/src/player_controller.c
index e13ded918..334f9ea5e 100644
--- a/src/player_controller.c
+++ b/src/player_controller.c
@@ -864,7 +864,7 @@ void func_8002934C(Player *player, Camera *camera, s8 arg2, s8 playerId) {
player->unk_0CC[arg2] = func_802B7C40(temp_f0 / temp_f2) * 2;
}
}
- if ((player->effects & 0x04000000) == 0x04000000) {
+ if ((player->effects & HIT_EFFECT) == HIT_EFFECT) {
player->unk_0CC[arg2] = (s16) ((s32) player->unk_D9C);
}
if ((player->effects & 8) != 8) {
@@ -879,7 +879,7 @@ void func_8002934C(Player *player, Camera *camera, s8 arg2, s8 playerId) {
}
player->unk_0D4[arg2] = (s16) ((s32) (((f64) func_802B7C40(var_f0 / temp_f2)) * 0.5));
}
- if ((player->effects & 0x04000000) == 0x04000000) {
+ if ((player->effects & HIT_EFFECT) == HIT_EFFECT) {
player->unk_0D4[arg2] = (s16) ((s32) player->unk_D9C);
}
func_80029200(player, arg2);
@@ -1538,8 +1538,8 @@ void apply_sound_effect(Player *player, s8 playerId, UNUSED s8 arg2) {
if ((player->soundEffects & 0x20000) == 0x20000) {
func_8008D7B0(player, playerId);
}
- if ((player->soundEffects & 0x100) == 0x100) {
- func_8008DABC(player, playerId);
+ if ((player->soundEffects & HIT_SOUND_EFFECT) == HIT_SOUND_EFFECT) {
+ apply_hit_sound_effect(player, playerId);
}
if ((player->soundEffects & HIT_ROTATING_SOUND_EFFECT) == HIT_ROTATING_SOUND_EFFECT) {
apply_hit_rotating_sound_effect(player, playerId);
@@ -1595,7 +1595,7 @@ void func_8002B5C0(Player *player, UNUSED s8 playerId, UNUSED s8 arg2) {
if ((player->effects & 0x800000) == 0x800000) {
player->soundEffects &= 0xFE1D0478;
}
- if ((player->effects & 0x04000000) == 0x04000000) {
+ if ((player->effects & HIT_EFFECT) == HIT_EFFECT) {
player->soundEffects &= 0xFE1D0578;
}
if ((player->effects & 0x01000000) == 0x01000000) {
@@ -2094,8 +2094,8 @@ void apply_effect(Player *player, s8 arg1, s8 arg2) {
if ((player->effects & BOOST_RAMP_WOOD_EFFECT) == BOOST_RAMP_WOOD_EFFECT) {
apply_boost_ramp_wood_effect(player);
}
- if ((s32)(player->effects & 0x04000000) == 0x04000000) {
- func_8008DC08(player, arg1);
+ if ((s32)(player->effects & HIT_EFFECT) == HIT_EFFECT) {
+ apply_hit_effect(player, arg1);
}
if ((player->effects & LIGHTNING_EFFECT) == LIGHTNING_EFFECT) {
apply_lightning_effect(player, arg1);
@@ -2312,7 +2312,7 @@ void func_8002D268(Player *player, UNUSED Camera *camera, s8 arg2, s8 playerId)
sp98[2] += (((((f64) ((sp184[2] + spAC) + sp160[2])) - (sp98[2] * (0.12 * ((f64) player->kartFriction)))) / 6000.0) / 30.0);
}
sp98[1] += (((((f64) ((sp184[1] + spB0) + sp160[1])) - (sp98[1] * (0.12 * ((f64) player->kartFriction)))) / 6000.0) / ((f64) player->unk_DAC));
- if (((((player->unk_0CA & 2) == 2) || ((player->unk_0CA & 8) == 8)) || ((player->effects & 0x04000000) == 0x04000000)) || (player->unk_0CA & 1)) {
+ if (((((player->unk_0CA & 2) == 2) || ((player->unk_0CA & 8) == 8)) || ((player->effects & HIT_EFFECT) == HIT_EFFECT)) || (player->unk_0CA & 1)) {
sp98[0] = 0.0f;
sp98[1] = 0.0f;
sp98[2] = 0.0f;
@@ -2334,7 +2334,7 @@ void func_8002D268(Player *player, UNUSED Camera *camera, s8 arg2, s8 playerId)
if (((((player->unk_0CA & 2) != 2)
&& ((player->unk_0CA & 8) != 8))
- && ((player->effects & 0x04000000) != 0x04000000))
+ && ((player->effects & HIT_EFFECT) != HIT_EFFECT))
&& (!(player->unk_0CA & 1))) {
func_8002AAC0(player);
spF8 += player->kartHopVelocity;
@@ -4292,7 +4292,7 @@ void func_8003680C(Player *player, s16 arg1) {
(player->effects & 0x20000) ||
(player->effects & 0x01000000) ||
(player->effects & HIT_BY_ITEM_EFFECT) ||
- (player->effects & 0x04000000))) {
+ (player->effects & HIT_EFFECT))) {
if (!(((player->unk_094 / 18.0f) * 216.0f) >= 110.0f)) {
player->effects &= ~0x20000000;
player->unk_228 = 0;
@@ -4638,7 +4638,7 @@ void func_80037CFC(Player *player, struct Controller *controller, s8 arg2) {
((player->effects & 0x01000000) != 0x01000000) &&
((player->effects & HIT_BY_ITEM_EFFECT) != HIT_BY_ITEM_EFFECT) && ((player->effects & 0x10000) != 0x10000) &&
((player->effects & 0x20000) != 0x20000)) {
- if (((player->effects & 0x04000000) != 0x04000000) &&
+ if (((player->effects & HIT_EFFECT) != HIT_EFFECT) &&
((player->effects & 8) != 8) &&
((player->effects & 2) != 2) &&
((player->effects & 0x10) != 0x10) &&
diff --git a/src/racing/actors.c b/src/racing/actors.c
index a64022cf2..8d95c2096 100644
--- a/src/racing/actors.c
+++ b/src/racing/actors.c
@@ -45,18 +45,20 @@ void cleanup_red_and_green_shells(struct ShellActor *shell) {
s32 actorIndex;
struct ShellActor *compare;
+ // try finding the dead green shell
for (actorIndex = gNumPermanentActors; actorIndex < ACTOR_LIST_SIZE; actorIndex++) {
compare = (struct ShellActor *)&gActorList[actorIndex];
if ((shell != compare) && !(compare->flags & ACTOR_IS_NOT_EXPIRED) && (compare->type == ACTOR_GREEN_SHELL)) {
if (compare->state == MOVING_SHELL) {
- func_8000EE58(actorIndex);
+ delete_actor_in_unexpired_actor_list(actorIndex);
}
- gNumSpawnedShells -= 1;
+ gNumSpawnedShells--;
destroy_actor((struct Actor *)compare);
return;
}
}
+ // try finding the dead red shell
for (actorIndex = gNumPermanentActors; actorIndex < ACTOR_LIST_SIZE; actorIndex++) {
compare = (struct ShellActor *) &gActorList[actorIndex];
if ((shell != compare) && !(compare->flags & ACTOR_IS_NOT_EXPIRED) && (compare->type == ACTOR_RED_SHELL)) {
@@ -67,7 +69,7 @@ void cleanup_red_and_green_shells(struct ShellActor *shell) {
case GREEN_SHELL_HIT_A_RACER:
case BLUE_SHELL_LOCK_ON:
case BLUE_SHELL_TARGET_ELIMINATED:
- func_8000EE58(actorIndex);
+ delete_actor_in_unexpired_actor_list(actorIndex);
case DESTROYED_SHELL:
gNumSpawnedShells -= 1;
destroy_actor((struct Actor *)compare);
@@ -78,12 +80,13 @@ void cleanup_red_and_green_shells(struct ShellActor *shell) {
}
}
+ // try finding the green shell
for (actorIndex = gNumPermanentActors; actorIndex < ACTOR_LIST_SIZE; actorIndex++) {
compare = (struct ShellActor *) &gActorList[actorIndex];
if ((shell != compare) && (compare->type == ACTOR_GREEN_SHELL)) {
switch(compare->state) {
case MOVING_SHELL:
- func_8000EE58(actorIndex);
+ delete_actor_in_unexpired_actor_list(actorIndex);
case DESTROYED_SHELL:
gNumSpawnedShells -= 1;
destroy_actor((struct Actor *)compare);
@@ -92,6 +95,7 @@ void cleanup_red_and_green_shells(struct ShellActor *shell) {
}
}
+ // try finding the red or blue shell
for (actorIndex = gNumPermanentActors; actorIndex < ACTOR_LIST_SIZE; actorIndex++) {
compare = (struct ShellActor *)&gActorList[actorIndex];
if ((shell != compare) && (compare->type == ACTOR_RED_SHELL)) {
@@ -102,7 +106,7 @@ void cleanup_red_and_green_shells(struct ShellActor *shell) {
case GREEN_SHELL_HIT_A_RACER:
case BLUE_SHELL_LOCK_ON:
case BLUE_SHELL_TARGET_ELIMINATED:
- func_8000EE58(actorIndex);
+ delete_actor_in_unexpired_actor_list(actorIndex);
case DESTROYED_SHELL:
gNumSpawnedShells -= 1;
destroy_actor((struct Actor *)compare);
@@ -125,188 +129,188 @@ void actor_init(struct Actor *actor, Vec3f startingPos, Vec3s startingRot, Vec3f
actor->boundingBoxSize = 0.0f;
func_802AAAAC(&actor->unk30);
switch (actorType) {
- case ACTOR_BOX_TRUCK:
- if ((s32) D_802BA260 >= 3) {
- D_802BA260 = 0;
- }
- actor->state = (s16) D_802BA260;
- D_802BA260 += 1;
- break;
- case ACTOR_YOSHI_VALLEY_EGG:
- actor->flags |= 0x4000;
- actor->unk_08 = 70.0f;
- actor->boundingBoxSize = 20.0f;
- actor->velocity[0] = actor->pos[0];
- actor->velocity[1] = actor->pos[1];
- actor->velocity[2] = actor->pos[2] + 70.0f;
- break;
- case ACTOR_KIWANO_FRUIT:
- actor->state = 0;
- actor->rot[0] = 0;
- actor->rot[1] = 0;
- actor->rot[2] = 0;
- actor->boundingBoxSize = 2.0f;
- break;
- case ACTOR_FALLING_ROCK:
- actor->flags |= 0x4000;
- actor->boundingBoxSize = 10.0f;
- break;
- case ACTOR_TRAIN_ENGINE:
- actor->unk_08 = 10.0f;
- break;
- case ACTOR_BANANA:
- actor->flags = actor->flags | 0x4000 | 0x1000;
- actor->boundingBoxSize = 2.0f;
- break;
- case ACTOR_GREEN_SHELL:
- gNumSpawnedShells += 1;
- actor->unk_04 = 0;
- actor->boundingBoxSize = 4.0f;
- actor->flags = actor->flags | 0x4000 | 0x2000 | 0x1000;
- if ((s32) gNumSpawnedShells >= 0x15) {
- cleanup_red_and_green_shells((struct ShellActor *) actor);
- }
- break;
- case ACTOR_RED_SHELL:
- gNumSpawnedShells += 1;
- actor->unk_04 = 0;
- actor->boundingBoxSize = 4.0f;
- actor->flags = actor->flags | 0x4000 | 0x2000 | 0x1000;
- if ((s32) gNumSpawnedShells >= 0x15) {
- cleanup_red_and_green_shells((struct ShellActor *) actor);
- }
- break;
- case 2:
- gNumSpawnedShells += 1;
- actor->flags |= 0x4000;
- actor->state = 0x0043;
- actor->boundingBoxSize = 3.0f;
- actor->unk_08 = 20.0f;
- break;
- case 3:
- actor->flags |= 0x4000;
- actor->state = 0x0043;
- actor->boundingBoxSize = 3.0f;
- actor->unk_08 = 23.0f;
- break;
- case 4:
- actor->flags |= 0x4000;
- actor->state = 0x0043;
- actor->boundingBoxSize = 3.0f;
- actor->unk_08 = 17.0f;
- break;
- case 19:
- actor->state = 0x0043;
- actor->flags = -0x8000;
- actor->boundingBoxSize = 3.0f;
- actor->unk_08 = 17.0f;
- break;
- case 26:
- actor->flags |= 0x4000;
- actor->state = 0x0043;
- actor->boundingBoxSize = 3.0f;
- actor->unk_08 = 17.0f;
- break;
- case 28:
- actor->state = 0x0043;
- actor->flags = -0x8000;
- actor->boundingBoxSize = 3.0f;
- actor->unk_08 = 17.0f;
- break;
- case 33:
- actor->flags |= 0x4000;
- actor->state = 0x0043;
- actor->boundingBoxSize = 3.0f;
- actor->unk_08 = 17.0f;
- break;
- case 29:
- actor->flags |= 0x4000;
- actor->state = 0x0043;
- actor->boundingBoxSize = 3.0f;
- actor->unk_08 = 17.0f;
- break;
- case 30:
- actor->flags |= 0x4000;
- actor->state = 0x0019;
- actor->boundingBoxSize = 3.0f;
- actor->unk_08 = 7.0f;
- break;
- case 31:
- actor->flags |= 0x4000;
- actor->state = 0x0019;
- actor->boundingBoxSize = 3.0f;
- actor->unk_08 = 7.0f;
- break;
- case 32:
- actor->flags |= 0x4000;
- actor->state = 0x0019;
- actor->boundingBoxSize = 3.0f;
- actor->unk_08 = 7.0f;
- break;
- case ACTOR_PALM_TREE:
- actor->flags |= 0x4000;
- actor->state = 0x003C;
- actor->boundingBoxSize = 3.0f;
- actor->unk_08 = 13.0f;
- break;
- case ACTOR_FAKE_ITEM_BOX:
- actor->flags = actor->flags | 0x4000 | 0x1000;
- actor->unk_08 = 0.35f;
- actor->boundingBoxSize = 1.925f;
- func_802ADDC8(&actor->unk30, 1.925f, actor->pos[0], actor->pos[1], actor->pos[2]);
- break;
- case ACTOR_HOT_AIR_BALLOON_ITEM_BOX:
- actor->flags |= 0x4000;
- actor->unk_04 = 0;
- actor->state = 5;
- actor->boundingBoxSize = 5.5f;
- break;
- case ACTOR_ITEM_BOX:
- actor->flags |= 0x4000;
- actor->unk_04 = 0;
- actor->state = 0;
- actor->boundingBoxSize = 5.5f;
- break;
- case ACTOR_PIRANHA_PLANT:
- actor->flags |= 0x4000;
- actor->state = 0x001E;
- actor->boundingBoxSize = 5.0f;
- break;
- default:
- break;
+ case ACTOR_BOX_TRUCK:
+ if ((s32) D_802BA260 >= 3) {
+ D_802BA260 = 0;
+ }
+ actor->state = (s16) D_802BA260;
+ D_802BA260 += 1;
+ break;
+ case ACTOR_YOSHI_EGG:
+ actor->flags |= 0x4000;
+ actor->unk_08 = 70.0f;
+ actor->boundingBoxSize = 20.0f;
+ actor->velocity[0] = actor->pos[0];
+ actor->velocity[1] = actor->pos[1];
+ actor->velocity[2] = actor->pos[2] + 70.0f;
+ break;
+ case ACTOR_KIWANO_FRUIT:
+ actor->state = 0;
+ actor->rot[0] = 0;
+ actor->rot[1] = 0;
+ actor->rot[2] = 0;
+ actor->boundingBoxSize = 2.0f;
+ break;
+ case ACTOR_FALLING_ROCK:
+ actor->flags |= 0x4000;
+ actor->boundingBoxSize = 10.0f;
+ break;
+ case ACTOR_TRAIN_ENGINE:
+ actor->unk_08 = 10.0f;
+ break;
+ case ACTOR_BANANA:
+ actor->flags = actor->flags | 0x4000 | 0x1000;
+ actor->boundingBoxSize = 2.0f;
+ break;
+ case ACTOR_GREEN_SHELL:
+ gNumSpawnedShells += 1;
+ actor->unk_04 = 0;
+ actor->boundingBoxSize = 4.0f;
+ actor->flags = actor->flags | 0x4000 | 0x2000 | 0x1000;
+ if ((s32) gNumSpawnedShells >= 0x15) {
+ cleanup_red_and_green_shells((struct ShellActor *) actor);
+ }
+ break;
+ case ACTOR_RED_SHELL:
+ gNumSpawnedShells += 1;
+ actor->unk_04 = 0;
+ actor->boundingBoxSize = 4.0f;
+ actor->flags = actor->flags | 0x4000 | 0x2000 | 0x1000;
+ if ((s32) gNumSpawnedShells >= 0x15) {
+ cleanup_red_and_green_shells((struct ShellActor *) actor);
+ }
+ break;
+ case ACTOR_TREE_MARIO_RACEWAY:
+ gNumSpawnedShells += 1;
+ actor->flags |= 0x4000;
+ actor->state = 0x0043;
+ actor->boundingBoxSize = 3.0f;
+ actor->unk_08 = 20.0f;
+ break;
+ case ACTOR_TREE_YOSHI_VALLEY:
+ actor->flags |= 0x4000;
+ actor->state = 0x0043;
+ actor->boundingBoxSize = 3.0f;
+ actor->unk_08 = 23.0f;
+ break;
+ case ACTOR_TREE_ROYAL_RACEWAY:
+ actor->flags |= 0x4000;
+ actor->state = 0x0043;
+ actor->boundingBoxSize = 3.0f;
+ actor->unk_08 = 17.0f;
+ break;
+ case ACTOR_TREE_MOO_MOO_FARM:
+ actor->state = 0x0043;
+ actor->flags = -0x8000;
+ actor->boundingBoxSize = 3.0f;
+ actor->unk_08 = 17.0f;
+ break;
+ case 26:
+ actor->flags |= 0x4000;
+ actor->state = 0x0043;
+ actor->boundingBoxSize = 3.0f;
+ actor->unk_08 = 17.0f;
+ break;
+ case 28:
+ actor->state = 0x0043;
+ actor->flags = -0x8000;
+ actor->boundingBoxSize = 3.0f;
+ actor->unk_08 = 17.0f;
+ break;
+ case 33:
+ actor->flags |= 0x4000;
+ actor->state = 0x0043;
+ actor->boundingBoxSize = 3.0f;
+ actor->unk_08 = 17.0f;
+ break;
+ case 29:
+ actor->flags |= 0x4000;
+ actor->state = 0x0043;
+ actor->boundingBoxSize = 3.0f;
+ actor->unk_08 = 17.0f;
+ break;
+ case 30:
+ actor->flags |= 0x4000;
+ actor->state = 0x0019;
+ actor->boundingBoxSize = 3.0f;
+ actor->unk_08 = 7.0f;
+ break;
+ case 31:
+ actor->flags |= 0x4000;
+ actor->state = 0x0019;
+ actor->boundingBoxSize = 3.0f;
+ actor->unk_08 = 7.0f;
+ break;
+ case 32:
+ actor->flags |= 0x4000;
+ actor->state = 0x0019;
+ actor->boundingBoxSize = 3.0f;
+ actor->unk_08 = 7.0f;
+ break;
+ case ACTOR_PALM_TREE:
+ actor->flags |= 0x4000;
+ actor->state = 0x003C;
+ actor->boundingBoxSize = 3.0f;
+ actor->unk_08 = 13.0f;
+ break;
+ case ACTOR_FAKE_ITEM_BOX:
+ actor->flags = actor->flags | 0x4000 | 0x1000;
+ actor->unk_08 = 0.35f;
+ actor->boundingBoxSize = 1.925f;
+ func_802ADDC8(&actor->unk30, 1.925f, actor->pos[0], actor->pos[1], actor->pos[2]);
+ break;
+ case ACTOR_HOT_AIR_BALLOON_ITEM_BOX:
+ actor->flags |= 0x4000;
+ actor->unk_04 = 0;
+ actor->state = 5;
+ actor->boundingBoxSize = 5.5f;
+ break;
+ case ACTOR_ITEM_BOX:
+ actor->flags |= 0x4000;
+ actor->unk_04 = 0;
+ actor->state = 0;
+ actor->boundingBoxSize = 5.5f;
+ break;
+ case ACTOR_PIRANHA_PLANT:
+ actor->flags |= 0x4000;
+ actor->state = 0x001E;
+ actor->boundingBoxSize = 5.0f;
+ break;
+ default:
+ break;
}
}
-void func_80297230(Camera *arg0, struct Actor *arg1) {
+void actor_not_rendered(Camera *arg0, struct Actor *arg1) {
switch(arg0 - camera1) {
- case 0:
- arg1->flags &= ~1;
+ case PLAYER_ONE:
+ arg1->flags &= ~(1<<PLAYER_ONE);
break;
- case 1:
- arg1->flags &= ~2;
+ case PLAYER_TWO:
+ arg1->flags &= ~(1<<PLAYER_TWO);
break;
- case 2:
- arg1->flags &= ~4;
+ case PLAYER_THREE:
+ arg1->flags &= ~(1<<PLAYER_THREE);
break;
- case 3:
- arg1->flags &= ~8;
+ case PLAYER_FOUR:
+ arg1->flags &= ~(1<<PLAYER_FOUR);
break;
}
}
-void func_802972B8(Camera *arg0, struct Actor *arg1) {
+void actor_rendered(Camera *arg0, struct Actor *arg1) {
switch(arg0 - camera1) {
- case 0:
- arg1->flags |= 1;
+ case PLAYER_ONE:
+ arg1->flags |= 1<<PLAYER_ONE;
break;
- case 1:
- arg1->flags |= 2;
+ case PLAYER_TWO:
+ arg1->flags |= 1<<PLAYER_TWO;
break;
- case 2:
- arg1->flags |= 4;
+ case PLAYER_THREE:
+ arg1->flags |= 1<<PLAYER_THREE;
break;
- case 3:
- arg1->flags |= 8;
+ case PLAYER_FOUR:
+ arg1->flags |= 1<<PLAYER_FOUR;
break;
}
}
@@ -383,10 +387,10 @@ void func_802977B0(Player *arg0) {
}
void func_802977E4(Player *arg0) {
- arg0->boundingBoxCorners[1].unk_14 &= 0xFFFD;
- arg0->boundingBoxCorners[0].unk_14 &= 0xFFFD;
- arg0->boundingBoxCorners[3].unk_14 &= 0xFFFD;
- arg0->boundingBoxCorners[2].unk_14 &= 0xFFFD;
+ arg0->boundingBoxCorners[1].unk_14 &= ~2 & 0xFFFF;
+ arg0->boundingBoxCorners[0].unk_14 &= ~2 & 0xFFFF;
+ arg0->boundingBoxCorners[3].unk_14 &= ~2 & 0xFFFF;
+ arg0->boundingBoxCorners[2].unk_14 &= ~2 & 0xFFFF;
}
// Invert green and red on green shell texture
@@ -402,7 +406,7 @@ void init_red_shell_texture(void) {
blue_color = color_pixel & 0x3E;
alpha_color = color_pixel & 0x1;
- *red_shell_texture = (red_color >> 5) | (green_color << 5) | blue_color | alpha_color; // Invert color
+ *red_shell_texture = (red_color >> 5) | (green_color << 5) | blue_color | alpha_color; // Invert green to red
green_shell_texture++;
red_shell_texture++;
}
@@ -410,80 +414,35 @@ void init_red_shell_texture(void) {
UNUSED void func_80297944(void) {};
-void func_8029794C(Vec3f arg0, Vec3s arg1, f32 arg2) {
+void func_8029794C(Vec3f pos, Vec3s rot, f32 scale) {
Mat4 sp20;
- arg0[1] += 2.0f;
+ pos[1] += 2.0f;
- mtxf_pos_rotation_xyz(sp20, arg0, arg1);
- mtxf_scale(sp20, arg2);
+ mtxf_pos_rotation_xyz(sp20, pos, rot);
+ mtxf_scale(sp20, scale);
if (render_set_position(sp20, 0) != 0) {
-
gSPDisplayList(gDisplayListHead++, D_0D007B20);
- arg0[1] -= 2.0f;
+ pos[1] -= 2.0f;
}
}
void func_802979F8(struct Actor *arg0, UNUSED f32 arg1) {
- Vec3f sp24;
- Vec3s sp1C;
+ Vec3f pos;
+ Vec3s rot;
if (arg0->unk30.unk34 != 0) {
- func_802976EC(&arg0->unk30, sp1C); // arg0 + 0x30
- func_80297760(arg0, sp24);
- func_8029794C(sp24, sp1C, 0.45f);
+ func_802976EC(&arg0->unk30, rot); // arg0 + 0x30
+ func_80297760(arg0, pos);
+ func_8029794C(pos, rot, 0.45f);
}
}
-void render_actor_cow(Camera *camera, Mat4 arg1, struct Actor *arg2) {
- if (is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f) < 0) { return; }
+#include "actors/cow/render.inc.c"
- arg1[3][0] = arg2->pos[0];
- arg1[3][1] = arg2->pos[1];
- arg1[3][2] = arg2->pos[2];
+#include "actors/yoshi_egg/update.inc.c"
- if (render_set_position(arg1, 0) != 0) {
- switch (arg2->state) {
- case 0:
- gSPDisplayList(gDisplayListHead++, d_course_moo_moo_farm_dl_cow1);
- break;
- case 1:
- gSPDisplayList(gDisplayListHead++, d_course_moo_moo_farm_dl_cow2);
- break;
- case 2:
- gSPDisplayList(gDisplayListHead++, d_course_moo_moo_farm_dl_cow3);
- break;
- case 3:
- gSPDisplayList(gDisplayListHead++, d_course_moo_moo_farm_dl_cow4);
- break;
- case 4:
- gSPDisplayList(gDisplayListHead++, d_course_moo_moo_farm_dl_cow5);
- break;
- }
- }
-}
-
-void update_actor_yoshi_valley_egg(struct YoshiValleyEgg *egg) {
- egg->pathRot += 0x5B;
- egg->pos[0] = egg->pathCenter[0] + (sins(egg->pathRot) * egg->pathRadius);
- egg->pos[2] = egg->pathCenter[2] + (coss(egg->pathRot) * egg->pathRadius);
- if ((egg->flags & 0x400) != 0) {
- egg->pathCenter[1] -= 0.12;
- if (egg->pathCenter[1] < -3.0f) {
- egg->pathCenter[1] = -3.0f;
- }
- egg->pos[1] += egg->pathCenter[1];
- if (egg->pos[1] < 0.0f) {
- egg->pos[1] = 0.0f;
- egg->pathCenter[1] = 0.0f;
- egg->flags &= ~(1 << 10);
- }
- egg->eggRot -= 0x4FA;
- }
- egg->eggRot -= 0x222;
-}
-
-void update_actor_trees_cacti_shrubs(struct Actor *arg0) {
+void update_actor_static_plant(struct Actor *arg0) {
if (((arg0->flags & 0x800) == 0) && ((arg0->flags & 0x400) != 0)) {
arg0->pos[1] = arg0->pos[1] + 4.0f;
if (arg0->pos[1] > 800.0f) {
@@ -492,240 +451,17 @@ void update_actor_trees_cacti_shrubs(struct Actor *arg0) {
}
}
-void update_actor_kiwano_fruit(struct KiwanoFruit *fruit) {
- Player *player;
- f32 temp_f2;
- f32 temp_f16;
- f32 temp_f14;
- f32 temp_f12;
- s32 nearestWaypoint;
-
- player = &gPlayers[fruit->targetPlayer];
- if (((player->type & PLAYER_CPU) != 0) || (player->unk_110.unk34 == 0)) {
- fruit->state = 0;
- return;
- }
- switch (fruit->state) { /* irregular */
- case 0:
- if ((get_surface_type(player->unk_110.unk3A) & 0xFF) != GRASS) {
- return;
- }
- fruit->state = 1;
- fruit->velocity[0] = 80.0f;
- case 1:
- nearestWaypoint = gNearestWaypointByPlayerId[(u16)(player - gPlayerOne)];
- temp_f2 = player->pos[0] - D_80164490[nearestWaypoint].posX;
- temp_f16 = player->pos[1] - D_80164490[nearestWaypoint].posY;
- temp_f14 = player->pos[2] - D_80164490[nearestWaypoint].posZ;
- temp_f12 = fruit->velocity[0] / sqrtf((temp_f2 * temp_f2) + (temp_f16 * temp_f16) + (temp_f14 * temp_f14));
- temp_f2 *= temp_f12;
- temp_f16 *= temp_f12;
- temp_f14 *= temp_f12;
- fruit->pos[0] = player->pos[0] + temp_f2;
- fruit->pos[1] = player->pos[1] + temp_f16;
- fruit->pos[2] = player->pos[2] + temp_f14;
- fruit->velocity[0] -= 2.0f;
- if (fruit->velocity[0] <= 0.0f) {
- fruit->state = 2;
- fruit->bonkTimer = 30.0f;
- fruit->velocity[0] = 0.0f;
- fruit->velocity[1] = 2.3f;
- fruit->velocity[2] = 0.0f;
- if ((player->effects & STAR_EFFECT) != 0) {
- func_800C9060(player - gPlayerOne, SOUND_ARG_LOAD(0x19, 0x00, 0xA0, 0x52));
- } else {
- player->effects |= 0x8000;
- player->pos[0] -= temp_f2 * 4.0f;
- player->pos[2] -= temp_f14 * 4.0f;
- player->velocity[0] -= temp_f2 * 0.7f;
- player->velocity[2] -= temp_f14 * 0.7f;
- func_800C9060(player - gPlayerOne, SOUND_ARG_LOAD(0x19, 0x00, 0x70, 0x18));
- if (gModeSelection != GRAND_PRIX) {
- D_80162DF8 = 1;
- }
- }
- }
- break;
- case 2:
- fruit->velocity[1] -= 0.3f;
- fruit->pos[0] += fruit->velocity[0];
- fruit->pos[1] += fruit->velocity[1];
- fruit->pos[2] += fruit->velocity[2];
- fruit->bonkTimer -= 1.0f;
- if (fruit->bonkTimer < 0.0f) {
- fruit->state = 0;
- }
- break;
- default:
- break;
- }
- if (fruit->state != 0) {
- fruit->animTimer += 1;
- if (fruit->animTimer == 8) {
- fruit->animTimer = 0;
- fruit->animState += 1;
- if (fruit->animState == 3) {
- fruit->animState = 0;
- }
- }
- }
-}
+#include "actors/kiwano_fruit/update.inc.c"
#include "actors/paddle_boat/update.inc.c"
-#include "actors/train.inc.c"
-
-void update_actor_piranha_plant(struct PiranhaPlant *arg0) {
- if ((arg0->flags & 0x800) == 0) {
- if ((arg0->flags & 0x400) != 0) {
- arg0->pos[1] += 4.0f;
- if (arg0->pos[1] > 800.0f) {
- arg0->flags |= 0x800;
- }
- } else {
- // This has to be an unrolled loop
- if (arg0->visibilityStates[0] == 1) {
- arg0->timers[0]++;
- if (arg0->timers[0] > 60) {
- arg0->timers[0] = 6;
- }
- } else {
- arg0->timers[0] = 0;
- }
- if (arg0->visibilityStates[1] == 1) {
- arg0->timers[1]++;
- if (arg0->timers[1] > 60) {
- arg0->timers[1] = 6;
- }
- } else {
- arg0->timers[1] = 0;
- }
- if (arg0->visibilityStates[2] == 1) {
- arg0->timers[2]++;
- if (arg0->timers[2] > 60) {
- arg0->timers[2] = 6;
- }
- } else {
- arg0->timers[2] = 0;
- }
- if (arg0->visibilityStates[3] == 1) {
- arg0->timers[3]++;
- if (arg0->timers[3] > 60) {
- arg0->timers[3] = 6;
- }
- } else {
- arg0->timers[3] = 0;
- }
- }
- }
-}
-
-// Mario Raceway Load piranha plant textures?
-void render_actor_piranha_plant(Camera *arg0, Mat4 arg1, struct PiranhaPlant *arg2) {
- UNUSED s32 pad;
- u8 *addr;
- s16 temp_lo = arg0 - camera1;
- s16 animationFrame; // unconfirmed
- s16 temp = arg2->flags;
- f32 temp_f0;
- s32 maxObjectsReached;
-
- if (temp & 0x800) { return; }
-
- temp_f0 = is_within_render_distance(arg0->pos, arg2->pos, arg0->rot[1], 0, gCameraZoom[arg0 - camera1], 1000000.0f);
-
- if (temp_f0 < 0.0f) {
-
- switch(temp_lo) {
- case 0:
- arg2->visibilityStates[0] = -1;
- break;
- case 1:
- arg2->visibilityStates[1] = -1;
- break;
- case 2:
- arg2->visibilityStates[2] = -1;
- break;
- case 3:
- arg2->visibilityStates[3] = -1;
- break;
-
- }
- return;
- }
- arg1[3][0] = arg2->pos[0];
- arg1[3][1] = arg2->pos[1];
- arg1[3][2] = arg2->pos[2];
- maxObjectsReached = render_set_position(arg1, 0) == 0;
- if (maxObjectsReached) { return; }
-
- if (90000.0f < temp_f0) {
-
- switch(temp_lo) {
- case 0:
- arg2->visibilityStates[0] = 0;
- break;
- case 1:
- arg2->visibilityStates[1] = 0;
- break;
- case 2:
- arg2->visibilityStates[2] = 0;
- break;
- case 3:
- arg2->visibilityStates[3] = 0;
- break;
- }
- animationFrame = 0;
-
- } else {
- switch(temp_lo) {
- case 0:
- arg2->visibilityStates[0] = 1;
- break;
- case 1:
- arg2->visibilityStates[1] = 1;
- break;
- case 2:
- arg2->visibilityStates[2] = 1;
- break;
- case 3:
- arg2->visibilityStates[3] = 1;
- break;
- }
-
- switch(temp_lo) {
- case 0:
- animationFrame = arg2->timers[0];
- break;
- case 1:
- animationFrame = arg2->timers[1];
- break;
- case 2:
- animationFrame = arg2->timers[2];
- break;
- case 3:
- animationFrame = arg2->timers[3];
- break;
- }
- }
- animationFrame /= 6;
-
- if (animationFrame > 8) {
- animationFrame = 8;
- }
- addr = D_802BA058 + (animationFrame << 0xB);
- gDPLoadTextureBlock(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(addr), G_IM_FMT_CI, G_IM_SIZ_8b, 32, 64, 0,
- G_TX_MIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
+#include "actors/train/update.inc.c"
+#include "actors/piranha_plant/update.inc.c"
- if (gCurrentCourseId == COURSE_MARIO_RACEWAY) {
- gSPDisplayList(gDisplayListHead++, &d_course_mario_raceway_dl_piranha_plant);
- } else {
- gSPDisplayList(gDisplayListHead++, &d_course_royal_raceway_dl_piranha_plant);
- }
-}
+#include "actors/piranha_plant/render.inc.c"
-void func_802986B4(Camera *camera, Mat4 arg1, UNUSED struct Actor *actor) {
+void render_cows(Camera *camera, Mat4 arg1, UNUSED struct Actor *actor) {
u16 temp_s1;
f32 temp_f0;
struct ActorSpawnData *var_t1;
@@ -743,7 +479,7 @@ void func_802986B4(Camera *camera, Mat4 arg1, UNUSED struct Actor *actor) {
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2);
var_s5 = NULL;
var_s1 = var_t1;
- while (var_s1->pos[0] != (-0x8000)) {
+ while (var_s1->pos[0] != END_OF_SPAWN_DATA) {
sp88[0] = var_s1->pos[0] * gCourseDirection;
sp88[1] = var_s1->pos[1];
sp88[2] = var_s1->pos[2];
@@ -799,17 +535,17 @@ void func_802986B4(Camera *camera, Mat4 arg1, UNUSED struct Actor *actor) {
}
}
-void func_80298AC0(Player *player) {
- Vec3f sp64;
+void evaluate_collision_player_palm_trees(Player *player) {
+ Vec3f pos;
s32 segment = SEGMENT_NUMBER2(d_course_dks_jungle_parkway_tree_spawn);
s32 offset = SEGMENT_OFFSET(d_course_dks_jungle_parkway_tree_spawn);
struct UnkActorSpawnData *data = (struct UnkActorSpawnData *) VIRTUAL_TO_PHYSICAL2(gSegmentTable[segment] + offset);
- while (data->pos[0] != -0x8000) {
- sp64[0] = data->pos[0] * gCourseDirection;
- sp64[1] = data->pos[1];
- sp64[2] = data->pos[2];
- if (func_8029EEB8(player, sp64, 5.0f, 40.0f, 0.8f) == 1) {
+ while (data->pos[0] != END_OF_SPAWN_DATA) {
+ pos[0] = data->pos[0] * gCourseDirection;
+ pos[1] = data->pos[1];
+ pos[2] = data->pos[2];
+ if (query_and_resolve_collision_player_actor(player, pos, 5.0f, 40.0f, 0.8f) == COLLISION) {
if ((player->effects & STAR_EFFECT) != 0) {
func_800C98B8(player->pos, player->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x10));
func_800C90F4((u8) (player - gPlayerOne), (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x0D));
@@ -824,13 +560,13 @@ void func_80298AC0(Player *player) {
}
}
-void func_80298C94(void) {
+void evaluate_collision_players_palm_trees(void) {
s32 index;
for (index = 0; index < 4; index++){
- // wtf is up with the << 0x18 >> 0x18? is it some weird type conversion?
- if (((gPlayers[index].type & 0xC000) != 0) && (((get_surface_type(gPlayers[index].unk_110.unk3A) << 0x18) >> 0x18) == 8)) {
- func_80298AC0(&gPlayers[index]);
+ // wtf is up with the << 0x18 >> 0x18? is it some weird type conversion? just use & 0xFF have the same effect to keep 8 first bit
+ if (((gPlayers[index].type & 0xC000) != 0) && (((get_surface_type(gPlayers[index].unk_110.unk3A) << 24) >> 24) == GRASS)) {
+ evaluate_collision_player_palm_trees(&gPlayers[index]);
}
}
}
@@ -840,14 +576,14 @@ void func_80298D10(void) {
s32 offset = SEGMENT_OFFSET(d_course_dks_jungle_parkway_tree_spawn);
struct UnkActorSpawnData *temp_v1 = (struct UnkActorSpawnData *) VIRTUAL_TO_PHYSICAL2(gSegmentTable[segment] + offset);
- while (temp_v1->pos[0] != -0x8000) {
+ while (temp_v1->pos[0] != END_OF_SPAWN_DATA) {
temp_v1->pos[1] = temp_v1->unk8;
temp_v1->someId &= 0xF;
temp_v1++;
}
}
-void func_80298D7C(Camera *camera, Mat4 arg1, UNUSED struct Actor *actor) {
+void render_palm_trees(Camera *camera, Mat4 arg1, UNUSED struct Actor *actor) {
s32 segment = SEGMENT_NUMBER2(d_course_dks_jungle_parkway_tree_spawn);
s32 offset = SEGMENT_OFFSET(d_course_dks_jungle_parkway_tree_spawn);
struct UnkActorSpawnData *var_s1 = (struct UnkActorSpawnData *)VIRTUAL_TO_PHYSICAL2(gSegmentTable[segment] + offset);
@@ -868,7 +604,7 @@ void func_80298D7C(Camera *camera, Mat4 arg1, UNUSED struct Actor *actor) {
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA);
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2);
- while (var_s1->pos[0] != -0x8000) {
+ while (var_s1->pos[0] != END_OF_SPAWN_DATA) {
test = var_s1->someId;
if (test & 0x0800) {
var_s1++;
@@ -925,278 +661,9 @@ dummylabel:
}
}
-void render_actor_tree_mario_raceway(Camera *camera, Mat4 arg1, struct Actor *arg2) {
- f32 temp_f0;
- s16 temp_v0 = arg2->flags;
-
- if ((temp_v0 & 0x800) != 0) { return; }
-
- temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 16000000.0f);
-
- if (temp_f0 < 0.0f) { return; }
-
- if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
- func_8029794C(arg2->pos, arg2->rot, 3.0f);
- }
- arg1[3][0] = arg2->pos[0];
- arg1[3][1] = arg2->pos[1];
- arg1[3][2] = arg2->pos[2];
-
- if (render_set_position(arg1, 0) != 0) {
- gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_trees_import);
- gSPDisplayList(gDisplayListHead++, d_course_mario_raceway_dl_tree);
- }
-}
-
-void render_actor_tree_yoshi_valley(Camera *camera, Mat4 arg1, struct Actor *arg2) {
- f32 temp_f0;
- s16 temp_v0 = arg2->flags;
-
- if ((temp_v0 & 0x800) != 0) { return; }
-
- temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
-
- if (temp_f0 < 0.0f) { return; }
-
- if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
- func_8029794C(arg2->pos, arg2->rot, 2.79999995f);
- }
- arg1[3][0] = arg2->pos[0];
- arg1[3][1] = arg2->pos[1];
- arg1[3][2] = arg2->pos[2];
-
- if (render_set_position(arg1, 0) != 0) {
- gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_trees_import);
- gSPDisplayList(gDisplayListHead++, d_course_yoshi_valley_dl_tree);
- }
-}
-
-void render_actor_tree_royal_raceway(Camera *camera, Mat4 arg1, struct Actor *arg2) {
- f32 temp_f0;
- s16 temp_v0 = arg2->flags;
-
- if ((temp_v0 & 0x800) != 0) { return; }
-
- temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
-
- if (temp_f0 < 0.0f) { return; }
-
- if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
- func_8029794C(arg2->pos, arg2->rot, 2.79999995f);
- }
- arg1[3][0] = arg2->pos[0];
- arg1[3][1] = arg2->pos[1];
- arg1[3][2] = arg2->pos[2];
-
- if (render_set_position(arg1, 0) != 0) {
- gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_trees_import);
- gSPDisplayList(gDisplayListHead++, d_course_royal_raceway_dl_tree);
- }
-}
-
-void render_actor_tree_moo_moo_farm(Camera *camera, Mat4 arg1, struct Actor *arg2) {
- f32 temp_f0;
- s16 temp_v0 = arg2->flags;
-
- if ((temp_v0 & 0x800) != 0) { return; }
-
- temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 6250000.0f);
-
- if (temp_f0 < 0.0f) { return; }
-
- if (((temp_v0 & 0x400) == 0) && (temp_f0 < 600.0f)) {
- func_8029794C(arg2->pos, arg2->rot, 5.0f);
- }
- arg1[3][0] = arg2->pos[0];
- arg1[3][1] = arg2->pos[1];
- arg1[3][2] = arg2->pos[2];
-
- if (render_set_position(arg1, 0) != 0) {
- gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_trees_import);
- gSPDisplayList(gDisplayListHead++, d_course_moo_moo_farm_dl_tree);
- }
-}
-
-void func_80299864(Camera *camera, Mat4 arg1, struct Actor *arg2) {
- f32 temp_f0;
- s16 temp_v0 = arg2->flags;
-
- if ((temp_v0 & 0x800) != 0) { return; }
-
- temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
+#include "actors/trees/render.inc.c"
- if (temp_f0 < 0.0f) { return; }
-
- if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
- func_8029794C(arg2->pos, arg2->rot, 2.79999995f);
- }
- arg1[3][0] = arg2->pos[0];
- arg1[3][1] = arg2->pos[1];
- arg1[3][2] = arg2->pos[2];
-
- if (render_set_position(arg1, 0) != 0) {
- gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_trees_import);
- // Why is a TLUT being used a DL here? That makes no sense
- // Based on the TLUT being loaded above, this ought to be be another
- // tree related DL, presumably one found in a course other than Moo Moo farm
- // 0x0600FC70
- gSPDisplayList(gDisplayListHead++, d_course_moo_moo_farm_mole_tlut);
- }
-}
-
-void render_actor_tree_bowser_castle(Camera *camera, Mat4 arg1, struct Actor *arg2) {
- f32 temp_f0;
- s16 temp_v0 = arg2->flags;
-
- if ((temp_v0 & 0x800) != 0) { return; }
-
- temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
-
- if (temp_f0 < 0.0f) { return; }
-
- if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
- func_8029794C(arg2->pos, arg2->rot, 2.79999995f);
- }
- arg1[3][0] = arg2->pos[0];
- arg1[3][1] = arg2->pos[1];
- arg1[3][2] = arg2->pos[2];
-
- if (render_set_position(arg1, 0) != 0) {
- gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_trees_import);
- gSPDisplayList(gDisplayListHead++, d_course_royal_raceway_dl_castle_tree);
- }
-}
-
-void render_actor_bush_bowser_castle(Camera *camera, Mat4 arg1, struct Actor *arg2) {
- f32 temp_f0;
- s16 temp_v0 = arg2->flags;
-
- if ((temp_v0 & 0x800) != 0) { return; }
-
- temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 640000.0f);
-
- if (temp_f0 < 0.0f) { return; }
-
- if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
- func_8029794C(arg2->pos, arg2->rot, 2.79999995f);
- }
- arg1[3][0] = arg2->pos[0];
- arg1[3][1] = arg2->pos[1];
- arg1[3][2] = arg2->pos[2];
-
- if (render_set_position(arg1, 0) != 0) {
- gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_trees_import);
- gSPDisplayList(gDisplayListHead++, d_course_bowsers_castle_dl_bush);
- }
-}
-
-void render_actor_tree_frappe_snowland(Camera *camera, Mat4 arg1, struct Actor *arg2) {
- f32 temp_f0;
- s16 temp_v0 = arg2->flags;
-
- if ((temp_v0 & 0x800) != 0) { return; }
-
- temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
-
- if (temp_f0 < 0.0f) { return; }
-
- if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
- func_8029794C(arg2->pos, arg2->rot, 2.79999995f);
- }
- arg1[3][0] = arg2->pos[0];
- arg1[3][1] = arg2->pos[1];
- arg1[3][2] = arg2->pos[2];
-
- if (render_set_position(arg1, 0) != 0) {
- gSPDisplayList(gDisplayListHead++, d_course_frappe_snowland_dl_tree);
- }
-}
-
-void render_actor_tree_cactus1_kalimari_desert(Camera *camera, Mat4 arg1, struct Actor *arg2) {
- f32 temp_f0;
- s16 temp_v0 = arg2->flags;
-
- if ((temp_v0 & 0x800) != 0) { return; }
-
- temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
-
- if (temp_f0 < 0.0f) { return; }
-
- if (((temp_v0 & 0x400) == 0) && (temp_f0 < 40000.0f)) {
- func_8029794C(arg2->pos, arg2->rot, 1.0f);
- }
- arg1[3][0] = arg2->pos[0];
- arg1[3][1] = arg2->pos[1];
- arg1[3][2] = arg2->pos[2];
-
- if (render_set_position(arg1, 0) != 0) {
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_cactus1);
- }
-}
-
-void render_actor_tree_cactus2_kalimari_desert(Camera *camera, Mat4 arg1, struct Actor *arg2) {
- f32 temp_f0;
- s16 temp_v0 = arg2->flags;
-
- if ((temp_v0 & 0x800) != 0) { return; }
-
- temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
-
- if (temp_f0 < 0.0f) { return; }
-
- if (((temp_v0 & 0x400) == 0) && (temp_f0 < 40000.0f)) {
- func_8029794C(arg2->pos, arg2->rot, 1.0f);
- }
- arg1[3][0] = arg2->pos[0];
- arg1[3][1] = arg2->pos[1];
- arg1[3][2] = arg2->pos[2];
-
- if (render_set_position(arg1, 0) != 0) {
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_cactus2);
- }
-}
-
-void render_actor_tree_cactus3_kalimari_desert(Camera *camera, Mat4 arg1, struct Actor *arg2) {
- f32 temp_f0;
- s16 temp_v0 = arg2->flags;
-
- if ((temp_v0 & 0x800) != 0) { return; }
-
- temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
-
- if (temp_f0 < 0.0f) { return; }
-
- if (((temp_v0 & 0x400) == 0) && (temp_f0 < 40000.0f)) {
- func_8029794C(arg2->pos, arg2->rot, 0.80000001f);
- }
- arg1[3][0] = arg2->pos[0];
- arg1[3][1] = arg2->pos[1];
- arg1[3][2] = arg2->pos[2];
-
- if (render_set_position(arg1, 0) != 0) {
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_cactus3);
- }
-}
-
-void render_actor_kiwano_fruit_dks_jungle_parkway(UNUSED Camera *camera, Mat4 arg1, struct Actor *actor) {
- uintptr_t addr;
- s32 maxObjectsReached;
-
- if (actor->state == 0) { return; }
-
- arg1[3][0] = actor->pos[0];
- arg1[3][1] = actor->pos[1];
- arg1[3][2] = actor->pos[2];
-
- maxObjectsReached = render_set_position(arg1, 0) == 0;
- if (maxObjectsReached) { return; }
-
- addr = (actor->rot[0] << 0xA) + 0x03009000; // Can this be a real symbol? Doesn't match.
- gDPLoadTextureBlock(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(addr),
- G_IM_FMT_CI, G_IM_SIZ_8b, 32, 32, 0, G_TX_NOMIRROR | G_TX_CLAMP,
- G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
- gSPDisplayList(gDisplayListHead++, d_course_dks_jungle_parkway_dl_kiwano_fruit);
-}
+#include "actors/kiwano_fruit/render.inc.c"
void render_actor_shell(Camera *camera, Mat4 matrix, struct ShellActor *shell) {
UNUSED s16 pad;
@@ -1216,11 +683,11 @@ void render_actor_shell(Camera *camera, Mat4 matrix, struct ShellActor *shell) {
f32 temp_f0 = is_within_render_distance(camera->pos, shell->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 490000.0f);
s32 maxObjectsReached;
if (temp_f0 < 0.0f) {
- func_80297230(camera, (struct Actor *)shell);
+ actor_not_rendered(camera, (struct Actor *)shell);
return;
}
- func_802972B8(camera, (struct Actor *) shell);
+ actor_rendered(camera, (struct Actor *) shell);
if (temp_f0 < 40000.0f) {
func_802979F8((struct Actor *) shell, 3.4f);
}
@@ -1261,105 +728,21 @@ UNUSED s16 D_802B8810[] = {
0x0000, 0x0000, 0xffff, 0xffff
};
-void render_actor_green_shell(Camera *camera, Mat4 matrix, struct ShellActor *shell) {
- gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_green_shell); // set texture
- render_actor_shell(camera, matrix, shell);
-}
+#include "actors/green_shell/render.inc.c"
-void render_actor_red_shell(Camera *camera, Mat4 matrix, struct ShellActor *shell) {
- gDPLoadTLUT_pal256(gDisplayListHead++, &gTLUTRedShell); // set texture
- render_actor_shell(camera, matrix, shell);
-}
+#include "actors/blue_and_red_shells/render.inc.c"
-// Middle of a tlut access
-void render_actor_blue_shell(Camera *camera, Mat4 matrix, struct ShellActor *shell) {
- gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_blue_shell); // set texture
- render_actor_shell(camera, matrix, shell);
-}
+#include "actors/banana/render.inc.c"
-// A little strange this render banana
-void render_actor_banana(Camera *camera, UNUSED Mat4 arg1, struct BananaActor *banana) {
- UNUSED s32 pad[2];
- s32 maxObjectsReached;
- Vec3s sp7C;
- Mat4 sp3C;
+#include "actors/wario_sign/update.inc.c"
- f32 temp = is_within_render_distance(camera->pos, banana->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 490000.0f);
- if (temp < 0.0f) {
- func_80297230(camera, (struct Actor *) banana);
- return;
- }
-
- if ((banana->pos[1] > D_8015F6EC + 800.0f)) {
- func_80297230(camera, (struct Actor *) banana);
- return;
- }
- if (banana->pos[1] < (D_8015F6EE - 800.0f)) {
- func_80297230(camera, (struct Actor *) banana);
- return;
- }
-
- func_802972B8(camera, (struct Actor *) banana);
-
- if (banana->state == 5) {
- mtxf_pos_rotation_xyz(sp3C, banana->pos, banana->rot);
- } else {
- sp7C[0] = 0;
- sp7C[1] = 0;
- sp7C[2] = 0;
- mtxf_pos_rotation_xyz(sp3C, banana->pos, sp7C);
- }
-
- maxObjectsReached = render_set_position(sp3C, 0) == 0;
- if (maxObjectsReached) { return; }
-
- if (banana->state != 5) {
- gSPDisplayList(gDisplayListHead++, &common_model_banana);
- } else {
- gSPDisplayList(gDisplayListHead++, &common_model_flat_banana);
- }
-}
+#include "actors/railroad_crossing/update.inc.c"
-void update_actor_wario_stadium_sign(struct Actor *arg0) {
- arg0->rot[1] += 0xB6;
-}
-
-/**
- * If train close activate bell sound according to timing
- **/
-void update_actor_railroad_crossing(struct RailroadCrossing *crossing) {
- // If train close?
- if (isCrossingTriggeredByIndex[crossing->crossingId] != 0) {
- // Timer++
- crossing->someTimer++;
- // Reset timer
- if (crossing->someTimer > 40) {
- crossing->someTimer = 1;
- }
- // Play Bell sound when timer hits 20 or 1.
- if ((crossing->someTimer == 1) || (crossing->someTimer == 20)) {
- func_800C98B8(crossing->pos, crossing->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x70, 0x16));
- }
- }
-}
-
-void update_actor_mario_raceway_sign(struct Actor *arg0) {
- if ((arg0->flags & 0x800) == 0) {
- if ((arg0->flags & 0x400) != 0) {
- arg0->pos[1] += 4.0f;
- if (arg0->pos[1] > 800.0f) {
- arg0->flags |= 0x800;
- arg0->rot[1] += 1820;
- }
- } else {
- arg0->rot[1] += 182;
- }
- }
-}
+#include "actors/mario_sign/update.inc.c"
UNUSED void func_8029ABD4(f32 *pos, s16 state) {
gNumActors = 0;
- gActorList[func_8029ED38(pos, 0x0014)].state = state;
+ gActorList[spawn_actor_at_pos(pos, ACTOR_UNKNOWN_0x14)].state = state;
}
void func_8029AC18(Camera *camera, Mat4 arg1, struct Actor *arg2) {
@@ -1407,495 +790,19 @@ UNUSED void func_8029AE14() {
#include "actors/paddle_boat/render.inc.c"
-void func_8029B06C(Camera *arg0, struct Actor *arg1) {
- UNUSED s32 pad[6];
- Mat4 spD8;
- UNUSED s32 pad2[32];
- f32 temp_f0 = is_within_render_distance(arg0->pos, arg1->pos, arg0->rot[1], 2500.0f, gCameraZoom[arg0 - camera1], 9000000.0f);
- if (temp_f0 < 0.0f) { return; }
-
- gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
- gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
-
- mtxf_pos_rotation_xyz(spD8, arg1->pos, arg1->rot);
- if (render_set_position(spD8, 0) != 0) {
-
- switch(arg1->state) {
- case 0:
- gSPDisplayList(gDisplayListHead++, &d_course_toads_turnpike_dl_23858);
- break;
- case 1:
- gSPDisplayList(gDisplayListHead++, &d_course_toads_turnpike_dl_238A0);
- break;
- case 2:
- gSPDisplayList(gDisplayListHead++, &d_course_toads_turnpike_dl_238E8);
- break;
- }
-
- if (gActiveScreenMode == SCREEN_MODE_1P) {
- if (temp_f0 < 160000.0f) {
- gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_0);
- } else if (temp_f0 < 640000.0f) {
- gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_1);
- } else {
- gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_2);
- }
- } else if (temp_f0 < 160000.0f) {
- gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_1);
- } else {
- gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_2);
- }
- }
-}
+#include "actors/box_truck/render.inc.c"
-void func_8029B2E4(Camera *arg0, struct Actor *arg1) {
- UNUSED s32 pad[6];
- Mat4 spC8;
- UNUSED s32 pad2[32];
- f32 temp_f0;
+#include "actors/school_bus/render.inc.c"
- temp_f0 = is_within_render_distance(arg0->pos, arg1->pos, arg0->rot[1], 2500.0f, gCameraZoom[arg0 - camera1], 9000000.0f);
- if (temp_f0 < 0.0f) { return; }
+#include "actors/car/render.inc.c"
- gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
- gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
+#include "actors/tanker_truck/render.inc.c"
+#include "actors/train/render.inc.c"
- mtxf_pos_rotation_xyz(spC8, arg1->pos, arg1->rot);
- if (render_set_position(spC8, 0) != 0) {
+#include "actors/falling_rock/render.inc.c"
- if (gActiveScreenMode == SCREEN_MODE_1P) {
- if (temp_f0 < 160000.0f) {
- gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_3);
- } else if (temp_f0 < 640000.0f) {
- gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_4);
- } else {
- gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_5);
- }
- } else if (temp_f0 < 160000.0f) {
- gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_4);
- } else {
- gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_5);
- }
- }
-}
-
-void func_8029B4E0(Camera *arg0, struct Actor *arg1) {
- UNUSED s32 pad[6];
- Mat4 spC8;
- UNUSED s32 pad2[32];
- f32 temp_f0 = is_within_render_distance(arg0->pos,arg1->pos, arg0->rot[1], 2500.0f, gCameraZoom[arg0 - camera1], 9000000.0f);
-
- if (!(temp_f0 < 0.0f)) {
-
- gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
- gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
-
-
- mtxf_pos_rotation_xyz(spC8, arg1->pos, arg1->rot);
- mtxf_scale(spC8, 0.1f);
- if (render_set_position(spC8, 0) != 0) {
-
- if (gActiveScreenMode == SCREEN_MODE_1P) {
- if (temp_f0 < 160000.0f) {
- gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_9);
- } else if (temp_f0 < 640000.0f) {
- gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_10);
- } else {
- gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_11);
- }
- } else if (temp_f0 < 160000.0f) {
- gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_10);
- } else {
- gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_11);
- }
- }
- }
-}
-
-void func_8029B6EC(Camera *camera, struct Actor* arg1) {
- UNUSED s32 pad[6];
- Mat4 spC8;
- UNUSED s32 pad2[32];
- f32 temp_f0 = is_within_render_distance(camera->pos, arg1->pos, camera->rot[1], 2500.0f, gCameraZoom[camera - camera1], 9000000.0f);
-
- if (!(temp_f0 < 0.0f)) {
-
- gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
- gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
-
- mtxf_pos_rotation_xyz(spC8, arg1->pos, arg1->rot);
- if (render_set_position(spC8, 0) != 0) {
-
- if (gActiveScreenMode == SCREEN_MODE_1P) {
- if (temp_f0 < 160000.0f) {
-
- gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_6);
- } else if (temp_f0 < 640000.0f) {
- gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_7);
- } else {
- gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_8);
- }
- } else if (temp_f0 < 160000.0f) {
- gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_7);
- } else {
- gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_8);
- }
- }
- }
-}
-
-// Spins train wheels?
-void render_actor_train_engine(Camera *camera, struct TrainCar *actor) {
- UNUSED s32 pad[2];
- s32 maxObjectsReached;
- Vec3f sp160;
- Mat4 sp120;
- Mat4 spE0;
- Mat4 spA0;
-
- f32 distance = is_within_render_distance(camera->pos, actor->pos, camera->rot[1], 2500.0f, gCameraZoom[camera - camera1], 9000000.0f);
-
- if (distance < 0.0f) { return; }
-
- gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
-
- mtxf_pos_rotation_xyz(sp120, actor->pos, actor->rot);
- maxObjectsReached = render_set_position(sp120, 0) == 0;
- if (maxObjectsReached) { return; }
-
- if (distance < 122500.0f) {
-
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1C0F0);
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1B978);
-
- } else if (distance < 640000.0f) {
-
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1D670);
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1D160);
- } else {
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1E910);
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1E480);
- }
- if (1440000.0f < distance) { return; }
-
- gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22D28);
-
- mtxf_rotate_x(sp120, actor->wheelRot);
- vec3f_set(sp160, 17.0f, 6.0f, 32.0f);
- mtxf_translate(spE0, sp160);
- mtxf_multiplication(spA0, sp120, spE0);
-
- maxObjectsReached = render_set_position(spA0, 3) == 0;
- if (maxObjectsReached) { return; }
-
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
- gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
-
- mtxf_rotate_x(sp120, actor->wheelRot);
- vec3f_set(sp160, -17.0, 6.0f, 32.0f);
- mtxf_translate(spE0, sp160);
- mtxf_multiplication(spA0, sp120, spE0);
-
- maxObjectsReached = render_set_position(spA0, 3) == 0;
- if (maxObjectsReached) { return; }
-
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
- gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
-
- mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x16C));
- vec3f_set(sp160, 17.0f, 6.0f, 16.0f);
- mtxf_translate(spE0, sp160);
- mtxf_multiplication(spA0, sp120, spE0);
-
- maxObjectsReached = render_set_position(spA0, 3) == 0;
- if (maxObjectsReached) { return; }
-
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
- gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
-
- mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x16C));
- vec3f_set(sp160, -17.0f, 6.0f, 16.0f);
- mtxf_translate(spE0, sp160);
- mtxf_multiplication(spA0, sp120, spE0);
-
- maxObjectsReached = render_set_position(spA0, 3) == 0;
- if (maxObjectsReached) { return; }
-
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
- gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
-
- mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x444));
- vec3f_set(sp160, 17.0f, 12.0f, -12.0f);
- mtxf_translate(spE0, sp160);
- mtxf_multiplication(spA0, sp120, spE0);
-
- maxObjectsReached = render_set_position(spA0, 3) == 0;
- if (maxObjectsReached) { return; }
-
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22D70);
- gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
-
- mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x444));
- vec3f_set(sp160, -17.0f, 12.0f, -12.0f);
- mtxf_translate(spE0, sp160);
- mtxf_multiplication(spA0, sp120, spE0);
-
- maxObjectsReached = render_set_position(spA0, 3) == 0;
- if (maxObjectsReached) { return; }
-
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22D70);
- gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
-
- mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x2D8));
- vec3f_set(sp160, 17.0f, 12.0f, -34.0f);
- mtxf_translate(spE0, sp160);
- mtxf_multiplication(spA0, sp120, spE0);
-
- maxObjectsReached = render_set_position(spA0, 3) == 0;
- if (maxObjectsReached) { return; }
-
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22D70);
- gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
-
- mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x2D8));
- vec3f_set(sp160, -17.0f, 12.0f, -34.0f);
- mtxf_translate(spE0, sp160);
- mtxf_multiplication(spA0, sp120, spE0);
-
- maxObjectsReached = render_set_position(spA0, 3) == 0;
- if (maxObjectsReached) { return; }
-
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22D70);
- gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
- gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
-}
-
-void render_actor_train_tender(Camera *camera, struct TrainCar *actor) {
- Mat4 sp120;
- Vec3f sp160;
- Mat4 spE0;
- Mat4 spA0;
-
- f32 temp_f0 = is_within_render_distance(camera->pos, actor->pos, camera->rot[1], 625.0f, gCameraZoom[camera - camera1], 9000000.0f);
-
- if (temp_f0 < 0.0f) { return; }
-
- gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
-
- mtxf_pos_rotation_xyz(sp120, actor->pos, actor->rot);
- if (render_set_position(sp120, 0) == 0) { return; }
-
- if (temp_f0 < 250000.0f) {
-
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1F228);
-
- } else if (temp_f0 < 1000000.0f) {
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1F708);
- } else {
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1FAF8);
- }
- if (1440000.0f < temp_f0) { return; }
-
- gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22D28);
-
- mtxf_rotate_x(sp120, actor->wheelRot);
- vec3f_set(sp160, 17.0f, 6.0f, 8.0f);
- mtxf_translate(spE0, sp160);
- mtxf_multiplication(spA0, sp120, spE0);
-
- if (render_set_position(spA0, 3) == 0) { return; }
-
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
- gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
-
- mtxf_rotate_x(sp120, actor->wheelRot);
- vec3f_set(sp160, -17.0, 6.0f, 8.0f);
- mtxf_translate(spE0, sp160);
- mtxf_multiplication(spA0, sp120, spE0);
-
- if (render_set_position(spA0, 3) == 0) { return; }
-
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
- gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
-
- mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x444));
- vec3f_set(sp160, 17.0f, 6.0f, -8.0f);
- mtxf_translate(spE0, sp160);
- mtxf_multiplication(spA0, sp120, spE0);
-
- if (render_set_position(spA0, 3) == 0) { return; }
-
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
- gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
-
- mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x444));
- vec3f_set(sp160, -17.0f, 6.0f, -8.0f);
- mtxf_translate(spE0, sp160);
- mtxf_multiplication(spA0, sp120, spE0);
-
- if (render_set_position(spA0, 3) == 0) { return; }
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
- gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
- gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
-}
-
-void render_actor_passenger_car(Camera *camera, struct TrainCar *actor) {
- Mat4 sp120;
- Vec3f sp160;
- Mat4 spE0;
- Mat4 spA0;
-
- f32 temp_f0 = is_within_render_distance(camera->pos, actor->pos, camera->rot[1], 2025.0f, gCameraZoom[camera - camera1], 9000000.0f);
-
- if (temp_f0 < 0.0f) { return; }
-
- gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
-
- mtxf_pos_rotation_xyz(sp120, actor->pos, actor->rot);
-
- if (render_set_position(sp120, 0) == 0) { return; }
-
- if (temp_f0 < 250000.0f) {
-
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_20A20);
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_20A08);
-
- } else if (temp_f0 < 1000000.0f) {
-
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_21550);
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_21220);
- } else {
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_21C90);
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_21A80);
- }
- if (1440000.0f < temp_f0) { return; }
-
- gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22D28);
-
- mtxf_rotate_x(sp120, actor->wheelRot);
- vec3f_set(sp160, 17.0f, 6.0f, 28.0f);
- mtxf_translate(spE0, sp160);
- mtxf_multiplication(spA0, sp120, spE0);
-
- if (render_set_position(spA0, 3) == 0) { return; }
-
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
- gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
-
- mtxf_rotate_x(sp120, actor->wheelRot);
- vec3f_set(sp160, -17.0, 6.0f, 28.0f);
- mtxf_translate(spE0, sp160);
- mtxf_multiplication(spA0, sp120, spE0);
-
- if (render_set_position(spA0, 3) == 0) { return; }
-
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
- gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
-
- mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x222));
- vec3f_set(sp160, 17.0f, 6.0f, 12.0f);
- mtxf_translate(spE0, sp160);
- mtxf_multiplication(spA0, sp120, spE0);
-
- if (render_set_position(spA0, 3) == 0) { return; }
-
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
- gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
-
- mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x222));
- vec3f_set(sp160, -17.0f, 6.0f, 12.0f);
- mtxf_translate(spE0, sp160);
- mtxf_multiplication(spA0, sp120, spE0);
-
- if (render_set_position(spA0, 3) == 0) { return; }
-
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
- gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
-
- mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x5B0));
- vec3f_set(sp160, 17.0f, 6.0f, -8.0f);
- mtxf_translate(spE0, sp160);
- mtxf_multiplication(spA0, sp120, spE0);
-
- if (render_set_position(spA0, 3) == 0) { return; }
-
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
- gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
-
- mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x5B0));
- vec3f_set(sp160, -17.0f, 6.0f, -8.0f);
- mtxf_translate(spE0, sp160);
- mtxf_multiplication(spA0, sp120, spE0);
-
- if (render_set_position(spA0, 3) == 0) { return; }
-
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
- gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
-
- mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x16C));
- vec3f_set(sp160, 17.0f, 6.0f, -24.0f);
- mtxf_translate(spE0, sp160);
- mtxf_multiplication(spA0, sp120, spE0);
-
- if (render_set_position(spA0, 3) == 0) { return; }
-
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
- gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
-
- mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x16C));
- vec3f_set(sp160, -17.0f, 6.0f, -24.0f);
- mtxf_translate(spE0, sp160);
- mtxf_multiplication(spA0, sp120, spE0);
-
- if (render_set_position(spA0, 3) == 0) { return; }
-
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
- gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
- gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
-}
-
-void render_actor_falling_rock(Camera *camera, struct FallingRock *rock) {
- Vec3s sp98;
- Vec3f sp8C;
- Mat4 sp4C;
- f32 temp_f0;
- UNUSED s32 pad[4];
-
- if (rock->respawnTimer != 0) { return; }
-
- temp_f0 = is_within_render_distance(camera->pos, rock->pos, camera->rot[1], 400.0f, gCameraZoom[camera - camera1], 4000000.0f);
-
- if (temp_f0 < 0.0f) { return; }
-
- if (temp_f0 < 250000.0f) {
-
- if (rock->unk30.unk34 == 1) {
- sp8C[0] = rock->pos[0];
- sp8C[2] = rock->pos[2];
- temp_f0 = func_802ABE30(sp8C[0], rock->pos[1], sp8C[2], rock->unk30.unk3A);
- sp98[0] = 0;
- sp98[1] = 0;
- sp98[2] = 0;
- sp8C[1] = temp_f0 + 2.0f;
- mtxf_pos_rotation_xyz(sp4C, sp8C, sp98);
- if (render_set_position(sp4C, 0) == 0) {
- return;
- }
- gSPDisplayList(gDisplayListHead++, d_course_choco_mountain_dl_6F88);
- }
- }
- mtxf_pos_rotation_xyz(sp4C, rock->pos, rock->rot);
- if (render_set_position(sp4C, 0) == 0) {
- return;
- }
- gSPDisplayList(gDisplayListHead++, d_course_choco_mountain_dl_falling_rock);
-}
-
-void place_piranha_plants(struct ActorSpawnData *spawnData) {
+void spawn_piranha_plants(struct ActorSpawnData *spawnData) {
s32 segment = SEGMENT_NUMBER2(spawnData);
s32 offset = SEGMENT_OFFSET(spawnData);
struct ActorSpawnData *temp_s0 = (struct ActorSpawnData *) VIRTUAL_TO_PHYSICAL2(gSegmentTable[segment] + offset);
@@ -1909,11 +816,11 @@ void place_piranha_plants(struct ActorSpawnData *spawnData) {
vec3f_set(startingVelocity, 0, 0, 0);
vec3s_set(startingRot, 0, 0, 0);
- while (temp_s0->pos[0] != -0x8000) {
+ while (temp_s0->pos[0] != END_OF_SPAWN_DATA) {
startingPos[0] = temp_s0->pos[0] * gCourseDirection;
startingPos[1] = temp_s0->pos[1];
startingPos[2] = temp_s0->pos[2];
- temp = addActorToEmptySlot(startingPos, startingRot, startingVelocity, ACTOR_PIRANHA_PLANT);
+ temp = add_actor_to_empty_slot(startingPos, startingRot, startingVelocity, ACTOR_PIRANHA_PLANT);
temp_v1 = (struct PiranhaPlant *) &gActorList[temp];
temp_v1->visibilityStates[0] = 0;
temp_v1->visibilityStates[1] = 0;
@@ -1927,7 +834,7 @@ void place_piranha_plants(struct ActorSpawnData *spawnData) {
}
}
-void place_palm_trees(struct ActorSpawnData *spawnData) {
+void spawn_palm_trees(struct ActorSpawnData *spawnData) {
s32 segment = SEGMENT_NUMBER2(spawnData);
s32 offset = SEGMENT_OFFSET(spawnData);
struct ActorSpawnData *temp_s0 = (struct ActorSpawnData *) VIRTUAL_TO_PHYSICAL2(gSegmentTable[segment] + offset);
@@ -1940,21 +847,21 @@ void place_palm_trees(struct ActorSpawnData *spawnData) {
vec3f_set(startingVelocity, 0, 0, 0);
vec3s_set(startingRot, 0, 0, 0);
- while (temp_s0->pos[0] != -0x8000) {
+ while (temp_s0->pos[0] != END_OF_SPAWN_DATA) {
startingPos[0] = temp_s0->pos[0] * gCourseDirection;
startingPos[1] = temp_s0->pos[1];
startingPos[2] = temp_s0->pos[2];
- temp = addActorToEmptySlot(startingPos, startingRot, startingVelocity, ACTOR_PALM_TREE);
+ temp = add_actor_to_empty_slot(startingPos, startingRot, startingVelocity, ACTOR_PALM_TREE);
temp_v1 = (struct PalmTree *) &gActorList[temp];
- temp_v1->visibilityStates[0] = temp_s0->someId;
+ temp_v1->variant = temp_s0->someId;
func_802ADDC8((Collision *) &temp_v1->unk30, 5.0f, temp_v1->pos[0], temp_v1->pos[1], temp_v1->pos[2]);
- func_802976EC((Collision *) &temp_v1->unk30, temp_v1->unk10);
+ func_802976EC((Collision *) &temp_v1->unk30, temp_v1->rot);
temp_s0++;
}
}
-#include "actors/falling_rocks.inc.c"
+#include "actors/falling_rock/update.inc.c"
// Trees, cacti, shrubs, etc.
void spawn_foliage(struct ActorSpawnData *arg0) {
@@ -1975,7 +882,7 @@ void spawn_foliage(struct ActorSpawnData *arg0) {
rotation[1] = 0;
rotation[2] = 0;
- while (var_s3->pos[0] != (-0x8000)) {
+ while (var_s3->pos[0] != END_OF_SPAWN_DATA) {
position[0] = var_s3->pos[0] * gCourseDirection;
position[2] = var_s3->pos[2];
position[1] = var_s3->pos[1];
@@ -2024,7 +931,7 @@ void spawn_foliage(struct ActorSpawnData *arg0) {
break;
}
- temp_s0 = &gActorList[addActorToEmptySlot(position, rotation, velocity, actorType)];
+ temp_s0 = &gActorList[add_actor_to_empty_slot(position, rotation, velocity, actorType)];
if (gGamestate == CREDITS_SEQUENCE) {
func_802976D8(temp_s0->rot);
} else {
@@ -2038,7 +945,7 @@ void spawn_foliage(struct ActorSpawnData *arg0) {
}
}
-void place_all_item_boxes(struct ActorSpawnData *spawnData) {
+void spawn_all_item_boxes(struct ActorSpawnData *spawnData) {
s32 segment = SEGMENT_NUMBER2(spawnData);
s32 offset = SEGMENT_OFFSET(spawnData);
s16 temp_s1;
@@ -2052,14 +959,14 @@ void place_all_item_boxes(struct ActorSpawnData *spawnData) {
if ((gModeSelection == TIME_TRIALS) || (gPlaceItemBoxes == 0)) { return; }
vec3f_set(startingVelocity, 0, 0, 0);
- while(temp_s0->pos[0] != -0x8000) {
+ while(temp_s0->pos[0] != END_OF_SPAWN_DATA) {
startingPos[0] = temp_s0->pos[0] * gCourseDirection;
startingPos[1] = temp_s0->pos[1];
startingPos[2] = temp_s0->pos[2];
startingRot[0] = random_u16();
startingRot[1] = random_u16();
startingRot[2] = random_u16();
- temp_s1 = addActorToEmptySlot(startingPos, startingRot, startingVelocity, ACTOR_ITEM_BOX);
+ temp_s1 = add_actor_to_empty_slot(startingPos, startingRot, startingVelocity, ACTOR_ITEM_BOX);
temp_f0 = func_802AE1C0(startingPos[0], startingPos[1] + 10.0f, startingPos[2]);
// Should be struct ItemBox but not enough space in the stack.
@@ -2096,7 +1003,7 @@ void init_kiwano_fruit(void) {
if ((phi_s1->type & 0x4000) == 0) { continue; }
if ((phi_s1->type & 0x100) != 0) { continue; }
- phi_s0 = addActorToEmptySlot(sp64, sp50, sp58, ACTOR_KIWANO_FRUIT);
+ phi_s0 = add_actor_to_empty_slot(sp64, sp50, sp58, ACTOR_KIWANO_FRUIT);
actor = &gActorList[phi_s0];
actor->unk_04 = i;
}
@@ -2120,7 +1027,7 @@ void destroy_all_actors(void) {
}
}
-void place_course_actors(void) {
+void spawn_course_actors(void) {
UNUSED s32 pad;
Vec3f position;
Vec3f velocity = { 0.0f, 0.0f, 0.0f };
@@ -2132,122 +1039,127 @@ void place_course_actors(void) {
switch (gCurrentCourseId) {
case COURSE_MARIO_RACEWAY:
spawn_foliage(d_course_mario_raceway_tree_spawns);
- place_piranha_plants(d_course_mario_raceway_piranha_plant_spawns);
- place_all_item_boxes(d_course_mario_raceway_item_box_spawns);
+ spawn_piranha_plants(d_course_mario_raceway_piranha_plant_spawns);
+ spawn_all_item_boxes(d_course_mario_raceway_item_box_spawns);
vec3f_set(position, 150.0f, 40.0f, -1300.0f);
position[0] *= gCourseDirection;
- addActorToEmptySlot(position, rotation, velocity, ACTOR_MARIO_SIGN);
+ add_actor_to_empty_slot(position, rotation, velocity, ACTOR_MARIO_SIGN);
vec3f_set(position, 2520.0f, 0.0f, 1240.0f);
position[0] *= gCourseDirection;
- actor = &gActorList[addActorToEmptySlot(position, rotation, velocity, ACTOR_MARIO_SIGN)];
+ actor = &gActorList[add_actor_to_empty_slot(position, rotation, velocity, ACTOR_MARIO_SIGN)];
actor->flags |= 0x4000;
break;
case COURSE_CHOCO_MOUNTAIN:
- place_all_item_boxes(d_course_choco_mountain_item_box_spawns);
- place_falling_rocks(d_course_choco_mountain_falling_rock_spawns);
+ spawn_all_item_boxes(d_course_choco_mountain_item_box_spawns);
+ spawn_falling_rocks(d_course_choco_mountain_falling_rock_spawns);
break;
case COURSE_BOWSER_CASTLE:
spawn_foliage(d_course_bowsers_castle_tree_spawn);
- place_all_item_boxes(d_course_bowsers_castle_item_box_spawns);
+ spawn_all_item_boxes(d_course_bowsers_castle_item_box_spawns);
break;
case COURSE_BANSHEE_BOARDWALK:
- place_all_item_boxes(d_course_banshee_boardwalk_item_box_spawns);
+ spawn_all_item_boxes(d_course_banshee_boardwalk_item_box_spawns);
break;
case COURSE_YOSHI_VALLEY:
spawn_foliage(d_course_yoshi_valley_tree_spawn);
- place_all_item_boxes(d_course_yoshi_valley_item_box_spawns);
+ spawn_all_item_boxes(d_course_yoshi_valley_item_box_spawns);
vec3f_set(position, -2300.0f, 0.0f, 634.0f);
position[0] *= gCourseDirection;
- addActorToEmptySlot(position, rotation, velocity, ACTOR_YOSHI_VALLEY_EGG);
+ add_actor_to_empty_slot(position, rotation, velocity, ACTOR_YOSHI_EGG);
break;
case COURSE_FRAPPE_SNOWLAND:
spawn_foliage(d_course_frappe_snowland_tree_spawns);
- place_all_item_boxes(d_course_frappe_snowland_item_box_spawns);
+ spawn_all_item_boxes(d_course_frappe_snowland_item_box_spawns);
break;
case COURSE_KOOPA_BEACH:
- func_802A14BC(328.0f * gCourseDirection, 70.0f, 2541.0f);
- place_all_item_boxes(d_course_koopa_troopa_beach_item_box_spawns);
- place_palm_trees(d_course_koopa_troopa_beach_tree_spawn);
+ init_actor_hot_air_balloon_item_box(328.0f * gCourseDirection, 70.0f, 2541.0f);
+ spawn_all_item_boxes(d_course_koopa_troopa_beach_item_box_spawns);
+ spawn_palm_trees(d_course_koopa_troopa_beach_tree_spawn);
break;
case COURSE_ROYAL_RACEWAY:
spawn_foliage(d_course_royal_raceway_tree_spawn);
- place_all_item_boxes(d_course_royal_raceway_item_box_spawns);
- place_piranha_plants(d_course_royal_raceway_piranha_plant_spawn);
+ spawn_all_item_boxes(d_course_royal_raceway_item_box_spawns);
+ spawn_piranha_plants(d_course_royal_raceway_piranha_plant_spawn);
break;
case COURSE_LUIGI_RACEWAY:
spawn_foliage(d_course_luigi_raceway_tree_spawn);
- place_all_item_boxes(d_course_luigi_raceway_item_box_spawns);
+ spawn_all_item_boxes(d_course_luigi_raceway_item_box_spawns);
break;
case COURSE_MOO_MOO_FARM:
if (gPlayerCountSelection1 != 4) {
spawn_foliage(d_course_moo_moo_farm_tree_spawn);
}
- place_all_item_boxes(d_course_moo_moo_farm_item_box_spawns);
+ spawn_all_item_boxes(d_course_moo_moo_farm_item_box_spawns);
break;
case COURSE_TOADS_TURNPIKE:
- place_all_item_boxes(d_course_toads_turnpike_item_box_spawns);
+ spawn_all_item_boxes(d_course_toads_turnpike_item_box_spawns);
break;
case COURSE_KALAMARI_DESERT:
spawn_foliage(d_course_kalimari_desert_cactus_spawn);
- place_all_item_boxes(d_course_kalimari_desert_item_box_spawns);
+ spawn_all_item_boxes(d_course_kalimari_desert_item_box_spawns);
vec3f_set(position, -1680.0f, 2.0f, 35.0f);
position[0] *= gCourseDirection;
- rrxing = (struct RailroadCrossing *)&gActorList[addActorToEmptySlot(position, rotation, velocity, ACTOR_RAILROAD_CROSSING)];
+ rrxing = (struct RailroadCrossing *)&gActorList[add_actor_to_empty_slot(position, rotation, velocity, ACTOR_RAILROAD_CROSSING)];
rrxing->crossingId = 1;
vec3f_set(position, -1600.0f, 2.0f, 35.0f);
position[0] *= gCourseDirection;
- rrxing = (struct RailroadCrossing *)&gActorList[addActorToEmptySlot(position, rotation, velocity, ACTOR_RAILROAD_CROSSING)];
+ rrxing = (struct RailroadCrossing *)&gActorList[add_actor_to_empty_slot(position, rotation, velocity, ACTOR_RAILROAD_CROSSING)];
rrxing->crossingId = 1;
vec3s_set(rotation, 0, -0x2000, 0);
vec3f_set(position, -2459.0f, 2.0f, 2263.0f);
position[0] *= gCourseDirection;
- rrxing = (struct RailroadCrossing *)&gActorList[addActorToEmptySlot(position, rotation, velocity, ACTOR_RAILROAD_CROSSING)];
+ rrxing = (struct RailroadCrossing *)&gActorList[add_actor_to_empty_slot(position, rotation, velocity, ACTOR_RAILROAD_CROSSING)];
rrxing->crossingId = 0;
vec3f_set(position, -2467.0f, 2.0f, 2375.0f);
position[0] *= gCourseDirection;
- rrxing = (struct RailroadCrossing *)&gActorList[addActorToEmptySlot(position, rotation, velocity, ACTOR_RAILROAD_CROSSING)];
+ rrxing = (struct RailroadCrossing *)&gActorList[add_actor_to_empty_slot(position, rotation, velocity, ACTOR_RAILROAD_CROSSING)];
rrxing->crossingId = 0;
break;
case COURSE_SHERBET_LAND:
- place_all_item_boxes(d_course_sherbet_land_item_box_spawns);
+ spawn_all_item_boxes(d_course_sherbet_land_item_box_spawns);
break;
case COURSE_RAINBOW_ROAD:
- place_all_item_boxes(d_course_rainbow_road_item_box_spawns);
+ spawn_all_item_boxes(d_course_rainbow_road_item_box_spawns);
break;
case COURSE_WARIO_STADIUM:
- place_all_item_boxes(d_course_wario_stadium_item_box_spawns);
+ spawn_all_item_boxes(d_course_wario_stadium_item_box_spawns);
vec3f_set(position, -131.0f, 83.0f, 286.0f);
position[0] *= gCourseDirection;
- addActorToEmptySlot(position, rotation, velocity, ACTOR_WARIO_SIGN);
+ add_actor_to_empty_slot(position, rotation, velocity, ACTOR_WARIO_SIGN);
vec3f_set(position, -2353.0f, 72.0f, -1608.0f);
position[0] *= gCourseDirection;
- addActorToEmptySlot(position, rotation, velocity, ACTOR_WARIO_SIGN);
+ add_actor_to_empty_slot(position, rotation, velocity, ACTOR_WARIO_SIGN);
vec3f_set(position, -2622.0f, 79.0f, 739.0f);
position[0] *= gCourseDirection;
- addActorToEmptySlot(position, rotation, velocity, ACTOR_WARIO_SIGN);
+ add_actor_to_empty_slot(position, rotation, velocity, ACTOR_WARIO_SIGN);
break;
case COURSE_BLOCK_FORT:
- place_all_item_boxes(d_course_block_fort_item_box_spawns);
+ spawn_all_item_boxes(d_course_block_fort_item_box_spawns);
break;
case COURSE_SKYSCRAPER:
- place_all_item_boxes(d_course_skyscraper_item_box_spawns);
+ spawn_all_item_boxes(d_course_skyscraper_item_box_spawns);
break;
case COURSE_DOUBLE_DECK:
- place_all_item_boxes(d_course_double_deck_item_box_spawns);
+ spawn_all_item_boxes(d_course_double_deck_item_box_spawns);
break;
case COURSE_DK_JUNGLE:
- place_all_item_boxes(d_course_dks_jungle_parkway_item_box_spawns);
+ spawn_all_item_boxes(d_course_dks_jungle_parkway_item_box_spawns);
init_kiwano_fruit();
func_80298D10();
break;
case COURSE_BIG_DONUT:
- place_all_item_boxes(d_course_big_donut_item_box_spawns);
+ spawn_all_item_boxes(d_course_big_donut_item_box_spawns);
break;
}
gNumPermanentActors = gNumActors;
}
-void func_8029E158(void) {
+/**
+ * @brief Loads actor textures, course specific actor textures.
+ * Calls to init_course_vehicles and place_course_actors
+ *
+ */
+void init_actors_and_load_textures(void) {
set_segment_base_addr(3, (void *) gNextFreeMemoryAddress);
D_802BA050 = dma_textures(gTextureGreenShell0, 0x00000257U, 0x00000400U);
dma_textures(gTextureGreenShell1, 0x00000242U, 0x00000400U);
@@ -2344,22 +1256,22 @@ void func_8029E158(void) {
}
init_red_shell_texture();
destroy_all_actors();
- place_course_actors();
+ spawn_course_actors();
init_course_vehicles();
}
-void func_8029E7DC(struct Actor *actor) {
- s16 temp_v0 = actor->flags;
+void play_sound_before_despawn(struct Actor *actor) {
+ s16 flags = actor->flags;
- if ((temp_v0 & 0x200) != 0) {
+ if ((flags & 0x200) != 0) {
func_800C99E0(actor->pos, SOUND_ARG_LOAD(0x19, 0x01, 0x90, 0x53));
return;
}
- if ((temp_v0 & 0x100) != 0) {
+ if ((flags & 0x100) != 0) {
func_800C99E0(actor->pos, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x10));
return;
}
- if ((temp_v0 & 0x80) != 0) {
+ if ((flags & 0x80) != 0) {
func_800C99E0(actor->pos, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x54));
}
}
@@ -2377,16 +1289,17 @@ void func_8029E7DC(struct Actor *actor) {
* @param Actor to destroy
*/
void destroy_actor(struct Actor *actor) {
- func_8029E7DC(actor);
+ play_sound_before_despawn(actor);
actor->flags = 0;
actor->type = 0;
gNumActors--;
}
-s16 func_8029E890(Vec3f pos, Vec3s rot, Vec3f velocity, s16 actorType) {
+s16 try_remove_destructable_item(Vec3f pos, Vec3s rot, Vec3f velocity, s16 actorType) {
s32 actorIndex;
struct ShellActor *compare;
+ // try removing a red shell, green shell, banana, or a fake item box if the actor is expired
for (actorIndex = gNumPermanentActors; actorIndex < ACTOR_LIST_SIZE; actorIndex++) {
compare = (struct ShellActor *) &gActorList[actorIndex];
if (!(compare->flags & ACTOR_IS_NOT_EXPIRED)) {
@@ -2399,9 +1312,9 @@ s16 func_8029E890(Vec3f pos, Vec3s rot, Vec3f velocity, s16 actorType) {
case GREEN_SHELL_HIT_A_RACER:
case BLUE_SHELL_LOCK_ON:
case BLUE_SHELL_TARGET_ELIMINATED:
- func_8000EE58(actorIndex);
+ delete_actor_in_unexpired_actor_list(actorIndex);
case DESTROYED_SHELL:
- func_8029E7DC((struct Actor *) compare);
+ play_sound_before_despawn((struct Actor *) compare);
actor_init((struct Actor *) compare, pos, rot, velocity, actorType);
return actorIndex;
default:
@@ -2411,9 +1324,9 @@ s16 func_8029E890(Vec3f pos, Vec3s rot, Vec3f velocity, s16 actorType) {
case ACTOR_GREEN_SHELL:
switch(compare->state) {
case MOVING_SHELL:
- func_8000EE58(actorIndex);
+ delete_actor_in_unexpired_actor_list(actorIndex);
case DESTROYED_SHELL:
- func_8029E7DC((struct Actor *) compare);
+ play_sound_before_despawn((struct Actor *) compare);
actor_init((struct Actor *) compare, pos, rot, velocity, actorType);
return actorIndex;
}
@@ -2423,7 +1336,7 @@ s16 func_8029E890(Vec3f pos, Vec3s rot, Vec3f velocity, s16 actorType) {
case DROPPED_BANANA:
case BANANA_ON_GROUND:
case DESTROYED_BANANA:
- func_8029E7DC((struct Actor *) compare);
+ play_sound_before_despawn((struct Actor *) compare);
actor_init((struct Actor *) compare, pos, rot, velocity, actorType);
return actorIndex;
}
@@ -2432,7 +1345,7 @@ s16 func_8029E890(Vec3f pos, Vec3s rot, Vec3f velocity, s16 actorType) {
switch(compare->state) {
case FAKE_ITEM_BOX_ON_GROUND:
case DESTROYED_FAKE_ITEM_BOX:
- func_8029E7DC((struct Actor *) compare);
+ play_sound_before_despawn((struct Actor *) compare);
actor_init((struct Actor *) compare, pos, rot, velocity, actorType);
return actorIndex;
}
@@ -2443,6 +1356,7 @@ s16 func_8029E890(Vec3f pos, Vec3s rot, Vec3f velocity, s16 actorType) {
}
}
+ // will remove the oldest destructable actor in the list
for (actorIndex = gNumPermanentActors; actorIndex < ACTOR_LIST_SIZE; actorIndex++) {
compare = (struct ShellActor *) &gActorList[actorIndex];
switch(compare->type) {
@@ -2454,9 +1368,9 @@ s16 func_8029E890(Vec3f pos, Vec3s rot, Vec3f velocity, s16 actorType) {
case GREEN_SHELL_HIT_A_RACER:
case BLUE_SHELL_LOCK_ON:
case BLUE_SHELL_TARGET_ELIMINATED:
- func_8000EE58(actorIndex);
+ delete_actor_in_unexpired_actor_list(actorIndex);
case DESTROYED_SHELL:
- func_8029E7DC((struct Actor *) compare);
+ play_sound_before_despawn((struct Actor *) compare);
actor_init((struct Actor *) compare, pos, rot, velocity, actorType);
return actorIndex;
default:
@@ -2466,9 +1380,9 @@ s16 func_8029E890(Vec3f pos, Vec3s rot, Vec3f velocity, s16 actorType) {
case ACTOR_GREEN_SHELL:
switch(compare->state) {
case MOVING_SHELL:
- func_8000EE58(actorIndex);
+ delete_actor_in_unexpired_actor_list(actorIndex);
case DESTROYED_SHELL:
- func_8029E7DC((struct Actor *) compare);
+ play_sound_before_despawn((struct Actor *) compare);
actor_init((struct Actor *) compare, pos, rot, velocity, actorType);
return actorIndex;
}
@@ -2478,7 +1392,7 @@ s16 func_8029E890(Vec3f pos, Vec3s rot, Vec3f velocity, s16 actorType) {
case DROPPED_BANANA:
case BANANA_ON_GROUND:
case DESTROYED_BANANA:
- func_8029E7DC((struct Actor *) compare);
+ play_sound_before_despawn((struct Actor *) compare);
actor_init((struct Actor *) compare, pos, rot, velocity, actorType);
return actorIndex;
}
@@ -2487,7 +1401,7 @@ s16 func_8029E890(Vec3f pos, Vec3s rot, Vec3f velocity, s16 actorType) {
switch(compare->state) {
case FAKE_ITEM_BOX_ON_GROUND:
case DESTROYED_FAKE_ITEM_BOX:
- func_8029E7DC((struct Actor *) compare);
+ play_sound_before_despawn((struct Actor *) compare);
actor_init((struct Actor *) compare, pos, rot, velocity, actorType);
return actorIndex;
}
@@ -2501,11 +1415,11 @@ s16 func_8029E890(Vec3f pos, Vec3s rot, Vec3f velocity, s16 actorType) {
}
// returns actor index if any slot avaible returns -1
-s16 addActorToEmptySlot(Vec3f pos, Vec3s rot, Vec3f velocity, s16 actorType) {
+s16 add_actor_to_empty_slot(Vec3f pos, Vec3s rot, Vec3f velocity, s16 actorType) {
s32 index;
if (gNumActors >= ACTOR_LIST_SIZE) {
- return func_8029E890(pos, rot, velocity, actorType);
+ return try_remove_destructable_item(pos, rot, velocity, actorType);
}
for(index = 0; index < ACTOR_LIST_SIZE; index++){
if (gActorList[index].flags == 0) {
@@ -2517,121 +1431,121 @@ s16 addActorToEmptySlot(Vec3f pos, Vec3s rot, Vec3f velocity, s16 actorType) {
return -1;
}
-s16 func_8029ED38(Vec3f pos, s16 actorType) {
+UNUSED s16 spawn_actor_at_pos(Vec3f pos, s16 actorType) {
Vec3f vel;
Vec3s rot;
vec3f_set(vel, 0.0f, 0.0f, 0.0f);
vec3s_set(rot, 0, 0, 0);
- return addActorToEmptySlot(pos, rot, vel, actorType);
+ return add_actor_to_empty_slot(pos, rot, vel, actorType);
}
-// I swear we have a struct that looks like this already but I cannot find it anywhere
+// not ActorSpawnData but very similar in structure and use
struct test {
Vec3s thing;
};
-UNUSED void func_8029ED98(Player *player, uintptr_t arg1) {
+UNUSED void prototype_actor_spawn_data(Player *player, uintptr_t arg1) {
Vec3f sp64;
struct test *var_s0;
s32 segment = SEGMENT_NUMBER2(arg1);
s32 offset = SEGMENT_OFFSET(arg1);
var_s0 = (struct test *) VIRTUAL_TO_PHYSICAL2(gSegmentTable[segment] + offset);
- while (var_s0->thing[0] != -0x8000) {
+ while (var_s0->thing[0] != END_OF_SPAWN_DATA) {
sp64[0] = var_s0->thing[0] * gCourseDirection;
sp64[1] = var_s0->thing[1];
sp64[2] = var_s0->thing[2];
if(arg1 & arg1){}
- func_8029EEB8(player, sp64, 5.0f, 40.0f, 0.8f);
+ query_and_resolve_collision_player_actor(player, sp64, 5.0f, 40.0f, 0.8f);
var_s0++;
}
}
-s32 func_8029EEB8(Player *player, Vec3f pos, f32 arg2, f32 arg3, f32 arg4) {
- f32 temp_f0_2;
- f32 temp_f0_3;
- f32 temp_f14;
- f32 temp_f16;
- f32 temp_f18;
+bool query_and_resolve_collision_player_actor(Player *player, Vec3f pos, f32 minDist, f32 dist, f32 arg4) {
+ f32 yDist;
+ f32 sqrtDist;
+ f32 zDist;
+ f32 xVelocity;
+ f32 zVelocity;
f32 temp_f0_4;
f32 temp_f0_5;
f32 temp_f0_6;
- f32 temp_f20;
+ f32 xDist;
f32 sp28;
f32 temp_f2_2;
- arg2 = player->boundingBoxSize + arg2;
- arg3 = player->boundingBoxSize + arg3;
- temp_f20 = pos[0] - player->pos[0];
- if (arg2 < temp_f20) {
- return 0;
+ minDist = player->boundingBoxSize + minDist;
+ dist = player->boundingBoxSize + dist;
+ xDist = pos[0] - player->pos[0];
+ if (minDist < xDist) {
+ return NO_COLLISION;
}
- if (temp_f20 < -arg2) {
- return 0;
+ if (xDist < -minDist) {
+ return NO_COLLISION;
}
- temp_f0_2 = pos[1] - player->pos[1];
- if (arg3 < temp_f0_2) {
- return 0;
+ yDist = pos[1] - player->pos[1];
+ if (dist < yDist) {
+ return NO_COLLISION;
}
- if (temp_f0_2 < -arg3) {
- return 0;
+ if (yDist < -dist) {
+ return NO_COLLISION;
}
- temp_f14 = pos[2] - player->pos[2];
- if (arg2 < temp_f14) {
- return 0;
+ zDist = pos[2] - player->pos[2];
+ if (minDist < zDist) {
+ return NO_COLLISION;
}
- if (temp_f14 < -arg2) {
- return 0;
+ if (zDist < -minDist) {
+ return NO_COLLISION;
}
- arg3 = (temp_f20 * temp_f20) + (temp_f0_2 * temp_f0_2) + (temp_f14 * temp_f14);
- if (arg3 < 0.1f) {
- return 0;
+ dist = (xDist * xDist) + (yDist * yDist) + (zDist * zDist);
+ if (dist < 0.1f) {
+ return NO_COLLISION;
}
- if ((arg2 * arg2) < arg3) {
- return 0;
+ if ((minDist * minDist) < dist) {
+ return NO_COLLISION;
}
- temp_f0_3 = sqrtf(arg3);
- sp28 = temp_f0_3 - arg2;
- temp_f16 = player->velocity[0];
- temp_f18 = player->velocity[2];
+ sqrtDist = sqrtf(dist);
+ sp28 = sqrtDist - minDist;
+ xVelocity = player->velocity[0];
+ zVelocity = player->velocity[2];
if (player->effects & STAR_EFFECT) {
- return 1;
+ return COLLISION;
}
- if (temp_f0_3 < 0.1f) {
- temp_f0_4 = sqrtf((temp_f16 * temp_f16) + (temp_f18 * temp_f18));
+ if (sqrtDist < 0.1f) {
+ temp_f0_4 = sqrtf((xVelocity * xVelocity) + (zVelocity * zVelocity));
if (temp_f0_4 < 0.5f) {
temp_f0_4 = 0.5f;
}
player->velocity[0] = 0;
player->velocity[2] = 0;
- player->pos[0] += (temp_f16 / temp_f0_4) * arg2;
- player->pos[2] += (temp_f18 / temp_f0_4) * arg2;
+ player->pos[0] += (xVelocity / temp_f0_4) * minDist;
+ player->pos[2] += (zVelocity / temp_f0_4) * minDist;
} else {
player->effects |= 0x8000;
- temp_f20 /= temp_f0_3;
- temp_f14 /= temp_f0_3;
- temp_f0_5 = sqrtf((temp_f16 * temp_f16) + (temp_f18 * temp_f18));
+ xDist /= sqrtDist;
+ zDist /= sqrtDist;
+ temp_f0_5 = sqrtf((xVelocity * xVelocity) + (zVelocity * zVelocity));
if (temp_f0_5 < 0.25f) {
temp_f0_6 = 1.2f;
- player->pos[0] = pos[0] - (temp_f20 * arg2 * temp_f0_6);
- player->pos[2] = pos[2] - (temp_f14 * arg2 * temp_f0_6);
+ player->pos[0] = pos[0] - (xDist * minDist * temp_f0_6);
+ player->pos[2] = pos[2] - (zDist * minDist * temp_f0_6);
player->velocity[0] = 0.0f;
player->velocity[2] = 0.0f;
- return 1;
+ return COLLISION;
}
- temp_f2_2 = ((temp_f20 * temp_f16) + (temp_f14 * temp_f18)) / temp_f0_5;
+ temp_f2_2 = ((xDist * xVelocity) + (zDist * zVelocity)) / temp_f0_5;
temp_f2_2 = temp_f0_5 * temp_f2_2 * arg4 * 1.3f;
- player->velocity[0] -= temp_f20 * temp_f2_2;
- player->velocity[2] -= temp_f14 * temp_f2_2;
- player->pos[0] += temp_f20 * sp28 * 0.5f;
- player->pos[2] += temp_f14 * sp28 * 0.5f;
+ player->velocity[0] -= xDist * temp_f2_2;
+ player->velocity[2] -= zDist * temp_f2_2;
+ player->pos[0] += xDist * sp28 * 0.5f;
+ player->pos[2] += zDist * sp28 * 0.5f;
}
- return 1;
+ return COLLISION;
}
-s32 func_8029F1F8(Player *player, struct Actor *marioRacewaySign) {
- if (func_8029EEB8(player, marioRacewaySign->pos, 7.0f, 200.0f, 0.8f) == 1) {
+bool collision_mario_sign(Player *player, struct Actor *marioRacewaySign) {
+ if (query_and_resolve_collision_player_actor(player, marioRacewaySign->pos, 7.0f, 200.0f, 0.8f) == COLLISION) {
if ((player->type & PLAYER_HUMAN) != 0) {
if ((player->effects & STAR_EFFECT) != 0) {
marioRacewaySign->flags |= 0x400;
@@ -2641,13 +1555,13 @@ s32 func_8029F1F8(Player *player, struct Actor *marioRacewaySign) {
func_800C9060(player - gPlayerOne, SOUND_ARG_LOAD(0x19, 0x00, 0x70, 0x1A));
}
}
- return 1;
+ return TRUE;
}
- return 0;
+ return FALSE;
}
-s32 func_8029F2FC(Player *player, struct PiranhaPlant *plant) {
- if (func_8029EEB8(player, plant->pos, plant->boundingBoxSize, plant->boundingBoxSize, 2.5f) == 1) {
+bool collision_piranha_plant(Player *player, struct PiranhaPlant *plant) {
+ if (query_and_resolve_collision_player_actor(player, plant->pos, plant->boundingBoxSize, plant->boundingBoxSize, 2.5f) == COLLISION) {
if ((player->type & PLAYER_HUMAN) != 0) {
if ((player->effects & STAR_EFFECT) != 0) {
plant->flags |= 0x400;
@@ -2657,45 +1571,45 @@ s32 func_8029F2FC(Player *player, struct PiranhaPlant *plant) {
func_800C9060(player - gPlayerOne, SOUND_ARG_LOAD(0x19, 0x00, 0xA0, 0x52));
}
}
- return 1;
+ return TRUE;
}
- return 0;
+ return FALSE;
}
-bool func_8029F408(Player *player, struct YoshiValleyEgg *egg) {
+bool collision_yoshi_egg(Player *player, struct YoshiValleyEgg *egg) {
UNUSED f32 pad[5];
f32 z_dist;
f32 xz_dist;
f32 x_dist;
f32 y_dist;
f32 totalBox;
- f32 thing = 60.0f;
- f32 thing2 = 0.0f;
+ f32 maxDist = 60.0f;
+ f32 minDist = 0.0f;
x_dist = egg->pos[0] - player->pos[0];
- if ((x_dist < thing2) && (x_dist < -thing)) {
+ if ((x_dist < minDist) && (x_dist < -maxDist)) {
return FALSE;
}
- if (x_dist > thing) {
+ if (x_dist > maxDist) {
return FALSE;
}
z_dist = egg->pos[2] - player->pos[2];
- if ((z_dist < thing2) && (z_dist < -thing)) {
+ if ((z_dist < minDist) && (z_dist < -maxDist)) {
return FALSE;
}
- if (z_dist > thing) {
+ if (z_dist > maxDist) {
return FALSE;
}
xz_dist = sqrtf((x_dist * x_dist) + (z_dist * z_dist));
- if (xz_dist > thing) {
+ if (xz_dist > maxDist) {
return FALSE;
}
func_802977B0(player);
y_dist = player->pos[1] - egg->pos[1];
- if (y_dist < thing2) {
+ if (y_dist < minDist) {
return FALSE;
}
@@ -2711,19 +1625,19 @@ bool func_8029F408(Player *player, struct YoshiValleyEgg *egg) {
func_800C98B8(player->pos, player->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x10));
func_800C90F4(player - gPlayerOne, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x0D));
} else {
- func_8008DABC(player, player - gPlayerOne);
+ apply_hit_sound_effect(player, player - gPlayerOne);
if ((gModeSelection == TIME_TRIALS) && ((player->type & PLAYER_CPU) == 0)) {
D_80162DF8 = 1;
}
}
} else {
- func_8008DABC(player, player - gPlayerOne);
+ apply_hit_sound_effect(player, player - gPlayerOne);
}
return TRUE;
}
-s32 func_8029F69C(Player *player, struct Actor *actor) {
+bool collision_tree(Player *player, struct Actor *actor) {
f32 x_dist;
f32 y_dist;
f32 z_dist;
@@ -2734,39 +1648,39 @@ s32 func_8029F69C(Player *player, struct Actor *actor) {
UNUSED f32 pad[2];
f32 temp_f12;
f32 temp_f0_4;
- Vec3f sp20;
+ Vec3f actorPos;
f32 temp_f2;
var_f16 = actor->unk_08;
x_dist = actor->pos[0] - player->pos[0];
if ((x_dist < 0.0f) && (x_dist < -var_f16)) {
- return 0;
+ return FALSE;
}
if (var_f16 < x_dist) {
- return 0;
+ return FALSE;
}
z_dist = actor->pos[2] - player->pos[2];
if ((z_dist < 0.0f) && (z_dist < -var_f16)) {
- return 0;
+ return FALSE;
}
if (var_f16 < z_dist) {
- return 0;
+ return FALSE;
}
y_dist = player->pos[1] - actor->pos[1];
if (y_dist < 0.0f) {
- return 0;
+ return FALSE;
}
if ((f32) actor->state < y_dist) {
- return 0;
+ return FALSE;
}
xz_dist = sqrtf((x_dist * x_dist) + (z_dist * z_dist));
if (var_f16 < xz_dist) {
- return 0;
+ return FALSE;
}
func_802977B0(player);
var_f16 = player->boundingBoxSize + actor->boundingBoxSize;
if (var_f16 < xz_dist) {
- return 0;
+ return FALSE;
}
sp48 = player->velocity[0];
sp44 = player->velocity[2];
@@ -2775,7 +1689,7 @@ s32 func_8029F69C(Player *player, struct Actor *actor) {
actor->flags |= 0x400;
func_800C98B8(player->pos, player->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x10));
func_800C90F4(player - gPlayerOne, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x0D));
- return 1;
+ return TRUE;
}
if (!(player->type & PLAYER_INVISIBLE_OR_BOMB)) {
func_800C9060(player - gPlayerOne, SOUND_ARG_LOAD(0x19, 0x00, 0x70, 0x18));
@@ -2784,29 +1698,29 @@ s32 func_8029F69C(Player *player, struct Actor *actor) {
if (!(player->effects & STAR_EFFECT)) {
player->effects |= 0x8000;
}
- sp20[0] = actor->pos[0];
- sp20[1] = actor->pos[1];
- sp20[2] = actor->pos[2];
+ actorPos[0] = actor->pos[0];
+ actorPos[1] = actor->pos[1];
+ actorPos[2] = actor->pos[2];
if (((gCurrentCourseId == COURSE_MARIO_RACEWAY) || (gCurrentCourseId == COURSE_YOSHI_VALLEY) || (gCurrentCourseId == COURSE_ROYAL_RACEWAY) || (gCurrentCourseId == COURSE_LUIGI_RACEWAY)) && (player->unk_094 > 1.0f)) {
- spawn_leaf(sp20, 0);
+ spawn_leaf(actorPos, 0);
}
if (xz_dist < 0.1f) {
sqrtf((sp48 * sp48) + (sp44 * sp44));
if(xz_dist){}
player->velocity[0] = 0;
player->velocity[2] = 0;
- player->pos[0] = sp20[0] - (x_dist * var_f16 * 1.2f);
- player->pos[2] = sp20[2] - (z_dist * var_f16 * 1.2f);
+ player->pos[0] = actorPos[0] - (x_dist * var_f16 * 1.2f);
+ player->pos[2] = actorPos[2] - (z_dist * var_f16 * 1.2f);
} else {
temp_f0_4 = sqrtf((sp48 * sp48) + (sp44 * sp44));
x_dist /= xz_dist;
z_dist /= xz_dist;
if (temp_f0_4 < 0.25f) {
- player->pos[0] = sp20[0] - (x_dist * var_f16 * 1.2f);
- player->pos[2] = sp20[2] - (z_dist * var_f16 * 1.2f);
+ player->pos[0] = actorPos[0] - (x_dist * var_f16 * 1.2f);
+ player->pos[2] = actorPos[2] - (z_dist * var_f16 * 1.2f);
player->velocity[0] = 0;
player->velocity[2] = 0;
- return 1;
+ return TRUE;
}
temp_f12 = ((x_dist * sp48) + (z_dist * sp44)) / temp_f0_4;
temp_f12 = temp_f0_4 * temp_f12 * 1.5f;
@@ -2816,88 +1730,88 @@ s32 func_8029F69C(Player *player, struct Actor *actor) {
player->pos[0] += x_dist * temp_f2 * 0.5f;
player->pos[2] += z_dist * temp_f2 * 0.5f;
}
- return 1;
+ return TRUE;
}
-s32 func_8029FB80(Player *arg0, struct Actor *arg1) {
+bool query_collision_player_vs_actor_item(Player *arg0, struct Actor *arg1) {
f32 temp_f0;
- f32 temp_f12_2;
- f32 temp_f14;
- f32 temp_f16;
- f32 temp_f2;
+ f32 dist;
+ f32 yDist;
+ f32 zDist;
+ f32 xDist;
temp_f0 = arg0->boundingBoxSize + arg1->boundingBoxSize;
- temp_f2 = arg1->pos[0] - arg0->pos[0];
- if (temp_f0 < temp_f2) {
- return 0;
+ xDist = arg1->pos[0] - arg0->pos[0];
+ if (temp_f0 < xDist) {
+ return NO_COLLISION;
}
- if (temp_f2 < -temp_f0) {
- return 0;
+ if (xDist < -temp_f0) {
+ return NO_COLLISION;
}
- temp_f14 = arg1->pos[1] - arg0->pos[1];
- if (temp_f0 < temp_f14) {
- return 0;
+ yDist = arg1->pos[1] - arg0->pos[1];
+ if (temp_f0 < yDist) {
+ return NO_COLLISION;
}
- if (temp_f14 < -temp_f0) {
- return 0;
+ if (yDist < -temp_f0) {
+ return NO_COLLISION;
}
- temp_f16 = arg1->pos[2] - arg0->pos[2];
- if (temp_f0 < temp_f16) {
- return 0;
+ zDist = arg1->pos[2] - arg0->pos[2];
+ if (temp_f0 < zDist) {
+ return NO_COLLISION;
}
- if (temp_f16 < -temp_f0) {
- return 0;
+ if (zDist < -temp_f0) {
+ return NO_COLLISION;
}
- temp_f12_2 = (temp_f2 * temp_f2) + (temp_f14 * temp_f14) + (temp_f16 * temp_f16);
- if (temp_f12_2 < 0.1f) {
- return 0;
+ dist = (xDist * xDist) + (yDist * yDist) + (zDist * zDist);
+ if (dist < 0.1f) {
+ return NO_COLLISION;
}
- if ((temp_f0 * temp_f0) < temp_f12_2) {
- return 0;
+ if ((temp_f0 * temp_f0) < dist) {
+ return NO_COLLISION;
}
- return 1;
+ return COLLISION;
}
-s32 func_8029FCA4(struct Actor *arg0, struct Actor *arg1) {
+bool query_collision_actor_vs_actor(struct Actor *arg0, struct Actor *arg1) {
f32 temp_f0;
- f32 temp_f12_2;
- f32 temp_f14;
- f32 temp_f16;
- f32 temp_f2;
+ f32 dist;
+ f32 dist_y;
+ f32 dist_z;
+ f32 dist_x;
temp_f0 = arg0->boundingBoxSize + arg1->boundingBoxSize;
- temp_f2 = arg0->pos[0] - arg1->pos[0];
- if (temp_f0 < temp_f2) {
- return 0;
+ dist_x = arg0->pos[0] - arg1->pos[0];
+ if (temp_f0 < dist_x) {
+ return NO_COLLISION;
}
- if (temp_f2 < -temp_f0) {
- return 0;
+ if (dist_x < -temp_f0) {
+ return NO_COLLISION;
}
- temp_f14 = arg0->pos[1] - arg1->pos[1];
- if (temp_f0 < temp_f14) {
- return 0;
+ dist_y = arg0->pos[1] - arg1->pos[1];
+ if (temp_f0 < dist_y) {
+ return NO_COLLISION;
}
- if (temp_f14 < -temp_f0) {
- return 0;
+ if (dist_y < -temp_f0) {
+ return NO_COLLISION;
}
- temp_f16 = arg0->pos[2] - arg1->pos[2];
- if (temp_f0 < temp_f16) {
- return 0;
+ dist_z = arg0->pos[2] - arg1->pos[2];
+ if (temp_f0 < dist_z) {
+ return NO_COLLISION;
}
- if (temp_f16 < -temp_f0) {
- return 0;
+ if (dist_z < -temp_f0) {
+ return NO_COLLISION;
}
- temp_f12_2 = (temp_f2 * temp_f2) + (temp_f14 * temp_f14) + (temp_f16 * temp_f16);
- if (temp_f12_2 < 0.1f) {
- return 0;
+ dist = (dist_x * dist_x) + (dist_y * dist_y) + (dist_z * dist_z);
+ if (dist < 0.1f) {
+ return NO_COLLISION;
}
- if ((temp_f0 * temp_f0) < temp_f12_2) {
- return 0;
+ if ((temp_f0 * temp_f0) < dist) {
+ return NO_COLLISION;
}
- return 1;
+ return COLLISION;
}
-void func_8029FDC8(struct Actor *actor) {
+void destroy_destructable_actor(struct Actor *actor) {
struct ShellActor *shell;
struct BananaActor *banana;
struct FakeItemBox *fakeItemBox;
@@ -2909,7 +1823,7 @@ void func_8029FDC8(struct Actor *actor) {
switch (banana->state) {
case FIRST_BANANA_BUNCH_BANANA:
case BANANA_BUNCH_BANANA:
- func_802B0570(banana);
+ destroy_banana_in_banana_bunch(banana);
break;
case HELD_BANANA:
player = &gPlayers[banana->playerId];
@@ -2918,7 +1832,7 @@ void func_8029FDC8(struct Actor *actor) {
case BANANA_ON_GROUND:
banana->flags = -0x8000;
banana->unk_04 = 0x003C;
- banana->state = 5;
+ banana->state = DESTROYED_BANANA;
banana->velocity[1] = 3.0f;
break;
case DROPPED_BANANA:
@@ -2932,7 +1846,7 @@ void func_8029FDC8(struct Actor *actor) {
if (shell->state != GREEN_SHELL_HIT_A_RACER) {
switch (shell->state) {
case MOVING_SHELL:
- func_8000EE58(actor - gActorList);
+ delete_actor_in_unexpired_actor_list(actor - gActorList);
/* fallthrough */
case HELD_SHELL:
case RELEASED_SHELL:
@@ -2943,7 +1857,7 @@ void func_8029FDC8(struct Actor *actor) {
shell->velocity[1] = 3.0f;
break;
case TRIPLE_GREEN_SHELL:
- func_802B02B4(shell, ACTOR_GREEN_SHELL);
+ triple_shell_actor_collide_with_player(shell, ACTOR_GREEN_SHELL);
break;
default:
break;
@@ -2961,7 +1875,7 @@ void func_8029FDC8(struct Actor *actor) {
case BLUE_SHELL_LOCK_ON:
case BLUE_SHELL_TARGET_ELIMINATED:
func_800C9EF4(shell->pos, SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x08));
- func_8000EE58(actor - gActorList);
+ delete_actor_in_unexpired_actor_list(actor - gActorList);
/* fallthrough */
case HELD_SHELL:
case RELEASED_SHELL:
@@ -2986,7 +1900,7 @@ void func_8029FDC8(struct Actor *actor) {
case GREEN_SHELL_HIT_A_RACER:
case BLUE_SHELL_LOCK_ON:
case BLUE_SHELL_TARGET_ELIMINATED:
- func_8000EE58(actor - gActorList);
+ delete_actor_in_unexpired_actor_list(actor - gActorList);
/* fallthrough */
case HELD_SHELL:
case RELEASED_SHELL:
@@ -2997,7 +1911,7 @@ void func_8029FDC8(struct Actor *actor) {
shell->velocity[1] = 3.0f;
break;
case TRIPLE_RED_SHELL:
- func_802B02B4(shell, ACTOR_RED_SHELL);
+ triple_shell_actor_collide_with_player(shell, ACTOR_RED_SHELL);
break;
default:
break;
@@ -3017,7 +1931,7 @@ void func_8029FDC8(struct Actor *actor) {
}
}
-void func_802A00E8(struct Actor *arg0, struct Actor *arg1) {
+void play_sound_on_destructible_actor_collision(struct Actor *arg0, struct Actor *arg1) {
switch(arg0->type) {
case ACTOR_GREEN_SHELL:
if ((arg0->state == HELD_SHELL) || (arg0->state == TRIPLE_GREEN_SHELL)) {
@@ -3084,34 +1998,34 @@ void func_802A00E8(struct Actor *arg0, struct Actor *arg1) {
func_800C98B8(arg0->pos, arg0->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x10));
}
-void func_802A0350(struct Actor *arg0, struct Actor *arg1) {
- if (func_8029FCA4(arg0, arg1) == 1) {
- if ((arg0->type == ACTOR_BLUE_SPINY_SHELL) && (arg1->type == ACTOR_BLUE_SPINY_SHELL)) {
- func_8029FDC8(arg0);
- func_8029FDC8(arg1);
- arg0->flags |= 256;
- func_800C98B8(arg0->pos, arg0->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x10));
+void evaluate_actor_collision_between_two_destructible_actors(struct Actor *actor1, struct Actor *actor2) {
+ if (query_collision_actor_vs_actor(actor1, actor2) == COLLISION) {
+ if ((actor1->type == ACTOR_BLUE_SPINY_SHELL) && (actor2->type == ACTOR_BLUE_SPINY_SHELL)) {
+ destroy_destructable_actor(actor1);
+ destroy_destructable_actor(actor2);
+ actor1->flags |= 0x100;
+ func_800C98B8(actor1->pos, actor1->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x10));
return;
}
- if (arg0->type == ACTOR_BLUE_SPINY_SHELL) {
- if (arg0->state == HELD_SHELL) {
- func_8029FDC8(arg0);
+ if (actor1->type == ACTOR_BLUE_SPINY_SHELL) {
+ if (actor1->state == HELD_SHELL) {
+ destroy_destructable_actor(actor1);
}
} else {
- func_8029FDC8(arg0);
+ destroy_destructable_actor(actor1); // automatically destroy if it's something different of a blueshell
}
- if (arg1->type == ACTOR_BLUE_SPINY_SHELL) {
- if (arg1->state == HELD_SHELL) {
- func_8029FDC8(arg1);
+ if (actor2->type == ACTOR_BLUE_SPINY_SHELL) {
+ if (actor2->state == HELD_SHELL) {
+ destroy_destructable_actor(actor2);
}
} else {
- func_8029FDC8(arg1);
+ destroy_destructable_actor(actor2); // automatically destroy if it's something different of a blueshell
}
- func_802A00E8(arg0, arg1);
+ play_sound_on_destructible_actor_collision(actor1, actor2);
}
}
-void func_802A0450(Player *player, struct Actor *actor) {
+void evaluate_collision_between_player_actor(Player *player, struct Actor *actor) {
UNUSED s32 pad;
s16 temp_lo;
UNUSED s32 pad2[2];
@@ -3122,125 +2036,17 @@ void func_802A0450(Player *player, struct Actor *actor) {
temp_lo = player - gPlayerOne;
switch (actor->type) {
- case ACTOR_YOSHI_VALLEY_EGG:
- if (!(player->effects & BOO_EFFECT) && !(player->type & PLAYER_INVISIBLE_OR_BOMB)) {
- func_8029F408(player, (struct YoshiValleyEgg *) actor);
- }
- break;
- case ACTOR_BANANA:
- if (player->effects & (BOO_EFFECT | 0x8C0)) { break; }
- if (player->soundEffects & 1) { break; }
- temp_v1 = actor->rot[0];
- if (((temp_lo == temp_v1) && (actor->flags & 0x1000)) || (func_8029FB80(player, actor) != 1)) { break; }
- player->soundEffects |= 1;
- owner = &gPlayers[temp_v1];
- if (owner->type & 0x4000) {
- if (actor->flags & 0xF) {
- if (temp_lo != temp_v1) {
- func_800C90F4(temp_v1, (owner->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x06));
- }
- } else {
- temp_f0 = actor->pos[0] - owner->pos[0];
- temp_f2 = actor->pos[2] - owner->pos[2];
- if ((((temp_f0 * temp_f0) + (temp_f2 * temp_f2)) < 360000.0f) && (temp_lo != temp_v1)) {
- func_800C90F4(temp_v1, (owner->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x06));
- }
- }
- }
- func_8029FDC8(actor);
- break;
- case ACTOR_GREEN_SHELL:
- if (player->effects & 0x80000400) { break; }
- if (player->soundEffects & 4) { break; }
- temp_v1 = actor->rot[2];
- if (((temp_lo == temp_v1) && (actor->flags & 0x1000)) || (func_8029FB80(player, actor) != 1)) { break; }
- player->soundEffects |= 4;
- func_800C98B8(player->pos, player->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x10));
- owner = &gPlayers[temp_v1];
- if ((owner->type & 0x4000) && (temp_lo != temp_v1)) {
- func_800C90F4(temp_v1, (owner->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x06));
- }
- func_8029FDC8(actor);
- break;
- case ACTOR_BLUE_SPINY_SHELL:
- if (player->soundEffects & 2) { break; }
- temp_v1 = actor->rot[2];
- if (((temp_lo == temp_v1) && (actor->flags & 0x1000)) || (func_8029FB80(player, actor) != 1)) { break; }
- if (!(player->effects & BOO_EFFECT)) {
- player->soundEffects |= 2;
- func_800C98B8(player->pos, player->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x10));
- }
- owner = &gPlayers[temp_v1];
- if ((owner->type & 0x4000) && (temp_lo != temp_v1)) {
- func_800C90F4(temp_v1, (owner->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x06));
- }
- if (temp_lo == actor->unk_04) {
- func_8029FDC8(actor);
- }
- break;
- case ACTOR_RED_SHELL:
- temp_v1 = actor->rot[2];
- if (player->effects & 0x01000000) { break; }
- if (player->soundEffects & 2) { break; }
- temp_v1 = actor->rot[2];
- if (((temp_lo == temp_v1) && (actor->flags & 0x1000)) || (func_8029FB80(player, actor) != 1)) { break; }
- if (!(player->effects & BOO_EFFECT)) {
- player->soundEffects |= 2;
- func_800C98B8(player->pos, player->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x10));
- }
- owner = &gPlayers[temp_v1];
- if ((owner->type & 0x4000) && (temp_lo != temp_v1)) {
- func_800C90F4(temp_v1, (owner->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x06));
- }
- func_8029FDC8(actor);
- break;
- case ACTOR_PIRANHA_PLANT:
- if (!(player->effects & BOO_EFFECT)) {
- func_8029F2FC(player, (struct PiranhaPlant *) actor);
- }
- break;
- case ACTOR_MARIO_SIGN:
- if (!(player->effects & BOO_EFFECT)) {
- func_8029F1F8(player, actor);
- }
- break;
- case 2:
- case 3:
- case 4:
- case 19:
- case 25:
- case 26:
- case 28:
- case 29:
- case 30:
- case 31:
- case 32:
- case 33:
- if (!(player->effects & BOO_EFFECT)) {
- func_8029F69C(player, actor);
- }
- break;
- case ACTOR_FALLING_ROCK:
- if (!(player->effects & BOO_EFFECT) && !(player->type & PLAYER_INVISIBLE_OR_BOMB)) {
- if (func_8029FB80(player, actor) == 1) {
- func_800C98B8(actor->pos, actor->velocity, SOUND_ACTION_EXPLOSION);
- if ((gModeSelection == TIME_TRIALS) && !(player->type & PLAYER_CPU)) {
- D_80162DF8 = 1;
- }
- if (player->effects & STAR_EFFECT) {
- actor->velocity[1] = 10.0f;
- } else {
- func_8008DABC(player, player - gPlayerOne);
- }
+ case ACTOR_YOSHI_EGG:
+ if (!(player->effects & BOO_EFFECT) && !(player->type & PLAYER_INVISIBLE_OR_BOMB)) {
+ collision_yoshi_egg(player, (struct YoshiValleyEgg *) actor);
}
- }
- break;
- case ACTOR_FAKE_ITEM_BOX:
- temp_v1 = actor->velocity[0];
- if (player->effects & BOO_EFFECT) { break; }
- temp_v1 = actor->velocity[0];
- if (((temp_lo == temp_v1) && (actor->flags & 0x1000)) || (func_8029FB80(player, actor) != 1)) { break; }
- player->soundEffects |= REVERSE_SOUND_EFFECT;
+ break;
+ case ACTOR_BANANA:
+ if (player->effects & (BOO_EFFECT | 0x8C0)) { break; }
+ if (player->soundEffects & 1) { break; }
+ temp_v1 = actor->rot[0];
+ if (((temp_lo == temp_v1) && (actor->flags & 0x1000)) || (query_collision_player_vs_actor_item(player, actor) != COLLISION)) { break; }
+ player->soundEffects |= 1;
owner = &gPlayers[temp_v1];
if (owner->type & 0x4000) {
if (actor->flags & 0xF) {
@@ -3254,46 +2060,154 @@ void func_802A0450(Player *player, struct Actor *actor) {
func_800C90F4(temp_v1, (owner->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x06));
}
}
- if (actor->state == 0) {
- owner->soundEffects &= ~0x00040000;
+ }
+ destroy_destructable_actor(actor);
+ break;
+ case ACTOR_GREEN_SHELL:
+ if (player->effects & 0x80000400) { break; }
+ if (player->soundEffects & 4) { break; }
+ temp_v1 = actor->rot[2];
+ if (((temp_lo == temp_v1) && (actor->flags & 0x1000)) || (query_collision_player_vs_actor_item(player, actor) != COLLISION)) { break; }
+ player->soundEffects |= 4;
+ func_800C98B8(player->pos, player->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x10));
+ owner = &gPlayers[temp_v1];
+ if ((owner->type & 0x4000) && (temp_lo != temp_v1)) {
+ func_800C90F4(temp_v1, (owner->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x06));
+ }
+ destroy_destructable_actor(actor);
+ break;
+ case ACTOR_BLUE_SPINY_SHELL:
+ if (player->soundEffects & 2) { break; }
+ temp_v1 = actor->rot[2];
+ if (((temp_lo == temp_v1) && (actor->flags & 0x1000)) || (query_collision_player_vs_actor_item(player, actor) != COLLISION)) { break; }
+ if (!(player->effects & BOO_EFFECT)) {
+ player->soundEffects |= 2;
+ func_800C98B8(player->pos, player->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x10));
+ }
+ owner = &gPlayers[temp_v1];
+ if ((owner->type & 0x4000) && (temp_lo != temp_v1)) {
+ func_800C90F4(temp_v1, (owner->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x06));
+ }
+ if (temp_lo == actor->unk_04) {
+ destroy_destructable_actor(actor);
+ }
+ break;
+ case ACTOR_RED_SHELL:
+ temp_v1 = actor->rot[2];
+ if (player->effects & 0x01000000) { break; }
+ if (player->soundEffects & 2) { break; }
+ temp_v1 = actor->rot[2];
+ if (((temp_lo == temp_v1) && (actor->flags & 0x1000)) || (query_collision_player_vs_actor_item(player, actor) != COLLISION)) { break; }
+ if (!(player->effects & BOO_EFFECT)) {
+ player->soundEffects |= 2;
+ func_800C98B8(player->pos, player->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x10));
+ }
+ owner = &gPlayers[temp_v1];
+ if ((owner->type & 0x4000) && (temp_lo != temp_v1)) {
+ func_800C90F4(temp_v1, (owner->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x06));
+ }
+ destroy_destructable_actor(actor);
+ break;
+ case ACTOR_PIRANHA_PLANT:
+ if (!(player->effects & BOO_EFFECT)) {
+ collision_piranha_plant(player, (struct PiranhaPlant *) actor);
+ }
+ break;
+ case ACTOR_MARIO_SIGN:
+ if (!(player->effects & BOO_EFFECT)) {
+ collision_mario_sign(player, actor);
+ }
+ break;
+ case ACTOR_TREE_MARIO_RACEWAY:
+ case ACTOR_TREE_YOSHI_VALLEY:
+ case ACTOR_TREE_ROYAL_RACEWAY:
+ case ACTOR_TREE_MOO_MOO_FARM:
+ case ACTOR_PALM_TREE:
+ case 26:
+ case ACTOR_TREE_BOWSERS_CASTLE:
+ case ACTOR_TREE_FRAPPE_SNOWLAND:
+ case ACTOR_CACTUS1_KALAMARI_DESERT:
+ case ACTOR_CACTUS2_KALAMARI_DESERT:
+ case ACTOR_CACTUS3_KALAMARI_DESERT:
+ case ACTOR_BUSH_BOWSERS_CASTLE:
+ if (!(player->effects & BOO_EFFECT)) {
+ collision_tree(player, actor);
+ }
+ break;
+ case ACTOR_FALLING_ROCK:
+ if (!(player->effects & BOO_EFFECT) && !(player->type & PLAYER_INVISIBLE_OR_BOMB)) {
+ if (query_collision_player_vs_actor_item(player, actor) == COLLISION) {
+ func_800C98B8(actor->pos, actor->velocity, SOUND_ACTION_EXPLOSION);
+ if ((gModeSelection == TIME_TRIALS) && !(player->type & PLAYER_CPU)) {
+ D_80162DF8 = 1;
+ }
+ if (player->effects & STAR_EFFECT) {
+ actor->velocity[1] = 10.0f;
+ } else {
+ apply_hit_sound_effect(player, player - gPlayerOne);
+ }
}
}
- actor->state = 2;
- actor->flags = -0x8000;
- actor->unk_04 = 0;
- break;
- case ACTOR_HOT_AIR_BALLOON_ITEM_BOX:
- if (func_8029FB80(player, actor) == 1) {
- actor->state = 3;
- actor->flags = -0x8000;
- actor->unk_04 = 0;
- if (player->type & PLAYER_HUMAN) {
- func_8007ABFC(player - gPlayerOne, 7);
+ break;
+ case ACTOR_FAKE_ITEM_BOX:
+ temp_v1 = actor->velocity[0];
+ if (player->effects & BOO_EFFECT) { break; }
+ temp_v1 = actor->velocity[0];
+ if (((temp_lo == temp_v1) && (actor->flags & 0x1000)) || (query_collision_player_vs_actor_item(player, actor) != COLLISION)) { break; }
+ player->soundEffects |= REVERSE_SOUND_EFFECT;
+ owner = &gPlayers[temp_v1];
+ if (owner->type & 0x4000) {
+ if (actor->flags & 0xF) {
+ if (temp_lo != temp_v1) {
+ func_800C90F4(temp_v1, (owner->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x06));
+ }
+ } else {
+ temp_f0 = actor->pos[0] - owner->pos[0];
+ temp_f2 = actor->pos[2] - owner->pos[2];
+ if ((((temp_f0 * temp_f0) + (temp_f2 * temp_f2)) < 360000.0f) && (temp_lo != temp_v1)) {
+ func_800C90F4(temp_v1, (owner->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x06));
+ }
+ }
+ if (actor->state == 0) {
+ owner->soundEffects &= ~0x00040000;
+ }
+ }
+ actor->state = 2;
+ actor->flags = -0x8000;
+ actor->unk_04 = 0;
+ break;
+ case ACTOR_HOT_AIR_BALLOON_ITEM_BOX:
+ if (query_collision_player_vs_actor_item(player, actor) == COLLISION) {
+ actor->state = 3;
+ actor->flags = -0x8000;
+ actor->unk_04 = 0;
+ if (player->type & PLAYER_HUMAN) {
+ func_8007ABFC(player - gPlayerOne, 7);
+ }
+ } else if (actor->state == 0) {
+ actor->state = 1;
+ actor->flags = -0x8000;
}
- } else if (actor->state == 0) {
- actor->state = 1;
- actor->flags = -0x8000;
- }
- break;
- case ACTOR_ITEM_BOX:
- if (func_8029FB80(player, actor) == (s32) 1) {
- actor->state = 3;
- actor->flags = -0x8000;
- actor->unk_04 = 0;
- if (player->type & PLAYER_HUMAN) {
- func_8007ABFC(player - gPlayerOne, 0);
+ break;
+ case ACTOR_ITEM_BOX:
+ if (query_collision_player_vs_actor_item(player, actor) == COLLISION) {
+ actor->state = 3;
+ actor->flags = -0x8000;
+ actor->unk_04 = 0;
+ if (player->type & PLAYER_HUMAN) {
+ func_8007ABFC(player - gPlayerOne, 0);
+ }
+ } else if (actor->state == 0) {
+ actor->state = 1;
+ actor->flags = -0x8000;
}
- } else if (actor->state == 0) {
- actor->state = 1;
- actor->flags = -0x8000;
- }
- break;
- default:
- break;
+ break;
+ default:
+ break;
}
}
-void evaluate_player_collision(void) {
+void evaluate_collision_for_players_and_actors(void) {
struct Actor *temp_a1;
s32 i, j;
Player *phi_s1;
@@ -3303,34 +2217,34 @@ void evaluate_player_collision(void) {
if (((phi_s1->type & 0x8000) != 0) && ((phi_s1->effects & 0x4000000) == 0)) {
func_802977E4(phi_s1);
- for (j = 0; j < ACTOR_LIST_SIZE; j++) {
- temp_a1 = &gActorList[j];
+ for (j = 0; j < ACTOR_LIST_SIZE; j++) {
+ temp_a1 = &gActorList[j];
- if ((phi_s1->effects & 0x4000000) == 0) {
- // temp_v0 = temp_a1->unk2;
- if (((temp_a1->flags & 0x8000) != 0) && ((temp_a1->flags & 0x4000) != 0)) {
- func_802A0450(phi_s1, temp_a1);
- }
+ if ((phi_s1->effects & 0x4000000) == 0) {
+ // temp_v0 = temp_a1->unk2;
+ if (((temp_a1->flags & 0x8000) != 0) && ((temp_a1->flags & 0x4000) != 0)) {
+ evaluate_collision_between_player_actor(phi_s1, temp_a1);
}
+ }
}
}
}
}
// It's look like to check collision between item and other different item
-void func_802A0E44(void) {
- struct Actor *phi_s0;
- struct Actor *temp_a1;
+void evaluate_collision_for_destructible_actors(void) {
+ struct Actor *actor1;
+ struct Actor *actor2;
s32 i, j;
UNUSED s32 pad;
for (i = gNumPermanentActors; i < (ACTOR_LIST_SIZE - 1); i++) {
- phi_s0 = &gActorList[i];
+ actor1 = &gActorList[i];
- if ((phi_s0->flags & 0x8000) == 0) { continue; }
- if ((phi_s0->flags & 0x4000) == 0) { continue; }
+ if ((actor1->flags & 0x8000) == 0) { continue; }
+ if ((actor1->flags & 0x4000) == 0) { continue; }
- switch(phi_s0->type) {
+ switch(actor1->type) {
case ACTOR_BANANA:
case ACTOR_GREEN_SHELL:
case ACTOR_RED_SHELL:
@@ -3338,34 +2252,34 @@ void func_802A0E44(void) {
case ACTOR_FAKE_ITEM_BOX:
for (j = i + 1; j < ACTOR_LIST_SIZE; j++) {
- temp_a1 = &gActorList[j];
+ actor2 = &gActorList[j];
- if ((phi_s0->flags & 0x8000) == 0) {continue;}
- if ((phi_s0->flags & 0x4000) == 0) {continue;}
+ if ((actor1->flags & 0x8000) == 0) {continue;}
+ if ((actor1->flags & 0x4000) == 0) {continue;}
- if ((temp_a1->flags & 0x8000) == 0) { continue; }
- if ((temp_a1->flags & 0x4000) == 0) { continue; }
+ if ((actor2->flags & 0x8000) == 0) { continue; }
+ if ((actor2->flags & 0x4000) == 0) { continue; }
- switch(temp_a1->type) {
+ switch(actor2->type) {
case ACTOR_BANANA:
- if (phi_s0->type == ACTOR_BANANA) { continue; }
- func_802A0350(phi_s0, temp_a1);
+ if (actor1->type == ACTOR_BANANA) { continue; }
+ evaluate_actor_collision_between_two_destructible_actors(actor1, actor2);
break;
case ACTOR_GREEN_SHELL:
- if (phi_s0->type == ACTOR_GREEN_SHELL) {
- if (phi_s0->rot[2] == temp_a1->rot[2]) { continue; }
+ if (actor1->type == ACTOR_GREEN_SHELL) {
+ if (actor1->rot[2] == actor2->rot[2]) { continue; }
}
- func_802A0350(phi_s0, temp_a1);
+ evaluate_actor_collision_between_two_destructible_actors(actor1, actor2);
break;
case ACTOR_RED_SHELL:
- if (phi_s0->type == ACTOR_RED_SHELL) {
- if (phi_s0->rot[2] == temp_a1->rot[2]) { continue; }
+ if (actor1->type == ACTOR_RED_SHELL) {
+ if (actor1->rot[2] == actor2->rot[2]) { continue; }
}
- func_802A0350(phi_s0, temp_a1);
+ evaluate_actor_collision_between_two_destructible_actors(actor1, actor2);
break;
case ACTOR_BLUE_SPINY_SHELL:
case ACTOR_FAKE_ITEM_BOX:
- func_802A0350(phi_s0, temp_a1);
+ evaluate_actor_collision_between_two_destructible_actors(actor1, actor2);
break;
}
}
@@ -3385,92 +2299,9 @@ void func_802A1064(struct FakeItemBox *fake_item_box) {
}
}
-void update_actor_fake_item_box(struct FakeItemBox *fake_item_box) {
- u32 temp_v1 = fake_item_box->playerId;
- Player *temp_v0_4 = &gPlayers[temp_v1];
- struct Controller *temp_v1_3;
-
- UNUSED s32 pad[7];
- f32 temp_f2_2;
- f32 temp_f14;
- f32 temp_f16;
- f32 temp_f18;
- UNUSED s32 pad2[3];
+#include "actors/fake_item_box/update.inc.c"
- switch(fake_item_box->state) {
- case 0:
- fake_item_box->boundingBoxSize = fake_item_box->sizeScaling * 5.5f;
- fake_item_box->rot[0] -= 0xB6;
- fake_item_box->rot[1] += 0x16C;
- fake_item_box->rot[2] -= 0xB6;
-
- temp_f14 = temp_v0_4->pos[0] - fake_item_box->pos[0];
- temp_f16 = temp_v0_4->pos[1] - fake_item_box->pos[1];
- temp_f18 = temp_v0_4->pos[2] - fake_item_box->pos[2];
-
- temp_f2_2 = sqrtf((temp_f14 * temp_f14) + (temp_f16 * temp_f16) + (temp_f18 * temp_f18)) / 10.0f;
- temp_f14 /= temp_f2_2;
- temp_f16 /= temp_f2_2;
- temp_f18 /= temp_f2_2;
- fake_item_box->pos[0] = temp_v0_4->pos[0] - temp_f14;
- fake_item_box->pos[1] = (temp_v0_4->pos[1] - temp_f16) - 1.0f;
- fake_item_box->pos[2] = temp_v0_4->pos[2] - temp_f18;
- func_802ADDC8(&fake_item_box->unk30, fake_item_box->boundingBoxSize, fake_item_box->pos[0], fake_item_box->pos[1], fake_item_box->pos[2]);
- func_802B4E30((struct Actor *)fake_item_box);
- temp_v1_3 = &gControllers[temp_v1];
- if ((temp_v0_4->type & 0x4000) != 0) {
-
- if ((temp_v1_3->buttonDepressed & Z_TRIG) != 0) {
- temp_v1_3->buttonDepressed &= 0xDFFF;
- func_802A1064(fake_item_box);
- temp_v0_4->soundEffects &= 0xFFFBFFFF;
- func_800C9060((u8)(temp_v0_4 - gPlayerOne), SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x12));
- }
- }
- break;
- case 1:
- if (fake_item_box->sizeScaling < 1.0f) {
- fake_item_box->sizeScaling += 0.05f;
- } else if (fake_item_box->sizeScaling >= 1.0f) {
- fake_item_box->sizeScaling = 1.0f;
- }
-
- fake_item_box->boundingBoxSize = fake_item_box->sizeScaling * 5.5f;
- if (fake_item_box->targetY <= fake_item_box->pos[1]) {
- fake_item_box->pos[1] = fake_item_box->targetY;
- } else {
- fake_item_box->pos[1] += 0.2f;
- }
- if ((fake_item_box->flags & 0x1000) != 0) {
- if ((fake_item_box->someTimer <= 0) || (fake_item_box->someTimer >= 0x12D)) {
- fake_item_box->flags &= 0xEFFF;
- fake_item_box->someTimer = 0;
- } else {
- fake_item_box->someTimer--;
- }
- }
- fake_item_box->rot[0] -= 0xB6;
- fake_item_box->rot[1] += 0x16C;
- fake_item_box->rot[2] -= 0xB6;
- break;
-
- case 2:
- if ((fake_item_box->someTimer >= 0x14) || (fake_item_box->someTimer < 0)) {
- destroy_actor((struct Actor *) fake_item_box);
- } else {
- fake_item_box->someTimer++;
- fake_item_box->rot[0] += 0x444;
- fake_item_box->rot[1] -= 0x2D8;
- fake_item_box->rot[2] += 0x16C;
- }
- break;
- default:
- destroy_actor((struct Actor *) fake_item_box);
- break;
- }
-}
-
-void func_802A14BC(f32 x, f32 y, f32 z) {
+void init_actor_hot_air_balloon_item_box(f32 x, f32 y, f32 z) {
Vec3f pos;
Vec3f velocity;
Vec3s rot;
@@ -3483,509 +2314,27 @@ void func_802A14BC(f32 x, f32 y, f32 z) {
pos[0] = x;
pos[1] = y;
pos[2] = z;
- id = addActorToEmptySlot(pos, rot, velocity, ACTOR_HOT_AIR_BALLOON_ITEM_BOX);
+ id = add_actor_to_empty_slot(pos, rot, velocity, ACTOR_HOT_AIR_BALLOON_ITEM_BOX);
gActorHotAirBalloonItemBox = &gActorList[id];
}
-void update_actor_item_box_hot_air_balloon(struct ItemBox *itemBox) {
- switch(itemBox->state) {
- case 5:
- itemBox->rot[0] += 0xB6;
- itemBox->rot[1] -= 0x16C;
- itemBox->rot[2] += 0xB6;
- break;
- case 3:
- if (itemBox->someTimer == 0x14) {
- itemBox->state = 5;
- itemBox->flags = -0x4000;
- } else {
- itemBox->someTimer++;
- itemBox->rot[0] += 0x444;
- itemBox->rot[1] -= 0x2D8;
- itemBox->rot[2] += 0x16C;
- }
- break;
- }
-}
-
-void update_actor_item_box(struct ItemBox *itemBox) {
- switch (itemBox->state) {
- case 0:
- itemBox->state = 1;
- break;
- case 1:
- if ((itemBox->pos[1] - itemBox->origY) < 8.66f) {
- itemBox->pos[1] += 0.45f;
- } else {
- itemBox->pos[1] = itemBox->origY + 8.66f;
- itemBox->state = 2;
- itemBox->flags = 0xC000;
- }
- break;
- case 2:
- itemBox->rot[0] += 0xB6;
- itemBox->rot[1] -= 0x16C;
- itemBox->rot[2] += 0xB6;
- break;
- case 3:
- if (itemBox->someTimer == 20) {
- itemBox->state = 0;
- itemBox->pos[1] = itemBox->resetDistance - 20.0f;
- itemBox->flags = 0xC000;
- } else {
- itemBox->someTimer++;
- itemBox->rot[0] += 0x444;
- itemBox->rot[1] -= 0x2D8;
- itemBox->rot[2] += 0x16C;
- }
- break;
- }
-}
-
-void func_802A171C(Camera *camera, struct FakeItemBox *fakeItemBox) {
- Vec3s someRot;
- UNUSED s32 pad[3];
- Vec3f someVec;
- Mat4 someMatrix2;
- Mat4 someMatrix3;
- UNUSED s32 pad2[12];
- f32 temp_f0_2;
- f32 temp_f0_3;
- f32 temp_f12;
- f32 temp_f2;
- f32 thing;
- f32 temp_f2_2;
- f32 someMultiplier;
-
- if (is_within_render_distance(camera->pos, fakeItemBox->pos, camera->rot[1], 2500.0f, gCameraZoom[camera - camera1], 1000000.0f) < 0) {
- func_80297230(camera, (struct Actor *) fakeItemBox);
- return;
- }
- if (((f32) D_8015F6EC + 800.0f) < fakeItemBox->pos[1]) {
- func_80297230(camera, (struct Actor *) fakeItemBox);
- return;
- }
- if (fakeItemBox->pos[1] < ((f32) D_8015F6EE - 800.0f)) {
- func_80297230(camera, (struct Actor *) fakeItemBox);
- return;
- }
-
- func_802972B8(camera, (struct Actor *) fakeItemBox);
- someRot[0] = 0;
- someRot[1] = fakeItemBox->rot[1];
- someRot[2] = 0;
- mtxf_pos_rotation_xyz(someMatrix2, fakeItemBox->pos, someRot);
- mtxf_scale(someMatrix2, fakeItemBox->sizeScaling);
- if (fakeItemBox->state != 2) {
-
- if (!render_set_position(someMatrix2, 0)) { return; }
-
- gSPDisplayList(gDisplayListHead++, common_model_fake_itembox);
- mtxf_pos_rotation_xyz(someMatrix2, fakeItemBox->pos, fakeItemBox->rot);
- mtxf_scale(someMatrix2, fakeItemBox->sizeScaling);
-
- if (!render_set_position(someMatrix2, 0)) { return; }
-
- gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
- gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
- if ((fakeItemBox->rot[1] < 0xAA1) && (fakeItemBox->rot[1] > 0)) {
- gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
- } else if ((fakeItemBox->rot[1] >= 0x6AA5) && (fakeItemBox->rot[1] < 0x754E)) {
- gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
- } else if ((fakeItemBox->rot[1] >= 0x38E1) && (fakeItemBox->rot[1] < 0x438A)) {
- gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
- } else if ((fakeItemBox->rot[1] >= 0xC711) && (fakeItemBox->rot[1] < 0xD1BA)) {
- gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
- } else {
- gDPSetBlendMask(gDisplayListHead++, 0xFF);
- gDPSetRenderMode(gDisplayListHead++, G_RM_ZB_CLD_SURF, G_RM_ZB_CLD_SURF2);
- }
- gSPDisplayList(gDisplayListHead++, D_0D003090);
- } else {
- gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
- gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
- gDPSetBlendMask(gDisplayListHead++, 0xFF);
- thing = fakeItemBox->someTimer;
- mtxf_pos_rotation_xyz(someMatrix2, fakeItemBox->pos, fakeItemBox->rot);
- if (thing < 10.0f) {
- someMultiplier = 1.0f;
- } else {
- someMultiplier = 1.0f - ((thing - 10.0f) * 0.1f);
- }
- mtxf_scale(someMatrix2, someMultiplier);
- if (fakeItemBox->someTimer & 1) {
- gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
- } else {
- gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_XLU_INTER, G_RM_NOOP2);
- }
- temp_f2 = 2.0f * thing;
- someVec[0] = 0.0f;
- someVec[1] = temp_f2;
- someVec[2] = thing;
- add_translate_mat4_vec3f(someMatrix2, someMatrix3, someVec);
-
- if (!render_set_position(someMatrix3, 0)) { return; }
-
- gSPDisplayList(gDisplayListHead++, D_0D003158);
- temp_f2_2 = 0.8f * thing;
- temp_f12 = 0.5f * thing;
- someVec[0] = temp_f2_2;
- someVec[1] = 2.3f * thing;
- someVec[2] = temp_f12;
- add_translate_mat4_vec3f(someMatrix2, someMatrix3, someVec);
-
- if (!render_set_position(someMatrix3, 0)) { return; }
-
- gSPDisplayList(gDisplayListHead++, D_0D0031B8);
- temp_f0_2 = -0.5f * thing;
- someVec[0] = temp_f2_2;
- someVec[1] = 1.2f * thing;
- someVec[2] = temp_f0_2;
- add_translate_mat4_vec3f(someMatrix2, someMatrix3, someVec);
-
- if (!render_set_position(someMatrix3, 0)) { return; }
-
- gSPDisplayList(gDisplayListHead++, D_0D003128);
- if (!(fakeItemBox->someTimer & 1)) {
- gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
- } else {
- gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_XLU_INTER, G_RM_NOOP2);
- }
- someVec[0] = 0.0f;
- someVec[1] = 1.8f * thing;
- someVec[2] = -1.0f * thing;
- add_translate_mat4_vec3f(someMatrix2, someMatrix3, someVec);
-
- if (!render_set_position(someMatrix3, 0)) { return; }
-
- gSPDisplayList(gDisplayListHead++, D_0D0031E8);
- temp_f0_3 = -0.8f * thing;
- someVec[0] = temp_f0_3;
- someVec[1] = 0.6f * thing;
- someVec[2] = temp_f0_2;
- add_translate_mat4_vec3f(someMatrix2, someMatrix3, someVec);
-
- if (!render_set_position(someMatrix3, 0)) { return; }
-
- gSPDisplayList(gDisplayListHead++, D_0D003188);
- someVec[0] = temp_f0_3;
- someVec[1] = temp_f2;
- someVec[2] = temp_f12;
- add_translate_mat4_vec3f(someMatrix2, someMatrix3, someVec);
-
- if (!render_set_position(someMatrix3, 0)) { return; }
-
- gSPDisplayList(gDisplayListHead++, D_0D0030F8);
- gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
- }
-}
-
-// render item box need more info to document this properly
-void func_802A1EA0(Camera *camera, struct ItemBox *item_box) {
- UNUSED s32 pad[2];
- Vec3f someVec1;
- Vec3f someVec2;
- Vec3s someRot;
- f32 thing;
- UNUSED s32 pad2;
- Mat4 someMatrix1;
- Mat4 someMatrix2;
- UNUSED s32 pad3[4];
- f32 temp_f0;
- f32 temp_f0_2;
- f32 temp_f0_3;
- f32 temp_f12;
- f32 temp_f2;
- f32 temp_f2_2;
- f32 someMultiplier;
+#include "actors/item_box/update.inc.c"
- temp_f0 = is_within_render_distance(camera->pos, item_box->pos, camera->rot[1], 0.0f, gCameraZoom[camera - camera1], 4000000.0f);
- if (!(temp_f0 < 0.0f) && !(600000.0f < temp_f0)) {
- if ((item_box->state == 2) && (temp_f0 < 100000.0f)) {
- someRot[0] = 0;
- someRot[1] = item_box->rot[1];
- someRot[2] = 0;
- someVec2[0] = item_box->pos[0];
- someVec2[1] = item_box->resetDistance + 2.0f;
- someVec2[2] = item_box->pos[2];
- mtxf_pos_rotation_xyz(someMatrix1, someVec2, someRot);
+#include "actors/fake_item_box/render.inc.c"
- if (!render_set_position(someMatrix1, 0)) { return; }
+#include "actors/item_box/render.inc.c"
- gSPDisplayList(gDisplayListHead++, D_0D002EE8);
- someRot[1] = item_box->rot[1] * 2;
- someVec2[1] = item_box->pos[1];
- mtxf_pos_rotation_xyz(someMatrix1, someVec2, someRot);
+#include "actors/wario_sign/render.inc.c"
- if (!render_set_position(someMatrix1, 0)) { return; }
+#include "actors/yoshi_egg/render.inc.c"
- gSPDisplayList(gDisplayListHead++, itemBoxQuestionMarkModel);
- }
- if (item_box->state == 5) {
- mtxf_pos_rotation_xyz(someMatrix1, item_box->pos, item_box->rot);
-
- if (!render_set_position(someMatrix1, 0)) { return; }
-
- gSPDisplayList(gDisplayListHead++, itemBoxQuestionMarkModel);
- }
- if (item_box->state != 3) {
- mtxf_pos_rotation_xyz(someMatrix1, item_box->pos, item_box->rot);
-
- if (!render_set_position(someMatrix1, 0)) { return; }
-
- gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
- gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
- if ((item_box->rot[1] < 0xAA1) && (item_box->rot[1] > 0)) {
- gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
- } else if ((item_box->rot[1] >= 0x6AA5) && (item_box->rot[1] < 0x754E)) {
- gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
- } else if ((item_box->rot[1] >= 0x38E1) && (item_box->rot[1] < 0x438A)) {
- gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
- } else if ((item_box->rot[1] >= 0xC711) && (item_box->rot[1] < 0xD1BA)) {
- gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
- } else {
- gDPSetBlendMask(gDisplayListHead++, 0xFF);
- gDPSetRenderMode(gDisplayListHead++, G_RM_ZB_CLD_SURF, G_RM_ZB_CLD_SURF2);
- }
- gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
- gSPDisplayList(gDisplayListHead++, D_0D003090);
- } else {
- gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
- gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
- gDPSetBlendMask(gDisplayListHead++, 0xFF);
- thing = item_box->someTimer;
- mtxf_pos_rotation_xyz(someMatrix1, item_box->pos, item_box->rot);
- if (thing < 10.0f) {
- someMultiplier = 1.0f;
- } else {
- someMultiplier = 1.0f - ((thing - 10.0f) * 0.1f);
- }
- mtxf_scale(someMatrix1, someMultiplier);
- if (item_box->someTimer & 1) {
- gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
- } else {
- gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_XLU_INTER, G_RM_NOOP2);
- }
- temp_f2 = 2.0f * thing;
- someVec1[0] = 0.0f;
- someVec1[1] = temp_f2;
- someVec1[2] = thing;
- add_translate_mat4_vec3f(someMatrix1, someMatrix2, someVec1);
-
- if (!render_set_position(someMatrix2, 0)) { return; }
-
- gSPDisplayList(gDisplayListHead++, D_0D003158);
- temp_f2_2 = 0.8f * thing;
- temp_f12 = 0.5f * thing;
- someVec1[0] = temp_f2_2;
- someVec1[1] = 2.3f * thing;
- someVec1[2] = temp_f12;
- add_translate_mat4_vec3f(someMatrix1, someMatrix2, someVec1);
-
- if (!render_set_position(someMatrix2, 0)) { return; }
-
- gSPDisplayList(gDisplayListHead++, D_0D0031B8);
- temp_f0_2 = -0.5f * thing;
- someVec1[0] = temp_f2_2;
- someVec1[1] = 1.2f * thing;
- someVec1[2] = temp_f0_2;
- add_translate_mat4_vec3f(someMatrix1, someMatrix2, someVec1);
-
- if (!render_set_position(someMatrix2, 0)) { return; }
-
- gSPDisplayList(gDisplayListHead++, D_0D003128);
- if (!(item_box->someTimer & 1)) {
- gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
- } else {
- gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_XLU_INTER, G_RM_NOOP2);
- }
- someVec1[0] = 0.0f;
- someVec1[1] = 1.8f * thing;
- someVec1[2] = -1.0f * thing;
- add_translate_mat4_vec3f(someMatrix1, someMatrix2, someVec1);
+#include "actors/mario_sign/render.inc.c"
- if (!render_set_position(someMatrix2, 0)) { return; }
+#include "actors/railroad_crossing/render.inc.c"
- gSPDisplayList(gDisplayListHead++, D_0D0031E8);
- temp_f0_3 = -0.8f * thing;
- someVec1[0] = temp_f0_3;
- someVec1[1] = 0.6f * thing;
- someVec1[2] = temp_f0_2;
- add_translate_mat4_vec3f(someMatrix1, someMatrix2, someVec1);
+#include "actors/palm_tree/render.inc.c"
- if (!render_set_position(someMatrix2, 0)) { return; }
-
- gSPDisplayList(gDisplayListHead++, D_0D003188);
- someVec1[0] = temp_f0_3;
- someVec1[1] = temp_f2;
- someVec1[2] = temp_f12;
- add_translate_mat4_vec3f(someMatrix1, someMatrix2, someVec1);
-
- if (!render_set_position(someMatrix2, 0)) { return; }
-
- gSPDisplayList(gDisplayListHead++, D_0D0030F8);
- gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
- }
- gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
- }
-}
-
-void render_actor_wario_sign(Camera *arg0, struct Actor *arg1) {
- Mat4 sp38;
- f32 unk = is_within_render_distance(arg0->pos, arg1->pos, arg0->rot[1], 0, gCameraZoom[arg0 - camera1], 16000000.0f);
-
- if (!(unk < 0.0f)) {
- gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
- gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
-
- mtxf_pos_rotation_xyz(sp38, arg1->pos, arg1->rot);
- if (render_set_position(sp38, 0) != 0) {
-
- gSPDisplayList(gDisplayListHead++, d_course_wario_stadium_dl_sign);
- }
- }
-}
-
-void func_802A27A0(Camera *arg0, Mat4 arg1, struct YoshiValleyEgg *egg, u16 arg3) {
- Mat4 sp60;
- Vec3s sp5C;
- Vec3f sp54;
- f32 temp_f0;
-
- if (gGamestate != CREDITS_SEQUENCE) {
- temp_f0 = is_within_render_distance(arg0->pos, egg->pos, arg0->rot[1], 200.0f, gCameraZoom[arg0 - camera1], 16000000.0f);
- if (temp_f0 < 0.0f) {
- return;
- }
- } else {
- arg3 = 15;
- temp_f0 = 0.0f;
- }
-
- gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
- if ((arg3 > 12) && (arg3 < 20)) {
- if (temp_f0 < 640000.0f) {
- sp54[0] = egg->pos[0];
- sp54[1] = 3.0f;
- sp54[2] = egg->pos[2];
- func_802976D8(sp5C);
- func_8029794C(sp54, sp5C, 10.0f);
- }
- sp5C[0] = 0;
- sp5C[1] = egg->eggRot;
- sp5C[2] = 0;
- mtxf_pos_rotation_xyz(sp60, egg->pos, sp5C);
- if (render_set_position(sp60, 0) == 0) { return; }
-
- gSPSetGeometryMode(gDisplayListHead++, G_LIGHTING);
- gSPDisplayList(gDisplayListHead++, d_course_yoshi_valley_dl_16D70);
- } else {
- arg1[3][0] = egg->pos[0];
- arg1[3][1] = egg->pos[1];
- arg1[3][2] = egg->pos[2];
-
- if (render_set_position(arg1, 0) != 0) {
- gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
- gSPDisplayList(gDisplayListHead++, d_course_yoshi_valley_dl_egg_lod0);
- }
- }
-}
-
-void render_actor_mario_sign(Camera *arg0, UNUSED Mat4 arg1, struct Actor *arg2) {
- Mat4 sp40;
- f32 unk;
- s16 temp = arg2->flags;
-
- if (temp & 0x800) { return; }
-
- unk = is_within_render_distance(arg0->pos, arg2->pos, arg0->rot[1], 0, gCameraZoom[arg0 - camera1], 16000000.0f);
- if (!(unk < 0.0f)) {
- gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
- gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
- mtxf_pos_rotation_xyz(sp40, arg2->pos, arg2->rot);
- if (render_set_position(sp40, 0) != 0) {
- gSPDisplayList(gDisplayListHead++, d_course_mario_raceway_dl_sign);
- }
- }
-}
-
-void func_802A2AD0(Camera *arg0, struct RailroadCrossing *rr_crossing) {
- UNUSED Vec3s sp80 = {0, 0, 0};
- Mat4 sp40;
- f32 unk = is_within_render_distance(arg0->pos, rr_crossing->pos, arg0->rot[1], 0.0f, gCameraZoom[arg0 - camera1], 4000000.0f);
-
- if (!(unk < 0.0f)) {
- mtxf_pos_rotation_xyz(sp40, rr_crossing->pos, rr_crossing->rot);
-
- if (render_set_position(sp40, 0) != 0) {
- gSPSetGeometryMode(gDisplayListHead++, G_LIGHTING);
- gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
-
- if (isCrossingTriggeredByIndex[rr_crossing->crossingId]) {
-
- if (rr_crossing->someTimer < 20) {
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_crossing_right_active);
- } else {
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_crossing_left_active);
- }
- } else {
- gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_crossing_both_inactive);
- }
- gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
- }
- }
-}
-
-void func_802A2C78(Camera *arg0, UNUSED Mat4 arg1, struct Actor *arg2) {
- Vec3s spA8 = {0, 0, 0};
- Mat4 sp68;
- f32 temp_f0;
- s16 temp_v0 = arg2->flags;
-
- if ((temp_v0 & 0x800)) {
- return;
- }
-
- temp_f0 = is_within_render_distance(arg0->pos, arg2->pos, arg0->rot[1], 0.0f, gCameraZoom[arg0 - camera1], 4000000.0f);
-
- if (!(temp_f0 < 0.0f)) {
- if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
- func_8029794C(arg2->pos, arg2->rot, 2.0f);
- }
- mtxf_pos_rotation_xyz(sp68, arg2->pos, spA8);
- if (render_set_position(sp68, 0) != 0) {
-
- gDPSetTextureLUT(gDisplayListHead++, G_TT_NONE);
- gSPSetGeometryMode(gDisplayListHead++, G_LIGHTING);
-
- switch(arg2->unk_04) {
- case 0:
- gSPDisplayList(gDisplayListHead++, &d_course_koopa_troopa_beach_dl_tree_trunk1);
- gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
- gSPDisplayList(gDisplayListHead++, &d_course_koopa_troopa_beach_dl_tree_top1);
- gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
- break;
-
- case 1:
- gSPDisplayList(gDisplayListHead++, &d_course_koopa_troopa_beach_dl_tree_trunk2);
- gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
- gSPDisplayList(gDisplayListHead++, &d_course_koopa_troopa_beach_dl_tree_top2);
- gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
- break;
-
- case 2:
- gSPDisplayList(gDisplayListHead++, &d_course_koopa_troopa_beach_dl_tree_trunk3);
- gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
- gSPDisplayList(gDisplayListHead++, &d_course_koopa_troopa_beach_dl_tree_top3);
- gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
- break;
-
- }
- }
- }
-}
-
-void func_802A2F34(struct UnkStruct_800DC5EC *arg0) {
+void render_item_boxes(struct UnkStruct_800DC5EC *arg0) {
Camera *camera = arg0->camera;
struct Actor *actor;
s32 i;
@@ -4000,13 +2349,13 @@ void func_802A2F34(struct UnkStruct_800DC5EC *arg0) {
switch(actor->type) {
case ACTOR_FAKE_ITEM_BOX:
- func_802A171C(camera, (struct FakeItemBox *) actor);
+ render_actor_fake_item_box(camera, (struct FakeItemBox *) actor);
break;
case ACTOR_ITEM_BOX:
- func_802A1EA0(camera, (struct ItemBox *) actor);
+ render_actor_item_box(camera, (struct ItemBox *) actor);
break;
case ACTOR_HOT_AIR_BALLOON_ITEM_BOX:
- func_802A1EA0(camera, (struct ItemBox *) actor);
+ render_actor_item_box(camera, (struct ItemBox *) actor);
break;
}
}
@@ -4067,7 +2416,7 @@ void render_course_actors(struct UnkStruct_800DC5EC *arg0) {
case ACTOR_TREE_MOO_MOO_FARM:
render_actor_tree_moo_moo_farm(camera, D_801502C0, actor);
break;
- case 0x1A:
+ case ACTOR_UNKNOWN_0x1A:
func_80299864(camera, D_801502C0, actor);
break;
case ACTOR_TREE_BOWSERS_CASTLE:
@@ -4092,7 +2441,7 @@ void render_course_actors(struct UnkStruct_800DC5EC *arg0) {
render_actor_falling_rock(camera, (struct FallingRock *) actor);
break;
case ACTOR_KIWANO_FRUIT:
- render_actor_kiwano_fruit_dks_jungle_parkway(camera, D_801502C0, actor);
+ render_actor_kiwano_fruit(camera, D_801502C0, actor);
break;
case ACTOR_BANANA:
render_actor_banana(camera, D_801502C0, (struct BananaActor *) actor);
@@ -4116,12 +2465,12 @@ void render_course_actors(struct UnkStruct_800DC5EC *arg0) {
render_actor_train_tender(camera, (struct TrainCar *) actor);
break;
case ACTOR_TRAIN_PASSENGER_CAR:
- render_actor_passenger_car(camera, (struct TrainCar *) actor);
+ render_actor_train_passenger_car(camera, (struct TrainCar *) actor);
break;
case ACTOR_COW:
render_actor_cow(camera, D_801502C0, actor);
break;
- case 0x14:
+ case ACTOR_UNKNOWN_0x14:
func_8029AC18(camera, D_801502C0, actor);
break;
case ACTOR_MARIO_SIGN:
@@ -4131,37 +2480,37 @@ void render_course_actors(struct UnkStruct_800DC5EC *arg0) {
render_actor_wario_sign(camera, actor);
break;
case ACTOR_PALM_TREE:
- func_802A2C78(camera, D_801502C0, actor);
+ render_actor_palm_tree(camera, D_801502C0, (struct PalmTree *) actor);
break;
case ACTOR_PADDLE_BOAT:
render_actor_paddle_boat(camera, (struct PaddleWheelBoat *) actor, D_801502C0, pathCounter);
break;
case ACTOR_BOX_TRUCK:
- func_8029B06C(camera, actor);
+ render_actor_box_truck(camera, actor);
break;
case ACTOR_SCHOOL_BUS:
- func_8029B2E4(camera, actor);
+ render_actor_school_bus(camera, actor);
break;
case ACTOR_TANKER_TRUCK:
- func_8029B6EC(camera, actor);
+ render_actor_tanker_truck(camera, actor);
break;
case ACTOR_CAR:
- func_8029B4E0(camera, actor);
+ render_actor_car(camera, actor);
break;
case ACTOR_RAILROAD_CROSSING:
- func_802A2AD0(camera, (struct RailroadCrossing *) actor);
+ render_actor_railroad_crossing(camera, (struct RailroadCrossing *) actor);
break;
- case ACTOR_YOSHI_VALLEY_EGG:
- func_802A27A0(camera, D_801502C0, (struct YoshiValleyEgg *) actor, pathCounter);
+ case ACTOR_YOSHI_EGG:
+ render_actor_yoshi_egg(camera, D_801502C0, (struct YoshiValleyEgg *) actor, pathCounter);
break;
}
}
switch (gCurrentCourseId) {
case COURSE_MOO_MOO_FARM:
- func_802986B4(camera, D_801502C0, actor);
+ render_cows(camera, D_801502C0, actor);
break;
case COURSE_DK_JUNGLE:
- func_80298D7C(camera, D_801502C0, actor);
+ render_palm_trees(camera, D_801502C0, actor);
break;
}
}
@@ -4202,10 +2551,10 @@ void update_course_actors(void) {
update_actor_train_engine((struct TrainCar *) actor);
break;
case ACTOR_TRAIN_TENDER:
- update_actor_train_car1((struct TrainCar *) actor);
+ update_actor_train_tender((struct TrainCar *) actor);
break;
case ACTOR_TRAIN_PASSENGER_CAR:
- update_actor_train_car2((struct TrainCar *) actor);
+ update_actor_train_passenger_car((struct TrainCar *) actor);
break;
case ACTOR_ITEM_BOX:
update_actor_item_box((struct ItemBox *) actor);
@@ -4229,10 +2578,10 @@ void update_course_actors(void) {
update_actor_triple_shell((TripleShellParent *) actor, ACTOR_RED_SHELL);
break;
case ACTOR_MARIO_SIGN:
- update_actor_mario_raceway_sign(actor);
+ update_actor_mario_sign(actor);
break;
case ACTOR_WARIO_SIGN:
- update_actor_wario_stadium_sign(actor);
+ update_actor_wario_sign(actor);
break;
case ACTOR_RAILROAD_CROSSING:
update_actor_railroad_crossing((struct RailroadCrossing *) actor);
@@ -4242,21 +2591,21 @@ void update_course_actors(void) {
case ACTOR_TREE_ROYAL_RACEWAY:
case ACTOR_TREE_MOO_MOO_FARM:
case ACTOR_PALM_TREE:
- case 0x1A: // A plant?
- case 0X1B:
+ case ACTOR_UNKNOWN_0x1A: // A plant?
+ case ACTOR_UNKNOWN_0x1B:
case ACTOR_TREE_BOWSERS_CASTLE:
case ACTOR_TREE_FRAPPE_SNOWLAND:
case ACTOR_CACTUS1_KALAMARI_DESERT:
case ACTOR_CACTUS2_KALAMARI_DESERT:
case ACTOR_CACTUS3_KALAMARI_DESERT:
case ACTOR_BUSH_BOWSERS_CASTLE:
- update_actor_trees_cacti_shrubs(actor);
+ update_actor_static_plant(actor);
break;
- case ACTOR_YOSHI_VALLEY_EGG:
- update_actor_yoshi_valley_egg((struct YoshiValleyEgg *) actor);
+ case ACTOR_YOSHI_EGG:
+ update_actor_yoshi_egg((struct YoshiValleyEgg *) actor);
break;
- }
}
- func_802A0E44();
- func_802B30EC();
+ }
+ evaluate_collision_for_destructible_actors();
+ check_player_use_item();
}
diff --git a/src/racing/actors.h b/src/racing/actors.h
index bc7eca7cb..0bd0b1b7c 100644
--- a/src/racing/actors.h
+++ b/src/racing/actors.h
@@ -4,10 +4,14 @@
#include "types.h"
#include "actor_types.h"
+#define END_OF_SPAWN_DATA -0x8000
+
+/** @cond */
+
void cleanup_red_and_green_shells(struct ShellActor*);
void actor_init(struct Actor*, Vec3f, Vec3s, Vec3f, s16);
-void func_80297230(Camera*, struct Actor*);
-void func_802972B8(Camera*, struct Actor*);
+void actor_not_rendered(Camera*, struct Actor*);
+void actor_rendered(Camera*, struct Actor*);
void func_80297340(Camera*);
void func_802976D8(Vec3s);
void func_802976EC(Collision*, Vec3s);
@@ -18,20 +22,20 @@ void init_red_shell_texture(void);
void func_8029794C(Vec3f, Vec3s, f32);
void func_802979F8(struct Actor*, f32);
void render_actor_cow(Camera*, Mat4, struct Actor*);
-void update_actor_yoshi_valley_egg(struct YoshiValleyEgg*);
-void update_actor_trees_cacti_shrubs(struct Actor*);
+void update_actor_yoshi_egg(struct YoshiValleyEgg*);
+void update_actor_static_plant(struct Actor*);
void update_actor_kiwano_fruit(struct KiwanoFruit*);
void update_actor_paddle_boat(struct PaddleWheelBoat*);
void update_actor_train_engine(struct TrainCar*);
-void update_actor_train_car1(struct TrainCar*);
-void update_actor_train_car2(struct TrainCar*);
+void update_actor_train_tender(struct TrainCar*);
+void update_actor_train_passenger_car(struct TrainCar*);
void update_actor_piranha_plant(struct PiranhaPlant*);
void render_actor_piranha_plant(Camera*, Mat4, struct PiranhaPlant*);
-void func_802986B4(Camera*, Mat4, struct Actor*);
-void func_80298AC0(Player*);
-void func_80298C94(void);
+void render_cows(Camera*, Mat4, struct Actor*);
+void evaluate_collision_player_palm_trees(Player*);
+void evaluate_collision_players_palm_trees(void);
void func_80298D10(void);
-void func_80298D7C(Camera*, Mat4, struct Actor*);
+void render_palm_trees(Camera*, Mat4, struct Actor*);
void render_actor_tree_mario_raceway(Camera*, Mat4, struct Actor*);
void render_actor_tree_yoshi_valley(Camera*, Mat4, struct Actor*);
void render_actor_tree_royal_raceway(Camera*, Mat4, struct Actor*);
@@ -43,67 +47,67 @@ void render_actor_tree_frappe_snowland(Camera*, Mat4, struct Actor*);
void render_actor_tree_cactus1_kalimari_desert(Camera*, Mat4, struct Actor*);
void render_actor_tree_cactus2_kalimari_desert(Camera*, Mat4, struct Actor*);
void render_actor_tree_cactus3_kalimari_desert(Camera*, Mat4, struct Actor*);
-void render_actor_kiwano_fruit_dks_jungle_parkway(Camera*, Mat4, struct Actor*);
+void render_actor_kiwano_fruit(Camera*, Mat4, struct Actor*);
void render_actor_shell(Camera*, Mat4, struct ShellActor*);
void render_actor_green_shell(Camera*, Mat4, struct ShellActor*);
void render_actor_red_shell(Camera*, Mat4, struct ShellActor*);
void render_actor_blue_shell(Camera*, Mat4, struct ShellActor*);
void render_actor_banana(Camera*, Mat4, struct BananaActor*);
-void update_actor_wario_stadium_sign(struct Actor*);
+void update_actor_wario_sign(struct Actor*);
void update_actor_railroad_crossing(struct RailroadCrossing*);
-void update_actor_mario_raceway_sign(struct Actor*);
+void update_actor_mario_sign(struct Actor*);
void func_8029AC18(Camera*, Mat4, struct Actor*);
void render_actor_paddle_boat(Camera*, struct PaddleWheelBoat*, Mat4, u16);
-void func_8029B06C(Camera*, struct Actor*);
-void func_8029B2E4(Camera*, struct Actor*);
-void func_8029B4E0(Camera*, struct Actor*);
-void func_8029B6EC(Camera*, struct Actor*);
+void render_actor_box_truck(Camera*, struct Actor*);
+void render_actor_school_bus(Camera*, struct Actor*);
+void render_actor_car(Camera*, struct Actor*);
+void render_actor_tanker_truck(Camera*, struct Actor*);
void render_actor_train_engine(Camera*, struct TrainCar*);
void render_actor_train_tender(Camera*, struct TrainCar*);
-void render_actor_passenger_car(Camera*, struct TrainCar*);
+void render_actor_train_passenger_car(Camera*, struct TrainCar*);
void render_actor_falling_rock(Camera*, struct FallingRock*);
-void place_piranha_plants(struct ActorSpawnData*);
-void place_palm_trees(struct ActorSpawnData*);
+void spawn_piranha_plants(struct ActorSpawnData*);
+void spawn_palm_trees(struct ActorSpawnData*);
void func_8029CF0C(struct ActorSpawnData*, struct FallingRock*);
-void place_falling_rocks(struct ActorSpawnData*);
+void spawn_falling_rocks(struct ActorSpawnData*);
void update_actor_falling_rocks(struct FallingRock*);
void spawn_foliage(struct ActorSpawnData*);
-void place_all_item_boxes(struct ActorSpawnData*);
+void spawn_all_item_boxes(struct ActorSpawnData*);
void init_kiwano_fruit(void);
void destroy_all_actors(void);
-void place_course_actors(void);
-void func_8029E158(void);
-void func_8029E7DC(struct Actor*);
+void spawn_course_actors(void);
+void init_actors_and_load_textures(void);
+void play_sound_before_despawn(struct Actor*);
void destroy_actor(struct Actor*);
-s16 func_8029E890(Vec3f, Vec3s, Vec3f, s16);
-s16 addActorToEmptySlot(Vec3f, Vec3s, Vec3f, s16);
-s16 func_8029ED38(Vec3f, s16);
-s32 func_8029EEB8(Player*, Vec3f, f32, f32, f32);
-s32 func_8029F1F8(Player*, struct Actor*);
-s32 func_8029F2FC(Player*, struct PiranhaPlant*);
-s32 func_8029F408(Player*, struct YoshiValleyEgg*);
-s32 func_8029F69C(Player*, struct Actor*);
-s32 func_8029FB80(Player*, struct Actor*);
-s32 func_8029FCA4(struct Actor*, struct Actor*);
-void func_8029FDC8(struct Actor*);
-void func_802A00E8(struct Actor*, struct Actor*);
-void func_802A0350(struct Actor*, struct Actor*);
-void func_802A0450(Player*, struct Actor*);
-void evaluate_player_collision(void);
-void func_802A0E44(void);
+s16 try_remove_destructable_item(Vec3f, Vec3s, Vec3f, s16);
+s16 add_actor_to_empty_slot(Vec3f, Vec3s, Vec3f, s16);
+s16 spawn_actor_at_pos(Vec3f, s16);
+s32 query_and_resolve_collision_player_actor(Player*, Vec3f, f32, f32, f32);
+s32 collision_mario_sign(Player*, struct Actor*);
+s32 collision_piranha_plant(Player*, struct PiranhaPlant*);
+s32 collision_yoshi_egg(Player*, struct YoshiValleyEgg*);
+s32 collision_tree(Player*, struct Actor*);
+s32 query_collision_player_vs_actor_item(Player*, struct Actor*);
+s32 query_collision_actor_vs_actor(struct Actor*, struct Actor*);
+void destroy_destructable_actor(struct Actor*);
+void play_sound_on_destructible_actor_collision(struct Actor*, struct Actor*);
+void evaluate_actor_collision_between_two_destructible_actors(struct Actor*, struct Actor*);
+void evaluate_collision_between_player_actor(Player*, struct Actor*);
+void evaluate_collision_for_players_and_actors(void);
+void evaluate_collision_for_destructible_actors(void);
void func_802A1064(struct FakeItemBox*);
void update_actor_fake_item_box(struct FakeItemBox*);
-void func_802A14BC(f32, f32, f32);
+void init_actor_hot_air_balloon_item_box(f32, f32, f32);
void update_actor_item_box_hot_air_balloon(struct ItemBox*);
void update_actor_item_box(struct ItemBox*);
-void func_802A171C(Camera*, struct FakeItemBox*);
-void func_802A1EA0(Camera*, struct ItemBox*);
+void render_actor_fake_item_box(Camera*, struct FakeItemBox*);
+void render_actor_item_box(Camera*, struct ItemBox*);
void render_actor_wario_sign(Camera*, struct Actor*);
-void func_802A27A0(Camera*, Mat4, struct YoshiValleyEgg*, u16);
+void render_actor_yoshi_egg(Camera*, Mat4, struct YoshiValleyEgg*, u16);
void render_actor_mario_sign(Camera*, Mat4, struct Actor*);
-void func_802A2AD0(Camera*, struct RailroadCrossing*);
-void func_802A2C78(Camera*, Mat4, struct Actor*);
-void func_802A2F34(struct UnkStruct_800DC5EC*);
+void render_actor_railroad_crossing(Camera*, struct RailroadCrossing*);
+void render_actor_palm_tree(Camera*, Mat4, struct PalmTree*);
+void render_item_boxes(struct UnkStruct_800DC5EC*);
void render_course_actors(struct UnkStruct_800DC5EC*);
void update_course_actors(void);
@@ -173,4 +177,6 @@ extern s8 D_800DC628[];
extern s8 D_800DC630[];
extern s8 D_802B8864[];
+/** @endcond */
+
#endif // ACTORS_H
diff --git a/src/racing/actors_extended.c b/src/racing/actors_extended.c
index afc795e09..a28d64215 100644
--- a/src/racing/actors_extended.c
+++ b/src/racing/actors_extended.c
@@ -32,7 +32,7 @@ void copy_collision(Collision *arg0, Collision *arg1) {
vec3f_copy_return(arg1->orientationVector, arg0->orientationVector);
}
-void func_802B02B4(struct ShellActor *shell, s32 shellType) {
+void triple_shell_actor_collide_with_player(struct ShellActor *shell, s32 shellType) {
TripleShellParent *parent = (TripleShellParent *) &gActorList[shell->parentIndex];
parent->shellsAvailable--;
@@ -95,7 +95,7 @@ void func_802B04E8(UNUSED struct BananaActor *arg0, s16 bananaIndex) {
}
// Handle a banana being ran over while it is still part of a banana bunch
-void func_802B0570(struct BananaActor *banana) {
+void destroy_banana_in_banana_bunch(struct BananaActor *banana) {
struct BananaBunchParent *temp_v0_2;
func_802B0464(banana->youngerIndex);
@@ -439,9 +439,9 @@ void update_actor_triple_shell(TripleShellParent *parent, s16 shellType) {
func_800C9060(parent->playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x04));
func_800C90F4(parent->playerId, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x00));
if (parent->type == ACTOR_TRIPLE_RED_SHELL) {
- func_8000ED80(parent->shellIndices[0]);
+ add_red_shell_in_unexpired_actor_list(parent->shellIndices[0]);
} else {
- func_8000EDC8(parent->shellIndices[0]);
+ add_green_shell_in_unexpired_actor_list(parent->shellIndices[0]);
}
parent->shellIndices[0] = -1.0f;
parent->shellsAvailable -= 1;
@@ -464,9 +464,9 @@ void update_actor_triple_shell(TripleShellParent *parent, s16 shellType) {
func_800C90F4(parent->playerId, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x00));
func_800C9060(parent->playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x04));
if (parent->type == ACTOR_TRIPLE_RED_SHELL) {
- func_8000ED80(parent->shellIndices[1]);
+ add_red_shell_in_unexpired_actor_list(parent->shellIndices[1]);
} else {
- func_8000EDC8(parent->shellIndices[1]);
+ add_green_shell_in_unexpired_actor_list(parent->shellIndices[1]);
}
parent->shellIndices[1] = -1.0f;
parent->shellsAvailable -= 1;
@@ -489,9 +489,9 @@ void update_actor_triple_shell(TripleShellParent *parent, s16 shellType) {
func_800C9060(parent->playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x04));
func_800C90F4(parent->playerId, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x00));
if (parent->type == ACTOR_TRIPLE_RED_SHELL) {
- func_8000ED80(parent->shellIndices[2]);
+ add_red_shell_in_unexpired_actor_list(parent->shellIndices[2]);
} else {
- func_8000EDC8(parent->shellIndices[2]);
+ add_green_shell_in_unexpired_actor_list(parent->shellIndices[2]);
}
parent->shellIndices[2] = -1.0f;
parent->shellsAvailable -= 1;
@@ -514,7 +514,7 @@ s32 use_banana_bunch_item(Player *player) {
struct BananaBunchParent *bananaBunch;
// this have a animation of spawning so see update_actor_banana_bunch
- actorIndex = addActorToEmptySlot(startingPos, startingRot, startingVelocity, ACTOR_BANANA_BUNCH);
+ actorIndex = add_actor_to_empty_slot(startingPos, startingRot, startingVelocity, ACTOR_BANANA_BUNCH);
if (actorIndex < 0) {
return actorIndex;
}
@@ -533,7 +533,7 @@ s32 use_triple_shell_item(Player *player, s16 tripleShellType) {
TripleShellParent *parent;
// this have a animation of spawning so see update_actor_triple_shell
- actorIndex = addActorToEmptySlot(startingPos, startingRot, startingVelocity, tripleShellType);
+ actorIndex = add_actor_to_empty_slot(startingPos, startingRot, startingVelocity, tripleShellType);
if (actorIndex < 0) {
return actorIndex;
}
@@ -562,7 +562,7 @@ s32 init_triple_shell(TripleShellParent *parent, Player *player, s16 shellType,
startingPos[1] += player->pos[1];
startingPos[2] += player->pos[2];
- actorIndex = addActorToEmptySlot(startingPos, startingRot, startingVelocity, shellType);
+ actorIndex = add_actor_to_empty_slot(startingPos, startingRot, startingVelocity, shellType);
if (actorIndex < 0) {
parent->shellIndices[shellId] = -1.0f;
return -1;
@@ -613,7 +613,7 @@ s32 use_green_shell_item(Player *player) {
startingPos[2] += player->pos[2];
// spawn the shell
- actorIndex = addActorToEmptySlot(startingPos, startingRot, startingVelocity, ACTOR_GREEN_SHELL);
+ actorIndex = add_actor_to_empty_slot(startingPos, startingRot, startingVelocity, ACTOR_GREEN_SHELL);
if (actorIndex < 0) {
return actorIndex;
}
@@ -652,7 +652,7 @@ s32 use_red_shell_item(Player *player) {
startingPos[2] += player->pos[2];
// spawn the shell
- actorIndex = addActorToEmptySlot(startingPos, startingRot, startingVelocity, ACTOR_RED_SHELL);
+ actorIndex = add_actor_to_empty_slot(startingPos, startingRot, startingVelocity, ACTOR_RED_SHELL);
if (actorIndex < 0) {
return actorIndex;
}
@@ -676,182 +676,7 @@ void use_blue_shell_item(Player *player) {
gActorList[use_red_shell_item(player)].type = ACTOR_BLUE_SPINY_SHELL;
}
-void update_actor_banana(struct BananaActor *banana) {
- UNUSED f32 pad;
- Player *player;
- struct BananaActor *elderBanana;
- struct Controller *controller;
- Vec3f someOtherVelocity;
- Vec3f someVelocity;
- f32 temp_f0;
- UNUSED f32 var_f8;
- UNUSED f32 pad2;
- UNUSED f32 pad3;
- UNUSED f32 pad4[2];
- f32 temp_f12;
- f32 temp_f2;
- f32 temp_f14;
- f32 temp_f16;
- f32 unkX;
- f32 unkY;
- f32 unkZ;
-
- player = &gPlayers[banana->rot[0]];
- switch (banana->state) {
- case HELD_BANANA:
- temp_f2 = player->pos[0] - banana->pos[0];
- temp_f14 = player->pos[1] - banana->pos[1];
- temp_f16 = player->pos[2] - banana->pos[2];
- temp_f12 = sqrtf((temp_f2 * temp_f2) + (temp_f14 * temp_f14) + (temp_f16 * temp_f16)) / 10.0f;
- if (temp_f12 == 0.0f) {
- banana->pos[0] = player->pos[0] + 0.2f;
- banana->pos[1] = player->pos[1] + 0.2f;
- banana->pos[2] = player->pos[2] + 0.2f;
- } else {
- temp_f2 /= temp_f12;
- temp_f14 /= temp_f12;
- temp_f16 /= temp_f12;
- banana->pos[0] = player->pos[0] - temp_f2;
- banana->pos[1] = player->pos[1] - temp_f14 - 2.0f;
- banana->pos[2] = player->pos[2] - temp_f16;
- }
- func_802ADDC8(&banana->unk30, banana->boundingBoxSize + 1.0f, banana->pos[0], banana->pos[1], banana->pos[2]);
- func_802B4E30((struct Actor *) banana);
- if ((player->type & PLAYER_HUMAN) != 0) {
- if (gDemoMode) {
- controller = gControllerOne;
- } else {
- controller = &gControllers[banana->rot[0]];
- }
- if ((controller->buttonDepressed & Z_TRIG) != 0) {
- controller->buttonDepressed &= ~Z_TRIG;
- banana->state = 1;
- banana->unk_04 = 0x00B4;
- player->soundEffects &= ~HOLD_BANANA_SOUND_EFFECT;
- func_800C9060(player - gPlayerOne, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x12));
- pad3 = controller->rawStickY;
- if ((pad3 > 30.0f) && (controller->rawStickX < 10) && (controller->rawStickX >= -9)) {
- pad3 = pad3 - ((f32) 30);
- pad3 = (pad3 / 20.0f) + 0.5f;
- if (player->unk_094 < 2.0f) {
- temp_f0 = 4.0f;
- } else {
- temp_f0 = (player->unk_094 * 0.75f) + 3.5f + pad3;
- }
- vec3f_set(someVelocity, 0, pad3, temp_f0);
- func_802B64C4(someVelocity, player->rotation[1] + player->unk_0C0);
- banana->velocity[0] = someVelocity[0];
- banana->velocity[1] = someVelocity[1];
- banana->velocity[2] = someVelocity[2];
- } else {
- banana->velocity[0] = 0;
- banana->velocity[1] = 1.5f;
- banana->velocity[2] = 0;
- }
- }
- }
- break;
- case DROPPED_BANANA:
- if (banana->unk_04 != 0) {
- banana->unk_04 -= 1;
- if (banana->unk_04 == 0) {
- banana->flags &= ~0x1000;
- }
- }
- banana->pos[0] += banana->velocity[0];
- banana->pos[2] += banana->velocity[2];
- if (banana->velocity[1] > -1.0f) {
- banana->velocity[1] -= 0.15f;
- }
- banana->pos[1] += banana->velocity[1];
- if ((banana->pos[2] < (f32) D_8015F6F2) || ((f32) D_8015F6F0 < banana->pos[2]) || (banana->pos[0] < (f32) D_8015F6EA) || ((f32) D_8015F6E8 < banana->pos[0]) || (banana->pos[1] < (f32) D_8015F6EE)) {
- func_8029FDC8((struct Actor *) banana);
- } else {
- func_802ADDC8(&banana->unk30, banana->boundingBoxSize + 1.0f, banana->pos[0], banana->pos[1], banana->pos[2]);
- banana->unk30.unk34 = 1;
- if ((banana->unk30.unk34 != 0) && (banana->unk30.unk3C[2] < 0.0f)) {
- someOtherVelocity[0] = -banana->unk30.orientationVector[0];
- someOtherVelocity[1] = -banana->unk30.orientationVector[1];
- someOtherVelocity[2] = -banana->unk30.orientationVector[2];
- banana->pos[0] += someOtherVelocity[0] * banana->unk30.unk3C[2];
- banana->pos[1] += someOtherVelocity[1] * banana->unk30.unk3C[2];
- banana->pos[2] += someOtherVelocity[2] * banana->unk30.unk3C[2];
- banana->flags &= ~0x1000;
- banana->state = 4;
- }
- }
- break;
- case FIRST_BANANA_BUNCH_BANANA:
- someVelocity[0] = 0.0f;
- someVelocity[1] = 0.0f;
- someVelocity[2] = -5.0f;
- func_802B64C4(someVelocity, player->rotation[1] + player->unk_0C0);
- unkX = player->pos[0] + someVelocity[0];
- unkY = player->pos[1] + someVelocity[1];
- unkZ = player->pos[2] + someVelocity[2];
- temp_f2 = unkX - banana->pos[0];
- temp_f14 = unkY - banana->pos[1];
- temp_f16 = unkZ - banana->pos[2];
- temp_f0 = sqrtf((temp_f2 * temp_f2) + (temp_f14 * temp_f14) + (temp_f16 * temp_f16));
- if (temp_f0 == 0.0f) {
- banana->pos[0] = player->pos[0] + 0.2f;
- banana->pos[1] = player->pos[1] + 0.2f;
- banana->pos[2] = player->pos[2] + 0.2f;
- } else {
- temp_f2 /= temp_f0;
- temp_f14 /= temp_f0;
- temp_f16 /= temp_f0;
- banana->pos[0] = someVelocity[0] + (unkX - temp_f2);
- banana->pos[1] = unkY - temp_f14 - 2.0f;
- banana->pos[2] = unkZ - temp_f16;
- }
- func_802ADDC8(&banana->unk30, banana->boundingBoxSize + 1.0f, banana->pos[0], banana->pos[1], banana->pos[2]);
- func_802B4E30((struct Actor *) banana);
- break;
- case BANANA_BUNCH_BANANA:
- elderBanana = (struct BananaActor*)&gActorList[banana->elderIndex];
- temp_f2 = elderBanana->pos[0] - banana->pos[0];
- temp_f14 = elderBanana->pos[1] - banana->pos[1];
- temp_f16 = elderBanana->pos[2] - banana->pos[2];
- temp_f12 = sqrtf((temp_f2 * temp_f2) + (temp_f14 * temp_f14) + (temp_f16 * temp_f16)) / 5.0f;
- if (temp_f12 == 0.0f) {
- banana->pos[0] = elderBanana->pos[0] + 0.2f;
- banana->pos[1] = elderBanana->pos[1] + 0.2f;
- banana->pos[2] = elderBanana->pos[2] + 0.2f;
- } else {
- temp_f2 /= temp_f12;
- temp_f14 /= temp_f12;
- temp_f16 /= temp_f12;
- banana->pos[0] = elderBanana->pos[0] - temp_f2;
- banana->pos[1] = elderBanana->pos[1] - temp_f14 - 2.0f;
- banana->pos[2] = elderBanana->pos[2] - temp_f16;
- }
- var_f8 = banana->pos[2];
- func_802ADDC8(&banana->unk30, banana->boundingBoxSize + 1.0f, banana->pos[0], banana->pos[1], banana->pos[2]);
- func_802B4E30((struct Actor *) banana);
- break;
- case DESTROYED_BANANA:
- banana->velocity[1] -= 0.3f;
- if (banana->velocity[1] < -5.0f) {
- banana->velocity[1] = -5.0f;
- }
- banana->pos[1] += banana->velocity[1];
- banana->rot[0] += 0x16C;
- banana->rot[1] -= 0x5B0;
- banana->rot[2] += 0x38E;
- banana->unk_04 -= 1;
- if (banana->unk_04 == 0) {
- destroy_actor((struct Actor *) banana);
- }
- break;
- case BANANA_ON_GROUND:
- banana->flags |= 0xC000;
- banana->flags &= ~0x1000;
- break;
- default:
- break;
- }
-}
+#include "actors/banana/update.inc.c"
// This function could reasonably be called "spawn_bananas_for_banana_bunch" or similar
void func_802B2914(struct BananaBunchParent *banana_bunch, Player *player, s16 bananaId) {
@@ -877,7 +702,7 @@ void func_802B2914(struct BananaBunchParent *banana_bunch, Player *player, s16 b
startingRot[0] = 0;
startingRot[1] = 0;
startingRot[2] = 0;
- actorIndex = addActorToEmptySlot(startingPos, startingRot, startingVelocity, ACTOR_BANANA);
+ actorIndex = add_actor_to_empty_slot(startingPos, startingRot, startingVelocity, ACTOR_BANANA);
if (actorIndex >= 0) {
newBanana = (struct BananaActor*)&gActorList[actorIndex];
startingPos[0] = player->pos[0];
@@ -963,7 +788,7 @@ s32 use_fake_itembox_item(Player *player) {
startingRot[2] = 0;
// spawn the itembox
- actorIndex = addActorToEmptySlot(startingPos, startingRot, startingVelocity, ACTOR_FAKE_ITEM_BOX);
+ actorIndex = add_actor_to_empty_slot(startingPos, startingRot, startingVelocity, ACTOR_FAKE_ITEM_BOX);
if (actorIndex < 0) {
return actorIndex;
}
@@ -1009,7 +834,7 @@ s32 use_banana_item(Player *player) {
startingRot[1] = 0;
startingRot[2] = 0;
- actorIndex = addActorToEmptySlot(startingPos, startingRot, startingVelocity, ACTOR_BANANA); // spawn banana
+ actorIndex = add_actor_to_empty_slot(startingPos, startingRot, startingVelocity, ACTOR_BANANA); // spawn banana
if (actorIndex < 0) {
return actorIndex;
}
@@ -1099,7 +924,7 @@ void player_use_item(Player *player) {
}
// Check if a player is using an item?
-void func_802B30EC(void) {
+void check_player_use_item(void) {
Player *player;
struct Controller *target;
struct Controller *controller;
@@ -1107,7 +932,7 @@ void func_802B30EC(void) {
for (player = &gPlayers[0], loopController = &gControllers[0], target = &gControllers[4]; loopController != target; player++, loopController++) {
controller = loopController;
- if (func_800910E4(player) == 0) {
+ if (prevent_item_use(player) == FALSE) {
if((player->type & PLAYER_INVISIBLE_OR_BOMB) != 0){
if ((player - gPlayerTwo) == 0) {
controller = gControllerSix;
@@ -1130,644 +955,9 @@ void func_802B30EC(void) {
}
}
-void update_actor_green_shell(struct ShellActor *shell) {
- Player *player;
- UNUSED f32 pad9;
- UNUSED f32 padA;
- Vec3f somePos2;
- Vec3f somePosVel;
- f32 var_f2;
- struct Controller *controller;
- TripleShellParent *parent;
- UNUSED f32 pad0;
- UNUSED f32 pad1;
- UNUSED f32 pad2;
- UNUSED f32 pad3;
- UNUSED f32 pad4;
- UNUSED f32 pad5;
- UNUSED f32 pad6;
- UNUSED f32 pad7;
- UNUSED f32 pad8;
-
- pad0 = shell->pos[0];
- pad6 = shell->pos[1];
- pad1 = shell->pos[2];
- if ((pad1 < D_8015F6F2) || (D_8015F6F0 < pad1) || (pad0 < D_8015F6EA) || (D_8015F6E8 < pad0) || (pad6 < D_8015F6EE)) {
- func_8029FDC8((struct Actor *) shell);
- }
- shell->rotVelocity += 0x71C;
- switch (shell->state) {
- case HELD_SHELL:
- player = &gPlayers[shell->playerId];
- copy_collision(&player->unk_110, &shell->unk30);
- somePosVel[0] = 0.0f;
- somePosVel[1] = player->boundingBoxSize;
- somePosVel[2] = -(player->boundingBoxSize + shell->boundingBoxSize + 2.0f);
- mtxf_translate_vec3f_mat3(somePosVel, player->orientationMatrix);
- shell->pos[0] = player->pos[0] + somePosVel[0];
- pad2 = player->pos[1] - somePosVel[1];
- shell->pos[2] = player->pos[2] + somePosVel[2];
- pad0 = func_802ABE30(shell->pos[0], pad2, shell->pos[2], player->unk_110.unk3A);
- pad1 = pad2 - pad0;
- if ((pad1 < 5.0f) && (pad1 > -5.0f)) {
- shell->pos[1] = shell->boundingBoxSize + pad0;
- } else {
- shell->pos[1] = pad2;
- }
- if ((player->type & PLAYER_HUMAN) != 0) {
- controller = &gControllers[shell->playerId];
- if ((controller->buttonDepressed & Z_TRIG) != 0) {
- controller->buttonDepressed &= ~Z_TRIG;
- if (controller->rawStickY < -0x2D) {
- var_f2 = 8.0f;
- if (player->unk_094 > 8.0f) {
- var_f2 = player->unk_094 * 1.2f;
- }
- somePosVel[0] = 0.0f;
- somePosVel[1] = 0.0f;
- somePosVel[2] = -var_f2;
- func_802B64C4(somePosVel, player->rotation[1] + player->unk_0C0);
- shell->velocity[0] = somePosVel[0];
- shell->velocity[1] = somePosVel[1];
- shell->velocity[2] = somePosVel[2];
- shell->state = 2;
- func_800C9060(shell->playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x04));
- func_800C90F4(shell->playerId, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x00));
- func_8000EDC8((struct Actor*)shell - gActorList);
- return;
- } else {
- shell->state = 1;
- if (player->unk_0C0 > 0) {
- shell->rotAngle = 0x78E3;
- } else {
- shell->rotAngle = -0x78E4;
- }
- }
- }
- }
- break;
- case RELEASED_SHELL:
- player = &gPlayers[shell->playerId];
- if (shell->rotAngle > 0) {
- shell->rotAngle -= 0xE38;
- if (shell->rotAngle < 0) {
- shell->state = 2;
- shell->someTimer = 0x001E;
- func_800C9060(shell->playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x04));
- func_800C90F4(shell->playerId, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x00));
- func_8000EDC8((struct Actor*)shell - gActorList);
- }
- } else {
- shell->rotAngle += 0xE38;
- if (shell->rotAngle > 0) {
- shell->state = 2;
- shell->someTimer = 0x001E;
- func_800C9060(shell->playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x04));
- func_800C90F4(shell->playerId, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x00));
- func_8000EDC8((struct Actor*)shell - gActorList);
- }
- }
- if (shell->state == 2) {
- var_f2 = 8.0f;
- if (player->unk_094 > 8.0f) {
- var_f2 = player->unk_094 * 1.2f;
- }
- somePosVel[0] = 0.0f;
- somePosVel[1] = 0.0f;
- somePosVel[2] = var_f2;
- func_802B64C4(somePosVel, player->rotation[1] + player->unk_0C0);
- shell->velocity[0] = somePosVel[0];
- shell->velocity[1] = somePosVel[1];
- shell->velocity[2] = somePosVel[2];
- } else {
- somePosVel[0] = sins(shell->rotAngle) * 6.0f;
- somePosVel[1] = shell->boundingBoxSize - player->boundingBoxSize;
- somePosVel[2] = coss(shell->rotAngle) * 6.0f;
- mtxf_translate_vec3f_mat3(somePosVel, player->orientationMatrix);
- shell->pos[0] = player->pos[0] + somePosVel[0];
- shell->pos[1] = player->pos[1] + somePosVel[1];
- shell->pos[2] = player->pos[2] + somePosVel[2];
- }
- break;
- case MOVING_SHELL:
- if (shell->parentIndex > 0) {
- shell->parentIndex -= 1;
- if (shell->parentIndex == 0) {
- shell->flags &= ~0x1000;
- }
- }
- shell->velocity[1] -= 0.5f;
- if (shell->velocity[1] < -2.0f) {
- shell->velocity[1] = -2.0f;
- }
- somePos2[0] = shell->pos[0];
- somePos2[1] = shell->pos[1];
- somePos2[2] = shell->pos[2];
- shell->pos[0] += shell->velocity[0];
- shell->pos[1] += shell->velocity[1];
- shell->pos[2] += shell->velocity[2];
- func_802AD950(&shell->unk30, 4.0f, shell->pos[0], shell->pos[1], shell->pos[2], somePos2[0], somePos2[1], somePos2[2]);
- func_802B4E30((struct Actor *) shell);
- if ((shell->unk30.unk3C[0] < 0.0f) || (shell->unk30.unk3C[1] < 0.0f)) {
- shell_collision(&shell->unk30, shell->velocity);
- func_800C98B8(shell->pos, shell->velocity, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x54));
- shell->flags |= 0x80;
- }
- break;
- case TRIPLE_GREEN_SHELL:
- player = &gPlayers[shell->playerId];
- parent = (TripleShellParent *) &gActorList[shell->parentIndex];
- if (parent->type != ACTOR_TRIPLE_GREEN_SHELL) {
- func_8029FDC8((struct Actor *) shell);
- } else {
- shell->rotAngle += parent->rotVelocity;
- somePosVel[0] = sins(shell->rotAngle) * 8.0f;
- somePosVel[1] = shell->boundingBoxSize - player->boundingBoxSize;
- somePosVel[2] = coss(shell->rotAngle) * 8.0f;
- mtxf_translate_vec3f_mat3(somePosVel, player->orientationMatrix);
- somePos2[0] = shell->pos[0];
- somePos2[1] = shell->pos[1];
- somePos2[2] = shell->pos[2];
- shell->pos[0] = player->pos[0] + somePosVel[0];
- shell->pos[1] = player->pos[1] + somePosVel[1];
- shell->pos[2] = player->pos[2] + somePosVel[2];
- func_802AD950(&shell->unk30, 4.0f, shell->pos[0], shell->pos[1], shell->pos[2], somePos2[0], somePos2[1], somePos2[2]);
- func_802B4E30((struct Actor *) shell);
- }
- break;
- case GREEN_SHELL_HIT_A_RACER:
- // Somehow, this fake match affects stack management up in case 2
- shell->velocity[1] -= (0, 0.3f);
- if (shell->velocity[1] < -5.0f) {
- shell->velocity[1] = -5.0f;
- }
- shell->rotAngle += 0x5B0;
- shell->someTimer -= 1;
- shell->pos[1] += shell->velocity[1];
- if (shell->someTimer == 0) {
- destroy_actor((struct Actor *) shell);
- }
- break;
- default:
- break;
- }
-}
-
-void func_802B3B44(struct ShellActor *shell) {
- u16 currentWaypoint;
- u16 nextWaypoint;
- f32 temp_f0;
- f32 temp_f0_2;
- f32 temp_f0_3;
- f32 temp_f12_3;
- f32 temp_f14_2;
- f32 temp_f16_2;
- f32 temp_f2;
- f32 temp_f12;
- f32 temp_f28;
- f32 temp_f20;
- f32 temp_f22;
- f32 temp_f24;
- f32 temp_f12_0;
- f32 temp_f12_1;
- f32 temp_f12_2;
- f32 temp_f18_3;
- f32 temp_f16_3;
- f32 temp_f26;
- Vec3f origPos;
-
- currentWaypoint = shell->pathIndex;
- temp_f2 = D_80164490[currentWaypoint].posX;
- temp_f12 = D_80164490[currentWaypoint].posY;
- temp_f28 = D_80164490[currentWaypoint].posZ;
- nextWaypoint = currentWaypoint + 1;
-
- if (nextWaypoint >= D_80164430) {
- nextWaypoint -= D_80164430;
- }
+#include "actors/green_shell/update.inc.c"
- temp_f20 = temp_f2 - shell->pos[0];
- temp_f22 = temp_f12 - shell->pos[1];
- temp_f24 = temp_f28 - shell->pos[2];
- temp_f0 = (temp_f20 * temp_f20) + (temp_f22 * temp_f22) + (temp_f24 * temp_f24);
- if (temp_f0 > 400.0f) {
- temp_f18_3 = D_80164490[nextWaypoint].posX;
- temp_f16_3 = D_80164490[nextWaypoint].posY;
- temp_f26 = D_80164490[nextWaypoint].posZ;
-
- temp_f12_0 = temp_f18_3 - shell->pos[0];
- temp_f12_1 = temp_f16_3 - shell->pos[1];
- temp_f12_2 = temp_f26 - shell->pos[2];
-
- temp_f0_3 = (temp_f12_0 * temp_f12_0) + (temp_f12_1 * temp_f12_1) + (temp_f12_2 * temp_f12_2);
- if (temp_f0_3 < temp_f0) {
- shell->pathIndex = nextWaypoint;
- } else {
- temp_f0_2 = sqrtf(temp_f0) * 4.0f;
- temp_f20 /= temp_f0_2;
- temp_f22 /= temp_f0_2;
- temp_f24 /= temp_f0_2;
-
- temp_f12_3 = shell->velocity[0];
- temp_f14_2 = shell->velocity[1];
- temp_f16_2 = shell->velocity[2];
-
- temp_f12_3 += temp_f20;
- temp_f14_2 += temp_f22;
- temp_f16_2 += temp_f24;
- temp_f0 = sqrtf((temp_f12_3 * temp_f12_3) + (temp_f14_2 * temp_f14_2) + (temp_f16_2 * temp_f16_2));
- if (temp_f0 > 6.0f) {
- temp_f0 /= 6.0f;
- temp_f12_3 /= temp_f0;
- temp_f14_2 /= temp_f0;
- temp_f16_2 /= temp_f0;
- }
- shell->velocity[0] = temp_f12_3;
- shell->velocity[1] = temp_f14_2;
- shell->velocity[2] = temp_f16_2;
-
- origPos[0] = shell->pos[0];
- origPos[1] = shell->pos[1];
- origPos[2] = shell->pos[2];
-
- shell->pos[0] += temp_f12_3;
- shell->pos[1] += temp_f14_2;
- shell->pos[2] += temp_f16_2;
- func_802AD950(&shell->unk30, 4.0f, shell->pos[0], shell->pos[1], shell->pos[2], origPos[0], origPos[1], origPos[2]);
- func_802B4E30((struct Actor *) shell);
- }
- } else {
- if (temp_f0 > 5.0f) {
- shell->pos[0] = temp_f2;
- shell->pos[1] = shell->boundingBoxSize + temp_f12;
- shell->pos[2] = temp_f28;
- shell->pathIndex = nextWaypoint;
- } else {
- temp_f18_3 = D_80164490[nextWaypoint].posX;
- temp_f16_3 = D_80164490[nextWaypoint].posY;
- temp_f26 = D_80164490[nextWaypoint].posZ;
-
- shell->pos[0] = (temp_f2 + temp_f18_3) * 0.5f;
- shell->pos[1] = ((temp_f12 + temp_f16_3) * 0.5f) + shell->boundingBoxSize;
- shell->pos[2] = (temp_f28 + temp_f26) * 0.5f;
-
- shell->velocity[0] = (temp_f18_3 - temp_f2) * 0.5f;
- shell->velocity[1] = (temp_f16_3 - temp_f12) * 0.5f;
- shell->velocity[2] = (temp_f26 - temp_f28) * 0.5f;
- }
- }
-}
-
-void func_802B3E7C(struct ShellActor *shell, Player *player) {
- f32 x_velocity;
- f32 z_velocity;
- f32 xz_dist;
- Vec3f newPosition;
-
- x_velocity = player->pos[0];
- x_velocity -= shell->pos[0];
- z_velocity = player->pos[2];
- z_velocity -= shell->pos[2];
- xz_dist = sqrtf((x_velocity * x_velocity) + (z_velocity * z_velocity)) / 8;
- if (xz_dist == 0.0f) {
- x_velocity = 0.0f;
- z_velocity = 0.0f;
- } else {
- x_velocity /= xz_dist;
- z_velocity /= xz_dist;
- }
-
- newPosition[0] = shell->pos[0];
- newPosition[1] = shell->pos[1];
- newPosition[2] = shell->pos[2];
- shell->pos[0] += x_velocity;
- shell->pos[1] -= 2.0f;
- shell->pos[2] += z_velocity;
- shell->velocity[0] = x_velocity;
- shell->velocity[1] = -2.0f;
- shell->velocity[2] = z_velocity;
-
- if (player->effects & BOO_EFFECT) {
- func_8029FDC8((struct Actor *) shell);
- } else {
- func_802AD950(&shell->unk30, 4.0f, shell->pos[0], shell->pos[1], shell->pos[2], newPosition[0], newPosition[1], newPosition[2]);
- func_802B4E30((struct Actor *) shell);
- func_802B4104(shell);
- }
-}
-
-/**
- * Only used in Battle mode
- * Likely trying to find the nearest player that is not the shell's owner and is not dead
-**/
-s16 func_802B3FD0(Player *owner, struct ShellActor *shell) {
- Player *player;
- s32 playerIndex;
- f32 playerToShellDistance;
- s16 playerId = -1;
- f32 smallestDistance = 25000000.0f;
-
- for (playerIndex = 0; playerIndex < 4; playerIndex++) {
- player = &gPlayers[playerIndex];
- if ((player->type & PLAYER_EXISTS) == 0) {continue;}
- if (player == owner) {continue; }
- if (gPlayerBalloonCount[playerIndex] < 0) { continue; }
- // func_802B51E8 is not quite a 3D distance function, it doubles (rather than squares) the Z difference of the positions
- playerToShellDistance = func_802B51E8(player->pos, shell->pos);
- if (playerToShellDistance < smallestDistance) {
- smallestDistance = playerToShellDistance;
- playerId = player - gPlayerOne;
- }
-
- }
-
- return playerId;
-}
-
-void func_802B4104(struct ShellActor *shell) {
- if ((shell->unk30.unk3C[0] < 0.0f) && ((shell->unk30.unk48[1] < 0.25f) || (shell->unk30.unk48[1] > -0.25f))) {
- func_8029FDC8((struct Actor *) shell);
- func_800C98B8(shell->pos, shell->velocity, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x54));
- shell->flags |= 0x80;
- } else if ((shell->unk30.unk3C[1] < 0.0f) && ((shell->unk30.unk54[1] < 0.25f) || (shell->unk30.unk54[1] < -0.25f))) {
- func_8029FDC8((struct Actor *) shell);
- func_800C98B8(shell->pos, shell->velocity, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x54));
- shell->flags |= 0x80;
- }
-}
-
-void update_actor_red_blue_shell(struct ShellActor *shell) {
- UNUSED f32 pad9;
- Player *player;
- f32 temp_f0;
- UNUSED f32 temp_f14;
- f32 temp_f2;
- s16 temp_v0;
- UNUSED s16 pad3;
- Vec3f somePosVel;
- struct Controller *controller;
- TripleShellParent *parent;
- UNUSED f32 pad0;
- UNUSED f32 pad1;
- UNUSED f32 pad2;
- UNUSED f32 pad4;
- UNUSED f32 pad5;
- UNUSED f32 pad6;
- UNUSED f32 pad7;
- UNUSED f32 pad8;
- UNUSED f32 pad10;
- UNUSED f32 pad11;
- UNUSED f32 pad12;
- UNUSED s16 pad13;
- UNUSED s16 pad13_2;
- UNUSED f32 pad14;
- UNUSED f32 pad15;
- UNUSED f32 pad16;
- UNUSED f32 pad17;
- Vec3f origPos;
-
- pad1 = shell->pos[0];
- pad0 = shell->pos[2];
- pad2 = shell->pos[1];
- pad13 = shell->type;
- if ((pad0 < (f32) D_8015F6F2) || ((f32) D_8015F6F0 < pad0) || (pad1 < (f32) D_8015F6EA) || ((f32) D_8015F6E8 < pad1) || (pad2 < (f32) D_8015F6EE)) {
- func_8029FDC8((struct Actor *) shell);
- }
-
- shell->rotVelocity += 0x71C;
- switch (shell->state) {
- case HELD_SHELL:
- player = &gPlayers[shell->playerId];
- copy_collision(&player->unk_110, &shell->unk30);
- somePosVel[0] = 0.0f;
- somePosVel[1] = player->boundingBoxSize;
- somePosVel[2] = -(player->boundingBoxSize + shell->boundingBoxSize + 2.0f);
- mtxf_translate_vec3f_mat3(somePosVel, player->orientationMatrix);
- shell->pos[0] = player->pos[0] + somePosVel[0];
- pad7 = player->pos[1] - somePosVel[1];
- shell->pos[2] = player->pos[2] + somePosVel[2];
- temp_f0 = func_802ABE30(shell->pos[0], pad7, shell->pos[2], player->unk_110.unk3A);
- temp_f2 = pad7 - temp_f0;
-
- if ((temp_f2 < 5.0f) && (temp_f2 > -5.0f)) {
- shell->pos[1] = shell->boundingBoxSize + temp_f0;
- } else {
- shell->pos[1] = pad7;
- }
-
- if ((player->type & PLAYER_HUMAN) != 0) {
- if (gDemoMode) {
- controller = gControllerOne;
- } else {
- controller = &gControllers[shell->playerId];
- }
- } else {
- controller = gControllerOne;
- }
-
- if ((controller->buttonDepressed & Z_TRIG) != 0) {
- controller->buttonDepressed &= ~Z_TRIG;
- shell->state = RELEASED_SHELL;
- if (player->unk_0C0 > 0) {
- shell->rotAngle = 0x78E3;
- } else {
- shell->rotAngle = -0x78E4;
- }
- }
- break;
- case RELEASED_SHELL:
- player = &gPlayers[shell->playerId];
- if (shell->rotAngle > 0) {
- shell->rotAngle -= 0x71C;
- if (shell->rotAngle < 0) {
- shell->state = MOVING_SHELL;
- func_800C9060(shell->playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x04));
- func_800C90F4(shell->playerId, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x00));
- if (pad13 == ACTOR_RED_SHELL) {
- func_8000ED80((struct Actor*)shell - gActorList);
- } else {
- func_8000EE10((struct Actor*)shell - gActorList);
- func_800C9D80(shell->pos, shell->velocity, SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x08));
- }
- }
- } else {
- shell->rotAngle += 0x71C;
- if (shell->rotAngle > 0) {
- shell->state = MOVING_SHELL;
- func_800C9060(shell->playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x04));
- func_800C90F4(shell->playerId, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x00));
- if (pad13 == ACTOR_RED_SHELL) {
- func_8000ED80((struct Actor*)shell - gActorList);
- } else {
- func_8000EE10((struct Actor*)shell - gActorList);
- func_800C9D80(shell->pos, shell->velocity, SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x08));
- }
- }
- }
- if (shell->state == MOVING_SHELL) {
- shell->someTimer = 0x001E;
- temp_f0 = 8.0f;
- if (player->unk_094 > 8.0f) {
- temp_f0 = player->unk_094 * 1.2f;
- }
- somePosVel[0] = 0.0f;
- somePosVel[1] = 0.0f;
- somePosVel[2] = temp_f0;
- func_802B64C4(somePosVel, (s16) (player->rotation[1] + player->unk_0C0));
- shell->velocity[0] = somePosVel[0];
- shell->velocity[1] = somePosVel[1];
- shell->velocity[2] = somePosVel[2];
- } else {
- somePosVel[0] = sins(shell->rotAngle) * 8.0f;
- somePosVel[1] = shell->boundingBoxSize - player->boundingBoxSize;
- somePosVel[2] = coss(shell->rotAngle) * 8.0f;
- mtxf_translate_vec3f_mat3(somePosVel, player->orientationMatrix);
- shell->pos[0] = player->pos[0] + somePosVel[0];
- shell->pos[1] = player->pos[1] + somePosVel[1];
- shell->pos[2] = player->pos[2] + somePosVel[2];
- }
- break;
- case MOVING_SHELL:
- player = &gPlayers[shell->playerId];
- shell->someTimer -= 1;
- if (shell->someTimer == 0) {
- shell->flags &= 0xEFFF;
- if (shell->type == ACTOR_BLUE_SPINY_SHELL) {
- shell->targetPlayer = gPlayerPositionLUT[0];
- shell->state = BLUE_SHELL_LOCK_ON;
- shell->shellId = 1000.0f;
- temp_v0 = gNearestWaypointByPlayerId[player - gPlayerOne] + 8;
- if ((s32) D_80164430 < temp_v0) {
- temp_v0 -= D_80164430;
- }
- shell->pathIndex = temp_v0;
- } else if (gModeSelection == BATTLE) {
- shell->shellId = 1000.0f;
- shell->targetPlayer = func_802B3FD0(player, shell);
- if (shell->targetPlayer < 0) {
- shell->flags = 0x8000;
- shell->velocity[1] = 3.0f;
- shell->pathIndex = 0;
- shell->someTimer = 0x003C;
- shell->state = DESTROYED_SHELL;
- } else {
- shell->state = RED_SHELL_LOCK_ON;
- }
- } else {
- if (player->currentRank == 0) {
- shell->state = TRIPLE_GREEN_SHELL;
- shell->someTimer = 0x0258;
- temp_v0 = gNearestWaypointByPlayerId[player - gPlayerOne] + 8;
- if ((s32) D_80164430 < temp_v0) {
- temp_v0 -= D_80164430;
- }
- shell->pathIndex = temp_v0;
- } else if (player->currentRank >= 5) {
- shell->state = GREEN_SHELL_HIT_A_RACER;
- shell->shellId = 1000.0f;
- temp_v0 = gNearestWaypointByPlayerId[player - gPlayerOne] + 8;
- if ((s32) D_80164430 < temp_v0) {
- temp_v0 -= D_80164430;
- }
- shell->pathIndex = temp_v0;
- shell->targetPlayer = gPlayerPositionLUT[player->currentRank - 1];
- } else {
- shell->state = RED_SHELL_LOCK_ON;
- shell->shellId = 1000.0f;
- shell->targetPlayer = gPlayerPositionLUT[player->currentRank - 1];
- }
- }
- }
- shell->velocity[1] -= 0.5;
- if (shell->velocity[1] < -2.0f) {
- shell->velocity[1] = -2.0f;
- }
- origPos[0] = shell->pos[0];
- origPos[1] = shell->pos[1];
- origPos[2] = shell->pos[2];
- shell->pos[0] += shell->velocity[0];
- shell->pos[1] += shell->velocity[1];
- shell->pos[2] += shell->velocity[2];
- func_802AD950(&shell->unk30, 4.0f, shell->pos[0], shell->pos[1], shell->pos[2], origPos[0], origPos[1], origPos[2]);
- func_802B4E30((struct Actor *) shell);
- func_802B4104(shell);
- break;
- case RED_SHELL_LOCK_ON:
- func_802B3E7C(shell, &gPlayers[shell->targetPlayer]);
- break;
- case TRIPLE_GREEN_SHELL:
- func_802B3B44(shell);
- if (shell->someTimer == 0) {
- if ((shell->flags & 0xF) == 0) {
- func_8029FDC8((struct Actor *) shell);
- } else {
- shell->someTimer -= 1;
- }
- }
- break;
- case GREEN_SHELL_HIT_A_RACER:
- func_802B3B44(shell);
- player = &gPlayers[shell->targetPlayer];
- temp_f0 = player->pos[0];
- temp_f0 -= shell->pos[0];
- temp_f2 = player->pos[2];
- temp_f2 -= shell->pos[2];
- if (((temp_f0 * temp_f0) + (temp_f2 * temp_f2)) < 40000.0f) {
- shell->state = RED_SHELL_LOCK_ON;
- }
- break;
- case TRIPLE_RED_SHELL:
- player = &gPlayers[shell->playerId];
- parent = (TripleShellParent *) &gActorList[shell->parentIndex];
- if (parent->type != ACTOR_TRIPLE_RED_SHELL) {
- func_8029FDC8((struct Actor *) shell);
- } else {
- shell->rotAngle += parent->rotVelocity;
- somePosVel[0] = sins(shell->rotAngle) * 8.0f;
- somePosVel[1] = shell->boundingBoxSize - player->boundingBoxSize;
- somePosVel[2] = coss(shell->rotAngle) * 8.0f;
- mtxf_translate_vec3f_mat3(somePosVel, player->orientationMatrix);
- origPos[0] = shell->pos[0];
- origPos[1] = shell->pos[1];
- origPos[2] = shell->pos[2];
- shell->pos[0] = player->pos[0] + somePosVel[0];
- shell->pos[1] = player->pos[1] + somePosVel[1];
- shell->pos[2] = player->pos[2] + somePosVel[2];
- func_802AD950(&shell->unk30, 4.0f, shell->pos[0], shell->pos[1], shell->pos[2], origPos[0], origPos[1], origPos[2]);
- func_802B4E30((struct Actor *) shell);
- }
- break;
- case DESTROYED_SHELL:
- shell->velocity[1] -= 0.3f;
- if (shell->velocity[1] < -5.0f) {
- shell->velocity[1] = -5.0f;
- }
- shell->rotAngle += 0x5B0;
- shell->someTimer -= 1;
- shell->pos[1] += shell->velocity[1];
- if (shell->someTimer == 0) {
- destroy_actor((struct Actor *) shell);
- }
- break;
- case BLUE_SHELL_LOCK_ON:
- func_802B3B44(shell);
- shell->targetPlayer = gPlayerPositionLUT[0];
- player = &gPlayers[gPlayerPositionLUT[0]];
- temp_f0 = player->pos[0];
- temp_f0 -= shell->pos[0];
- temp_f2 = player->pos[2];
- temp_f2 -= shell->pos[2];
- if (((temp_f0 * temp_f0) + (temp_f2 * temp_f2)) < 40000.0f) {
- shell->state = BLUE_SHELL_TARGET_ELIMINATED;
- }
- break;
- case 9:
- func_802B3E7C(shell, &gPlayers[shell->targetPlayer]);
- break;
- default:
- break;
- }
-}
+#include "actors/blue_and_red_shells/update.inc.c"
void func_802B4E30(struct Actor *arg0) {
if ((arg0->unk30.unk3C[2] < 0.0f) && (arg0->unk30.unk34 == 1)) {
diff --git a/src/racing/actors_extended.h b/src/racing/actors_extended.h
index e0143668f..89aa28e5a 100644
--- a/src/racing/actors_extended.h
+++ b/src/racing/actors_extended.h
@@ -4,12 +4,14 @@
#include "common_structs.h"
#include "actor_types.h"
+/** @cond */
+
void copy_collision(Collision*, Collision*);
-void func_802B02B4(struct ShellActor*, s32);
+void triple_shell_actor_collide_with_player(struct ShellActor*, s32);
void func_802B039C(struct BananaActor*);
void func_802B0464(s16);
void func_802B04E8(struct BananaActor*, s16);
-void func_802B0570(struct BananaActor*);
+void destroy_banana_in_banana_bunch(struct BananaActor*);
void func_802B0648(struct BananaBunchParent*);
void func_802B0788(s16, struct BananaBunchParent*, Player*);
s32 func_802B09C0(s16);
@@ -28,7 +30,7 @@ s32 use_fake_itembox_item(Player*);
s32 use_banana_item(Player*);
void use_thunder_item(Player*);
void player_use_item(Player*);
-void func_802B30EC(void);
+void check_player_use_item(void);
void update_actor_green_shell(struct ShellActor*);
void func_802B3B44(struct ShellActor*);
void func_802B3E7C(struct ShellActor*, Player*);
@@ -44,4 +46,6 @@ extern f32 D_802B9F68;
extern s16 gPlayerBalloonCount[];
+/** @endcond */
+
#endif // ACTORS_EXTENDED_H
diff --git a/src/racing/collision.c b/src/racing/collision.c
index a13fbea62..92bb12ac1 100644
--- a/src/racing/collision.c
+++ b/src/racing/collision.c
@@ -77,7 +77,7 @@ f32 func_802AAB4C(Player *player) {
return 0.8f;
case COURSE_SHERBET_LAND:
if ((get_surface_type(player->unk_110.unk3A) & 0xFF) == SNOW) {
- return (f32) (D_8015F6EE - 0xA);
+ return (f32) (gCourseMinY - 0xA);
}
return D_8015F8E4;
case COURSE_DK_JUNGLE:
@@ -691,10 +691,10 @@ s32 func_802AC22C(KartBoundingBoxCorner *arg0) {
default:
break;
}
- temp1 = D_8015F6E8 - D_8015F6EA;
- temp2 = D_8015F6F0 - D_8015F6F2;
- temp_f4 = (temp_f22 - D_8015F6EA) / (temp1 / 32);
- temp_f6 = (temp_f26 - D_8015F6F2) / (temp2 / 32);
+ temp1 = gCourseMaxX - gCourseMinX;
+ temp2 = gCourseMaxZ - gCourseMinZ;
+ temp_f4 = (temp_f22 - gCourseMinX) / (temp1 / 32);
+ temp_f6 = (temp_f26 - gCourseMinZ) / (temp2 / 32);
if (temp_f4 < 0) {
return 0;
}
@@ -1279,14 +1279,14 @@ u16 func_802AD950(Collision *collision, f32 boundingBoxSize, f32 x1, f32 y1, f32
}
- temp_v0_4 = (s32) D_8015F6E8 - D_8015F6EA;
- temp_v1 = (s32) D_8015F6F0 - D_8015F6F2;
+ temp_v0_4 = (s32) gCourseMaxX - gCourseMinX;
+ temp_v1 = (s32) gCourseMaxZ - gCourseMinZ;
temp1 = temp_v0_4 / 32;
temp2 = temp_v1 / 32;
- temp_f10 = (x1 - D_8015F6EA) / temp1;
- temp_f16 = (z1 - D_8015F6F2) / temp2;
+ temp_f10 = (x1 - gCourseMinX) / temp1;
+ temp_f16 = (z1 - gCourseMinZ) / temp2;
if (temp_f10 < 0) {
return 0;
@@ -1387,14 +1387,14 @@ u16 func_802ADDC8(Collision* collision, f32 boundingBoxSize, f32 posX, f32 posY,
return var_s4;
}
- temp_f4 = (s32) D_8015F6E8 - D_8015F6EA;
- temp_f6 = (s32) D_8015F6F0 - D_8015F6F2;
+ temp_f4 = (s32) gCourseMaxX - gCourseMinX;
+ temp_f6 = (s32) gCourseMaxZ - gCourseMinZ;
temp1 = temp_f4 / 32;
temp2 = temp_f6 / 32;
- temp_f10 = (posX - D_8015F6EA) / temp1;
- temp_f16 = (posZ - D_8015F6F2) / temp2;
+ temp_f10 = (posX - gCourseMinX) / temp1;
+ temp_f16 = (posZ - gCourseMinZ) / temp2;
if (temp_f10 < 0) {
@@ -1471,13 +1471,13 @@ f32 func_802AE1C0(f32 posX, f32 posY, f32 posZ) {
s32 c;
s32 d;
- a = (D_8015F6E8 - D_8015F6EA);
- b = (D_8015F6F0 - D_8015F6F2);
+ a = (gCourseMaxX - gCourseMinX);
+ b = (gCourseMaxZ - gCourseMinZ);
c = a / 32;
d = b / 32;
- temp_f4 = (s16) ((posX - D_8015F6EA) / c);
- temp_f6 = (s16) ((posZ - D_8015F6F2) / d);
+ temp_f4 = (s16) ((posX - gCourseMinX) / c);
+ temp_f6 = (s16) ((posZ - gCourseMinZ) / d);
temp_f66 = temp_f4 + (temp_f6 * 32);
iter = D_8014F110[temp_f66].unk2;
@@ -1514,6 +1514,28 @@ f32 func_802AE1C0(f32 posX, f32 posY, f32 posZ) {
return phi_f20;
}
+#define MAX3(a,b,c, out) if (a >= b) {\
+ if (a >= c) {\
+ out = a;\
+ } else\
+ out = c;\
+\
+ } else if (b >= c) {\
+ out = b;\
+ } else\
+ out = c; \
+
+#define MIN3(a,b,c, out) if (a <= b) {\
+ if (a <= c) {\
+ out = a;\
+ } else\
+ out = c;\
+\
+ } else if (b <= c) {\
+ out = b;\
+ } else\
+ out = c;\
+
void func_802AE434(Vtx *vtx1, Vtx *vtx2, Vtx *vtx3, s8 surfaceType, u16 sectionId) {
mk64_surface_map_ram *tile = &gSurfaceMap[D_8015F588];
s16 x2;
@@ -1545,12 +1567,12 @@ void func_802AE434(Vtx *vtx1, Vtx *vtx2, Vtx *vtx3, s8 surfaceType, u16 sectionI
f32 normalZ;
f32 distance;
- s16 sp4A;
- s16 sp48;
- s16 sp46;
- s16 sp44;
- s16 sp42;
- s16 sp40;
+ s16 maxX;
+ s16 maxZ;
+ s16 minY;
+ s16 minX;
+ s16 maxY;
+ s16 minZ;
tile->vtxPoly1 = vtx1;
tile->vtxPoly2 = vtx2;
@@ -1585,73 +1607,17 @@ void func_802AE434(Vtx *vtx1, Vtx *vtx2, Vtx *vtx3, s8 surfaceType, u16 sectionI
y3 = tile->vtxPoly2->v.ob[1];
z3 = tile->vtxPoly2->v.ob[2];
}
- if (x1 >= x2) {
- if (x1 >= x3) {
- sp4A = x1;
- } else
- sp4A = x3;
-
- } else if (x2 >= x3) {
- sp4A = x2;
- } else
- sp4A = x3;
-
- if (z1 >= z2) {
-
- if (z1 >= z3) {
- sp48 = z1;
- } else
- sp48 = z3;
-
- } else if (z2 >= z3) {
- sp48 = z2;
- } else
- sp48 = z3;
-
- if (y1 >= y2) {
-
- if (y1 >= y3) {
- sp42 = y1;
- } else
- sp42 = y3;
-
- } else if (y2 >= y3) {
- sp42 = y2;
- } else
- sp42 = y3;
-
- if (x1 <= x2) {
- if (x1 <= x3) {
- sp44 = x1;
- } else
- sp44 = x3;
-
- } else if (x2 <= x3) {
- sp44 = x2;
- } else
- sp44 = x3;
-
- if (y1 <= y2) {
- if (y1 <= y3) {
- sp46 = y1;
- } else
- sp46 = y3;
-
- } else if (y2 <= y3) {
- sp46 = y2;
- } else
- sp46 = y3;
-
- if (z1 <= z2) {
- if (z1 <= z3) {
- sp40 = z1;
- } else
- sp40 = z3;
-
- } else if (z2 <= z3) {
- sp40 = z2;
- } else
- sp40 = z3;
+ MAX3(x1, x2, x3, maxX)
+
+ MAX3(z1, z2, z3, maxZ)
+
+ MAX3(y1, y2, y3, maxY)
+
+ MIN3(x1, x2, x3, minX)
+
+ MIN3(y1, y2, y3, minY)
+
+ MIN3(z1, z2, z3, minZ)
crossProductX = (((y2 - y1) * (z3 - z2)) - ((z2 - z1) * (y3 - y2)));
crossProductY = (((z2 - z1) * (x3 - x2)) - ((x2 - x1) * (z3 - z2)));
@@ -1689,30 +1655,30 @@ void func_802AE434(Vtx *vtx1, Vtx *vtx2, Vtx *vtx3, s8 surfaceType, u16 sectionI
}
}
- tile->vtx21 = sp4A;
- tile->vtx23 = sp48;
- tile->vtx31 = sp44;
- tile->vtx33 = sp40;
- tile->vtx32 = sp46;
- tile->vtx22 = sp42;
+ tile->vtx21 = maxX;
+ tile->vtx23 = maxZ;
+ tile->vtx31 = minX;
+ tile->vtx33 = minZ;
+ tile->vtx32 = minY;
+ tile->vtx22 = maxY;
- if (sp44 < D_8015F6EA) {
- D_8015F6EA = sp44;
+ if (minX < gCourseMinX) {
+ gCourseMinX = minX;
}
- if (sp46 < D_8015F6EE) {
- D_8015F6EE = sp46;
+ if (minY < gCourseMinY) {
+ gCourseMinY = minY;
}
- if (sp40 < D_8015F6F2) {
- D_8015F6F2 = sp40;
+ if (minZ < gCourseMinZ) {
+ gCourseMinZ = minZ;
}
- if (sp4A > D_8015F6E8) {
- D_8015F6E8 = sp4A;
+ if (maxX > gCourseMaxX) {
+ gCourseMaxX = maxX;
}
- if (sp42 > D_8015F6EC) {
- D_8015F6EC = sp42;
+ if (maxY > gCourseMaxY) {
+ gCourseMaxY = maxY;
}
- if (sp48 > D_8015F6F0) {
- D_8015F6F0 = sp48;
+ if (maxZ > gCourseMaxZ) {
+ gCourseMaxZ = maxZ;
}
tile->height = normalX;
@@ -1953,8 +1919,8 @@ void func_802AF314(void) {
s32 temp1;
s32 temp2;
s32 index;
- temp1 = (s32) D_8015F6E8 - D_8015F6EA;
- temp2 = (s32) D_8015F6F0 - D_8015F6F2;
+ temp1 = (s32) gCourseMaxX - gCourseMinX;
+ temp2 = (s32) gCourseMaxZ - gCourseMinZ;
temp_s6 = temp1 / 32;
temp_fp = temp2 / 32;
@@ -1976,8 +1942,8 @@ void func_802AF314(void) {
for (k = 0; k < 32; k++) {
index = k + j * 32;
- temp_s1 = (D_8015F6EA + (temp_s6 * k)) - 20;
- temp_s2 = (D_8015F6F2 + (temp_fp * j)) - 20;
+ temp_s1 = (gCourseMinX + (temp_s6 * k)) - 20;
+ temp_s2 = (gCourseMinZ + (temp_fp * j)) - 20;
temp_a1 = temp_s1 + temp_s6 + 40;
temp_a3 = temp_s2 + temp_fp + 40;
@@ -2218,14 +2184,14 @@ u16 process_collision(Player *player, KartBoundingBoxCorner *corner, f32 cornerP
// If the surface flags are not set then try setting them.
- temp_v0_2 = (s32) D_8015F6E8 - D_8015F6EA;
- temp_v1 = (s32) D_8015F6F0 - D_8015F6F2;
+ temp_v0_2 = (s32) gCourseMaxX - gCourseMinX;
+ temp_v1 = (s32) gCourseMaxZ - gCourseMinZ;
temp1 = temp_v0_2 / 32;
temp2 = temp_v1 / 32;
- temp_f10 = (cornerPos1 - D_8015F6EA) / temp1;
- temp_f16 = (cornerPos3 - D_8015F6F2) / temp2;
+ temp_f10 = (cornerPos1 - gCourseMinX) / temp1;
+ temp_f16 = (cornerPos3 - gCourseMinZ) / temp2;
if (temp_f10 < 0) { return 0; }
diff --git a/src/racing/collision.h b/src/racing/collision.h
index cecc93f2c..9dd6859f5 100644
--- a/src/racing/collision.h
+++ b/src/racing/collision.h
@@ -3,6 +3,9 @@
#include "common_structs.h"
+#define COLLISION 0x1
+#define NO_COLLISION 0x0
+
void nullify_displaylist(uintptr_t);
void func_802AAAAC(Collision*);
f32 func_802AAB4C(Player*);
diff --git a/src/racing/render_courses.c b/src/racing/render_courses.c
index 35781e821..22c4bdd24 100644
--- a/src/racing/render_courses.c
+++ b/src/racing/render_courses.c
@@ -1383,11 +1383,11 @@ void func_80295BF8(s32 playerIndex) {
void func_80295C6C(void) {
gNextFreeMemoryAddress += ALIGN16(D_8015F588 * sizeof(mk64_surface_map_ram));
- D_8015F6E8 += 20;
- D_8015F6F0 += 20;
- D_8015F6EA += -20;
- D_8015F6F2 += -20;
- D_8015F6EE += -20;
+ gCourseMaxX += 20;
+ gCourseMaxZ += 20;
+ gCourseMinX += -20;
+ gCourseMinZ += -20;
+ gCourseMinY += -20;
func_802AF314();
gNextFreeMemoryAddress += ALIGN16(D_8015F58A * 2);
}
@@ -1404,12 +1404,15 @@ void func_80295D6C(void) {
void func_80295D88(void) {
gNumActors = 0;
- D_8015F6EA = 0;
- D_8015F6EE = 0;
- D_8015F6F2 = 0;
- D_8015F6E8 = 0;
- D_8015F6EC = 0;
- D_8015F6F0 = 0;
+
+ gCourseMinX = 0;
+ gCourseMinY = 0;
+ gCourseMinZ = 0;
+
+ gCourseMaxX = 0;
+ gCourseMaxY = 0;
+ gCourseMaxZ = 0;
+
D_8015F59C = 0;
D_8015F5A0 = 0;
func_80295D6C();
@@ -1431,7 +1434,7 @@ void func_80295D88(void) {
}
parse_course_displaylists((uintptr_t) d_course_mario_raceway_addr);
func_80295C6C();
- D_8015F8E4 = D_8015F6EE - 10.0f;
+ D_8015F8E4 = gCourseMinY - 10.0f;
break;
case COURSE_CHOCO_MOUNTAIN:
D_800DC5BC = 1;
@@ -1485,7 +1488,7 @@ void func_80295D88(void) {
func_802B5D64(&d_course_yoshi_valley_lights4, -0x38F0, 0x1C70, 1);
parse_course_displaylists((uintptr_t) d_course_yoshi_valley_addr);
func_80295C6C();
- D_8015F8E4 = D_8015F6EE - 10.0f;
+ D_8015F8E4 = gCourseMinY - 10.0f;
break;
case COURSE_FRAPPE_SNOWLAND:
parse_course_displaylists((uintptr_t) d_course_frappe_snowland_addr);
@@ -1512,12 +1515,12 @@ void func_80295D88(void) {
case COURSE_LUIGI_RACEWAY:
parse_course_displaylists((uintptr_t) d_course_luigi_raceway_addr);
func_80295C6C();
- D_8015F8E4 = D_8015F6EE - 10.0f;
+ D_8015F8E4 = gCourseMinY - 10.0f;
break;
case COURSE_MOO_MOO_FARM:
parse_course_displaylists((uintptr_t) d_course_moo_moo_farm_addr);
func_80295C6C();
- D_8015F8E4 = D_8015F6EE - 10.0f;
+ D_8015F8E4 = gCourseMinY - 10.0f;
break;
case COURSE_TOADS_TURNPIKE:
D_801625EC = 43;
@@ -1527,12 +1530,12 @@ void func_80295D88(void) {
D_802B87B4 = 1000;
parse_course_displaylists((uintptr_t) d_course_toads_turnpike_addr);
func_80295C6C();
- D_8015F8E4 = D_8015F6EE - 10.0f;
+ D_8015F8E4 = gCourseMinY - 10.0f;
break;
case COURSE_KALAMARI_DESERT:
parse_course_displaylists((uintptr_t) d_course_kalimari_desert_addr);
func_80295C6C();
- D_8015F8E4 = D_8015F6EE - 10.0f;
+ D_8015F8E4 = gCourseMinY - 10.0f;
break;
case COURSE_SHERBET_LAND:
parse_course_displaylists((uintptr_t) d_course_sherbet_land_addr);
@@ -1562,7 +1565,7 @@ void func_80295D88(void) {
case COURSE_WARIO_STADIUM:
parse_course_displaylists((uintptr_t) d_course_wario_stadium_addr);
func_80295C6C();
- D_8015F8E4 = D_8015F6EE - 10.0f;
+ D_8015F8E4 = gCourseMinY - 10.0f;
// d_course_wario_stadium_packed_dl_C50
find_vtx_and_set_colours((uintptr_t)0x07000C50, 100, 255, 255, 255);
// d_course_wario_stadium_packed_dl_BD8
@@ -1584,7 +1587,7 @@ void func_80295D88(void) {
// d_course_block_fort_packed_dl_15C0
set_vertex_data_with_default_section_id((uintptr_t)0x070015C0, 1);
func_80295C6C();
- D_8015F8E4 = D_8015F6EE - 10.0f;
+ D_8015F8E4 = gCourseMinY - 10.0f;
break;
case COURSE_SKYSCRAPER:
// d_course_skyscraper_packed_dl_1110
@@ -1599,7 +1602,7 @@ void func_80295D88(void) {
// d_course_double_deck_packed_dl_738
set_vertex_data_with_default_section_id((uintptr_t)0x07000738, 1);
func_80295C6C();
- D_8015F8E4 = D_8015F6EE - 10.0f;
+ D_8015F8E4 = gCourseMinY - 10.0f;
break;
case COURSE_DK_JUNGLE:
parse_course_displaylists((uintptr_t) d_course_dks_jungle_parkway_addr);
@@ -1698,7 +1701,7 @@ void func_802966A0(void) {
}
// d_course_dks_jungle_parkway_packed_dl_9880
find_and_set_tile_size((uintptr_t)0x07009880, 0, D_802B87C4);
- func_80298C94();
+ evaluate_collision_players_palm_trees();
break;
}
}
diff --git a/src/racing/skybox_and_splitscreen.c b/src/racing/skybox_and_splitscreen.c
index d48899662..ebdaf7b96 100644
--- a/src/racing/skybox_and_splitscreen.c
+++ b/src/racing/skybox_and_splitscreen.c
@@ -814,7 +814,7 @@ void render_player_one_1p_screen(void) {
render_players_on_screen_one();
func_8029122C(D_800DC5EC, PLAYER_ONE);
func_80021B0C();
- func_802A2F34(D_800DC5EC);
+ render_item_boxes(D_800DC5EC);
render_player_snow_effect(RENDER_SCREEN_MODE_1P_PLAYER_ONE);
func_80058BF4();
if (D_800DC5B8 != 0) {
@@ -870,7 +870,7 @@ void render_player_one_2p_screen_vertical(void) {
render_players_on_screen_one();
func_8029122C(D_800DC5EC, PLAYER_ONE);
func_80021B0C();
- func_802A2F34(D_800DC5EC);
+ render_item_boxes(D_800DC5EC);
render_player_snow_effect(RENDER_SCREEN_MODE_2P_HORIZONTAL_PLAYER_ONE);
func_80058BF4();
if (D_800DC5B8 != 0) {
@@ -924,7 +924,7 @@ void render_player_two_2p_screen_vertical(void) {
render_players_on_screen_two();
func_8029122C(D_800DC5F0, PLAYER_TWO);
func_80021C78();
- func_802A2F34(D_800DC5F0);
+ render_item_boxes(D_800DC5F0);
func_80058BF4();
render_player_snow_effect(RENDER_SCREEN_MODE_2P_HORIZONTAL_PLAYER_TWO);
if (D_800DC5B8 != 0) {
@@ -982,7 +982,7 @@ void render_player_one_2p_screen_horizontal(void) {
render_players_on_screen_one();
func_8029122C(D_800DC5EC, PLAYER_ONE);
func_80021B0C();
- func_802A2F34(D_800DC5EC);
+ render_item_boxes(D_800DC5EC);
render_player_snow_effect(RENDER_SCREEN_MODE_2P_VERTICAL_PLAYER_ONE);
func_80058BF4();
if (D_800DC5B8 != 0) {
@@ -1039,7 +1039,7 @@ void render_player_two_2p_screen_horizontal(void) {
render_players_on_screen_two();
func_8029122C(D_800DC5F0, PLAYER_TWO);
func_80021C78();
- func_802A2F34(D_800DC5F0);
+ render_item_boxes(D_800DC5F0);
render_player_snow_effect(RENDER_SCREEN_MODE_2P_VERTICAL_PLAYER_TWO);
func_80058BF4();
if (D_800DC5B8 != 0) {
@@ -1093,7 +1093,7 @@ void render_player_one_3p_4p_screen(void) {
render_players_on_screen_one();
func_8029122C(D_800DC5EC, PLAYER_ONE);
func_80021B0C();
- func_802A2F34(D_800DC5EC);
+ render_item_boxes(D_800DC5EC);
render_player_snow_effect(RENDER_SCREEN_MODE_3P_4P_PLAYER_ONE);
func_80058BF4();
if (D_800DC5B8 != 0) {
@@ -1147,7 +1147,7 @@ void render_player_two_3p_4p_screen(void) {
render_players_on_screen_two();
func_8029122C(D_800DC5F0, PLAYER_TWO);
func_80021C78();
- func_802A2F34(D_800DC5F0);
+ render_item_boxes(D_800DC5F0);
render_player_snow_effect(RENDER_SCREEN_MODE_3P_4P_PLAYER_TWO);
func_80058BF4();
if (D_800DC5B8 != 0) {
@@ -1202,7 +1202,7 @@ void render_player_three_3p_4p_screen(void) {
render_players_on_screen_three();
func_8029122C(D_800DC5F4, PLAYER_THREE);
func_80021D40();
- func_802A2F34(D_800DC5F4);
+ render_item_boxes(D_800DC5F4);
render_player_snow_effect(RENDER_SCREEN_MODE_3P_4P_PLAYER_THREE);
func_80058BF4();
if (D_800DC5B8 != 0) {
@@ -1265,7 +1265,7 @@ void render_player_four_3p_4p_screen(void) {
render_players_on_screen_four();
func_8029122C(D_800DC5F8, PLAYER_FOUR);
func_80021DA8();
- func_802A2F34(D_800DC5F8);
+ render_item_boxes(D_800DC5F8);
render_player_snow_effect(RENDER_SCREEN_MODE_3P_4P_PLAYER_FOUR);
func_80058BF4();
if (D_800DC5B8 != 0) {
diff --git a/src/render_player.c b/src/render_player.c
index 35f838286..59e1cf0b6 100644
--- a/src/render_player.c
+++ b/src/render_player.c
@@ -896,8 +896,8 @@ void func_80022A98(Player* player, s8 arg1) {
if ((player->type & PLAYER_EXISTS) == PLAYER_EXISTS) {
func_80026A48(player, arg1);
func_800235AC(player, arg1);
- if (((player->effects & 0x04000000) == 0x04000000) || ((player->effects & 0x08000000) == 0x08000000)) {
- if ((player->effects & 0x04000000) == 0x04000000) {
+ if (((player->effects & HIT_EFFECT) == HIT_EFFECT) || ((player->effects & 0x08000000) == 0x08000000)) {
+ if ((player->effects & HIT_EFFECT) == HIT_EFFECT) {
func_80022B50(player, arg1);
}
if ((player->effects & 0x08000000) == 0x08000000) {
@@ -1207,7 +1207,7 @@ void func_800235AC(Player *player, s8 arg1) {
}
void func_80023BF0(Player *player, s8 arg1, s8 arg2, s8 arg3) {
- if (((player->effects & 0x4000000) == 0x4000000) || ((player->effects & 0x8000000) == 0x8000000)) {
+ if (((player->effects & HIT_EFFECT) == HIT_EFFECT) || ((player->effects & 0x8000000) == 0x8000000)) {
func_80022CA8(player, arg1, arg2, arg3);
} else {
func_80022E84(player, arg1, arg2, arg3);
@@ -1374,7 +1374,7 @@ void kart_render(Player *player, s8 playerId, s8 arg2, s8 arg3) {
}
sp14C[1] = player->unk_048[arg2];
sp14C[2] = player->unk_050[arg2];
- if (((s32)player->effects & 0x04000000) == 0x04000000) {
+ if (((s32)player->effects & HIT_EFFECT) == HIT_EFFECT) {
func_80062B18(&sp148, &sp144, &sp140, 0.0f, 8.0f, 0.0f, -player->unk_048[arg2], player->unk_050[arg2]);
sp154[1] = (player->pos[1] - player->boundingBoxSize) + player->unk_108;
sp154[0] = player->pos[0] + sp148;
diff --git a/src/update_objects.c b/src/update_objects.c
index a5c0d5bb0..d11747c04 100644
--- a/src/update_objects.c
+++ b/src/update_objects.c
@@ -7442,7 +7442,7 @@ void init_hot_air_balloon(s32 objectIndex) {
func_800886F4(objectIndex);
func_80086EF0(objectIndex);
gObjectList[objectIndex].velocity[1] = -2.0f;
- func_802A14BC(0.0f, 0.0f, 0.0f);
+ init_actor_hot_air_balloon_item_box(0.0f, 0.0f, 0.0f);
func_80072488(objectIndex);
}
diff --git a/tools/doxygen_syms.md b/tools/doxygen_syms.md
index 1fd98846c..5a6921d79 100644
--- a/tools/doxygen_syms.md
+++ b/tools/doxygen_syms.md
@@ -142,11 +142,11 @@ Variable Name | Memory Address
[func_8000DBAC](@ref func_8000DBAC) | 0x8000DBAC
[set_bomb_kart_spawn_positions](@ref set_bomb_kart_spawn_positions) | 0x8000DD78
[func_8000DF8C](@ref func_8000DF8C) | 0x8000DF8C
-[func_8000ED14](@ref func_8000ED14) | 0x8000ED14
-[func_8000ED80](@ref func_8000ED80) | 0x8000ED80
-[func_8000EDC8](@ref func_8000EDC8) | 0x8000EDC8
-[func_8000EE10](@ref func_8000EE10) | 0x8000EE10
-[func_8000EE58](@ref func_8000EE58) | 0x8000EE58
+[add_actor_in_unexpired_actor_list](@ref add_actor_in_unexpired_actor_list) | 0x8000ED14
+[add_red_shell_in_unexpired_actor_list](@ref add_red_shell_in_unexpired_actor_list) | 0x8000ED80
+[add_green_shell_in_unexpired_actor_list](@ref add_green_shell_in_unexpired_actor_list) | 0x8000EDC8
+[add_blue_shell_in_unexpired_actor_list](@ref add_blue_shell_in_unexpired_actor_list) | 0x8000EE10
+[delete_actor_in_unexpired_actor_list](@ref delete_actor_in_unexpired_actor_list) | 0x8000EE58
[func_8000EEDC](@ref func_8000EEDC) | 0x8000EEDC
[generate_player_smoke](@ref generate_player_smoke) | 0x8000EF20
[func_8000F0E0](@ref func_8000F0E0) | 0x8000F0E0
@@ -1795,8 +1795,8 @@ Variable Name | Memory Address
[func_8008D8B4](@ref func_8008D8B4) | 0x8008D8B4
[func_8008D97C](@ref func_8008D97C) | 0x8008D97C
[func_8008D9C0](@ref func_8008D9C0) | 0x8008D9C0
-[func_8008DABC](@ref func_8008DABC) | 0x8008DABC
-[func_8008DC08](@ref func_8008DC08) | 0x8008DC08
+[apply_hit_sound_effect](@ref apply_hit_sound_effect) | 0x8008DABC
+[apply_hit_effect](@ref apply_hit_effect) | 0x8008DC08
[apply_hit_rotating_sound_effect](@ref apply_hit_rotating_sound_effect) | 0x8008DF98
[apply_lightning_effect](@ref apply_lightning_effect) | 0x8008E118
[remove_lightning_effect](@ref remove_lightning_effect) | 0x8008E3C0
@@ -1837,7 +1837,7 @@ Variable Name | Memory Address
[func_80090778](@ref func_80090778) | 0x80090778
[func_80090868](@ref func_80090868) | 0x80090868
[func_80090970](@ref func_80090970) | 0x80090970
-[func_800910E4](@ref func_800910E4) | 0x800910E4
+[prevent_item_use](@ref prevent_item_use) | 0x800910E4
[func_800911B4](@ref func_800911B4) | 0x800911B4
[func_80091298](@ref func_80091298) | 0x80091298
[func_80091440](@ref func_80091440) | 0x80091440
@@ -2583,10 +2583,10 @@ Variable Name | Memory Address
[rspF3DBootStart](@ref rspF3DBootStart) | 0x800D8F70
[rspF3DBootEnd](@ref rspF3DBootEnd) | 0x800D9040
[gspF3DEXTextStart](@ref gspF3DEXTextStart) | 0x800D9040
-[gspF3DEXTextEnd](@ref gspF3DEXTextEnd) | 0x800DA420
[gspF3DLXTextStart](@ref gspF3DLXTextStart) | 0x800DA420
-[gspF3DLXTextEnd](@ref gspF3DLXTextEnd) | 0x800DB830
+[gspF3DEXTextEnd](@ref gspF3DEXTextEnd) | 0x800DA420
[rspAspMainStart](@ref rspAspMainStart) | 0x800DB830
+[gspF3DLXTextEnd](@ref gspF3DLXTextEnd) | 0x800DB830
[rspAspMainEnd](@ref rspAspMainEnd) | 0x800DC4A0
[gVblankHandler1](@ref gVblankHandler1) | 0x800DC4A0
[gVblankHandler2](@ref gVblankHandler2) | 0x800DC4A4
@@ -3694,8 +3694,8 @@ Variable Name | Memory Address
[gspF3DEXDataStart](@ref gspF3DEXDataStart) | 0x800F3D00
[gspF3DEXDataEnd](@ref gspF3DEXDataEnd) | 0x800F4500
[gspF3DLXDataStart](@ref gspF3DLXDataStart) | 0x800F4500
-[rspAspMainDataStart](@ref rspAspMainDataStart) | 0x800F4D00
[gspF3DLXDataEnd](@ref gspF3DLXDataEnd) | 0x800F4D00
+[rspAspMainDataStart](@ref rspAspMainDataStart) | 0x800F4D00
[rspAspMainDataEnd](@ref rspAspMainDataEnd) | 0x800F5000
[sSawtoothWaves](@ref sSawtoothWaves) | 0x800F5000
[sTriangleWaves](@ref sTriangleWaves) | 0x800F5200
@@ -3809,12 +3809,12 @@ Variable Name | Memory Address
[D_8015F5A4](@ref D_8015F5A4) | 0x8015F5A4
[code_800029B0_bss_pad](@ref code_800029B0_bss_pad) | 0x8015F5A8
[vtxBuffer](@ref vtxBuffer) | 0x8015F668
-[D_8015F6E8](@ref D_8015F6E8) | 0x8015F6E8
-[D_8015F6EA](@ref D_8015F6EA) | 0x8015F6EA
-[D_8015F6EC](@ref D_8015F6EC) | 0x8015F6EC
-[D_8015F6EE](@ref D_8015F6EE) | 0x8015F6EE
-[D_8015F6F0](@ref D_8015F6F0) | 0x8015F6F0
-[D_8015F6F2](@ref D_8015F6F2) | 0x8015F6F2
+[gCourseMaxX](@ref gCourseMaxX) | 0x8015F6E8
+[gCourseMinX](@ref gCourseMinX) | 0x8015F6EA
+[gCourseMaxY](@ref gCourseMaxY) | 0x8015F6EC
+[gCourseMinY](@ref gCourseMinY) | 0x8015F6EE
+[gCourseMaxZ](@ref gCourseMaxZ) | 0x8015F6F0
+[gCourseMinZ](@ref gCourseMinZ) | 0x8015F6F2
[D_8015F6F4](@ref D_8015F6F4) | 0x8015F6F4
[D_8015F6F6](@ref D_8015F6F6) | 0x8015F6F6
[D_8015F6F8](@ref D_8015F6F8) | 0x8015F6F8
@@ -4833,8 +4833,8 @@ Variable Name | Memory Address
[func_802969F8](@ref func_802969F8) | 0x802969F8
[cleanup_red_and_green_shells](@ref cleanup_red_and_green_shells) | 0x80296A50
[actor_init](@ref actor_init) | 0x80296D10
-[func_80297230](@ref func_80297230) | 0x80297230
-[func_802972B8](@ref func_802972B8) | 0x802972B8
+[actor_not_rendered](@ref actor_not_rendered) | 0x80297230
+[actor_rendered](@ref actor_rendered) | 0x802972B8
[func_80297340](@ref func_80297340) | 0x80297340
[func_80297524](@ref func_80297524) | 0x80297524
[func_802976D8](@ref func_802976D8) | 0x802976D8
@@ -4847,20 +4847,20 @@ Variable Name | Memory Address
[func_8029794C](@ref func_8029794C) | 0x8029794C
[func_802979F8](@ref func_802979F8) | 0x802979F8
[render_actor_cow](@ref render_actor_cow) | 0x80297A50
-[update_actor_yoshi_valley_egg](@ref update_actor_yoshi_valley_egg) | 0x80297BFC
-[update_actor_trees_cacti_shrubs](@ref update_actor_trees_cacti_shrubs) | 0x80297D04
+[update_actor_yoshi_egg](@ref update_actor_yoshi_egg) | 0x80297BFC
+[update_actor_static_plant](@ref update_actor_static_plant) | 0x80297D04
[update_actor_kiwano_fruit](@ref update_actor_kiwano_fruit) | 0x80297D5C
[update_actor_paddle_boat](@ref update_actor_paddle_boat) | 0x8029816C
[update_actor_train_engine](@ref update_actor_train_engine) | 0x8029817C
-[update_actor_train_car1](@ref update_actor_train_car1) | 0x802981CC
-[update_actor_train_car2](@ref update_actor_train_car2) | 0x802981DC
+[update_actor_train_tender](@ref update_actor_train_tender) | 0x802981CC
+[update_actor_train_passenger_car](@ref update_actor_train_passenger_car) | 0x802981DC
[update_actor_piranha_plant](@ref update_actor_piranha_plant) | 0x802981EC
[render_actor_piranha_plant](@ref render_actor_piranha_plant) | 0x80298328
-[func_802986B4](@ref func_802986B4) | 0x802986B4
-[func_80298AC0](@ref func_80298AC0) | 0x80298AC0
-[func_80298C94](@ref func_80298C94) | 0x80298C94
+[render_cows](@ref render_cows) | 0x802986B4
+[evaluate_collision_player_palm_trees](@ref evaluate_collision_player_palm_trees) | 0x80298AC0
+[evaluate_collision_players_palm_trees](@ref evaluate_collision_players_palm_trees) | 0x80298C94
[func_80298D10](@ref func_80298D10) | 0x80298D10
-[func_80298D7C](@ref func_80298D7C) | 0x80298D7C
+[render_palm_trees](@ref render_palm_trees) | 0x80298D7C
[render_actor_tree_mario_raceway](@ref render_actor_tree_mario_raceway) | 0x80299144
[render_actor_tree_yoshi_valley](@ref render_actor_tree_yoshi_valley) | 0x8029930C
[render_actor_tree_royal_raceway](@ref render_actor_tree_royal_raceway) | 0x802994D4
@@ -4872,70 +4872,70 @@ Variable Name | Memory Address
[render_actor_tree_cactus1_kalimari_desert](@ref render_actor_tree_cactus1_kalimari_desert) | 0x80299EDC
[render_actor_tree_cactus2_kalimari_desert](@ref render_actor_tree_cactus2_kalimari_desert) | 0x80299FFC
[render_actor_tree_cactus3_kalimari_desert](@ref render_actor_tree_cactus3_kalimari_desert) | 0x8029A11C
-[render_actor_kiwano_fruit_dks_jungle_parkway](@ref render_actor_kiwano_fruit_dks_jungle_parkway) | 0x8029A23C
+[render_actor_kiwano_fruit](@ref render_actor_kiwano_fruit) | 0x8029A23C
[render_actor_shell](@ref render_actor_shell) | 0x8029A3AC
[render_actor_green_shell](@ref render_actor_green_shell) | 0x8029A690
[render_actor_red_shell](@ref render_actor_red_shell) | 0x8029A75C
[render_actor_blue_shell](@ref render_actor_blue_shell) | 0x8029A828
[render_actor_banana](@ref render_actor_banana) | 0x8029A8F4
-[update_actor_wario_stadium_sign](@ref update_actor_wario_stadium_sign) | 0x8029AAC8
+[update_actor_wario_sign](@ref update_actor_wario_sign) | 0x8029AAC8
[update_actor_railroad_crossing](@ref update_actor_railroad_crossing) | 0x8029AAD8
-[update_actor_mario_raceway_sign](@ref update_actor_mario_raceway_sign) | 0x8029AB60
+[update_actor_mario_sign](@ref update_actor_mario_sign) | 0x8029AB60
[func_8029ABD4](@ref func_8029ABD4) | 0x8029ABD4
[func_8029AC18](@ref func_8029AC18) | 0x8029AC18
[func_8029AE14](@ref func_8029AE14) | 0x8029AE14
[render_actor_paddle_boat](@ref render_actor_paddle_boat) | 0x8029AE1C
-[func_8029B06C](@ref func_8029B06C) | 0x8029B06C
-[func_8029B2E4](@ref func_8029B2E4) | 0x8029B2E4
-[func_8029B4E0](@ref func_8029B4E0) | 0x8029B4E0
-[func_8029B6EC](@ref func_8029B6EC) | 0x8029B6EC
+[render_actor_box_truck](@ref render_actor_box_truck) | 0x8029B06C
+[render_actor_school_bus](@ref render_actor_school_bus) | 0x8029B2E4
+[render_actor_car](@ref render_actor_car) | 0x8029B4E0
+[render_actor_tanker_truck](@ref render_actor_tanker_truck) | 0x8029B6EC
[render_actor_train_engine](@ref render_actor_train_engine) | 0x8029B8E8
[render_actor_train_tender](@ref render_actor_train_tender) | 0x8029BFB0
-[render_actor_passenger_car](@ref render_actor_passenger_car) | 0x8029C3CC
+[render_actor_train_passenger_car](@ref render_actor_train_passenger_car) | 0x8029C3CC
[render_actor_falling_rock](@ref render_actor_falling_rock) | 0x8029CA90
-[place_piranha_plants](@ref place_piranha_plants) | 0x8029CC14
-[place_palm_trees](@ref place_palm_trees) | 0x8029CD80
+[spawn_piranha_plants](@ref spawn_piranha_plants) | 0x8029CC14
+[spawn_palm_trees](@ref spawn_palm_trees) | 0x8029CD80
[func_8029CF0C](@ref func_8029CF0C) | 0x8029CF0C
-[place_falling_rocks](@ref place_falling_rocks) | 0x8029D018
+[spawn_falling_rocks](@ref spawn_falling_rocks) | 0x8029D018
[update_actor_falling_rocks](@ref update_actor_falling_rocks) | 0x8029D188
[spawn_foliage](@ref spawn_foliage) | 0x8029D584
-[place_all_item_boxes](@ref place_all_item_boxes) | 0x8029D830
+[spawn_all_item_boxes](@ref spawn_all_item_boxes) | 0x8029D830
[init_kiwano_fruit](@ref init_kiwano_fruit) | 0x8029D9F8
[destroy_all_actors](@ref destroy_all_actors) | 0x8029DAB8
-[place_course_actors](@ref place_course_actors) | 0x8029DB44
-[func_8029E158](@ref func_8029E158) | 0x8029E158
-[func_8029E7DC](@ref func_8029E7DC) | 0x8029E7DC
+[spawn_course_actors](@ref spawn_course_actors) | 0x8029DB44
+[init_actors_and_load_textures](@ref init_actors_and_load_textures) | 0x8029E158
+[play_sound_before_despawn](@ref play_sound_before_despawn) | 0x8029E7DC
[destroy_actor](@ref destroy_actor) | 0x8029E854
-[func_8029E890](@ref func_8029E890) | 0x8029E890
-[addActorToEmptySlot](@ref addActorToEmptySlot) | 0x8029EC88
-[func_8029ED38](@ref func_8029ED38) | 0x8029ED38
-[func_8029ED98](@ref func_8029ED98) | 0x8029ED98
-[func_8029EEB8](@ref func_8029EEB8) | 0x8029EEB8
-[func_8029F1F8](@ref func_8029F1F8) | 0x8029F1F8
-[func_8029F2FC](@ref func_8029F2FC) | 0x8029F2FC
-[func_8029F408](@ref func_8029F408) | 0x8029F408
-[func_8029F69C](@ref func_8029F69C) | 0x8029F69C
-[func_8029FB80](@ref func_8029FB80) | 0x8029FB80
-[func_8029FCA4](@ref func_8029FCA4) | 0x8029FCA4
-[func_8029FDC8](@ref func_8029FDC8) | 0x8029FDC8
-[func_802A00E8](@ref func_802A00E8) | 0x802A00E8
-[func_802A0350](@ref func_802A0350) | 0x802A0350
-[func_802A0450](@ref func_802A0450) | 0x802A0450
-[evaluate_player_collision](@ref evaluate_player_collision) | 0x802A0D54
-[func_802A0E44](@ref func_802A0E44) | 0x802A0E44
+[try_remove_destructable_item](@ref try_remove_destructable_item) | 0x8029E890
+[add_actor_to_empty_slot](@ref add_actor_to_empty_slot) | 0x8029EC88
+[spawn_actor_at_pos](@ref spawn_actor_at_pos) | 0x8029ED38
+[prototype_actor_spawn_data](@ref prototype_actor_spawn_data) | 0x8029ED98
+[query_and_resolve_collision_player_actor](@ref query_and_resolve_collision_player_actor) | 0x8029EEB8
+[collision_mario_sign](@ref collision_mario_sign) | 0x8029F1F8
+[collision_piranha_plant](@ref collision_piranha_plant) | 0x8029F2FC
+[collision_yoshi_egg](@ref collision_yoshi_egg) | 0x8029F408
+[collision_tree](@ref collision_tree) | 0x8029F69C
+[query_collision_player_vs_actor_item](@ref query_collision_player_vs_actor_item) | 0x8029FB80
+[query_collision_actor_vs_actor](@ref query_collision_actor_vs_actor) | 0x8029FCA4
+[destroy_destructable_actor](@ref destroy_destructable_actor) | 0x8029FDC8
+[play_sound_on_destructible_actor_collision](@ref play_sound_on_destructible_actor_collision) | 0x802A00E8
+[evaluate_actor_collision_between_two_destructible_actors](@ref evaluate_actor_collision_between_two_destructible_actors) | 0x802A0350
+[evaluate_collision_between_player_actor](@ref evaluate_collision_between_player_actor) | 0x802A0450
+[evaluate_collision_for_players_and_actors](@ref evaluate_collision_for_players_and_actors) | 0x802A0D54
+[evaluate_collision_for_destructible_actors](@ref evaluate_collision_for_destructible_actors) | 0x802A0E44
[func_802A1064](@ref func_802A1064) | 0x802A1064
[update_actor_fake_item_box](@ref update_actor_fake_item_box) | 0x802A10F0
-[func_802A14BC](@ref func_802A14BC) | 0x802A14BC
+[init_actor_hot_air_balloon_item_box](@ref init_actor_hot_air_balloon_item_box) | 0x802A14BC
[update_actor_item_box_hot_air_balloon](@ref update_actor_item_box_hot_air_balloon) | 0x802A156C
[update_actor_item_box](@ref update_actor_item_box) | 0x802A1600
-[func_802A171C](@ref func_802A171C) | 0x802A171C
-[func_802A1EA0](@ref func_802A1EA0) | 0x802A1EA0
+[render_actor_fake_item_box](@ref render_actor_fake_item_box) | 0x802A171C
+[render_actor_item_box](@ref render_actor_item_box) | 0x802A1EA0
[render_actor_wario_sign](@ref render_actor_wario_sign) | 0x802A269C
-[func_802A27A0](@ref func_802A27A0) | 0x802A27A0
+[render_actor_yoshi_egg](@ref render_actor_yoshi_egg) | 0x802A27A0
[render_actor_mario_sign](@ref render_actor_mario_sign) | 0x802A29BC
-[func_802A2AD0](@ref func_802A2AD0) | 0x802A2AD0
-[func_802A2C78](@ref func_802A2C78) | 0x802A2C78
-[func_802A2F34](@ref func_802A2F34) | 0x802A2F34
+[render_actor_railroad_crossing](@ref render_actor_railroad_crossing) | 0x802A2AD0
+[render_actor_palm_tree](@ref render_actor_palm_tree) | 0x802A2C78
+[render_item_boxes](@ref render_item_boxes) | 0x802A2F34
[render_course_actors](@ref render_course_actors) | 0x802A3008
[update_course_actors](@ref update_course_actors) | 0x802A3548
[func_802A3730](@ref func_802A3730) | 0x802A3730
@@ -5084,11 +5084,11 @@ Variable Name | Memory Address
[subtract_scaled_vector](@ref subtract_scaled_vector) | 0x802AF9F0
[process_collision](@ref process_collision) | 0x802AFA34
[copy_collision](@ref copy_collision) | 0x802B0210
-[func_802B02B4](@ref func_802B02B4) | 0x802B02B4
+[triple_shell_actor_collide_with_player](@ref triple_shell_actor_collide_with_player) | 0x802B02B4
[func_802B039C](@ref func_802B039C) | 0x802B039C
[func_802B0464](@ref func_802B0464) | 0x802B0464
[func_802B04E8](@ref func_802B04E8) | 0x802B04E8
-[func_802B0570](@ref func_802B0570) | 0x802B0570
+[destroy_banana_in_banana_bunch](@ref destroy_banana_in_banana_bunch) | 0x802B0570
[func_802B0648](@ref func_802B0648) | 0x802B0648
[func_802B0788](@ref func_802B0788) | 0x802B0788
[func_802B09C0](@ref func_802B09C0) | 0x802B09C0
@@ -5107,7 +5107,7 @@ Variable Name | Memory Address
[use_banana_item](@ref use_banana_item) | 0x802B2D70
[use_thunder_item](@ref use_thunder_item) | 0x802B2EBC
[player_use_item](@ref player_use_item) | 0x802B2FA0
-[func_802B30EC](@ref func_802B30EC) | 0x802B30EC
+[check_player_use_item](@ref check_player_use_item) | 0x802B30EC
[update_actor_green_shell](@ref update_actor_green_shell) | 0x802B32C4
[func_802B3B44](@ref func_802B3B44) | 0x802B3B44
[func_802B3E7C](@ref func_802B3E7C) | 0x802B3E7C
@@ -18681,66 +18681,66 @@ Variable Name | Memory Address
[gCosineTable](@ref gCosineTable) | 0x802BB370
[gArctanTable](@ref gArctanTable) | 0x802BF370
[gTextureMarioFace00](@ref gTextureMarioFace00) | 0x0A000000
-[gTextureMarioFace00_end](@ref gTextureMarioFace00_end) | 0x0A000CD4
[gTextureMarioFace01](@ref gTextureMarioFace01) | 0x0A000CD4
-[gTextureMarioFace01_end](@ref gTextureMarioFace01_end) | 0x0A001994
+[gTextureMarioFace00_end](@ref gTextureMarioFace00_end) | 0x0A000CD4
[gTextureMarioFace02](@ref gTextureMarioFace02) | 0x0A001994
-[gTextureMarioFace02_end](@ref gTextureMarioFace02_end) | 0x0A002650
+[gTextureMarioFace01_end](@ref gTextureMarioFace01_end) | 0x0A001994
[gTextureMarioFace03](@ref gTextureMarioFace03) | 0x0A002650
-[gTextureMarioFace04](@ref gTextureMarioFace04) | 0x0A0032BC
+[gTextureMarioFace02_end](@ref gTextureMarioFace02_end) | 0x0A002650
[gTextureMarioFace03_end](@ref gTextureMarioFace03_end) | 0x0A0032BC
-[gTextureMarioFace04_end](@ref gTextureMarioFace04_end) | 0x0A003F08
+[gTextureMarioFace04](@ref gTextureMarioFace04) | 0x0A0032BC
[gTextureMarioFace05](@ref gTextureMarioFace05) | 0x0A003F08
-[gTextureMarioFace05_end](@ref gTextureMarioFace05_end) | 0x0A004B48
+[gTextureMarioFace04_end](@ref gTextureMarioFace04_end) | 0x0A003F08
[gTextureMarioFace06](@ref gTextureMarioFace06) | 0x0A004B48
+[gTextureMarioFace05_end](@ref gTextureMarioFace05_end) | 0x0A004B48
[gTextureMarioFace07](@ref gTextureMarioFace07) | 0x0A00585C
[gTextureMarioFace06_end](@ref gTextureMarioFace06_end) | 0x0A00585C
[gTextureMarioFace08](@ref gTextureMarioFace08) | 0x0A006568
[gTextureMarioFace07_end](@ref gTextureMarioFace07_end) | 0x0A006568
-[gTextureMarioFace09](@ref gTextureMarioFace09) | 0x0A00726C
[gTextureMarioFace08_end](@ref gTextureMarioFace08_end) | 0x0A00726C
-[gTextureMarioFace10](@ref gTextureMarioFace10) | 0x0A007F4C
+[gTextureMarioFace09](@ref gTextureMarioFace09) | 0x0A00726C
[gTextureMarioFace09_end](@ref gTextureMarioFace09_end) | 0x0A007F4C
+[gTextureMarioFace10](@ref gTextureMarioFace10) | 0x0A007F4C
[gTextureMarioFace11](@ref gTextureMarioFace11) | 0x0A008C48
[gTextureMarioFace10_end](@ref gTextureMarioFace10_end) | 0x0A008C48
-[gTextureMarioFace12](@ref gTextureMarioFace12) | 0x0A009944
[gTextureMarioFace11_end](@ref gTextureMarioFace11_end) | 0x0A009944
+[gTextureMarioFace12](@ref gTextureMarioFace12) | 0x0A009944
[gTextureMarioFace13](@ref gTextureMarioFace13) | 0x0A00A688
[gTextureMarioFace12_end](@ref gTextureMarioFace12_end) | 0x0A00A688
-[gTextureMarioFace13_end](@ref gTextureMarioFace13_end) | 0x0A00B3DC
[gTextureMarioFace14](@ref gTextureMarioFace14) | 0x0A00B3DC
-[gTextureMarioFace14_end](@ref gTextureMarioFace14_end) | 0x0A00C180
+[gTextureMarioFace13_end](@ref gTextureMarioFace13_end) | 0x0A00B3DC
[gTextureMarioFace15](@ref gTextureMarioFace15) | 0x0A00C180
-[gTextureMarioFace15_end](@ref gTextureMarioFace15_end) | 0x0A00CF20
+[gTextureMarioFace14_end](@ref gTextureMarioFace14_end) | 0x0A00C180
[gTextureMarioFace16](@ref gTextureMarioFace16) | 0x0A00CF20
+[gTextureMarioFace15_end](@ref gTextureMarioFace15_end) | 0x0A00CF20
[gTextureLuigiFace00](@ref gTextureLuigiFace00) | 0x0A00DA64
[gTextureMarioFace16_end](@ref gTextureMarioFace16_end) | 0x0A00DA64
-[gTextureLuigiFace01](@ref gTextureLuigiFace01) | 0x0A00E680
[gTextureLuigiFace00_end](@ref gTextureLuigiFace00_end) | 0x0A00E680
+[gTextureLuigiFace01](@ref gTextureLuigiFace01) | 0x0A00E680
[gTextureLuigiFace01_end](@ref gTextureLuigiFace01_end) | 0x0A00F2A0
[gTextureLuigiFace02](@ref gTextureLuigiFace02) | 0x0A00F2A0
-[gTextureLuigiFace02_end](@ref gTextureLuigiFace02_end) | 0x0A00FEC0
[gTextureLuigiFace03](@ref gTextureLuigiFace03) | 0x0A00FEC0
+[gTextureLuigiFace02_end](@ref gTextureLuigiFace02_end) | 0x0A00FEC0
[gTextureLuigiFace03_end](@ref gTextureLuigiFace03_end) | 0x0A010AA8
[gTextureLuigiFace04](@ref gTextureLuigiFace04) | 0x0A010AA8
-[gTextureLuigiFace04_end](@ref gTextureLuigiFace04_end) | 0x0A011690
[gTextureLuigiFace05](@ref gTextureLuigiFace05) | 0x0A011690
+[gTextureLuigiFace04_end](@ref gTextureLuigiFace04_end) | 0x0A011690
[gTextureLuigiFace06](@ref gTextureLuigiFace06) | 0x0A01225C
[gTextureLuigiFace05_end](@ref gTextureLuigiFace05_end) | 0x0A01225C
[gTextureLuigiFace06_end](@ref gTextureLuigiFace06_end) | 0x0A012E84
[gTextureLuigiFace07](@ref gTextureLuigiFace07) | 0x0A012E84
-[gTextureLuigiFace08](@ref gTextureLuigiFace08) | 0x0A013AB8
[gTextureLuigiFace07_end](@ref gTextureLuigiFace07_end) | 0x0A013AB8
-[gTextureLuigiFace09](@ref gTextureLuigiFace09) | 0x0A014744
+[gTextureLuigiFace08](@ref gTextureLuigiFace08) | 0x0A013AB8
[gTextureLuigiFace08_end](@ref gTextureLuigiFace08_end) | 0x0A014744
-[gTextureLuigiFace10](@ref gTextureLuigiFace10) | 0x0A0153C4
+[gTextureLuigiFace09](@ref gTextureLuigiFace09) | 0x0A014744
[gTextureLuigiFace09_end](@ref gTextureLuigiFace09_end) | 0x0A0153C4
-[gTextureLuigiFace10_end](@ref gTextureLuigiFace10_end) | 0x0A016054
+[gTextureLuigiFace10](@ref gTextureLuigiFace10) | 0x0A0153C4
[gTextureLuigiFace11](@ref gTextureLuigiFace11) | 0x0A016054
+[gTextureLuigiFace10_end](@ref gTextureLuigiFace10_end) | 0x0A016054
[gTextureLuigiFace11_end](@ref gTextureLuigiFace11_end) | 0x0A016D14
[gTextureLuigiFace12](@ref gTextureLuigiFace12) | 0x0A016D14
-[gTextureLuigiFace12_end](@ref gTextureLuigiFace12_end) | 0x0A017A44
[gTextureLuigiFace13](@ref gTextureLuigiFace13) | 0x0A017A44
+[gTextureLuigiFace12_end](@ref gTextureLuigiFace12_end) | 0x0A017A44
[gTextureLuigiFace14](@ref gTextureLuigiFace14) | 0x0A018770
[gTextureLuigiFace13_end](@ref gTextureLuigiFace13_end) | 0x0A018770
[gTextureLuigiFace15](@ref gTextureLuigiFace15) | 0x0A0194B8
@@ -18749,68 +18749,68 @@ Variable Name | Memory Address
[gTextureLuigiFace16](@ref gTextureLuigiFace16) | 0x0A01A20C
[gTextureLuigiFace16_end](@ref gTextureLuigiFace16_end) | 0x0A01AC44
[gTexturePeachFace00](@ref gTexturePeachFace00) | 0x0A01AC44
-[gTexturePeachFace00_end](@ref gTexturePeachFace00_end) | 0x0A01BAFC
[gTexturePeachFace01](@ref gTexturePeachFace01) | 0x0A01BAFC
+[gTexturePeachFace00_end](@ref gTexturePeachFace00_end) | 0x0A01BAFC
[gTexturePeachFace01_end](@ref gTexturePeachFace01_end) | 0x0A01C9A8
[gTexturePeachFace02](@ref gTexturePeachFace02) | 0x0A01C9A8
-[gTexturePeachFace02_end](@ref gTexturePeachFace02_end) | 0x0A01D864
[gTexturePeachFace03](@ref gTexturePeachFace03) | 0x0A01D864
+[gTexturePeachFace02_end](@ref gTexturePeachFace02_end) | 0x0A01D864
[gTexturePeachFace04](@ref gTexturePeachFace04) | 0x0A01E71C
[gTexturePeachFace03_end](@ref gTexturePeachFace03_end) | 0x0A01E71C
-[gTexturePeachFace05](@ref gTexturePeachFace05) | 0x0A01F5A4
[gTexturePeachFace04_end](@ref gTexturePeachFace04_end) | 0x0A01F5A4
-[gTexturePeachFace06](@ref gTexturePeachFace06) | 0x0A020444
+[gTexturePeachFace05](@ref gTexturePeachFace05) | 0x0A01F5A4
[gTexturePeachFace05_end](@ref gTexturePeachFace05_end) | 0x0A020444
-[gTexturePeachFace07](@ref gTexturePeachFace07) | 0x0A02130C
+[gTexturePeachFace06](@ref gTexturePeachFace06) | 0x0A020444
[gTexturePeachFace06_end](@ref gTexturePeachFace06_end) | 0x0A02130C
-[gTexturePeachFace07_end](@ref gTexturePeachFace07_end) | 0x0A0221FC
+[gTexturePeachFace07](@ref gTexturePeachFace07) | 0x0A02130C
[gTexturePeachFace08](@ref gTexturePeachFace08) | 0x0A0221FC
+[gTexturePeachFace07_end](@ref gTexturePeachFace07_end) | 0x0A0221FC
[gTexturePeachFace08_end](@ref gTexturePeachFace08_end) | 0x0A02310C
[gTexturePeachFace09](@ref gTexturePeachFace09) | 0x0A02310C
[gTexturePeachFace09_end](@ref gTexturePeachFace09_end) | 0x0A0240C0
[gTexturePeachFace10](@ref gTexturePeachFace10) | 0x0A0240C0
-[gTexturePeachFace10_end](@ref gTexturePeachFace10_end) | 0x0A0250A4
[gTexturePeachFace11](@ref gTexturePeachFace11) | 0x0A0250A4
+[gTexturePeachFace10_end](@ref gTexturePeachFace10_end) | 0x0A0250A4
[gTexturePeachFace11_end](@ref gTexturePeachFace11_end) | 0x0A0260F0
[gTexturePeachFace12](@ref gTexturePeachFace12) | 0x0A0260F0
[gTexturePeachFace13](@ref gTexturePeachFace13) | 0x0A027128
[gTexturePeachFace12_end](@ref gTexturePeachFace12_end) | 0x0A027128
-[gTexturePeachFace14](@ref gTexturePeachFace14) | 0x0A02810C
[gTexturePeachFace13_end](@ref gTexturePeachFace13_end) | 0x0A02810C
-[gTexturePeachFace15](@ref gTexturePeachFace15) | 0x0A0290A0
+[gTexturePeachFace14](@ref gTexturePeachFace14) | 0x0A02810C
[gTexturePeachFace14_end](@ref gTexturePeachFace14_end) | 0x0A0290A0
-[gTexturePeachFace15_end](@ref gTexturePeachFace15_end) | 0x0A02A028
+[gTexturePeachFace15](@ref gTexturePeachFace15) | 0x0A0290A0
[gTexturePeachFace16](@ref gTexturePeachFace16) | 0x0A02A028
+[gTexturePeachFace15_end](@ref gTexturePeachFace15_end) | 0x0A02A028
[gTexturePeachFace16_end](@ref gTexturePeachFace16_end) | 0x0A02AED0
[gTextureToadFace00](@ref gTextureToadFace00) | 0x0A02AED0
-[gTextureToadFace00_end](@ref gTextureToadFace00_end) | 0x0A02B88C
[gTextureToadFace01](@ref gTextureToadFace01) | 0x0A02B88C
+[gTextureToadFace00_end](@ref gTextureToadFace00_end) | 0x0A02B88C
[gTextureToadFace02](@ref gTextureToadFace02) | 0x0A02C240
[gTextureToadFace01_end](@ref gTextureToadFace01_end) | 0x0A02C240
[gTextureToadFace02_end](@ref gTextureToadFace02_end) | 0x0A02CBFC
[gTextureToadFace03](@ref gTextureToadFace03) | 0x0A02CBFC
-[gTextureToadFace03_end](@ref gTextureToadFace03_end) | 0x0A02D5B4
[gTextureToadFace04](@ref gTextureToadFace04) | 0x0A02D5B4
-[gTextureToadFace05](@ref gTextureToadFace05) | 0x0A02DF70
+[gTextureToadFace03_end](@ref gTextureToadFace03_end) | 0x0A02D5B4
[gTextureToadFace04_end](@ref gTextureToadFace04_end) | 0x0A02DF70
+[gTextureToadFace05](@ref gTextureToadFace05) | 0x0A02DF70
[gTextureToadFace06](@ref gTextureToadFace06) | 0x0A02E910
[gTextureToadFace05_end](@ref gTextureToadFace05_end) | 0x0A02E910
[gTextureToadFace06_end](@ref gTextureToadFace06_end) | 0x0A02F2A8
[gTextureToadFace07](@ref gTextureToadFace07) | 0x0A02F2A8
[gTextureToadFace07_end](@ref gTextureToadFace07_end) | 0x0A02FC74
[gTextureToadFace08](@ref gTextureToadFace08) | 0x0A02FC74
-[gTextureToadFace09](@ref gTextureToadFace09) | 0x0A030628
[gTextureToadFace08_end](@ref gTextureToadFace08_end) | 0x0A030628
-[gTextureToadFace10](@ref gTextureToadFace10) | 0x0A031010
+[gTextureToadFace09](@ref gTextureToadFace09) | 0x0A030628
[gTextureToadFace09_end](@ref gTextureToadFace09_end) | 0x0A031010
-[gTextureToadFace11](@ref gTextureToadFace11) | 0x0A031A24
+[gTextureToadFace10](@ref gTextureToadFace10) | 0x0A031010
[gTextureToadFace10_end](@ref gTextureToadFace10_end) | 0x0A031A24
+[gTextureToadFace11](@ref gTextureToadFace11) | 0x0A031A24
[gTextureToadFace12](@ref gTextureToadFace12) | 0x0A03247C
[gTextureToadFace11_end](@ref gTextureToadFace11_end) | 0x0A03247C
[gTextureToadFace13](@ref gTextureToadFace13) | 0x0A032EDC
[gTextureToadFace12_end](@ref gTextureToadFace12_end) | 0x0A032EDC
-[gTextureToadFace14](@ref gTextureToadFace14) | 0x0A03395C
[gTextureToadFace13_end](@ref gTextureToadFace13_end) | 0x0A03395C
+[gTextureToadFace14](@ref gTextureToadFace14) | 0x0A03395C
[gTextureToadFace15](@ref gTextureToadFace15) | 0x0A0343D0
[gTextureToadFace14_end](@ref gTextureToadFace14_end) | 0x0A0343D0
[gTextureToadFace15_end](@ref gTextureToadFace15_end) | 0x0A034E30
@@ -18819,94 +18819,94 @@ Variable Name | Memory Address
[gTextureToadFace16_end](@ref gTextureToadFace16_end) | 0x0A035794
[gTextureYoshiFace00_end](@ref gTextureYoshiFace00_end) | 0x0A036280
[gTextureYoshiFace01](@ref gTextureYoshiFace01) | 0x0A036280
-[gTextureYoshiFace01_end](@ref gTextureYoshiFace01_end) | 0x0A036D64
[gTextureYoshiFace02](@ref gTextureYoshiFace02) | 0x0A036D64
-[gTextureYoshiFace02_end](@ref gTextureYoshiFace02_end) | 0x0A037844
+[gTextureYoshiFace01_end](@ref gTextureYoshiFace01_end) | 0x0A036D64
[gTextureYoshiFace03](@ref gTextureYoshiFace03) | 0x0A037844
+[gTextureYoshiFace02_end](@ref gTextureYoshiFace02_end) | 0x0A037844
[gTextureYoshiFace04](@ref gTextureYoshiFace04) | 0x0A0382F8
[gTextureYoshiFace03_end](@ref gTextureYoshiFace03_end) | 0x0A0382F8
[gTextureYoshiFace04_end](@ref gTextureYoshiFace04_end) | 0x0A038D68
[gTextureYoshiFace05](@ref gTextureYoshiFace05) | 0x0A038D68
[gTextureYoshiFace05_end](@ref gTextureYoshiFace05_end) | 0x0A0397B0
[gTextureYoshiFace06](@ref gTextureYoshiFace06) | 0x0A0397B0
-[gTextureYoshiFace07](@ref gTextureYoshiFace07) | 0x0A03A2D4
[gTextureYoshiFace06_end](@ref gTextureYoshiFace06_end) | 0x0A03A2D4
-[gTextureYoshiFace08](@ref gTextureYoshiFace08) | 0x0A03AD00
+[gTextureYoshiFace07](@ref gTextureYoshiFace07) | 0x0A03A2D4
[gTextureYoshiFace07_end](@ref gTextureYoshiFace07_end) | 0x0A03AD00
-[gTextureYoshiFace08_end](@ref gTextureYoshiFace08_end) | 0x0A03B6BC
+[gTextureYoshiFace08](@ref gTextureYoshiFace08) | 0x0A03AD00
[gTextureYoshiFace09](@ref gTextureYoshiFace09) | 0x0A03B6BC
-[gTextureYoshiFace09_end](@ref gTextureYoshiFace09_end) | 0x0A03C068
+[gTextureYoshiFace08_end](@ref gTextureYoshiFace08_end) | 0x0A03B6BC
[gTextureYoshiFace10](@ref gTextureYoshiFace10) | 0x0A03C068
-[gTextureYoshiFace10_end](@ref gTextureYoshiFace10_end) | 0x0A03CA28
+[gTextureYoshiFace09_end](@ref gTextureYoshiFace09_end) | 0x0A03C068
[gTextureYoshiFace11](@ref gTextureYoshiFace11) | 0x0A03CA28
-[gTextureYoshiFace12](@ref gTextureYoshiFace12) | 0x0A03D438
+[gTextureYoshiFace10_end](@ref gTextureYoshiFace10_end) | 0x0A03CA28
[gTextureYoshiFace11_end](@ref gTextureYoshiFace11_end) | 0x0A03D438
-[gTextureYoshiFace13](@ref gTextureYoshiFace13) | 0x0A03DE94
+[gTextureYoshiFace12](@ref gTextureYoshiFace12) | 0x0A03D438
[gTextureYoshiFace12_end](@ref gTextureYoshiFace12_end) | 0x0A03DE94
+[gTextureYoshiFace13](@ref gTextureYoshiFace13) | 0x0A03DE94
[gTextureYoshiFace14](@ref gTextureYoshiFace14) | 0x0A03E974
[gTextureYoshiFace13_end](@ref gTextureYoshiFace13_end) | 0x0A03E974
-[gTextureYoshiFace14_end](@ref gTextureYoshiFace14_end) | 0x0A03F47C
[gTextureYoshiFace15](@ref gTextureYoshiFace15) | 0x0A03F47C
+[gTextureYoshiFace14_end](@ref gTextureYoshiFace14_end) | 0x0A03F47C
[gTextureYoshiFace15_end](@ref gTextureYoshiFace15_end) | 0x0A03FF94
[gTextureYoshiFace16](@ref gTextureYoshiFace16) | 0x0A03FF94
[gTextureYoshiFace16_end](@ref gTextureYoshiFace16_end) | 0x0A040ABC
[gTextureDkFace00](@ref gTextureDkFace00) | 0x0A040ABC
-[gTextureDkFace00_end](@ref gTextureDkFace00_end) | 0x0A0418A8
[gTextureDkFace01](@ref gTextureDkFace01) | 0x0A0418A8
-[gTextureDkFace02](@ref gTextureDkFace02) | 0x0A0426B0
+[gTextureDkFace00_end](@ref gTextureDkFace00_end) | 0x0A0418A8
[gTextureDkFace01_end](@ref gTextureDkFace01_end) | 0x0A0426B0
-[gTextureDkFace03](@ref gTextureDkFace03) | 0x0A043490
+[gTextureDkFace02](@ref gTextureDkFace02) | 0x0A0426B0
[gTextureDkFace02_end](@ref gTextureDkFace02_end) | 0x0A043490
-[gTextureDkFace04](@ref gTextureDkFace04) | 0x0A044240
+[gTextureDkFace03](@ref gTextureDkFace03) | 0x0A043490
[gTextureDkFace03_end](@ref gTextureDkFace03_end) | 0x0A044240
+[gTextureDkFace04](@ref gTextureDkFace04) | 0x0A044240
[gTextureDkFace05](@ref gTextureDkFace05) | 0x0A044FE8
[gTextureDkFace04_end](@ref gTextureDkFace04_end) | 0x0A044FE8
-[gTextureDkFace05_end](@ref gTextureDkFace05_end) | 0x0A045DCC
[gTextureDkFace06](@ref gTextureDkFace06) | 0x0A045DCC
+[gTextureDkFace05_end](@ref gTextureDkFace05_end) | 0x0A045DCC
[gTextureDkFace06_end](@ref gTextureDkFace06_end) | 0x0A046BF8
[gTextureDkFace07](@ref gTextureDkFace07) | 0x0A046BF8
-[gTextureDkFace07_end](@ref gTextureDkFace07_end) | 0x0A047A8C
[gTextureDkFace08](@ref gTextureDkFace08) | 0x0A047A8C
-[gTextureDkFace08_end](@ref gTextureDkFace08_end) | 0x0A048968
+[gTextureDkFace07_end](@ref gTextureDkFace07_end) | 0x0A047A8C
[gTextureDkFace09](@ref gTextureDkFace09) | 0x0A048968
+[gTextureDkFace08_end](@ref gTextureDkFace08_end) | 0x0A048968
[gTextureDkFace10](@ref gTextureDkFace10) | 0x0A0498B0
[gTextureDkFace09_end](@ref gTextureDkFace09_end) | 0x0A0498B0
[gTextureDkFace10_end](@ref gTextureDkFace10_end) | 0x0A04A7E8
[gTextureDkFace11](@ref gTextureDkFace11) | 0x0A04A7E8
-[gTextureDkFace11_end](@ref gTextureDkFace11_end) | 0x0A04B76C
[gTextureDkFace12](@ref gTextureDkFace12) | 0x0A04B76C
+[gTextureDkFace11_end](@ref gTextureDkFace11_end) | 0x0A04B76C
[gTextureDkFace13](@ref gTextureDkFace13) | 0x0A04C770
[gTextureDkFace12_end](@ref gTextureDkFace12_end) | 0x0A04C770
[gTextureDkFace13_end](@ref gTextureDkFace13_end) | 0x0A04D730
[gTextureDkFace14](@ref gTextureDkFace14) | 0x0A04D730
-[gTextureDkFace14_end](@ref gTextureDkFace14_end) | 0x0A04E67C
[gTextureDkFace15](@ref gTextureDkFace15) | 0x0A04E67C
-[gTextureDkFace16](@ref gTextureDkFace16) | 0x0A04F57C
+[gTextureDkFace14_end](@ref gTextureDkFace14_end) | 0x0A04E67C
[gTextureDkFace15_end](@ref gTextureDkFace15_end) | 0x0A04F57C
-[gTextureDkFace16_end](@ref gTextureDkFace16_end) | 0x0A0504D0
+[gTextureDkFace16](@ref gTextureDkFace16) | 0x0A04F57C
[gTextureWarioFace00](@ref gTextureWarioFace00) | 0x0A0504D0
-[gTextureWarioFace01](@ref gTextureWarioFace01) | 0x0A051630
+[gTextureDkFace16_end](@ref gTextureDkFace16_end) | 0x0A0504D0
[gTextureWarioFace00_end](@ref gTextureWarioFace00_end) | 0x0A051630
+[gTextureWarioFace01](@ref gTextureWarioFace01) | 0x0A051630
[gTextureWarioFace01_end](@ref gTextureWarioFace01_end) | 0x0A052774
[gTextureWarioFace02](@ref gTextureWarioFace02) | 0x0A052774
[gTextureWarioFace03](@ref gTextureWarioFace03) | 0x0A0538C8
[gTextureWarioFace02_end](@ref gTextureWarioFace02_end) | 0x0A0538C8
-[gTextureWarioFace04](@ref gTextureWarioFace04) | 0x0A054A30
[gTextureWarioFace03_end](@ref gTextureWarioFace03_end) | 0x0A054A30
+[gTextureWarioFace04](@ref gTextureWarioFace04) | 0x0A054A30
[gTextureWarioFace05](@ref gTextureWarioFace05) | 0x0A055B84
[gTextureWarioFace04_end](@ref gTextureWarioFace04_end) | 0x0A055B84
[gTextureWarioFace05_end](@ref gTextureWarioFace05_end) | 0x0A056CE0
[gTextureWarioFace06](@ref gTextureWarioFace06) | 0x0A056CE0
-[gTextureWarioFace06_end](@ref gTextureWarioFace06_end) | 0x0A057E54
[gTextureWarioFace07](@ref gTextureWarioFace07) | 0x0A057E54
-[gTextureWarioFace07_end](@ref gTextureWarioFace07_end) | 0x0A05902C
+[gTextureWarioFace06_end](@ref gTextureWarioFace06_end) | 0x0A057E54
[gTextureWarioFace08](@ref gTextureWarioFace08) | 0x0A05902C
+[gTextureWarioFace07_end](@ref gTextureWarioFace07_end) | 0x0A05902C
[gTextureWarioFace09](@ref gTextureWarioFace09) | 0x0A05A254
[gTextureWarioFace08_end](@ref gTextureWarioFace08_end) | 0x0A05A254
[gTextureWarioFace09_end](@ref gTextureWarioFace09_end) | 0x0A05B4C0
[gTextureWarioFace10](@ref gTextureWarioFace10) | 0x0A05B4C0
-[gTextureWarioFace11](@ref gTextureWarioFace11) | 0x0A05C7A0
[gTextureWarioFace10_end](@ref gTextureWarioFace10_end) | 0x0A05C7A0
+[gTextureWarioFace11](@ref gTextureWarioFace11) | 0x0A05C7A0
[gTextureWarioFace11_end](@ref gTextureWarioFace11_end) | 0x0A05DAA8
[gTextureWarioFace12](@ref gTextureWarioFace12) | 0x0A05DAA8
[gTextureWarioFace12_end](@ref gTextureWarioFace12_end) | 0x0A05ED8C
@@ -18915,34 +18915,34 @@ Variable Name | Memory Address
[gTextureWarioFace14](@ref gTextureWarioFace14) | 0x0A0600B0
[gTextureWarioFace14_end](@ref gTextureWarioFace14_end) | 0x0A06139C
[gTextureWarioFace15](@ref gTextureWarioFace15) | 0x0A06139C
-[gTextureWarioFace16](@ref gTextureWarioFace16) | 0x0A062668
[gTextureWarioFace15_end](@ref gTextureWarioFace15_end) | 0x0A062668
+[gTextureWarioFace16](@ref gTextureWarioFace16) | 0x0A062668
[gTextureWarioFace16_end](@ref gTextureWarioFace16_end) | 0x0A0637E0
[gTextureBowserFace00](@ref gTextureBowserFace00) | 0x0A0637E0
[gTextureBowserFace00_end](@ref gTextureBowserFace00_end) | 0x0A064AC8
[gTextureBowserFace01](@ref gTextureBowserFace01) | 0x0A064AC8
-[gTextureBowserFace01_end](@ref gTextureBowserFace01_end) | 0x0A065D7C
[gTextureBowserFace02](@ref gTextureBowserFace02) | 0x0A065D7C
-[gTextureBowserFace02_end](@ref gTextureBowserFace02_end) | 0x0A067044
+[gTextureBowserFace01_end](@ref gTextureBowserFace01_end) | 0x0A065D7C
[gTextureBowserFace03](@ref gTextureBowserFace03) | 0x0A067044
+[gTextureBowserFace02_end](@ref gTextureBowserFace02_end) | 0x0A067044
[gTextureBowserFace03_end](@ref gTextureBowserFace03_end) | 0x0A068310
[gTextureBowserFace04](@ref gTextureBowserFace04) | 0x0A068310
-[gTextureBowserFace05](@ref gTextureBowserFace05) | 0x0A0695B4
[gTextureBowserFace04_end](@ref gTextureBowserFace04_end) | 0x0A0695B4
+[gTextureBowserFace05](@ref gTextureBowserFace05) | 0x0A0695B4
[gTextureBowserFace06](@ref gTextureBowserFace06) | 0x0A06A840
[gTextureBowserFace05_end](@ref gTextureBowserFace05_end) | 0x0A06A840
-[gTextureBowserFace07](@ref gTextureBowserFace07) | 0x0A06BB1C
[gTextureBowserFace06_end](@ref gTextureBowserFace06_end) | 0x0A06BB1C
+[gTextureBowserFace07](@ref gTextureBowserFace07) | 0x0A06BB1C
[gTextureBowserFace08](@ref gTextureBowserFace08) | 0x0A06CE04
[gTextureBowserFace07_end](@ref gTextureBowserFace07_end) | 0x0A06CE04
-[gTextureBowserFace08_end](@ref gTextureBowserFace08_end) | 0x0A06E0F4
[gTextureBowserFace09](@ref gTextureBowserFace09) | 0x0A06E0F4
+[gTextureBowserFace08_end](@ref gTextureBowserFace08_end) | 0x0A06E0F4
[gTextureBowserFace09_end](@ref gTextureBowserFace09_end) | 0x0A06F410
[gTextureBowserFace10](@ref gTextureBowserFace10) | 0x0A06F410
[gTextureBowserFace10_end](@ref gTextureBowserFace10_end) | 0x0A0706DC
[gTextureBowserFace11](@ref gTextureBowserFace11) | 0x0A0706DC
-[gTextureBowserFace12](@ref gTextureBowserFace12) | 0x0A071A18
[gTextureBowserFace11_end](@ref gTextureBowserFace11_end) | 0x0A071A18
+[gTextureBowserFace12](@ref gTextureBowserFace12) | 0x0A071A18
[gTextureBowserFace13](@ref gTextureBowserFace13) | 0x0A072DBC
[gTextureBowserFace12_end](@ref gTextureBowserFace12_end) | 0x0A072DBC
[gTextureBowserFace14](@ref gTextureBowserFace14) | 0x0A074138
@@ -18977,12 +18977,12 @@ Variable Name | Memory Address
[gTextureTrophySilver](@ref gTextureTrophySilver) | 0x0A0AEFEC
[gTextureTrophySilver_end](@ref gTextureTrophySilver_end) | 0x0A0AF614
[gTextureTrophyBronze](@ref gTextureTrophyBronze) | 0x0A0AF614
-[gTextureTrophyBronze_end](@ref gTextureTrophyBronze_end) | 0x0A0AFC00
[gTextureCupGold](@ref gTextureCupGold) | 0x0A0AFC00
+[gTextureTrophyBronze_end](@ref gTextureTrophyBronze_end) | 0x0A0AFC00
[gTextureCupSilver](@ref gTextureCupSilver) | 0x0A0B058C
[gTextureCupGold_end](@ref gTextureCupGold_end) | 0x0A0B058C
-[gTextureCupSilver_end](@ref gTextureCupSilver_end) | 0x0A0B0F10
[gTextureCupBronze](@ref gTextureCupBronze) | 0x0A0B0F10
+[gTextureCupSilver_end](@ref gTextureCupSilver_end) | 0x0A0B0F10
[gTextureCupBronze_end](@ref gTextureCupBronze_end) | 0x0A0B17B4
[gTexturePushStartButton](@ref gTexturePushStartButton) | 0x0A0B17B4
[gTextureCopyright1996](@ref gTextureCopyright1996) | 0x0A0B2B94
@@ -18994,16 +18994,16 @@ Variable Name | Memory Address
[gTexture7E56E4](@ref gTexture7E56E4) | 0x0A0BBCB4
[gTexture7E56E4_end](@ref gTexture7E56E4_end) | 0x0A0BCE1F
[gTextureSmallFont0](@ref gTextureSmallFont0) | 0x0A0BCE20
-[gTextureSmallFont0_end](@ref gTextureSmallFont0_end) | 0x0A0BCEB0
[gTextureSmallFont1](@ref gTextureSmallFont1) | 0x0A0BCEB0
+[gTextureSmallFont0_end](@ref gTextureSmallFont0_end) | 0x0A0BCEB0
[gTextureSmallFont2](@ref gTextureSmallFont2) | 0x0A0BCF08
[gTextureSmallFont1_end](@ref gTextureSmallFont1_end) | 0x0A0BCF08
-[gTextureSmallFont3](@ref gTextureSmallFont3) | 0x0A0BCFA0
[gTextureSmallFont2_end](@ref gTextureSmallFont2_end) | 0x0A0BCFA0
+[gTextureSmallFont3](@ref gTextureSmallFont3) | 0x0A0BCFA0
[gTextureSmallFont3_end](@ref gTextureSmallFont3_end) | 0x0A0BD034
[gTextureSmallFont4](@ref gTextureSmallFont4) | 0x0A0BD034
-[gTextureSmallFont4_end](@ref gTextureSmallFont4_end) | 0x0A0BD0BC
[gTextureSmallFont5](@ref gTextureSmallFont5) | 0x0A0BD0BC
+[gTextureSmallFont4_end](@ref gTextureSmallFont4_end) | 0x0A0BD0BC
[gTextureSmallFont6](@ref gTextureSmallFont6) | 0x0A0BD154
[gTextureSmallFont5_end](@ref gTextureSmallFont5_end) | 0x0A0BD154
[gTextureSmallFont6_end](@ref gTextureSmallFont6_end) | 0x0A0BD1F0
@@ -19012,52 +19012,52 @@ Variable Name | Memory Address
[gTextureSmallFont7_end](@ref gTextureSmallFont7_end) | 0x0A0BD260
[gTextureSmallFont9](@ref gTextureSmallFont9) | 0x0A0BD2F0
[gTextureSmallFont8_end](@ref gTextureSmallFont8_end) | 0x0A0BD2F0
-[gTextureN64ControllerPakDataSelect](@ref gTextureN64ControllerPakDataSelect) | 0x0A0BD390
[gTextureSmallFont9_end](@ref gTextureSmallFont9_end) | 0x0A0BD390
-[gTextureEraseDataRecordConfirmation](@ref gTextureEraseDataRecordConfirmation) | 0x0A0BE4B8
+[gTextureN64ControllerPakDataSelect](@ref gTextureN64ControllerPakDataSelect) | 0x0A0BD390
[gTextureN64ControllerPakDataSelect_end](@ref gTextureN64ControllerPakDataSelect_end) | 0x0A0BE4B8
+[gTextureEraseDataRecordConfirmation](@ref gTextureEraseDataRecordConfirmation) | 0x0A0BE4B8
[gTextureEraseDataRecordConfirmation_end](@ref gTextureEraseDataRecordConfirmation_end) | 0x0A0BF4AC
[gTextureRecordNotErased](@ref gTextureRecordNotErased) | 0x0A0BF4AC
-[gTexturePlaceN64ControllerPakIntoController1](@ref gTexturePlaceN64ControllerPakIntoController1) | 0x0A0BFD7C
[gTextureRecordNotErased_end](@ref gTextureRecordNotErased_end) | 0x0A0BFD7C
-[gTexturePleaseReinsertOriginalN64ControllerPak](@ref gTexturePleaseReinsertOriginalN64ControllerPak) | 0x0A0C09C8
+[gTexturePlaceN64ControllerPakIntoController1](@ref gTexturePlaceN64ControllerPakIntoController1) | 0x0A0BFD7C
[gTexturePlaceN64ControllerPakIntoController1_end](@ref gTexturePlaceN64ControllerPakIntoController1_end) | 0x0A0C09C8
-[gTexturePleaseReinsertOriginalN64ControllerPak_end](@ref gTexturePleaseReinsertOriginalN64ControllerPak_end) | 0x0A0C16A0
+[gTexturePleaseReinsertOriginalN64ControllerPak](@ref gTexturePleaseReinsertOriginalN64ControllerPak) | 0x0A0C09C8
[gTextureErasingSelectedRecord](@ref gTextureErasingSelectedRecord) | 0x0A0C16A0
+[gTexturePleaseReinsertOriginalN64ControllerPak_end](@ref gTexturePleaseReinsertOriginalN64ControllerPak_end) | 0x0A0C16A0
[gTextureSelectRecord](@ref gTextureSelectRecord) | 0x0A0C22A4
[gTextureErasingSelectedRecord_end](@ref gTextureErasingSelectedRecord_end) | 0x0A0C22A4
[gTextureTextEnd](@ref gTextureTextEnd) | 0x0A0C261C
[gTextureSelectRecord_end](@ref gTextureSelectRecord_end) | 0x0A0C261C
-[gTextureTextEnd_end](@ref gTextureTextEnd_end) | 0x0A0C274C
[gTextureTableOfContents](@ref gTextureTableOfContents) | 0x0A0C274C
-[gTextureTableOfContents_end](@ref gTextureTableOfContents_end) | 0x0A0C2B78
+[gTextureTextEnd_end](@ref gTextureTextEnd_end) | 0x0A0C274C
[gTextureTextHash](@ref gTextureTextHash) | 0x0A0C2B78
+[gTextureTableOfContents_end](@ref gTextureTableOfContents_end) | 0x0A0C2B78
[gTextureTextHash_end](@ref gTextureTextHash_end) | 0x0A0C2BF8
[gTextureTextGameData](@ref gTextureTextGameData) | 0x0A0C2BF8
-[gTextureTextPages](@ref gTextureTextPages) | 0x0A0C2EBC
[gTextureTextGameData_end](@ref gTextureTextGameData_end) | 0x0A0C2EBC
-[gTextureTextPagesFree](@ref gTextureTextPagesFree) | 0x0A0C307C
+[gTextureTextPages](@ref gTextureTextPages) | 0x0A0C2EBC
[gTextureTextPages_end](@ref gTextureTextPages_end) | 0x0A0C307C
+[gTextureTextPagesFree](@ref gTextureTextPagesFree) | 0x0A0C307C
[gTextureTextPagesFree_end](@ref gTextureTextPagesFree_end) | 0x0A0C3340
[gTextureTextErase](@ref gTextureTextErase) | 0x0A0C3340
-[gTextureTextErase_end](@ref gTextureTextErase_end) | 0x0A0C34E0
[gTextureTextQuit](@ref gTextureTextQuit) | 0x0A0C34E0
+[gTextureTextErase_end](@ref gTextureTextErase_end) | 0x0A0C34E0
[gTextureTextQuit_end](@ref gTextureTextQuit_end) | 0x0A0C3628
[gTexture7ED058](@ref gTexture7ED058) | 0x0A0C3628
[gTexture7ED290](@ref gTexture7ED290) | 0x0A0C3860
[gTexture7ED058_end](@ref gTexture7ED058_end) | 0x0A0C3860
[gTexture7ED50C](@ref gTexture7ED50C) | 0x0A0C3ADC
[gTexture7ED290_end](@ref gTexture7ED290_end) | 0x0A0C3ADC
-[gTexture7ED6A4](@ref gTexture7ED6A4) | 0x0A0C3C74
[gTexture7ED50C_end](@ref gTexture7ED50C_end) | 0x0A0C3C74
-[gTextureTinyFont0](@ref gTextureTinyFont0) | 0x0A0C4004
+[gTexture7ED6A4](@ref gTexture7ED6A4) | 0x0A0C3C74
[gTexture7ED6A4_end](@ref gTexture7ED6A4_end) | 0x0A0C4004
+[gTextureTinyFont0](@ref gTextureTinyFont0) | 0x0A0C4004
[gTextureTinyFont0_end](@ref gTextureTinyFont0_end) | 0x0A0C4078
[gTextureTinyFont1](@ref gTextureTinyFont1) | 0x0A0C4078
[gTextureTinyFont1_end](@ref gTextureTinyFont1_end) | 0x0A0C40C0
[gTextureTinyFont2](@ref gTextureTinyFont2) | 0x0A0C40C0
-[gTextureTinyFont3](@ref gTextureTinyFont3) | 0x0A0C4134
[gTextureTinyFont2_end](@ref gTextureTinyFont2_end) | 0x0A0C4134
+[gTextureTinyFont3](@ref gTextureTinyFont3) | 0x0A0C4134
[gTextureTinyFont3_end](@ref gTextureTinyFont3_end) | 0x0A0C41A4
[gTextureTinyFont4](@ref gTextureTinyFont4) | 0x0A0C41A4
[gTextureTinyFont5](@ref gTextureTinyFont5) | 0x0A0C4200
@@ -19068,70 +19068,70 @@ Variable Name | Memory Address
[gTextureTinyFont7](@ref gTextureTinyFont7) | 0x0A0C42E8
[gTextureTinyFont8](@ref gTextureTinyFont8) | 0x0A0C4348
[gTextureTinyFont7_end](@ref gTextureTinyFont7_end) | 0x0A0C4348
-[gTextureTinyFont9](@ref gTextureTinyFont9) | 0x0A0C43C0
[gTextureTinyFont8_end](@ref gTextureTinyFont8_end) | 0x0A0C43C0
-[gTextureTinyFont9_end](@ref gTextureTinyFont9_end) | 0x0A0C4434
+[gTextureTinyFont9](@ref gTextureTinyFont9) | 0x0A0C43C0
[gTextureTinyFontA](@ref gTextureTinyFontA) | 0x0A0C4434
+[gTextureTinyFont9_end](@ref gTextureTinyFont9_end) | 0x0A0C4434
[gTextureTinyFontA_end](@ref gTextureTinyFontA_end) | 0x0A0C44A0
[gTextureTinyFontB](@ref gTextureTinyFontB) | 0x0A0C44A0
[gTextureTinyFontC](@ref gTextureTinyFontC) | 0x0A0C451C
[gTextureTinyFontB_end](@ref gTextureTinyFontB_end) | 0x0A0C451C
[gTextureTinyFontD](@ref gTextureTinyFontD) | 0x0A0C4590
[gTextureTinyFontC_end](@ref gTextureTinyFontC_end) | 0x0A0C4590
-[gTextureTinyFontE](@ref gTextureTinyFontE) | 0x0A0C4600
[gTextureTinyFontD_end](@ref gTextureTinyFontD_end) | 0x0A0C4600
-[gTextureTinyFontF](@ref gTextureTinyFontF) | 0x0A0C4674
+[gTextureTinyFontE](@ref gTextureTinyFontE) | 0x0A0C4600
[gTextureTinyFontE_end](@ref gTextureTinyFontE_end) | 0x0A0C4674
-[gTextureTinyFontG](@ref gTextureTinyFontG) | 0x0A0C46D8
+[gTextureTinyFontF](@ref gTextureTinyFontF) | 0x0A0C4674
[gTextureTinyFontF_end](@ref gTextureTinyFontF_end) | 0x0A0C46D8
-[gTextureTinyFontH](@ref gTextureTinyFontH) | 0x0A0C474C
+[gTextureTinyFontG](@ref gTextureTinyFontG) | 0x0A0C46D8
[gTextureTinyFontG_end](@ref gTextureTinyFontG_end) | 0x0A0C474C
-[gTextureTinyFontH_end](@ref gTextureTinyFontH_end) | 0x0A0C47C4
+[gTextureTinyFontH](@ref gTextureTinyFontH) | 0x0A0C474C
[gTextureTinyFontI](@ref gTextureTinyFontI) | 0x0A0C47C4
-[gTextureTinyFontI_end](@ref gTextureTinyFontI_end) | 0x0A0C480C
+[gTextureTinyFontH_end](@ref gTextureTinyFontH_end) | 0x0A0C47C4
[gTextureTinyFontJ](@ref gTextureTinyFontJ) | 0x0A0C480C
+[gTextureTinyFontI_end](@ref gTextureTinyFontI_end) | 0x0A0C480C
[gTextureTinyFontK](@ref gTextureTinyFontK) | 0x0A0C4860
[gTextureTinyFontJ_end](@ref gTextureTinyFontJ_end) | 0x0A0C4860
-[gTextureTinyFontL](@ref gTextureTinyFontL) | 0x0A0C48D0
[gTextureTinyFontK_end](@ref gTextureTinyFontK_end) | 0x0A0C48D0
-[gTextureTinyFontM](@ref gTextureTinyFontM) | 0x0A0C491C
+[gTextureTinyFontL](@ref gTextureTinyFontL) | 0x0A0C48D0
[gTextureTinyFontL_end](@ref gTextureTinyFontL_end) | 0x0A0C491C
-[gTextureTinyFontN](@ref gTextureTinyFontN) | 0x0A0C4998
+[gTextureTinyFontM](@ref gTextureTinyFontM) | 0x0A0C491C
[gTextureTinyFontM_end](@ref gTextureTinyFontM_end) | 0x0A0C4998
-[gTextureTinyFontN_end](@ref gTextureTinyFontN_end) | 0x0A0C4A14
+[gTextureTinyFontN](@ref gTextureTinyFontN) | 0x0A0C4998
[gTextureTinyFontO](@ref gTextureTinyFontO) | 0x0A0C4A14
-[gTextureTinyFontP](@ref gTextureTinyFontP) | 0x0A0C4A8C
+[gTextureTinyFontN_end](@ref gTextureTinyFontN_end) | 0x0A0C4A14
[gTextureTinyFontO_end](@ref gTextureTinyFontO_end) | 0x0A0C4A8C
-[gTextureTinyFontP_end](@ref gTextureTinyFontP_end) | 0x0A0C4AF8
+[gTextureTinyFontP](@ref gTextureTinyFontP) | 0x0A0C4A8C
[gTextureTinyFontQ](@ref gTextureTinyFontQ) | 0x0A0C4AF8
+[gTextureTinyFontP_end](@ref gTextureTinyFontP_end) | 0x0A0C4AF8
[gTextureTinyFontQ_end](@ref gTextureTinyFontQ_end) | 0x0A0C4B70
[gTextureTinyFontR](@ref gTextureTinyFontR) | 0x0A0C4B70
[gTextureTinyFontR_end](@ref gTextureTinyFontR_end) | 0x0A0C4BE4
[gTextureTinyFontS](@ref gTextureTinyFontS) | 0x0A0C4BE4
-[gTextureTinyFontS_end](@ref gTextureTinyFontS_end) | 0x0A0C4C54
[gTextureTinyFontT](@ref gTextureTinyFontT) | 0x0A0C4C54
+[gTextureTinyFontS_end](@ref gTextureTinyFontS_end) | 0x0A0C4C54
[gTextureTinyFontU](@ref gTextureTinyFontU) | 0x0A0C4CA8
[gTextureTinyFontT_end](@ref gTextureTinyFontT_end) | 0x0A0C4CA8
-[gTextureTinyFontV](@ref gTextureTinyFontV) | 0x0A0C4D0C
[gTextureTinyFontU_end](@ref gTextureTinyFontU_end) | 0x0A0C4D0C
+[gTextureTinyFontV](@ref gTextureTinyFontV) | 0x0A0C4D0C
[gTextureTinyFontW](@ref gTextureTinyFontW) | 0x0A0C4D6C
[gTextureTinyFontV_end](@ref gTextureTinyFontV_end) | 0x0A0C4D6C
-[gTextureTinyFontX](@ref gTextureTinyFontX) | 0x0A0C4DE8
[gTextureTinyFontW_end](@ref gTextureTinyFontW_end) | 0x0A0C4DE8
+[gTextureTinyFontX](@ref gTextureTinyFontX) | 0x0A0C4DE8
[gTextureTinyFontX_end](@ref gTextureTinyFontX_end) | 0x0A0C4E54
[gTextureTinyFontY](@ref gTextureTinyFontY) | 0x0A0C4E54
[gTextureTinyFontY_end](@ref gTextureTinyFontY_end) | 0x0A0C4EA4
[gTextureTinyFontZ](@ref gTextureTinyFontZ) | 0x0A0C4EA4
-[gTextureTinyFontExclamationMark](@ref gTextureTinyFontExclamationMark) | 0x0A0C4F0C
[gTextureTinyFontZ_end](@ref gTextureTinyFontZ_end) | 0x0A0C4F0C
+[gTextureTinyFontExclamationMark](@ref gTextureTinyFontExclamationMark) | 0x0A0C4F0C
[gTextureTinyFontDoubleQuote](@ref gTextureTinyFontDoubleQuote) | 0x0A0C4F54
[gTextureTinyFontExclamationMark_end](@ref gTextureTinyFontExclamationMark_end) | 0x0A0C4F54
-[gTextureTinyFontDoubleQuote_end](@ref gTextureTinyFontDoubleQuote_end) | 0x0A0C4F8C
[gTextureTinyFontHash](@ref gTextureTinyFontHash) | 0x0A0C4F8C
+[gTextureTinyFontDoubleQuote_end](@ref gTextureTinyFontDoubleQuote_end) | 0x0A0C4F8C
[gTextureTinyFontHash_end](@ref gTextureTinyFontHash_end) | 0x0A0C4FFC
[gTextureTinyFontSingleQuote](@ref gTextureTinyFontSingleQuote) | 0x0A0C4FFC
-[gTextureTinyFontAsterisk](@ref gTextureTinyFontAsterisk) | 0x0A0C502C
[gTextureTinyFontSingleQuote_end](@ref gTextureTinyFontSingleQuote_end) | 0x0A0C502C
+[gTextureTinyFontAsterisk](@ref gTextureTinyFontAsterisk) | 0x0A0C502C
[gTextureTinyFontPlus](@ref gTextureTinyFontPlus) | 0x0A0C5098
[gTextureTinyFontAsterisk_end](@ref gTextureTinyFontAsterisk_end) | 0x0A0C5098
[gTextureTinyFontPlus_end](@ref gTextureTinyFontPlus_end) | 0x0A0C50E8
@@ -19142,60 +19142,60 @@ Variable Name | Memory Address
[gTextureTinyFontMinus_end](@ref gTextureTinyFontMinus_end) | 0x0A0C514C
[gTextureTinyFontForwardSlash](@ref gTextureTinyFontForwardSlash) | 0x0A0C517C
[gTextureTinyFontComma_end](@ref gTextureTinyFontComma_end) | 0x0A0C517C
-[gTextureTinyFontForwardSlash_end](@ref gTextureTinyFontForwardSlash_end) | 0x0A0C51CC
[gTextureTinyFontColon](@ref gTextureTinyFontColon) | 0x0A0C51CC
-[gTextureTinyFontColon_end](@ref gTextureTinyFontColon_end) | 0x0A0C5204
+[gTextureTinyFontForwardSlash_end](@ref gTextureTinyFontForwardSlash_end) | 0x0A0C51CC
[gTexture7EEC34](@ref gTexture7EEC34) | 0x0A0C5204
-[gTextureTinyFontQuestion](@ref gTextureTinyFontQuestion) | 0x0A0C5254
+[gTextureTinyFontColon_end](@ref gTextureTinyFontColon_end) | 0x0A0C5204
[gTexture7EEC34_end](@ref gTexture7EEC34_end) | 0x0A0C5254
-[gTexture7EECE4](@ref gTexture7EECE4) | 0x0A0C52B4
+[gTextureTinyFontQuestion](@ref gTextureTinyFontQuestion) | 0x0A0C5254
[gTextureTinyFontQuestion_end](@ref gTextureTinyFontQuestion_end) | 0x0A0C52B4
+[gTexture7EECE4](@ref gTexture7EECE4) | 0x0A0C52B4
[gTexture7EECE4_end](@ref gTexture7EECE4_end) | 0x0A0C5344
[gTexture7EED74](@ref gTexture7EED74) | 0x0A0C5344
-[gTexture7EED74_end](@ref gTexture7EED74_end) | 0x0A0C5380
[gTexture7EEDB0](@ref gTexture7EEDB0) | 0x0A0C5380
-[gTexture7EEDB0_end](@ref gTexture7EEDB0_end) | 0x0A0C53B8
+[gTexture7EED74_end](@ref gTexture7EED74_end) | 0x0A0C5380
[gTexture7EEDE8](@ref gTexture7EEDE8) | 0x0A0C53B8
-[gTexture7EEE20](@ref gTexture7EEE20) | 0x0A0C53F0
+[gTexture7EEDB0_end](@ref gTexture7EEDB0_end) | 0x0A0C53B8
[gTexture7EEDE8_end](@ref gTexture7EEDE8_end) | 0x0A0C53F0
+[gTexture7EEE20](@ref gTexture7EEE20) | 0x0A0C53F0
[gTexture7EEE7C](@ref gTexture7EEE7C) | 0x0A0C544C
[gTexture7EEE20_end](@ref gTexture7EEE20_end) | 0x0A0C544C
-[gTexture7EEE7C_end](@ref gTexture7EEE7C_end) | 0x0A0C54A0
[gTexture7EEED0](@ref gTexture7EEED0) | 0x0A0C54A0
-[gTexture7EEED0_end](@ref gTexture7EEED0_end) | 0x0A0C550C
+[gTexture7EEE7C_end](@ref gTexture7EEE7C_end) | 0x0A0C54A0
[gTexture7EEF3C](@ref gTexture7EEF3C) | 0x0A0C550C
-[gTexture7EEF90](@ref gTexture7EEF90) | 0x0A0C5560
+[gTexture7EEED0_end](@ref gTexture7EEED0_end) | 0x0A0C550C
[gTexture7EEF3C_end](@ref gTexture7EEF3C_end) | 0x0A0C5560
-[gTexture7EEFF4](@ref gTexture7EEFF4) | 0x0A0C55C4
+[gTexture7EEF90](@ref gTexture7EEF90) | 0x0A0C5560
[gTexture7EEF90_end](@ref gTexture7EEF90_end) | 0x0A0C55C4
-[gTexture7EEFF4_end](@ref gTexture7EEFF4_end) | 0x0A0C5628
+[gTexture7EEFF4](@ref gTexture7EEFF4) | 0x0A0C55C4
[gTexture7EF058](@ref gTexture7EF058) | 0x0A0C5628
-[gTexture7EF0B4](@ref gTexture7EF0B4) | 0x0A0C5684
+[gTexture7EEFF4_end](@ref gTexture7EEFF4_end) | 0x0A0C5628
[gTexture7EF058_end](@ref gTexture7EF058_end) | 0x0A0C5684
-[gTexture7EF110](@ref gTexture7EF110) | 0x0A0C56E0
+[gTexture7EF0B4](@ref gTexture7EF0B4) | 0x0A0C5684
[gTexture7EF0B4_end](@ref gTexture7EF0B4_end) | 0x0A0C56E0
+[gTexture7EF110](@ref gTexture7EF110) | 0x0A0C56E0
[gTexture7EF17C](@ref gTexture7EF17C) | 0x0A0C574C
[gTexture7EF110_end](@ref gTexture7EF110_end) | 0x0A0C574C
-[gTexture7EF1F0](@ref gTexture7EF1F0) | 0x0A0C57C0
[gTexture7EF17C_end](@ref gTexture7EF17C_end) | 0x0A0C57C0
-[gTexture7EF250](@ref gTexture7EF250) | 0x0A0C5820
+[gTexture7EF1F0](@ref gTexture7EF1F0) | 0x0A0C57C0
[gTexture7EF1F0_end](@ref gTexture7EF1F0_end) | 0x0A0C5820
-[gTexture7EF250_end](@ref gTexture7EF250_end) | 0x0A0C5888
+[gTexture7EF250](@ref gTexture7EF250) | 0x0A0C5820
[gTexture7EF2B8](@ref gTexture7EF2B8) | 0x0A0C5888
+[gTexture7EF250_end](@ref gTexture7EF250_end) | 0x0A0C5888
[gTexture7EF314](@ref gTexture7EF314) | 0x0A0C58E4
[gTexture7EF2B8_end](@ref gTexture7EF2B8_end) | 0x0A0C58E4
[gTexture7EF388](@ref gTexture7EF388) | 0x0A0C5958
[gTexture7EF314_end](@ref gTexture7EF314_end) | 0x0A0C5958
[gTexture7EF388_end](@ref gTexture7EF388_end) | 0x0A0C59C8
[gTexture7EF3F8](@ref gTexture7EF3F8) | 0x0A0C59C8
-[gTexture7EF3F8_end](@ref gTexture7EF3F8_end) | 0x0A0C5A40
[gTexture7EF470](@ref gTexture7EF470) | 0x0A0C5A40
-[gTexture7EF4E4](@ref gTexture7EF4E4) | 0x0A0C5AB4
+[gTexture7EF3F8_end](@ref gTexture7EF3F8_end) | 0x0A0C5A40
[gTexture7EF470_end](@ref gTexture7EF470_end) | 0x0A0C5AB4
+[gTexture7EF4E4](@ref gTexture7EF4E4) | 0x0A0C5AB4
[gTexture7EF554](@ref gTexture7EF554) | 0x0A0C5B24
[gTexture7EF4E4_end](@ref gTexture7EF4E4_end) | 0x0A0C5B24
-[gTexture7EF554_end](@ref gTexture7EF554_end) | 0x0A0C5B90
[gTexture7EF5C0](@ref gTexture7EF5C0) | 0x0A0C5B90
+[gTexture7EF554_end](@ref gTexture7EF554_end) | 0x0A0C5B90
[gTexture7EF620](@ref gTexture7EF620) | 0x0A0C5BF0
[gTexture7EF5C0_end](@ref gTexture7EF5C0_end) | 0x0A0C5BF0
[gTexture7EF620_end](@ref gTexture7EF620_end) | 0x0A0C5C64
@@ -19206,20 +19206,20 @@ Variable Name | Memory Address
[gTexture7EF77C](@ref gTexture7EF77C) | 0x0A0C5D4C
[gTexture7EF7E8](@ref gTexture7EF7E8) | 0x0A0C5DB8
[gTexture7EF77C_end](@ref gTexture7EF77C_end) | 0x0A0C5DB8
-[gTexture7EF7E8_end](@ref gTexture7EF7E8_end) | 0x0A0C5E2C
[gTexture7EF85C](@ref gTexture7EF85C) | 0x0A0C5E2C
+[gTexture7EF7E8_end](@ref gTexture7EF7E8_end) | 0x0A0C5E2C
[gTexture7EF8C8](@ref gTexture7EF8C8) | 0x0A0C5E98
[gTexture7EF85C_end](@ref gTexture7EF85C_end) | 0x0A0C5E98
[gTexture7EF93C](@ref gTexture7EF93C) | 0x0A0C5F0C
[gTexture7EF8C8_end](@ref gTexture7EF8C8_end) | 0x0A0C5F0C
-[gTexture7EF93C_end](@ref gTexture7EF93C_end) | 0x0A0C5F84
[gTexture7EF9B4](@ref gTexture7EF9B4) | 0x0A0C5F84
-[gTexture7EF9B4_end](@ref gTexture7EF9B4_end) | 0x0A0C5FFC
+[gTexture7EF93C_end](@ref gTexture7EF93C_end) | 0x0A0C5F84
[gTexture7EFA2C](@ref gTexture7EFA2C) | 0x0A0C5FFC
+[gTexture7EF9B4_end](@ref gTexture7EF9B4_end) | 0x0A0C5FFC
[gTexture7EFA2C_end](@ref gTexture7EFA2C_end) | 0x0A0C6078
[gTexture7EFAA8](@ref gTexture7EFAA8) | 0x0A0C6078
-[gTexture7EFB00](@ref gTexture7EFB00) | 0x0A0C60D0
[gTexture7EFAA8_end](@ref gTexture7EFAA8_end) | 0x0A0C60D0
+[gTexture7EFB00](@ref gTexture7EFB00) | 0x0A0C60D0
[gTexture7EFB00_end](@ref gTexture7EFB00_end) | 0x0A0C6134
[gTexture7EFB64](@ref gTexture7EFB64) | 0x0A0C6134
[gTexture7EFB64_end](@ref gTexture7EFB64_end) | 0x0A0C618C
@@ -19230,68 +19230,68 @@ Variable Name | Memory Address
[gTexture7EFCAC](@ref gTexture7EFCAC) | 0x0A0C627C
[gTexture7EFD00](@ref gTexture7EFD00) | 0x0A0C62D0
[gTexture7EFCAC_end](@ref gTexture7EFCAC_end) | 0x0A0C62D0
-[gTexture7EFD00_end](@ref gTexture7EFD00_end) | 0x0A0C6330
[gTexture7EFD60](@ref gTexture7EFD60) | 0x0A0C6330
+[gTexture7EFD00_end](@ref gTexture7EFD00_end) | 0x0A0C6330
[gTexture7EFDD4](@ref gTexture7EFDD4) | 0x0A0C63A4
[gTexture7EFD60_end](@ref gTexture7EFD60_end) | 0x0A0C63A4
[gTexture7EFE48](@ref gTexture7EFE48) | 0x0A0C6418
[gTexture7EFDD4_end](@ref gTexture7EFDD4_end) | 0x0A0C6418
[gTexture7EFE48_end](@ref gTexture7EFE48_end) | 0x0A0C6470
[gTexture7EFEA0](@ref gTexture7EFEA0) | 0x0A0C6470
-[gTexture7EFF2C](@ref gTexture7EFF2C) | 0x0A0C64FC
[gTexture7EFEA0_end](@ref gTexture7EFEA0_end) | 0x0A0C64FC
-[gTexture7EFF90](@ref gTexture7EFF90) | 0x0A0C6560
+[gTexture7EFF2C](@ref gTexture7EFF2C) | 0x0A0C64FC
[gTexture7EFF2C_end](@ref gTexture7EFF2C_end) | 0x0A0C6560
-[gTexture7F0000](@ref gTexture7F0000) | 0x0A0C65D0
+[gTexture7EFF90](@ref gTexture7EFF90) | 0x0A0C6560
[gTexture7EFF90_end](@ref gTexture7EFF90_end) | 0x0A0C65D0
-[gTexture7F0000_end](@ref gTexture7F0000_end) | 0x0A0C663C
+[gTexture7F0000](@ref gTexture7F0000) | 0x0A0C65D0
[gTexture7F006C](@ref gTexture7F006C) | 0x0A0C663C
+[gTexture7F0000_end](@ref gTexture7F0000_end) | 0x0A0C663C
[gTexture7F00D8](@ref gTexture7F00D8) | 0x0A0C66A8
[gTexture7F006C_end](@ref gTexture7F006C_end) | 0x0A0C66A8
[gTexture7F00D8_end](@ref gTexture7F00D8_end) | 0x0A0C6728
[gTexture7F0158](@ref gTexture7F0158) | 0x0A0C6728
[gTexture7F01D0](@ref gTexture7F01D0) | 0x0A0C67A0
[gTexture7F0158_end](@ref gTexture7F0158_end) | 0x0A0C67A0
-[gTexture7F023C](@ref gTexture7F023C) | 0x0A0C680C
[gTexture7F01D0_end](@ref gTexture7F01D0_end) | 0x0A0C680C
-[gTexture7F02B4](@ref gTexture7F02B4) | 0x0A0C6884
+[gTexture7F023C](@ref gTexture7F023C) | 0x0A0C680C
[gTexture7F023C_end](@ref gTexture7F023C_end) | 0x0A0C6884
+[gTexture7F02B4](@ref gTexture7F02B4) | 0x0A0C6884
[gTexture7F02B4_end](@ref gTexture7F02B4_end) | 0x0A0C68FC
[gTexture7F032C](@ref gTexture7F032C) | 0x0A0C68FC
-[gTexture7F0390](@ref gTexture7F0390) | 0x0A0C6960
[gTexture7F032C_end](@ref gTexture7F032C_end) | 0x0A0C6960
+[gTexture7F0390](@ref gTexture7F0390) | 0x0A0C6960
[gTexture7F0404](@ref gTexture7F0404) | 0x0A0C69D4
[gTexture7F0390_end](@ref gTexture7F0390_end) | 0x0A0C69D4
[gTexture7F0470](@ref gTexture7F0470) | 0x0A0C6A40
[gTexture7F0404_end](@ref gTexture7F0404_end) | 0x0A0C6A40
-[gTexture7F04EC](@ref gTexture7F04EC) | 0x0A0C6ABC
[gTexture7F0470_end](@ref gTexture7F0470_end) | 0x0A0C6ABC
-[gTexture7F055C](@ref gTexture7F055C) | 0x0A0C6B2C
+[gTexture7F04EC](@ref gTexture7F04EC) | 0x0A0C6ABC
[gTexture7F04EC_end](@ref gTexture7F04EC_end) | 0x0A0C6B2C
-[gTexture7F055C_end](@ref gTexture7F055C_end) | 0x0A0C6BC0
+[gTexture7F055C](@ref gTexture7F055C) | 0x0A0C6B2C
[gTexture7F05F0](@ref gTexture7F05F0) | 0x0A0C6BC0
+[gTexture7F055C_end](@ref gTexture7F055C_end) | 0x0A0C6BC0
[gTexture7F0670](@ref gTexture7F0670) | 0x0A0C6C40
[gTexture7F05F0_end](@ref gTexture7F05F0_end) | 0x0A0C6C40
-[gTexture7F0670_end](@ref gTexture7F0670_end) | 0x0A0C6CBC
[gTexture7F06EC](@ref gTexture7F06EC) | 0x0A0C6CBC
+[gTexture7F0670_end](@ref gTexture7F0670_end) | 0x0A0C6CBC
[gTexture7F06EC_end](@ref gTexture7F06EC_end) | 0x0A0C6D38
[gTexture7F0768](@ref gTexture7F0768) | 0x0A0C6D38
-[gTexture7F0768_end](@ref gTexture7F0768_end) | 0x0A0C6DB0
[gTexture7F07E0](@ref gTexture7F07E0) | 0x0A0C6DB0
+[gTexture7F0768_end](@ref gTexture7F0768_end) | 0x0A0C6DB0
[gTexture7F07E0_end](@ref gTexture7F07E0_end) | 0x0A0C6E28
[gTexture7F0858](@ref gTexture7F0858) | 0x0A0C6E28
-[gTexture7F0858_end](@ref gTexture7F0858_end) | 0x0A0C6EA8
[gTexture7F08D8](@ref gTexture7F08D8) | 0x0A0C6EA8
+[gTexture7F0858_end](@ref gTexture7F0858_end) | 0x0A0C6EA8
[gTexture7F0948](@ref gTexture7F0948) | 0x0A0C6F18
[gTexture7F08D8_end](@ref gTexture7F08D8_end) | 0x0A0C6F18
-[gTexture7F09D0](@ref gTexture7F09D0) | 0x0A0C6FA0
[gTexture7F0948_end](@ref gTexture7F0948_end) | 0x0A0C6FA0
+[gTexture7F09D0](@ref gTexture7F09D0) | 0x0A0C6FA0
[gTexture7F09D0_end](@ref gTexture7F09D0_end) | 0x0A0C700C
[gTexture7F0A3C](@ref gTexture7F0A3C) | 0x0A0C700C
[gTexture7F0A3C_end](@ref gTexture7F0A3C_end) | 0x0A0C708C
[gTexture7F0ABC](@ref gTexture7F0ABC) | 0x0A0C708C
-[gTexture7F0ABC_end](@ref gTexture7F0ABC_end) | 0x0A0C7104
[gTexture7F0B34](@ref gTexture7F0B34) | 0x0A0C7104
+[gTexture7F0ABC_end](@ref gTexture7F0ABC_end) | 0x0A0C7104
[gTexture7F0B34_end](@ref gTexture7F0B34_end) | 0x0A0C7180
[gTexture7F0BB0](@ref gTexture7F0BB0) | 0x0A0C7180
[gTexture7F0BB0_end](@ref gTexture7F0BB0_end) | 0x0A0C71F4
@@ -19300,24 +19300,24 @@ Variable Name | Memory Address
[gTexture7F0C24_end](@ref gTexture7F0C24_end) | 0x0A0C7264
[gTexture7F0C94_end](@ref gTexture7F0C94_end) | 0x0A0C72DC
[gTexture7F0D0C](@ref gTexture7F0D0C) | 0x0A0C72DC
-[gTexture7F0D0C_end](@ref gTexture7F0D0C_end) | 0x0A0C735C
[gTexture7F0D8C](@ref gTexture7F0D8C) | 0x0A0C735C
-[gTexture7F0DEC](@ref gTexture7F0DEC) | 0x0A0C73BC
+[gTexture7F0D0C_end](@ref gTexture7F0D0C_end) | 0x0A0C735C
[gTexture7F0D8C_end](@ref gTexture7F0D8C_end) | 0x0A0C73BC
+[gTexture7F0DEC](@ref gTexture7F0DEC) | 0x0A0C73BC
[gTexture7F0E5C](@ref gTexture7F0E5C) | 0x0A0C742C
[gTexture7F0DEC_end](@ref gTexture7F0DEC_end) | 0x0A0C742C
-[gTexture7F0E5C_end](@ref gTexture7F0E5C_end) | 0x0A0C74B4
[gTexture7F0EE4](@ref gTexture7F0EE4) | 0x0A0C74B4
-[gTexture7F0F5C](@ref gTexture7F0F5C) | 0x0A0C752C
+[gTexture7F0E5C_end](@ref gTexture7F0E5C_end) | 0x0A0C74B4
[gTexture7F0EE4_end](@ref gTexture7F0EE4_end) | 0x0A0C752C
-[gTexture7F0F5C_end](@ref gTexture7F0F5C_end) | 0x0A0C75A8
+[gTexture7F0F5C](@ref gTexture7F0F5C) | 0x0A0C752C
[gTexture7F0FD8](@ref gTexture7F0FD8) | 0x0A0C75A8
+[gTexture7F0F5C_end](@ref gTexture7F0F5C_end) | 0x0A0C75A8
[gTexture7F0FD8_end](@ref gTexture7F0FD8_end) | 0x0A0C7608
[gTexture7F1038](@ref gTexture7F1038) | 0x0A0C7608
-[gTexture7F109C](@ref gTexture7F109C) | 0x0A0C766C
[gTexture7F1038_end](@ref gTexture7F1038_end) | 0x0A0C766C
-[gTexture7F109C_end](@ref gTexture7F109C_end) | 0x0A0C76F4
+[gTexture7F109C](@ref gTexture7F109C) | 0x0A0C766C
[gTexture7F1124](@ref gTexture7F1124) | 0x0A0C76F4
+[gTexture7F109C_end](@ref gTexture7F109C_end) | 0x0A0C76F4
[gTexture7F11F4](@ref gTexture7F11F4) | 0x0A0C77C4
[gTexture7F12C4](@ref gTexture7F12C4) | 0x0A0C7894
[gTexture7F1394](@ref gTexture7F1394) | 0x0A0C7964
@@ -19555,54 +19555,54 @@ Variable Name | Memory Address
[gTexturePlayerSelect](@ref gTexturePlayerSelect) | 0x0B000000
[gTexturePlayerSelect_end](@ref gTexturePlayerSelect_end) | 0x0B000C00
[gTextureOption](@ref gTextureOption) | 0x0B000C00
-[gTextureNameDK](@ref gTextureNameDK) | 0x0B001500
[gTextureOption_end](@ref gTextureOption_end) | 0x0B001500
-[gTextureNameDK_end](@ref gTextureNameDK_end) | 0x0B001700
+[gTextureNameDK](@ref gTextureNameDK) | 0x0B001500
[gTextureNameToad](@ref gTextureNameToad) | 0x0B001700
+[gTextureNameDK_end](@ref gTextureNameDK_end) | 0x0B001700
[gTextureNameToad_end](@ref gTextureNameToad_end) | 0x0B001900
[gTextureNameBowser](@ref gTextureNameBowser) | 0x0B001900
-[gTextureNameBowser_end](@ref gTextureNameBowser_end) | 0x0B001B00
[gTextureNameLuigi](@ref gTextureNameLuigi) | 0x0B001B00
-[gTextureNameMario](@ref gTextureNameMario) | 0x0B001D00
+[gTextureNameBowser_end](@ref gTextureNameBowser_end) | 0x0B001B00
[gTextureNameLuigi_end](@ref gTextureNameLuigi_end) | 0x0B001D00
-[gTextureNamePeach](@ref gTextureNamePeach) | 0x0B001F00
+[gTextureNameMario](@ref gTextureNameMario) | 0x0B001D00
[gTextureNameMario_end](@ref gTextureNameMario_end) | 0x0B001F00
-[gTextureNameWario](@ref gTextureNameWario) | 0x0B002100
+[gTextureNamePeach](@ref gTextureNamePeach) | 0x0B001F00
[gTextureNamePeach_end](@ref gTextureNamePeach_end) | 0x0B002100
+[gTextureNameWario](@ref gTextureNameWario) | 0x0B002100
[gTextureNameYoshi](@ref gTextureNameYoshi) | 0x0B002300
[gTextureNameWario_end](@ref gTextureNameWario_end) | 0x0B002300
-[gTextureNameYoshi_end](@ref gTextureNameYoshi_end) | 0x0B002500
[gTextureTitleMarioRaceway](@ref gTextureTitleMarioRaceway) | 0x0B002500
+[gTextureNameYoshi_end](@ref gTextureNameYoshi_end) | 0x0B002500
[gTextureTitleChocoMountain](@ref gTextureTitleChocoMountain) | 0x0B002A00
[gTextureTitleMarioRaceway_end](@ref gTextureTitleMarioRaceway_end) | 0x0B002A00
-[gTextureTitleChocoMountain_end](@ref gTextureTitleChocoMountain_end) | 0x0B002F00
[gTextureTitleBowsersCastle](@ref gTextureTitleBowsersCastle) | 0x0B002F00
+[gTextureTitleChocoMountain_end](@ref gTextureTitleChocoMountain_end) | 0x0B002F00
[gTextureTitleBowsersCastle_end](@ref gTextureTitleBowsersCastle_end) | 0x0B003400
[gTextureTitleBansheeBoardwalk](@ref gTextureTitleBansheeBoardwalk) | 0x0B003400
-[gTextureTitleBansheeBoardwalk_end](@ref gTextureTitleBansheeBoardwalk_end) | 0x0B003A00
[gTextureTitleYoshiValley](@ref gTextureTitleYoshiValley) | 0x0B003A00
+[gTextureTitleBansheeBoardwalk_end](@ref gTextureTitleBansheeBoardwalk_end) | 0x0B003A00
[gTextureTitleYoshiValley_end](@ref gTextureTitleYoshiValley_end) | 0x0B003E00
[gTextureTitleFrappeSnowland](@ref gTextureTitleFrappeSnowland) | 0x0B003E00
-[gTextureTitleKoopaTroopaBeach](@ref gTextureTitleKoopaTroopaBeach) | 0x0B004300
[gTextureTitleFrappeSnowland_end](@ref gTextureTitleFrappeSnowland_end) | 0x0B004300
+[gTextureTitleKoopaTroopaBeach](@ref gTextureTitleKoopaTroopaBeach) | 0x0B004300
[gTextureTitleKoopaTroopaBeach_end](@ref gTextureTitleKoopaTroopaBeach_end) | 0x0B004800
[gTextureTitleRoyalRaceway](@ref gTextureTitleRoyalRaceway) | 0x0B004800
[gTextureTitleRoyalRaceway_end](@ref gTextureTitleRoyalRaceway_end) | 0x0B004C00
[gTextureTitleLuigiRaceway](@ref gTextureTitleLuigiRaceway) | 0x0B004C00
[gTextureTitleMooMooFarm](@ref gTextureTitleMooMooFarm) | 0x0B005000
[gTextureTitleLuigiRaceway_end](@ref gTextureTitleLuigiRaceway_end) | 0x0B005000
-[gTextureTitleMooMooFarm_end](@ref gTextureTitleMooMooFarm_end) | 0x0B005400
[gTextureTitleToadsTurnpike](@ref gTextureTitleToadsTurnpike) | 0x0B005400
-[gTextureTitleKalimariDesert](@ref gTextureTitleKalimariDesert) | 0x0B005900
+[gTextureTitleMooMooFarm_end](@ref gTextureTitleMooMooFarm_end) | 0x0B005400
[gTextureTitleToadsTurnpike_end](@ref gTextureTitleToadsTurnpike_end) | 0x0B005900
-[gTextureTitleKalimariDesert_end](@ref gTextureTitleKalimariDesert_end) | 0x0B005D00
+[gTextureTitleKalimariDesert](@ref gTextureTitleKalimariDesert) | 0x0B005900
[gTextureTitleSherbetLand](@ref gTextureTitleSherbetLand) | 0x0B005D00
-[gTextureTitleSherbetLand_end](@ref gTextureTitleSherbetLand_end) | 0x0B006100
+[gTextureTitleKalimariDesert_end](@ref gTextureTitleKalimariDesert_end) | 0x0B005D00
[gTextureTitleRainbowRoad](@ref gTextureTitleRainbowRoad) | 0x0B006100
+[gTextureTitleSherbetLand_end](@ref gTextureTitleSherbetLand_end) | 0x0B006100
[gTextureTitleWarioStadium](@ref gTextureTitleWarioStadium) | 0x0B006500
[gTextureTitleRainbowRoad_end](@ref gTextureTitleRainbowRoad_end) | 0x0B006500
-[gTextureTitleWarioStadium_end](@ref gTextureTitleWarioStadium_end) | 0x0B006A00
[gTextureTitleBlockFort](@ref gTextureTitleBlockFort) | 0x0B006A00
+[gTextureTitleWarioStadium_end](@ref gTextureTitleWarioStadium_end) | 0x0B006A00
[gTextureTitleBlockFort_end](@ref gTextureTitleBlockFort_end) | 0x0B006D00
[gTextureTitleSkyscraper](@ref gTextureTitleSkyscraper) | 0x0B006D00
[gTextureTitleDoubleDeck](@ref gTextureTitleDoubleDeck) | 0x0B007100
@@ -19617,22 +19617,22 @@ Variable Name | Memory Address
[gTextureMapSelect_end](@ref gTextureMapSelect_end) | 0x0B008A00
[gTextureMenuMushroomCup](@ref gTextureMenuMushroomCup) | 0x0B008E00
[gTextureMenuFlowerCup_end](@ref gTextureMenuFlowerCup_end) | 0x0B008E00
-[gTextureMenuMushroomCup_end](@ref gTextureMenuMushroomCup_end) | 0x0B009200
[gTextureMenuStarCup](@ref gTextureMenuStarCup) | 0x0B009200
+[gTextureMenuMushroomCup_end](@ref gTextureMenuMushroomCup_end) | 0x0B009200
[gTextureMenuSpecialCup](@ref gTextureMenuSpecialCup) | 0x0B009600
[gTextureMenuStarCup_end](@ref gTextureMenuStarCup_end) | 0x0B009600
[gTextureGameSelect](@ref gTextureGameSelect) | 0x0B009A00
[gTextureMenuSpecialCup_end](@ref gTextureMenuSpecialCup_end) | 0x0B009A00
-[gTextureMenu1PGame](@ref gTextureMenu1PGame) | 0x0B00A600
[gTextureGameSelect_end](@ref gTextureGameSelect_end) | 0x0B00A600
-[gTextureMenu1PGame_end](@ref gTextureMenu1PGame_end) | 0x0B00AB00
+[gTextureMenu1PGame](@ref gTextureMenu1PGame) | 0x0B00A600
[gTextureMenu2PGame](@ref gTextureMenu2PGame) | 0x0B00AB00
-[gTextureMenu3PGame](@ref gTextureMenu3PGame) | 0x0B00B200
+[gTextureMenu1PGame_end](@ref gTextureMenu1PGame_end) | 0x0B00AB00
[gTextureMenu2PGame_end](@ref gTextureMenu2PGame_end) | 0x0B00B200
-[gTextureMenu4PGame](@ref gTextureMenu4PGame) | 0x0B00BC00
+[gTextureMenu3PGame](@ref gTextureMenu3PGame) | 0x0B00B200
[gTextureMenu3PGame_end](@ref gTextureMenu3PGame_end) | 0x0B00BC00
-[gTextureMenu4PGame_end](@ref gTextureMenu4PGame_end) | 0x0B00C700
+[gTextureMenu4PGame](@ref gTextureMenu4PGame) | 0x0B00BC00
[gTextureMenuModeBattle](@ref gTextureMenuModeBattle) | 0x0B00C700
+[gTextureMenu4PGame_end](@ref gTextureMenu4PGame_end) | 0x0B00C700
[gTextureMenuModeTimeTrials](@ref gTextureMenuModeTimeTrials) | 0x0B00CA00
[gTextureMenuModeBattle_end](@ref gTextureMenuModeBattle_end) | 0x0B00CA00
[gTextureMenuModeMarioGP](@ref gTextureMenuModeMarioGP) | 0x0B00CE00
@@ -19643,36 +19643,36 @@ Variable Name | Memory Address
[gTextureMenuModeVS_end](@ref gTextureMenuModeVS_end) | 0x0B00D500
[gTextureMenuLOption_end](@ref gTextureMenuLOption_end) | 0x0B00D800
[gTextureMenuRData](@ref gTextureMenuRData) | 0x0B00D800
-[gTextureMenuRData_end](@ref gTextureMenuRData_end) | 0x0B00DB00
[gTextureMenu50cc](@ref gTextureMenu50cc) | 0x0B00DB00
-[gTextureMenu50cc_end](@ref gTextureMenu50cc_end) | 0x0B00DD00
+[gTextureMenuRData_end](@ref gTextureMenuRData_end) | 0x0B00DB00
[gTextureMenu100cc](@ref gTextureMenu100cc) | 0x0B00DD00
-[gTextureMenu150cc](@ref gTextureMenu150cc) | 0x0B00DF00
+[gTextureMenu50cc_end](@ref gTextureMenu50cc_end) | 0x0B00DD00
[gTextureMenu100cc_end](@ref gTextureMenu100cc_end) | 0x0B00DF00
+[gTextureMenu150cc](@ref gTextureMenu150cc) | 0x0B00DF00
[gTextureMenuExtra](@ref gTextureMenuExtra) | 0x0B00E100
[gTextureMenu150cc_end](@ref gTextureMenu150cc_end) | 0x0B00E100
[gTextureMenuWithoutItem](@ref gTextureMenuWithoutItem) | 0x0B00E300
[gTextureMenuExtra_end](@ref gTextureMenuExtra_end) | 0x0B00E300
[gTextureMenuWithoutItem_end](@ref gTextureMenuWithoutItem_end) | 0x0B00E600
[gTextureMenuWithItem](@ref gTextureMenuWithItem) | 0x0B00E600
-[gTextureMenuWithItem_end](@ref gTextureMenuWithItem_end) | 0x0B00E900
[gTextureMenuBegin](@ref gTextureMenuBegin) | 0x0B00E900
+[gTextureMenuWithItem_end](@ref gTextureMenuWithItem_end) | 0x0B00E900
[gTextureMenuGhost](@ref gTextureMenuGhost) | 0x0B00EB00
[gTextureMenuBegin_end](@ref gTextureMenuBegin_end) | 0x0B00EB00
[gTextureMenuData](@ref gTextureMenuData) | 0x0B00ED00
[gTextureMenuGhost_end](@ref gTextureMenuGhost_end) | 0x0B00ED00
[gTextureMenuData_end](@ref gTextureMenuData_end) | 0x0B00EF00
[gTextureMenuOK](@ref gTextureMenuOK) | 0x0B00EF00
-[gTextureBackgroundBlueSky](@ref gTextureBackgroundBlueSky) | 0x0B00F100
[gTextureMenuOK_end](@ref gTextureMenuOK_end) | 0x0B00F100
+[gTextureBackgroundBlueSky](@ref gTextureBackgroundBlueSky) | 0x0B00F100
[gTextureBackgroundBlueSky_end](@ref gTextureBackgroundBlueSky_end) | 0x0B01BF00
[gTextureBackgroundSunset](@ref gTextureBackgroundSunset) | 0x0B01BF00
-[gTextureGreenGoldStripe](@ref gTextureGreenGoldStripe) | 0x0B025300
[gTextureBackgroundSunset_end](@ref gTextureBackgroundSunset_end) | 0x0B025300
-[gTextureGoldStripe](@ref gTextureGoldStripe) | 0x0B025F00
+[gTextureGreenGoldStripe](@ref gTextureGreenGoldStripe) | 0x0B025300
[gTextureGreenGoldStripe_end](@ref gTextureGreenGoldStripe_end) | 0x0B025F00
-[gTextureWhiteStripe](@ref gTextureWhiteStripe) | 0x0B026600
+[gTextureGoldStripe](@ref gTextureGoldStripe) | 0x0B025F00
[gTextureGoldStripe_end](@ref gTextureGoldStripe_end) | 0x0B026600
+[gTextureWhiteStripe](@ref gTextureWhiteStripe) | 0x0B026600
[gTexturePinkBar](@ref gTexturePinkBar) | 0x0B026700
[gTextureWhiteStripe_end](@ref gTextureWhiteStripe_end) | 0x0B026700
[gTexturePinkBar_end](@ref gTexturePinkBar_end) | 0x0B026C00
@@ -19767,64 +19767,64 @@ Variable Name | Memory Address
[d_course_big_donut_packed](@ref d_course_big_donut_packed) | 0x0F001B84
[music_sequence_table_header](@ref music_sequence_table_header) | 0x0025FD00
[music_sequence_table](@ref music_sequence_table) | 0x0025FD04
-[music_sequence_table_end](@ref music_sequence_table_end) | 0x0025FE00
[seq_00](@ref seq_00) | 0x0025FE00
+[music_sequence_table_end](@ref music_sequence_table_end) | 0x0025FE00
[seq_01](@ref seq_01) | 0x00262630
[seq_00_end](@ref seq_00_end) | 0x00262630
-[seq_02](@ref seq_02) | 0x00264160
[seq_01_end](@ref seq_01_end) | 0x00264160
+[seq_02](@ref seq_02) | 0x00264160
[seq_02_end](@ref seq_02_end) | 0x00264EC0
[seq_03](@ref seq_03) | 0x00264EC0
[seq_03_end](@ref seq_03_end) | 0x002668D0
[seq_04](@ref seq_04) | 0x002668D0
-[seq_04_end](@ref seq_04_end) | 0x00268570
[seq_05](@ref seq_05) | 0x00268570
+[seq_04_end](@ref seq_04_end) | 0x00268570
[seq_05_end](@ref seq_05_end) | 0x0026A4E0
[seq_06](@ref seq_06) | 0x0026A4E0
-[seq_06_end](@ref seq_06_end) | 0x0026C3C0
[seq_07](@ref seq_07) | 0x0026C3C0
+[seq_06_end](@ref seq_06_end) | 0x0026C3C0
[seq_07_end](@ref seq_07_end) | 0x0026DA90
[seq_08](@ref seq_08) | 0x0026DA90
-[seq_08_end](@ref seq_08_end) | 0x0026FE60
[seq_09](@ref seq_09) | 0x0026FE60
+[seq_08_end](@ref seq_08_end) | 0x0026FE60
[seq_09_end](@ref seq_09_end) | 0x00271660
[seq_0A](@ref seq_0A) | 0x00271660
[seq_0B](@ref seq_0B) | 0x00273140
[seq_0A_end](@ref seq_0A_end) | 0x00273140
[seq_0C](@ref seq_0C) | 0x00273730
[seq_0B_end](@ref seq_0B_end) | 0x00273730
-[seq_0D](@ref seq_0D) | 0x00273B00
[seq_0C_end](@ref seq_0C_end) | 0x00273B00
-[seq_0D_end](@ref seq_0D_end) | 0x00273E60
+[seq_0D](@ref seq_0D) | 0x00273B00
[seq_0E](@ref seq_0E) | 0x00273E60
+[seq_0D_end](@ref seq_0D_end) | 0x00273E60
[seq_0E_end](@ref seq_0E_end) | 0x00274140
[seq_0F](@ref seq_0F) | 0x00274140
[seq_0F_end](@ref seq_0F_end) | 0x00274600
[seq_10](@ref seq_10) | 0x00274600
[seq_10_end](@ref seq_10_end) | 0x00275A10
[seq_11](@ref seq_11) | 0x00275A10
-[seq_11_end](@ref seq_11_end) | 0x002760F0
[seq_12](@ref seq_12) | 0x002760F0
-[seq_13](@ref seq_13) | 0x002793E0
+[seq_11_end](@ref seq_11_end) | 0x002760F0
[seq_12_end](@ref seq_12_end) | 0x002793E0
+[seq_13](@ref seq_13) | 0x002793E0
[seq_14](@ref seq_14) | 0x00279AA0
[seq_13_end](@ref seq_13_end) | 0x00279AA0
[seq_15](@ref seq_15) | 0x00279F50
[seq_14_end](@ref seq_14_end) | 0x00279F50
-[seq_15_end](@ref seq_15_end) | 0x0027B0B0
[seq_16](@ref seq_16) | 0x0027B0B0
-[seq_17](@ref seq_17) | 0x0027B3C0
+[seq_15_end](@ref seq_15_end) | 0x0027B0B0
[seq_16_end](@ref seq_16_end) | 0x0027B3C0
+[seq_17](@ref seq_17) | 0x0027B3C0
[seq_17_end](@ref seq_17_end) | 0x0027C670
[seq_18](@ref seq_18) | 0x0027C670
[seq_19](@ref seq_19) | 0x0027CC70
[seq_18_end](@ref seq_18_end) | 0x0027CC70
-[seq_1A](@ref seq_1A) | 0x0027E350
[seq_19_end](@ref seq_19_end) | 0x0027E350
-[seq_1A_end](@ref seq_1A_end) | 0x0027EE20
+[seq_1A](@ref seq_1A) | 0x0027E350
[seq_1B](@ref seq_1B) | 0x0027EE20
-[seq_1B_end](@ref seq_1B_end) | 0x0027FAA0
+[seq_1A_end](@ref seq_1A_end) | 0x0027EE20
[seq_1C](@ref seq_1C) | 0x0027FAA0
+[seq_1B_end](@ref seq_1B_end) | 0x0027FAA0
[seq_1D](@ref seq_1D) | 0x002821F0
[seq_1C_end](@ref seq_1C_end) | 0x002821F0
[seq_1D_end](@ref seq_1D_end) | 0x00282E70