From 332d22489f30b3adc0424ea66613956a963793f0 Mon Sep 17 00:00:00 2001 From: Arceveti <73617174+Arceveti@users.noreply.github.com> Date: Sat, 25 Sep 2021 09:31:45 -0700 Subject: [PATCH] Remove a bunch of unused/messy stuff --- actors/breakable_box/collision.inc.c | 3 - actors/bubba/model.inc.c | 3 - actors/cannon_lid/geo.inc.c | 1 - actors/chain_ball/model.inc.c | 3 - actors/cyan_fish/model.inc.c | 3 - actors/flyguy/model.inc.c | 3 - actors/klepto/model.inc.c | 3 - actors/mips/geo.inc.c | 2 - actors/moneybag/geo.inc.c | 2 - actors/peach/geo.inc.c | 2 - actors/piranha_plant/anims/table.inc.c | 3 - actors/power_meter/model.inc.c | 2 - actors/small_key/model.inc.c | 5 - actors/snowman/model.inc.c | 3 - actors/spindrift/anims/anim_050006AC.inc.c | 4 - actors/springboard/collision.inc.c | 2 - actors/sushi/model.inc.c | 5 - actors/toad/geo.inc.c | 2 - actors/ukiki/model.inc.c | 3 - actors/whomp/collision.inc.c | 2 - actors/whomp/model.inc.c | 4 - actors/wiggler_head/model.inc.c | 148 -------------- bin/effect.c | 2 - bin/segment2.c | 2 - data/behavior_data.c | 2 - levels/bitfs/areas/1/3/model.inc.c | 9 - levels/castle_grounds/areas/1/11/model.inc.c | 6 - levels/castle_grounds/areas/1/12/model.inc.c | 2 - levels/castle_inside/painting.inc.c | 5 - levels/hmc/areas/1/painting.inc.c | 3 - levels/menu/leveldata.c | 4 - levels/ttm/areas/1/painting.inc.c | 3 - src/audio/audio_session_presets_sh.c | 1 - src/audio/data.c | 8 - src/audio/data.h | 6 - src/audio/external.c | 24 +-- src/audio/external.h | 5 - src/audio/heap.c | 16 -- src/audio/load.c | 37 ---- src/audio/load_sh.c | 28 +-- src/audio/playback.c | 15 -- src/audio/seqplayer.c | 30 +-- src/audio/synthesis.c | 24 +-- src/audio/synthesis_sh.c | 10 - src/boot/memory.c | 5 - src/engine/behavior_script.c | 9 - src/engine/behavior_script.h | 2 - src/engine/level_script.c | 1 - src/engine/math_util.c | 4 + src/engine/math_util.h | 1 + src/engine/surface_collision.c | 2 +- src/engine/surface_load.c | 6 - src/game/behaviors/amp.inc.c | 2 - .../behaviors/bbh_haunted_bookshelf.inc.c | 4 - src/game/behaviors/bobomb.inc.c | 3 +- src/game/behaviors/boo.inc.c | 5 +- src/game/behaviors/bowser.inc.c | 2 - src/game/behaviors/cannon.inc.c | 13 +- src/game/behaviors/capswitch.inc.c | 2 - src/game/behaviors/clock_arm.inc.c | 1 - .../behaviors/controllable_platform.inc.c | 1 - src/game/behaviors/fish.inc.c | 7 - src/game/behaviors/mips.inc.c | 8 +- src/game/behaviors/platform_on_track.inc.c | 1 - src/game/behaviors/seesaw_platform.inc.c | 1 - src/game/behaviors/ttc_pendulum.inc.c | 1 - src/game/behaviors/whomp.inc.c | 4 +- src/game/behaviors/yoshi.inc.c | 3 +- src/game/camera.c | 184 ++---------------- src/game/camera.h | 3 - src/game/debug.c | 23 +-- src/game/envfx_bubbles.c | 7 - src/game/game_init.c | 3 - src/game/ingame_menu.c | 24 +-- src/game/interaction.c | 7 +- src/game/level_update.c | 3 - src/game/macro_special_objects.c | 9 +- src/game/mario.c | 2 - src/game/mario_actions_cutscene.c | 8 - src/game/mario_step.c | 5 +- src/game/mario_step.h | 20 +- src/game/obj_behaviors.c | 2 - src/game/object_helpers.c | 32 +-- src/game/object_helpers.h | 3 +- src/game/object_list_processor.c | 6 - src/game/paintings.c | 12 +- src/game/rendering_graph_node.c | 2 +- src/game/save_file.c | 5 - src/game/screen_transition.c | 2 - src/game/skybox.c | 2 - src/goddard/debug_utils.c | 2 - src/goddard/draw_objects.c | 65 +------ src/goddard/draw_objects.h | 2 - src/goddard/dynlist_proc.c | 21 -- .../dynlists_mario_eyebrows_mustache.c | 2 +- src/goddard/gd_main.c | 3 - src/goddard/joints.c | 30 +-- src/goddard/objects.c | 43 ---- src/goddard/objects.h | 3 - src/goddard/old_menu.c | 4 - src/goddard/particles.c | 2 - src/goddard/renderer.c | 113 +---------- src/goddard/renderer.h | 2 - src/goddard/shape_helper.c | 50 ----- src/goddard/skin.c | 46 +---- src/goddard/skin_movement.c | 8 +- src/menu/intro_geo.c | 26 +-- 107 files changed, 97 insertions(+), 1227 deletions(-) diff --git a/actors/breakable_box/collision.inc.c b/actors/breakable_box/collision.inc.c index 8434a161..0b5f8df7 100644 --- a/actors/breakable_box/collision.inc.c +++ b/actors/breakable_box/collision.inc.c @@ -29,6 +29,3 @@ const Collision breakable_box_seg8_collision_08012D70[] = { COL_TRI_STOP(), COL_END(), }; - -UNUSED static const u32 breakable_box_unused_1 = 0; -UNUSED static const u64 breakable_box_unused_2 = 0; diff --git a/actors/bubba/model.inc.c b/actors/bubba/model.inc.c index 8e32bbbb..07ec3ed8 100644 --- a/actors/bubba/model.inc.c +++ b/actors/bubba/model.inc.c @@ -2,9 +2,6 @@ // It's possible that bubba and bub used to be 2 "actors" in // one actor file. -// Bin ID? What is this? -UNUSED static const u64 bubba_unused_1 = 0; - // Bubba // 0x05000008 diff --git a/actors/cannon_lid/geo.inc.c b/actors/cannon_lid/geo.inc.c index 7117b50c..0481bf66 100644 --- a/actors/cannon_lid/geo.inc.c +++ b/actors/cannon_lid/geo.inc.c @@ -1,2 +1 @@ // Empty geo script -UNUSED static const u64 cannon_lid_unused_1 = 0; diff --git a/actors/chain_ball/model.inc.c b/actors/chain_ball/model.inc.c index cd0a92bd..d956bb18 100644 --- a/actors/chain_ball/model.inc.c +++ b/actors/chain_ball/model.inc.c @@ -9,9 +9,6 @@ static const Vtx chain_ball_seg6_vertex_06020AA0[] = { {{{ -26, 26, 0}, 0, { 0, 0}, {0xff, 0xff, 0xff, 0xff}}}, }; -// align? binid? -UNUSED static const u64 chain_ball_unused_1 = 0; - // 0x06020AE8 ALIGNED8 static const Texture chain_ball_seg6_texture_06020AE8[] = { #include "actors/chain_ball/chain_ball.rgba16.inc.c" diff --git a/actors/cyan_fish/model.inc.c b/actors/cyan_fish/model.inc.c index 9dff09c9..ea58aae8 100644 --- a/actors/cyan_fish/model.inc.c +++ b/actors/cyan_fish/model.inc.c @@ -1,8 +1,5 @@ // Cyan Fish -// ??? -UNUSED static const u64 cyan_fish_unused_1 = 0; - // 0x0600D468 ALIGNED8 static const Texture cyan_fish_seg6_texture_0600D468[] = { #include "actors/cyan_fish/cyan_fish.rgba16.inc.c" diff --git a/actors/flyguy/model.inc.c b/actors/flyguy/model.inc.c index c9fc0648..c542432b 100644 --- a/actors/flyguy/model.inc.c +++ b/actors/flyguy/model.inc.c @@ -1,8 +1,5 @@ // Flyguy -// ??? -UNUSED static const u64 flyguy_unused_1 = 0; - // 0x0800E088 ALIGNED8 static const Texture flyguy_seg8_texture_0800E088[] = { #include "actors/flyguy/flyguy_cloth_wrinkle.rgba16.inc.c" diff --git a/actors/klepto/model.inc.c b/actors/klepto/model.inc.c index 3b2eec96..1814f096 100644 --- a/actors/klepto/model.inc.c +++ b/actors/klepto/model.inc.c @@ -1,8 +1,5 @@ // Possible Removed Actor File -// Bin ID? What is this? -UNUSED static const u64 klepto_unused_1 = 0; - // Klepto // 0x05000008 diff --git a/actors/mips/geo.inc.c b/actors/mips/geo.inc.c index b16fc78d..2dc7cf37 100644 --- a/actors/mips/geo.inc.c +++ b/actors/mips/geo.inc.c @@ -51,5 +51,3 @@ const GeoLayout mips_geo[] = { GEO_CLOSE_NODE(), GEO_END(), }; - -UNUSED static const u64 mips_unused_1 = 0; diff --git a/actors/moneybag/geo.inc.c b/actors/moneybag/geo.inc.c index ab741d48..a4d7af1a 100644 --- a/actors/moneybag/geo.inc.c +++ b/actors/moneybag/geo.inc.c @@ -54,5 +54,3 @@ const GeoLayout moneybag_geo[] = { GEO_CLOSE_NODE(), GEO_END(), }; - -UNUSED static const u64 moneybag_unused_1 = 0; diff --git a/actors/peach/geo.inc.c b/actors/peach/geo.inc.c index 53e9a8db..76593813 100644 --- a/actors/peach/geo.inc.c +++ b/actors/peach/geo.inc.c @@ -142,5 +142,3 @@ const GeoLayout peach_geo[] = { GEO_CLOSE_NODE(), GEO_END(), }; - -UNUSED static const u64 peach_unused_1 = 0; diff --git a/actors/piranha_plant/anims/table.inc.c b/actors/piranha_plant/anims/table.inc.c index 96ac962c..388cd963 100644 --- a/actors/piranha_plant/anims/table.inc.c +++ b/actors/piranha_plant/anims/table.inc.c @@ -12,6 +12,3 @@ const struct Animation *const piranha_plant_seg6_anims_0601C31C[] = { &piranha_plant_seg6_anim_0601C304, NULL, }; - -// huh? this isnt following the Bin ID format? -UNUSED static const u64 piranha_plant_unused_1 = 1; diff --git a/actors/power_meter/model.inc.c b/actors/power_meter/model.inc.c index 1a2c17f6..d2102eb4 100644 --- a/actors/power_meter/model.inc.c +++ b/actors/power_meter/model.inc.c @@ -1,7 +1,5 @@ // Power Meter HUD -UNUSED static const u64 power_meter_unused_1 = 0; - // 0x030233E0 ALIGNED8 static const Texture texture_power_meter_left_side[] = { #include "actors/power_meter/power_meter_left_side.rgba16.inc.c" diff --git a/actors/small_key/model.inc.c b/actors/small_key/model.inc.c index d6493eb7..974b66ad 100644 --- a/actors/small_key/model.inc.c +++ b/actors/small_key/model.inc.c @@ -1,8 +1,5 @@ // Small Key (unused) -// ??? -UNUSED static const u64 small_key_unused_1 = 0; - // 0x05005798 static const Lights1 small_key_seg5_lights_05005798 = gdSPDefLights1( 0x3f, 0x19, 0x0c, @@ -27,8 +24,6 @@ static const Lights1 small_key_seg5_lights_050057E0 = gdSPDefLights1( 0xcc, 0xff, 0x00, 0x28, 0x28, 0x28 ); -// align -UNUSED static const u64 small_key_unused_2 = 0; // 0x05005800 static const Vtx small_key_seg5_vertex_05005800[] = { {{{ -14, -109, 14}, 0, { 0, 0}, {0x00, 0x00, 0x7f, 0x00}}}, diff --git a/actors/snowman/model.inc.c b/actors/snowman/model.inc.c index ada671f0..dd34edc2 100644 --- a/actors/snowman/model.inc.c +++ b/actors/snowman/model.inc.c @@ -1,8 +1,5 @@ // Snowman -// ??? -UNUSED static const u64 snowman_unused_1 = 1; - // Unreferenced light group UNUSED static const Lights1 snowman_lights_unused1 = gdSPDefLights1( 0x0d, 0x0c, 0x28, diff --git a/actors/spindrift/anims/anim_050006AC.inc.c b/actors/spindrift/anims/anim_050006AC.inc.c index 3e65567a..6a55f730 100644 --- a/actors/spindrift/anims/anim_050006AC.inc.c +++ b/actors/spindrift/anims/anim_050006AC.inc.c @@ -67,10 +67,6 @@ static const struct Animation spindrift_seg5_anim_050006AC = { 0, }; - -// False Bin ID? -UNUSED static const u64 spindrift_unused_1 = 1; - // 0x050006D0 ALIGNED8 static const Texture spindrift_seg5_texture_050006D0[] = { #include "actors/spindrift/spindrift_face.rgba16.inc.c" diff --git a/actors/springboard/collision.inc.c b/actors/springboard/collision.inc.c index 06fa6368..171777c7 100644 --- a/actors/springboard/collision.inc.c +++ b/actors/springboard/collision.inc.c @@ -76,5 +76,3 @@ const Collision springboard_collision_05001A28[] = { COL_TRI_STOP(), COL_END(), }; - -UNUSED static const u32 springboard_unused_1 = 0; diff --git a/actors/sushi/model.inc.c b/actors/sushi/model.inc.c index d62bc9e7..1e4d7115 100644 --- a/actors/sushi/model.inc.c +++ b/actors/sushi/model.inc.c @@ -1,10 +1,5 @@ // Sushi (Shark) -// Could be a duplicate binid of the previous actor, but i'm putting it here for -// macro reasons so I don't have to clutter the macros.inc with a new macro for this -// case. -UNUSED static const u64 sushi_unused_1 = 1; - // 0x05008ED0 ALIGNED8 static const Texture sushi_seg5_texture_05008ED0[] = { #include "actors/sushi/sushi_snout.rgba16.inc.c" diff --git a/actors/toad/geo.inc.c b/actors/toad/geo.inc.c index 8692a2ea..feb87951 100644 --- a/actors/toad/geo.inc.c +++ b/actors/toad/geo.inc.c @@ -125,5 +125,3 @@ const GeoLayout toad_geo[] = { GEO_CLOSE_NODE(), GEO_END(), }; - -UNUSED static const u64 toad_unused_1 = 0; diff --git a/actors/ukiki/model.inc.c b/actors/ukiki/model.inc.c index fdc22c14..ad072eee 100644 --- a/actors/ukiki/model.inc.c +++ b/actors/ukiki/model.inc.c @@ -18,9 +18,6 @@ static const Lights1 ukiki_seg5_lights_05007BA0 = gdSPDefLights1( 0xe7, 0x93, 0x61, 0x28, 0x28, 0x28 ); -// The hell? -UNUSED static const u64 ukiki_unused_1 = 1; - // 0x05007BC0 ALIGNED8 static const Texture ukiki_seg5_texture_05007BC0[] = { #include "actors/ukiki/ukiki_face.rgba16.inc.c" diff --git a/actors/whomp/collision.inc.c b/actors/whomp/collision.inc.c index 2d0b52ae..950a704a 100644 --- a/actors/whomp/collision.inc.c +++ b/actors/whomp/collision.inc.c @@ -29,5 +29,3 @@ const Collision whomp_seg6_collision_06020A0C[] = { COL_TRI_STOP(), COL_END(), }; - -UNUSED static const u32 whomp_unused_2 = 0; diff --git a/actors/whomp/model.inc.c b/actors/whomp/model.inc.c index a359d0f3..fc6c7978 100644 --- a/actors/whomp/model.inc.c +++ b/actors/whomp/model.inc.c @@ -1,9 +1,5 @@ // Whomp -// ??? -UNUSED static const u64 whomp_unused_1 = 2; - - // 0x0601C360 ALIGNED8 static const Texture whomp_seg6_texture_0601C360[] = { #include "actors/whomp/whomp_back.rgba16.inc.c" diff --git a/actors/wiggler_head/model.inc.c b/actors/wiggler_head/model.inc.c index 2e2f405e..99f93b48 100644 --- a/actors/wiggler_head/model.inc.c +++ b/actors/wiggler_head/model.inc.c @@ -236,154 +236,6 @@ static const Vtx wiggler_seg5_vertex_0500D228[] = { {{{ 42, -2, -13}, 0, { 0, 0}, {0x2f, 0xc4, 0x9c, 0xff}}}, }; -// Unused vertices? what are these? [D318] -UNUSED static const Vtx wiggler_seg5_vertex_0500D318[] = { - {{{ 92, 51, 0}, 0, { 0, 0}, {0x5d, 0x55, 0x00, 0x00}}}, - {{{ 87, 46, -28}, 0, { 0, 0}, {0x5a, 0x53, 0xe1, 0x00}}}, - {{{ 49, 88, -28}, 0, { 0, 0}, {0x5a, 0x53, 0xe1, 0x00}}}, - {{{ 54, 92, 0}, 0, { 0, 0}, {0x5d, 0x55, 0x00, 0xff}}}, - {{{ 49, 88, 28}, 0, { 0, 0}, {0x5a, 0x53, 0x1f, 0xff}}}, - {{{ 87, 46, 28}, 0, { 0, 0}, {0x5a, 0x53, 0x1f, 0xff}}}, - {{{ 58, -84, 0}, 0, { 0, 0}, {0x60, 0xad, 0x00, 0x00}}}, - {{{ 52, -78, -44}, 0, { 0, 0}, {0x5e, 0xaf, 0xe8, 0x00}}}, - {{{ 89, -36, -44}, 0, { 0, 0}, {0x5e, 0xaf, 0xe8, 0x00}}}, - {{{ 95, -42, 0}, 0, { 0, 0}, {0x60, 0xad, 0x00, 0xff}}}, - {{{ 89, -36, 44}, 0, { 0, 0}, {0x5e, 0xaf, 0x18, 0xff}}}, - {{{ 52, -78, 44}, 0, { 0, 0}, {0x5e, 0xaf, 0x18, 0xff}}}, - {{{ -78, -100, 1}, 0, { 0, 0}, {0xd2, 0x9b, 0x3c, 0x00}}}, - {{{ 5, -130, 16}, 0, { 0, 0}, {0xd2, 0x9b, 0x3c, 0x00}}}, - {{{ 8, -85, 94}, 0, { 0, 0}, {0xd2, 0x9b, 0x3c, 0x00}}}, - {{{ -75, -55, 80}, 0, { 0, 0}, {0xd2, 0x9b, 0x3c, 0xff}}}, - {{{ -64, 44, 22}, 0, { 0, 0}, {0x9c, 0x46, 0x22, 0x00}}}, - {{{ -47, 58, 31}, 0, { 0, 0}, {0xb7, 0x5b, 0x30, 0x00}}}, - {{{ -51, 63, 0}, 0, { 0, 0}, {0xb1, 0x63, 0x00, 0x00}}}, - {{{ -68, 19, 40}, 0, { 0, 0}, {0x97, 0x1e, 0x3f, 0xff}}}, - {{{ -36, 45, 57}, 0, { 0, 0}, {0xc8, 0x46, 0x59, 0xff}}}, - {{{ -61, -9, 53}, 0, { 0, 0}, {0xa1, 0xf3, 0x52, 0xff}}}, - {{{ -19, 24, 75}, 0, { 0, 0}, {0xe2, 0x26, 0x75, 0xff}}}, - {{{ -45, -36, 57}, 0, { 0, 0}, {0xbb, 0xc8, 0x59, 0xff}}}, - {{{ 0, 0, 81}, 0, { 0, 0}, {0x00, 0x00, 0x7f, 0xff}}}, - {{{ -22, -57, 53}, 0, { 0, 0}, {0xde, 0xa6, 0x52, 0xff}}}, - {{{ 19, -24, 75}, 0, { 0, 0}, {0x1e, 0xda, 0x75, 0xff}}}, - {{{ 4, -70, 40}, 0, { 0, 0}, {0x07, 0x93, 0x3f, 0xff}}}, - {{{ 36, -45, 57}, 0, { 0, 0}, {0x38, 0xba, 0x59, 0xff}}}, - {{{ 30, -72, 22}, 0, { 0, 0}, {0x2e, 0x90, 0x22, 0xff}}}, - {{{ 47, -58, 31}, 0, { 0, 0}, {0x49, 0xa5, 0x30, 0xff}}}, - {{{ 51, -63, 0}, 0, { 0, 0}, {0x4f, 0x9d, 0x00, 0xff}}}, - {{{ -71, 39, 0}, 0, { 0, 0}, {0x91, 0x3d, 0x00, 0xff}}}, - {{{ -64, 44, 22}, 0, { 0, 0}, {0x9c, 0x46, 0x22, 0x00}}}, - {{{ -51, 63, 0}, 0, { 0, 0}, {0xb1, 0x63, 0x00, 0x00}}}, - {{{ -81, 8, 0}, 0, { 0, 0}, {0x82, 0x0e, 0x00, 0xff}}}, - {{{ -68, 19, 40}, 0, { 0, 0}, {0x97, 0x1e, 0x3f, 0xff}}}, - {{{ -78, -22, 0}, 0, { 0, 0}, {0x87, 0xdd, 0x00, 0xff}}}, - {{{ -61, -9, 53}, 0, { 0, 0}, {0xa1, 0xf3, 0x52, 0xff}}}, - {{{ -63, -51, 0}, 0, { 0, 0}, {0x9d, 0xb1, 0x00, 0xff}}}, - {{{ -45, -36, 57}, 0, { 0, 0}, {0xbb, 0xc8, 0x59, 0xff}}}, - {{{ -39, -71, 0}, 0, { 0, 0}, {0xc4, 0x91, 0x00, 0xff}}}, - {{{ -22, -57, 53}, 0, { 0, 0}, {0xde, 0xa6, 0x52, 0xff}}}, - {{{ -8, -81, 0}, 0, { 0, 0}, {0xf3, 0x82, 0x00, 0xff}}}, - {{{ 4, -70, 40}, 0, { 0, 0}, {0x07, 0x93, 0x3f, 0xff}}}, - {{{ 22, -78, 0}, 0, { 0, 0}, {0x23, 0x87, 0x00, 0xff}}}, - {{{ 30, -72, 22}, 0, { 0, 0}, {0x2e, 0x90, 0x22, 0xff}}}, - {{{ 51, -63, 0}, 0, { 0, 0}, {0x4f, 0x9d, 0x00, 0xff}}}, - {{{ -64, 44, -22}, 0, { 0, 0}, {0x9c, 0x46, 0xde, 0xff}}}, - {{{ -71, 39, 0}, 0, { 0, 0}, {0x91, 0x3d, 0x00, 0x00}}}, - {{{ -51, 63, 0}, 0, { 0, 0}, {0xb1, 0x63, 0x00, 0x00}}}, - {{{ -68, 19, -40}, 0, { 0, 0}, {0x97, 0x1e, 0xc1, 0xff}}}, - {{{ -81, 8, 0}, 0, { 0, 0}, {0x82, 0x0e, 0x00, 0xff}}}, - {{{ -61, -9, -53}, 0, { 0, 0}, {0xa1, 0xf3, 0xae, 0xff}}}, - {{{ -78, -22, 0}, 0, { 0, 0}, {0x87, 0xdd, 0x00, 0xff}}}, - {{{ -45, -36, -57}, 0, { 0, 0}, {0xbb, 0xc8, 0xa7, 0xff}}}, - {{{ -63, -51, 0}, 0, { 0, 0}, {0x9d, 0xb1, 0x00, 0xff}}}, - {{{ -22, -57, -53}, 0, { 0, 0}, {0xde, 0xa6, 0xae, 0xff}}}, - {{{ -39, -71, 0}, 0, { 0, 0}, {0xc4, 0x91, 0x00, 0xff}}}, - {{{ 4, -70, -40}, 0, { 0, 0}, {0x07, 0x93, 0xc1, 0xff}}}, - {{{ -8, -81, 0}, 0, { 0, 0}, {0xf3, 0x82, 0x00, 0xff}}}, - {{{ 30, -72, -22}, 0, { 0, 0}, {0x2e, 0x90, 0xde, 0xff}}}, - {{{ 22, -78, 0}, 0, { 0, 0}, {0x23, 0x87, 0x00, 0xff}}}, - {{{ 51, -63, 0}, 0, { 0, 0}, {0x4f, 0x9d, 0x00, 0xff}}}, - {{{ -47, 58, -31}, 0, { 0, 0}, {0xb7, 0x5b, 0xd0, 0xff}}}, - {{{ -64, 44, -22}, 0, { 0, 0}, {0x9c, 0x46, 0xde, 0x00}}}, - {{{ -51, 63, 0}, 0, { 0, 0}, {0xb1, 0x63, 0x00, 0x00}}}, - {{{ -36, 45, -57}, 0, { 0, 0}, {0xc8, 0x46, 0xa7, 0xff}}}, - {{{ -68, 19, -40}, 0, { 0, 0}, {0x97, 0x1e, 0xc1, 0xff}}}, - {{{ -19, 24, -75}, 0, { 0, 0}, {0xe2, 0x26, 0x8b, 0xff}}}, - {{{ -61, -9, -53}, 0, { 0, 0}, {0xa1, 0xf3, 0xae, 0xff}}}, - {{{ 0, 0, -81}, 0, { 0, 0}, {0x00, 0x00, 0x81, 0xff}}}, - {{{ -45, -36, -57}, 0, { 0, 0}, {0xbb, 0xc8, 0xa7, 0xff}}}, - {{{ 19, -24, -75}, 0, { 0, 0}, {0x1e, 0xda, 0x8b, 0xff}}}, - {{{ -22, -57, -53}, 0, { 0, 0}, {0xde, 0xa6, 0xae, 0xff}}}, - {{{ 36, -45, -57}, 0, { 0, 0}, {0x38, 0xba, 0xa7, 0xff}}}, - {{{ 4, -70, -40}, 0, { 0, 0}, {0x07, 0x93, 0xc1, 0xff}}}, - {{{ 47, -58, -31}, 0, { 0, 0}, {0x49, 0xa5, 0xd0, 0xff}}}, - {{{ 30, -72, -22}, 0, { 0, 0}, {0x2e, 0x90, 0xde, 0xff}}}, - {{{ 51, -63, 0}, 0, { 0, 0}, {0x4f, 0x9d, 0x00, 0xff}}}, - {{{ -30, 72, -22}, 0, { 0, 0}, {0xd2, 0x70, 0xde, 0xff}}}, - {{{ -47, 58, -31}, 0, { 0, 0}, {0xb7, 0x5b, 0xd0, 0x00}}}, - {{{ -51, 63, 0}, 0, { 0, 0}, {0xb1, 0x63, 0x00, 0x00}}}, - {{{ -4, 70, -40}, 0, { 0, 0}, {0xf9, 0x6d, 0xc1, 0xff}}}, - {{{ -36, 45, -57}, 0, { 0, 0}, {0xc8, 0x46, 0xa7, 0xff}}}, - {{{ 22, 57, -53}, 0, { 0, 0}, {0x22, 0x5a, 0xae, 0xff}}}, - {{{ -19, 24, -75}, 0, { 0, 0}, {0xe2, 0x26, 0x8b, 0xff}}}, - {{{ 45, 36, -57}, 0, { 0, 0}, {0x45, 0x38, 0xa7, 0xff}}}, - {{{ 0, 0, -81}, 0, { 0, 0}, {0x00, 0x00, 0x81, 0xff}}}, - {{{ 61, 9, -53}, 0, { 0, 0}, {0x5f, 0x0d, 0xae, 0xff}}}, - {{{ 19, -24, -75}, 0, { 0, 0}, {0x1e, 0xda, 0x8b, 0xff}}}, - {{{ 68, -19, -40}, 0, { 0, 0}, {0x69, 0xe2, 0xc1, 0xff}}}, - {{{ 36, -45, -57}, 0, { 0, 0}, {0x38, 0xba, 0xa7, 0xff}}}, - {{{ 64, -44, -22}, 0, { 0, 0}, {0x64, 0xba, 0xde, 0xff}}}, - {{{ 47, -58, -31}, 0, { 0, 0}, {0x49, 0xa5, 0xd0, 0xff}}}, - {{{ 51, -63, 0}, 0, { 0, 0}, {0x4f, 0x9d, 0x00, 0xff}}}, - {{{ -22, 78, 0}, 0, { 0, 0}, {0xdd, 0x79, 0x00, 0xff}}}, - {{{ -30, 72, -22}, 0, { 0, 0}, {0xd2, 0x70, 0xde, 0x00}}}, - {{{ -51, 63, 0}, 0, { 0, 0}, {0xb1, 0x63, 0x00, 0x00}}}, - {{{ 8, 81, 0}, 0, { 0, 0}, {0x0d, 0x7e, 0x00, 0xff}}}, - {{{ -4, 70, -40}, 0, { 0, 0}, {0xf9, 0x6d, 0xc1, 0xff}}}, - {{{ 39, 71, 0}, 0, { 0, 0}, {0x3c, 0x6f, 0x00, 0xff}}}, - {{{ 22, 57, -53}, 0, { 0, 0}, {0x22, 0x5a, 0xae, 0xff}}}, - {{{ 63, 51, 0}, 0, { 0, 0}, {0x63, 0x4f, 0x00, 0xff}}}, - {{{ 45, 36, -57}, 0, { 0, 0}, {0x45, 0x38, 0xa7, 0xff}}}, - {{{ 78, 22, 0}, 0, { 0, 0}, {0x79, 0x23, 0x00, 0xff}}}, - {{{ 61, 9, -53}, 0, { 0, 0}, {0x5f, 0x0d, 0xae, 0xff}}}, - {{{ 81, -8, 0}, 0, { 0, 0}, {0x7e, 0xf2, 0x00, 0xff}}}, - {{{ 68, -19, -40}, 0, { 0, 0}, {0x69, 0xe2, 0xc1, 0xff}}}, - {{{ 71, -39, 0}, 0, { 0, 0}, {0x6f, 0xc3, 0x00, 0xff}}}, - {{{ 64, -44, -22}, 0, { 0, 0}, {0x64, 0xba, 0xde, 0xff}}}, - {{{ 51, -63, 0}, 0, { 0, 0}, {0x4f, 0x9d, 0x00, 0xff}}}, - {{{ -30, 72, 22}, 0, { 0, 0}, {0xd2, 0x70, 0x22, 0xff}}}, - {{{ -22, 78, 0}, 0, { 0, 0}, {0xdd, 0x79, 0x00, 0x00}}}, - {{{ -51, 63, 0}, 0, { 0, 0}, {0xb1, 0x63, 0x00, 0x00}}}, - {{{ -4, 70, 40}, 0, { 0, 0}, {0xf9, 0x6d, 0x3f, 0xff}}}, - {{{ 8, 81, 0}, 0, { 0, 0}, {0x0d, 0x7e, 0x00, 0xff}}}, - {{{ 22, 57, 53}, 0, { 0, 0}, {0x22, 0x5a, 0x52, 0xff}}}, - {{{ 39, 71, 0}, 0, { 0, 0}, {0x3c, 0x6f, 0x00, 0xff}}}, - {{{ 45, 36, 57}, 0, { 0, 0}, {0x45, 0x38, 0x59, 0xff}}}, - {{{ 63, 51, 0}, 0, { 0, 0}, {0x63, 0x4f, 0x00, 0xff}}}, - {{{ 61, 9, 53}, 0, { 0, 0}, {0x5f, 0x0d, 0x52, 0xff}}}, - {{{ 78, 22, 0}, 0, { 0, 0}, {0x79, 0x23, 0x00, 0xff}}}, - {{{ 68, -19, 40}, 0, { 0, 0}, {0x69, 0xe2, 0x3f, 0xff}}}, - {{{ 81, -8, 0}, 0, { 0, 0}, {0x7e, 0xf2, 0x00, 0xff}}}, - {{{ 64, -44, 22}, 0, { 0, 0}, {0x64, 0xba, 0x22, 0xff}}}, - {{{ 71, -39, 0}, 0, { 0, 0}, {0x6f, 0xc3, 0x00, 0xff}}}, - {{{ 51, -63, 0}, 0, { 0, 0}, {0x4f, 0x9d, 0x00, 0xff}}}, - {{{ -47, 58, 31}, 0, { 0, 0}, {0xb7, 0x5b, 0x30, 0xff}}}, - {{{ -30, 72, 22}, 0, { 0, 0}, {0xd2, 0x70, 0x22, 0x00}}}, - {{{ -51, 63, 0}, 0, { 0, 0}, {0xb1, 0x63, 0x00, 0x00}}}, - {{{ -36, 45, 57}, 0, { 0, 0}, {0xc8, 0x46, 0x59, 0xff}}}, - {{{ -4, 70, 40}, 0, { 0, 0}, {0xf9, 0x6d, 0x3f, 0xff}}}, - {{{ -19, 24, 75}, 0, { 0, 0}, {0xe2, 0x26, 0x75, 0xff}}}, - {{{ 22, 57, 53}, 0, { 0, 0}, {0x22, 0x5a, 0x52, 0xff}}}, - {{{ 0, 0, 81}, 0, { 0, 0}, {0x00, 0x00, 0x7f, 0xff}}}, - {{{ 45, 36, 57}, 0, { 0, 0}, {0x45, 0x38, 0x59, 0xff}}}, - {{{ 19, -24, 75}, 0, { 0, 0}, {0x1e, 0xda, 0x75, 0xff}}}, - {{{ 61, 9, 53}, 0, { 0, 0}, {0x5f, 0x0d, 0x52, 0xff}}}, - {{{ 36, -45, 57}, 0, { 0, 0}, {0x38, 0xba, 0x59, 0xff}}}, - {{{ 68, -19, 40}, 0, { 0, 0}, {0x69, 0xe2, 0x3f, 0xff}}}, - {{{ 47, -58, 31}, 0, { 0, 0}, {0x49, 0xa5, 0x30, 0xff}}}, - {{{ 64, -44, 22}, 0, { 0, 0}, {0x64, 0xba, 0x22, 0xff}}}, - {{{ 51, -63, 0}, 0, { 0, 0}, {0x4f, 0x9d, 0x00, 0xff}}}, -}; - // 0x0500DC18 - 0x0500DD70 const Gfx wiggler_seg5_dl_0500DC18[] = { gsSPLight(&wiggler_seg5_lights_0500C878.l, 1), diff --git a/bin/effect.c b/bin/effect.c index 1b8091b1..3221b104 100644 --- a/bin/effect.c +++ b/bin/effect.c @@ -6,8 +6,6 @@ #include "make_const_nonconst.h" -UNUSED static const u64 effect_unused_0 = 0; - // Flower (Unused) // 0x0B000008 ALIGNED8 static const Texture effect_0B000008[] = { diff --git a/bin/segment2.c b/bin/segment2.c index 13f3cb7b..23a99516 100644 --- a/bin/segment2.c +++ b/bin/segment2.c @@ -2079,8 +2079,6 @@ const Texture *const main_hud_camera_lut[] = { #include "text/us/define_text.inc.c" #endif -UNUSED static const u64 segment2_unused_0 = 0; - // 0x0200EC60 - 0x0200EC98 const Gfx dl_hud_img_begin[] = { gsDPPipeSync(), diff --git a/data/behavior_data.c b/data/behavior_data.c index 720b7d7e..e30a4d2f 100644 --- a/data/behavior_data.c +++ b/data/behavior_data.c @@ -3422,7 +3422,6 @@ const BehaviorScript bhvYellowBall[] = { BREAK(), }; -UNUSED static const u64 behavior_data_unused_0 = 0; const BehaviorScript bhvMario[] = { BEGIN(OBJ_LIST_PLAYER), SET_INT(oIntangibleTimer, 0), @@ -3516,7 +3515,6 @@ const BehaviorScript bhvSwimmingWarp[] = { BREAK(), }; -UNUSED static const u64 behavior_data_unused_1 = 0; const BehaviorScript bhvRandomAnimatedTexture[] = { BEGIN(OBJ_LIST_LEVEL), OR_INT(oFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE), diff --git a/levels/bitfs/areas/1/3/model.inc.c b/levels/bitfs/areas/1/3/model.inc.c index 5687c306..bf0a217d 100644 --- a/levels/bitfs/areas/1/3/model.inc.c +++ b/levels/bitfs/areas/1/3/model.inc.c @@ -174,15 +174,6 @@ static const Vtx bitfs_seg7_vertex_07003340[] = { {{{ -81, 1536, -511}, 0, { 0, -8208}, {0xac, 0x9d, 0x52, 0xff}}}, }; -// TODO: what is this? -// Possibly vertices for a perfect triangle, but flag seems to be used here. -// 0x070033B0 - 0x070033E0 -UNUSED static const s16 bitfs_seg7_todo_070033B0[] = { - 0x0080, 0x0100, 0x0000, 0x0000, 0x03de, 0x0000, 0xFFFF, 0xFFFF, - 0xFF81, 0x0100, 0x0000, 0x0000, 0xFBE4, 0x0000, 0xFFFF, 0xFFFF, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x07DA, 0xFFFF, 0xFFFF, -}; - // 0x070033E0 - 0x07003528 static const Gfx bitfs_seg7_dl_070033E0[] = { gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, bitfs_seg7_texture_07001800), diff --git a/levels/castle_grounds/areas/1/11/model.inc.c b/levels/castle_grounds/areas/1/11/model.inc.c index a1b3a81b..79a11e37 100644 --- a/levels/castle_grounds/areas/1/11/model.inc.c +++ b/levels/castle_grounds/areas/1/11/model.inc.c @@ -1,6 +1,3 @@ -// TODO: what is this? 0700C4C0-0700C4C8 [8,8] -UNUSED static const u64 castle_grounds_unused_0 = 0; - // 0x0700C4C8 - 0x0700C4E0 static const Lights1 castle_grounds_seg7_lights_0700C4C8 = gdSPDefLights1( 0x66, 0x00, 0x00, @@ -13,9 +10,6 @@ static const Lights1 castle_grounds_seg7_lights_0700C4E0 = gdSPDefLights1( 0xff, 0xff, 0xff, 0x28, 0x28, 0x28 ); -// TODO: what is this? 0700C4F8-0700C500 [8,8] -UNUSED static const u64 castle_grounds_unused_1 = 0; - // 0x0700C500 - 0x0700C530 static const Vtx castle_grounds_seg7_vertex_0700C500[] = { {{{ 0, 0, 75}, 0, { 0, 0}, {0x00, 0x7f, 0x00, 0x00}}}, diff --git a/levels/castle_grounds/areas/1/12/model.inc.c b/levels/castle_grounds/areas/1/12/model.inc.c index 55129ae4..f53a154b 100644 --- a/levels/castle_grounds/areas/1/12/model.inc.c +++ b/levels/castle_grounds/areas/1/12/model.inc.c @@ -1,5 +1,3 @@ -// TODO: what is this? 0700C960-0700C968 [8,8] -UNUSED static const u64 castle_grounds_unused_2 = 0; // 0x0700C968 - 0x0700C9A8 static const Vtx castle_grounds_seg7_vertex_0700C968[] = { diff --git a/levels/castle_inside/painting.inc.c b/levels/castle_inside/painting.inc.c index 096d2ebd..7dc2e82e 100644 --- a/levels/castle_inside/painting.inc.c +++ b/levels/castle_inside/painting.inc.c @@ -561,8 +561,6 @@ static const PaintingData *const inside_castle_seg7_painting_texture_maps_070225 inside_castle_seg7_painting_texture_map_top_07021FFC, }; -UNUSED static const u64 castle_inside_unused_0 = 0x0; - // 0x07022528 - 0x07022540 static const Lights1 inside_castle_seg7_lights_07022528 = gdSPDefLights1( @@ -1063,9 +1061,6 @@ static const PaintingData *const inside_castle_seg7_painting_env_map_texture_map inside_castle_seg7_painting_env_map_texture_map_07022660, }; -UNUSED static const u64 castle_inside_unused_1 = 0x0; - - // 0x07023050 - 0x070230B0 static const Gfx inside_castle_seg7_painting_dl_07023050[] = { gsSPDisplayList(inside_castle_seg7_dl_07021A48), diff --git a/levels/hmc/areas/1/painting.inc.c b/levels/hmc/areas/1/painting.inc.c index a0c55961..da95de86 100644 --- a/levels/hmc/areas/1/painting.inc.c +++ b/levels/hmc/areas/1/painting.inc.c @@ -497,9 +497,6 @@ static const PaintingData *const hmc_seg7_painting_texture_maps_07024CD4[] = { hmc_seg7_pool_texture_map_070242F0, }; -UNUSED static const u64 hmc_unused_0 = 0; - - // 0x07024CE0 - 0x070254E0 ALIGNED8 static const Texture hmc_seg7_texture_07024CE0[] = { #include "levels/hmc/7.rgba16.inc.c" diff --git a/levels/menu/leveldata.c b/levels/menu/leveldata.c index d5b3e511..4bc8d797 100644 --- a/levels/menu/leveldata.c +++ b/levels/menu/leveldata.c @@ -608,8 +608,6 @@ const Texture *const menu_hud_lut[] = { }; #if defined(VERSION_JP) || defined(VERSION_SH) -UNUSED static const u64 menu_unused_0 = 0; - // 0x0700AC48 ALIGNED8 static const Texture texture_menu_font_char_jp_0[] = { #include "levels/menu/main_menu_seg7.0AC48.ia8.inc.c" @@ -1717,8 +1715,6 @@ const Gfx dl_menu_ia8_text_end[] = { gsSPEndDisplayList(), }; -UNUSED static const u64 menu_unused_1 = 0; - #ifdef VERSION_EU // 0x0700BDA0 - 0x0700CDA0 diff --git a/levels/ttm/areas/1/painting.inc.c b/levels/ttm/areas/1/painting.inc.c index 2477f654..a1cbfc32 100644 --- a/levels/ttm/areas/1/painting.inc.c +++ b/levels/ttm/areas/1/painting.inc.c @@ -525,9 +525,6 @@ static const PaintingData *const ttm_seg7_painting_texture_maps_07012E88[] = { ttm_seg7_painting_top_0701296C, }; -UNUSED static const u64 ttm_unused_0 = 0x0; - - // 0x07012E98 - 0x07012EF8 static const Gfx ttm_seg7_painting_dl_07012E98[] = { gsSPDisplayList(ttm_seg7_dl_070123B8), diff --git a/src/audio/audio_session_presets_sh.c b/src/audio/audio_session_presets_sh.c index 958ec15a..ab7b00be 100644 --- a/src/audio/audio_session_presets_sh.c +++ b/src/audio/audio_session_presets_sh.c @@ -31,7 +31,6 @@ struct AudioSessionSettingsEU gAudioSessionPresets[] = { 0x00000000, 0x00004000, 0x00001b00, 0x00000000, 0x00000000, 0x00000000 } }; -s8 gUnusedCount80333EE8 = UNUSED_COUNT_80333EE8; s16 gTatumsPerBeat = TATUMS_PER_BEAT; s32 gAudioHeapSize = DOUBLE_SIZE_ON_64_BIT(AUDIO_HEAP_SIZE); s32 gAudioInitPoolSize = DOUBLE_SIZE_ON_64_BIT(AUDIO_INIT_POOL_SIZE); diff --git a/src/audio/data.c b/src/audio/data.c index d012cb68..0ecd602a 100644 --- a/src/audio/data.c +++ b/src/audio/data.c @@ -892,7 +892,6 @@ u16 unk_sh_data_4[] = { #ifndef VERSION_SH s16 gTatumsPerBeat = TATUMS_PER_BEAT; -s8 gUnusedCount80333EE8 = UNUSED_COUNT_80333EE8; s32 gAudioHeapSize = DOUBLE_SIZE_ON_64_BIT(AUDIO_HEAP_SIZE); s32 gAudioInitPoolSize = DOUBLE_SIZE_ON_64_BIT(AUDIO_INIT_POOL_SIZE); volatile s32 gAudioLoadLock = AUDIO_LOCK_UNINITIALIZED; @@ -904,8 +903,6 @@ u8 D_EU_80302010 = 0; u8 D_EU_80302014 = 0; struct OSMesgQueue *OSMesgQueues[4] = { &OSMesgQueue0, &OSMesgQueue1, &OSMesgQueue2, &OSMesgQueue3 }; -#elif defined(VERSION_JP) || defined(VERSION_US) -s8 sUnused8033EF8 = 24; #endif // .bss @@ -935,11 +932,6 @@ s32 gRefreshRate; ALIGNED8 s16 *gAiBuffers[NUMAIBUFFERS]; s16 gAiBufferLengths[NUMAIBUFFERS]; -#if defined(VERSION_JP) || defined(VERSION_US) -u32 gUnused80226E58[0x10]; -u16 gUnused80226E98[0x10]; -#endif - u32 gAudioRandom; #if defined(VERSION_EU) || defined(VERSION_SH) diff --git a/src/audio/data.h b/src/audio/data.h index 80bc9581..2e0c37aa 100644 --- a/src/audio/data.h +++ b/src/audio/data.h @@ -68,7 +68,6 @@ extern f32 gVolRampingRhs128[128]; // non-constant .data extern s16 gTatumsPerBeat; -extern s8 gUnusedCount80333EE8; extern s32 gAudioHeapSize; // AUDIO_HEAP_SIZE extern s32 gAudioInitPoolSize; // AUDIO_INIT_POOL_SIZE extern volatile s32 gAudioLoadLock; @@ -107,9 +106,6 @@ extern s16 gAiBufferLengths[NUMAIBUFFERS]; #define AIBUFFER_LEN (0xa0 * 16) #endif -extern u32 gUnused80226E58[0x10]; -extern u16 gUnused80226E98[0x10]; - extern u32 gAudioRandom; #ifdef EXPAND_AUDIO_HEAP @@ -152,11 +148,9 @@ extern OSMesgQueue *D_SH_80350FA8; #endif #if defined(VERSION_EU) || defined(VERSION_SH) -#define UNUSED_COUNT_80333EE8 24 #define AUDIO_HEAP_SIZE (0x3AB00 + EXT_AUDIO_HEAP_SIZE + EXT_AUDIO_INIT_POOL_SIZE + BETTER_REVERB_SIZE) #define AUDIO_INIT_POOL_SIZE (0x2C00 + EXT_AUDIO_INIT_POOL_SIZE) #else -#define UNUSED_COUNT_80333EE8 16 #define AUDIO_HEAP_SIZE (0x34750 + EXT_AUDIO_HEAP_SIZE + EXT_AUDIO_INIT_POOL_SIZE + BETTER_REVERB_SIZE) #define AUDIO_INIT_POOL_SIZE (0x2500 + EXT_AUDIO_INIT_POOL_SIZE) #endif diff --git a/src/audio/external.c b/src/audio/external.c index 29b134b0..ecc12247 100644 --- a/src/audio/external.c +++ b/src/audio/external.c @@ -326,7 +326,6 @@ u8 sMaxChannelsForSoundBank[SOUND_BANK_COUNT] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } #define TARGET_VOLUME_UNSET 0x00 f32 gGlobalSoundSource[3] = { 0.0f, 0.0f, 0.0f }; -f32 sUnusedSoundArgs[3] = { 1.0f, 1.0f, 1.0f }; u8 sSoundBankDisabled[16] = { 0 }; u8 D_80332108 = 0; u8 sHasStartedFadeOut = FALSE; @@ -341,11 +340,6 @@ u8 D_EU_80300558 = 0; u8 sBackgroundMusicQueueSize = 0; -#ifndef VERSION_JP -u8 sUnused8033323C = 0; // never read, set to 0 -#endif - - // bss #if defined(VERSION_JP) || defined(VERSION_US) s16 *gCurrAiBuffer; @@ -392,9 +386,7 @@ extern OSMesgQueue *OSMesgQueues[]; struct EuAudioCmd sAudioCmd[0x100]; OSMesg OSMesg0; -s32 pad1; // why is there 1 s32 here OSMesg OSMesg1; -s32 pad2[2]; // it's not just that the struct is bigger than we think, because there are 2 here OSMesg OSMesg2; // and none here. wth nintendo OSMesg OSMesg3; #else // VERSION_SH @@ -1824,15 +1816,12 @@ static void func_8031F96C(u8 player) { void process_level_music_dynamics(void) { u32 conditionBits; u16 tempBits; - UNUSED u16 pad; u8 musicDynIndex; u8 condIndex; - u8 i; - u8 j; + u8 i, j; s16 conditionValues[8]; u8 conditionTypes[8]; - s16 dur1; - s16 dur2; + s16 dur1, dur2; u16 bit; func_8031F96C(0); @@ -2668,7 +2657,6 @@ void sound_reset(u8 presetId) { #ifndef VERSION_JP if (presetId >= 8) { presetId = 0; - sUnused8033323C = 0; } #endif sGameLoopTicked = 0; @@ -2701,11 +2689,3 @@ void audio_set_sound_mode(u8 soundMode) { D_80332108 = (D_80332108 & 0xf) + (soundMode << 4); gSoundMode = soundMode; } - -#if defined(VERSION_JP) || defined(VERSION_US) -void unused_80321460(UNUSED s32 arg0, UNUSED s32 arg1, UNUSED s32 arg2, UNUSED s32 arg3) { -} - -void unused_80321474(UNUSED s32 arg0) { -} -#endif diff --git a/src/audio/external.h b/src/audio/external.h index 0a802a0e..d26723ce 100644 --- a/src/audio/external.h +++ b/src/audio/external.h @@ -66,9 +66,4 @@ void audio_set_sound_mode(u8 arg0); void audio_init(void); // in load.c -#if defined(VERSION_EU) || defined(VERSION_SH) -struct SPTask *unused_80321460(); -struct SPTask *unused_80321460(void); -#endif - #endif // AUDIO_EXTERNAL_H diff --git a/src/audio/heap.c b/src/audio/heap.c index 77ccff79..c87692f2 100644 --- a/src/audio/heap.c +++ b/src/audio/heap.c @@ -131,8 +131,6 @@ f64 kth_root(f64 d, s32 k) { root = 1.0; } else { for (i = 0; i < 64; i++) { - if (1) { - } next = root_newton_step(root, k, d); diff = next - root; @@ -381,11 +379,6 @@ void temporary_pools_init(struct PoolSplit *a) { } #undef SOUND_ALLOC_FUNC -#if defined(VERSION_JP) || defined(VERSION_US) -UNUSED static void unused_803163D4(void) { -} -#endif - #ifdef VERSION_SH void *alloc_bank_or_seq(s32 poolIdx, s32 size, s32 arg3, s32 id) { #else @@ -497,14 +490,6 @@ void *alloc_bank_or_seq(struct SoundMultiPool *arg0, s32 arg1, s32 size, s32 arg return NULL; } #else -#ifdef VERSION_EU - if (0) { - // It's unclear where these string literals go. - eu_stubbed_printf_0("DataHeap Not Allocate \n"); - eu_stubbed_printf_1("StayHeap Not Allocate %d\n", 0); - eu_stubbed_printf_1("AutoHeap Not Allocate %d\n", 0); - } -#endif #ifdef VERSION_SH if (poolIdx == 1) { @@ -1753,7 +1738,6 @@ void func_sh_802f23ec(void) { s32 drumId; struct Drum *drum; struct Instrument *inst; - UNUSED s32 pad; struct UnkEntry *entry; //! @bug: not initialized but nevertheless used seqCount = gAlCtlHeader->seqCount; diff --git a/src/audio/load.c b/src/audio/load.c index ab267ad3..5e1a025e 100644 --- a/src/audio/load.c +++ b/src/audio/load.c @@ -26,10 +26,6 @@ void port_eu_init(void); struct Note *gNotes; -#if defined(VERSION_EU) -UNUSED static u8 pad[4]; -#endif - struct SequencePlayer gSequencePlayers[SEQUENCE_PLAYERS]; struct SequenceChannel gSequenceChannels[SEQUENCE_CHANNELS]; struct SequenceChannelLayer gSequenceLayers[SEQUENCE_LAYERS]; @@ -49,7 +45,6 @@ OSIoMesg gAudioDmaIoMesg; struct SharedDma sSampleDmas[0x60]; u32 gSampleDmaNumListItems; // sh: 0x803503D4 u32 sSampleDmaListSize1; // sh: 0x803503D8 -u32 sUnused80226B40; // set to 0, never read, sh: 0x803503DC // Circular buffer of DMAs with ttl = 0. tail <= head, wrapping around mod 256. u8 sSampleDmaReuseQueue1[256]; @@ -207,8 +202,6 @@ void decrease_sample_dma_ttls() { } } } - - sUnused80226B40 = 0; } void *dma_sample_data(uintptr_t devAddr, u32 size, s32 arg2, u8 *dmaIndexRef) { @@ -219,7 +212,6 @@ void *dma_sample_data(uintptr_t devAddr, u32 size, s32 arg2, u8 *dmaIndexRef) { u32 i; u32 dmaIndex; ssize_t bufferPos; - UNUSED u32 pad; #if PUPPYPRINT_DEBUG OSTime first = osGetTime(); #endif @@ -283,10 +275,6 @@ void *dma_sample_data(uintptr_t devAddr, u32 size, s32 arg2, u8 *dmaIndexRef) { // Move the DMA out of the reuse queue, by swapping it with the // tail, and then incrementing the tail. if (dma->reuseIndex != sSampleDmaReuseQueueTail1) { -#if defined(VERSION_EU) - if (1) { - } -#endif sSampleDmaReuseQueue1[dma->reuseIndex] = sSampleDmaReuseQueue1[sSampleDmaReuseQueueTail1]; sSampleDmas[sSampleDmaReuseQueue1[sSampleDmaReuseQueueTail1]].reuseIndex = @@ -614,7 +602,6 @@ l2: } struct AudioBank *bank_load_immediate(s32 bankId, s32 arg1) { - UNUSED u32 pad1[4]; u32 buf[4]; u32 numInstruments, numDrums; struct AudioBank *ret; @@ -647,16 +634,11 @@ struct AudioBank *bank_load_immediate(s32 bankId, s32 arg1) { struct AudioBank *bank_load_async(s32 bankId, s32 arg1, struct SequencePlayer *seqPlayer) { u32 numInstruments, numDrums; - UNUSED u32 pad1[2]; u32 buf[4]; - UNUSED u32 pad2; size_t alloc; struct AudioBank *ret; u8 *ctlData; OSMesgQueue *mesgQueue; -#if defined(VERSION_EU) - UNUSED u32 pad3; -#endif alloc = gAlCtlHeader->seqArray[bankId].len + 0xf; alloc = ALIGN16(alloc); @@ -679,8 +661,6 @@ struct AudioBank *bank_load_async(s32 bankId, s32 arg1, struct SequencePlayer *s seqPlayer->bankDmaCurrMemAddr = (u8 *) ret; seqPlayer->bankDmaCurrDevAddr = (uintptr_t)(ctlData + 0x10); seqPlayer->bankDmaRemaining = alloc; - if (1) { - } #else seqPlayer->loadingBankNumInstruments = numInstruments; seqPlayer->loadingBankNumDrums = numDrums; @@ -738,8 +718,6 @@ void *sequence_dma_async(s32 seqId, s32 arg1, struct SequencePlayer *seqPlayer) if (seqLength <= 0x40) { // Immediately load short sequenece audio_dma_copy_immediate((uintptr_t) seqData, ptr, seqLength); - if (1) { - } gSeqLoadStatus[seqId] = SOUND_LOAD_STATUS_COMPLETE; } else { audio_dma_copy_immediate((uintptr_t) seqData, ptr, 0x40); @@ -877,7 +855,6 @@ void load_sequence(u32 player, u32 seqId, s32 loadAsync) { void load_sequence_internal(u32 player, u32 seqId, s32 loadAsync) { void *sequenceData; struct SequencePlayer *seqPlayer = &gSequencePlayers[player]; - UNUSED u32 padding[2]; if (seqId >= gSequenceCount) { return; @@ -940,11 +917,6 @@ void load_sequence_internal(u32 player, u32 seqId, s32 loadAsync) { // (void) must be omitted from parameters to fix stack with -framepointer void audio_init() { -#if defined(VERSION_EU) - UNUSED s8 pad[16]; -#else - UNUSED s8 pad[32]; -#endif #if defined(VERSION_JP) || defined(VERSION_US) u8 buf[0x10]; #endif @@ -959,17 +931,10 @@ void audio_init() { UNUSED u32 size; UNUSED u64 *ptr64; void *data; - UNUSED s32 pad2; gAudioLoadLock = AUDIO_LOCK_UNINITIALIZED; #if defined(VERSION_JP) || defined(VERSION_US) - lim1 = gUnusedCount80333EE8; - for (i = 0; i < lim1; i++) { - gUnused80226E58[i] = 0; - gUnused80226E98[i] = 0; - } - lim2 = gAudioHeapSize; for (i = 0; i <= lim2 / 8 - 1; i++) { ((u64 *) gAudioHeap)[i] = 0; @@ -1004,8 +969,6 @@ void audio_init() { D_EU_802298D0 = 16.713f; gRefreshRate = 60; port_eu_init(); - if (k) { - } #endif #ifdef TARGET_N64 diff --git a/src/audio/load_sh.c b/src/audio/load_sh.c index b005febc..5a0e293a 100644 --- a/src/audio/load_sh.c +++ b/src/audio/load_sh.c @@ -26,8 +26,6 @@ void *func_802f3f08(s32 poolIdx, s32 idx, s32 numChunks, s32 arg3, OSMesgQueue * struct Note *gNotes; -UNUSED static u32 pad; - struct SequencePlayer gSequencePlayers[SEQUENCE_PLAYERS]; struct SequenceChannel gSequenceChannels[SEQUENCE_CHANNELS]; struct SequenceChannelLayer gSequenceLayers[SEQUENCE_LAYERS]; @@ -74,7 +72,6 @@ OSIoMesg gAudioDmaIoMesg; struct SharedDma *sSampleDmas; u32 gSampleDmaNumListItems; u32 sSampleDmaListSize1; -u32 sUnused80226B40; // set to 0, never read // Circular buffer of DMAs with ttl = 0. tail <= head, wrapping around mod 256. u8 sSampleDmaReuseQueue1[256]; @@ -159,17 +156,13 @@ void decrease_sample_dma_ttls() { } } } - - sUnused80226B40 = 0; } extern char shindouDebugPrint62[]; // "SUPERDMA" void *dma_sample_data(uintptr_t devAddr, u32 size, s32 arg2, u8 *dmaIndexRef, s32 medium) { - UNUSED s32 sp60; struct SharedDma *dma; s32 hasDma = FALSE; uintptr_t dmaDevAddr; - UNUSED u32 pad; u32 dmaIndex; u32 transfer; ssize_t bufferPos; @@ -228,7 +221,6 @@ void *dma_sample_data(uintptr_t devAddr, u32 size, s32 arg2, u8 *dmaIndexRef, s3 } if (!hasDma) { - if (1) {} // Allocate a DMA from reuse queue 1. This queue will hopefully never // be empty, since TTL 2 is so small. dmaIndex = sSampleDmaReuseQueue1[sSampleDmaReuseQueueTail1++]; @@ -337,7 +329,6 @@ struct AudioBank *load_banks_immediate(s32 seqId, s32 *outDefaultBank) { } void preload_sequence(u32 seqId, s32 preloadMask) { - UNUSED s32 pad; s32 temp; seqId = canonicalize_index(0, seqId); @@ -510,9 +501,6 @@ void load_sequence_internal(s32 player, s32 seqId, UNUSED s32 loadAsync) { seqPlayer->scriptState.depth = 0; seqPlayer->delay = 0; seqPlayer->finished = 0; - - for (i = 0; i < 0x10; i++) { - } } void *func_sh_802f3564(s32 seqId) { @@ -600,7 +588,6 @@ void *func_sh_802f3764(s32 poolIdx, s32 idx, s32 *arg2) { ALSeqFile *f; void *vAddr; s32 medium; - UNUSED u32 pad2; u8 *devAddr; s8 loadStatus; s32 sp18; @@ -749,12 +736,8 @@ void patch_audio_bank(s32 bankId, struct AudioBank *mem, struct PatchStruct *pat numDrums = gCtlEntries[bankId].numDrums; numInstruments = gCtlEntries[bankId].numInstruments; itInstrs = (void **) mem->drums; - if (mem->drums) { - } if (itInstrs != NULL && numDrums != 0) { - if (1) { - mem->drums = PATCH(itInstrs, mem); - } + mem->drums = PATCH(itInstrs, mem); for (i = 0; i < numDrums; i++) { patched = mem->drums[i]; if (patched != NULL) { @@ -998,12 +981,10 @@ u8 gShindouSequencesHeader[] = { // (void) must be omitted from parameters void audio_init() { - UNUSED s8 pad[0x34]; s32 i, j, k; s32 lim; u64 *ptr64; void *data; - UNUSED u8 pad2[4]; s32 seqCount; gAudioLoadLockSH = 0; @@ -1157,9 +1138,6 @@ struct AudioBankSample *func_sh_802f4978(s32 bankId, s32 idx) { return ret; } -void stub_sh_802f49dc(void) { -} - void func_sh_802f49e4(struct PendingDmaSample *arg0) { struct AudioBankSample *sample = func_sh_802f4978(arg0->bankId, arg0->idx); if (sample != NULL) { @@ -1425,9 +1403,7 @@ void patch_sound(struct AudioBankSound *sound, struct AudioBank *memBase, struct } void func_sh_802f5310(s32 bankId, struct AudioBank *mem, struct PatchStruct *patchInfo, s32 arg3) { - UNUSED u32 pad[2]; u8 *addr; - UNUSED u32 pad1[3]; s32 sp4C; struct AudioBankSample *temp_s0; s32 i; @@ -1455,8 +1431,6 @@ void func_sh_802f5310(s32 bankId, struct AudioBank *mem, struct PatchStruct *pat case 0: temp = temp_s0->medium = patchInfo->medium1; if (temp != 0) { - if (temp_s0->size) { - } addr = func_sh_802f1d90(temp_s0->size, patchInfo->bankId1, temp_s0->sampleAddr, temp_s0->medium); } else { temp = temp_s0->medium = patchInfo->medium2; diff --git a/src/audio/playback.c b/src/audio/playback.c index ff42e765..a900b1b1 100644 --- a/src/audio/playback.c +++ b/src/audio/playback.c @@ -26,8 +26,6 @@ void note_set_vel_pan_reverb(struct Note *note, f32 velocity, u8 pan, u8 reverbV #ifdef VERSION_EU u16 unkMask = ~0x80; #else - UNUSED u32 pad; - UNUSED u32 pad1; f32 velocity; u8 pan; u8 reverbVol; @@ -359,12 +357,9 @@ void process_notes(void) { struct NotePlaybackState *playbackState; struct NoteSubEu *noteSubEu; #ifndef VERSION_SH - UNUSED u8 pad[12]; u8 reverbVol; - UNUSED u8 pad3; u8 pan; #else - UNUSED u8 pad[8]; struct ReverbInfo reverbInfo; #endif u8 bookOffset; @@ -456,9 +451,6 @@ void process_notes(void) { #endif d: if (playbackState->priority != NOTE_PRIORITY_DISABLED) { -#ifdef VERSION_SH - if (1) {} -#endif noteSubEu = ¬e->noteSubEu; #ifdef VERSION_SH if (playbackState->unkSH34 >= 1 || noteSubEu->finished) { @@ -490,10 +482,6 @@ void process_notes(void) { goto skip; } } -#ifndef VERSION_SH - if (1) { - } -#endif } else if (playbackState->adsr.state == ADSR_STATE_DISABLED) { note_disable(note); audio_list_remove(¬e->listItem); @@ -540,8 +528,6 @@ void process_notes(void) { velocity = attributes->velocity; pan = attributes->pan; reverbVol = attributes->reverbVol; - if (1) { - } bookOffset = noteSubEu->bookOffset; } else { frequency = playbackState->parentLayer->noteFreqScale; @@ -1130,7 +1116,6 @@ struct Note *pop_node_with_lower_prio(struct AudioListItem *list, s32 limit) { #if defined(VERSION_EU) || defined(VERSION_SH) void note_init_for_layer(struct Note *note, struct SequenceChannelLayer *seqLayer) { - UNUSED s32 pad[4]; s16 instId; struct NoteSubEu *sub = ¬e->noteSubEu; diff --git a/src/audio/seqplayer.c b/src/audio/seqplayer.c index 2364fc89..67e88360 100644 --- a/src/audio/seqplayer.c +++ b/src/audio/seqplayer.c @@ -460,9 +460,6 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) { void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) { struct SequencePlayer *seqPlayer; struct SequenceChannel *seqChannel; -#ifdef VERSION_EU - UNUSED u32 pad0; -#endif struct M64ScriptState *state; struct Portamento *portamento; struct AudioBankSound *sound; @@ -472,9 +469,7 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) { #ifdef VERSION_EU u16 sp3A; s32 sameSound; -#endif - UNUSED u32 pad1; -#ifndef VERSION_EU +#else u8 sameSound; #endif u8 cmd; @@ -630,9 +625,6 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) { layer->instrument = NULL; } - if (1) { - } - if (cmd == 0xff) { layer->adsr.releaseRate = 0; } @@ -956,10 +948,6 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) { if (layer->note != NULL && layer->note->parentLayer == layer) { note_vibrato_init(layer->note); } -#if defined(VERSION_EU) || defined(VERSION_SH) - if (seqChannel) { - } -#endif } #ifdef VERSION_EU @@ -1118,9 +1106,6 @@ s32 seq_channel_layer_process_script_part2(struct SequenceChannelLayer *layer) { layer->instrument = NULL; } - if (1) { - } - if (cmd == 0xff) { layer->adsr.releaseRate = 0; } @@ -1209,7 +1194,6 @@ s32 seq_channel_layer_process_script_part4(struct SequenceChannelLayer *layer, s f32 freqScale; f32 sp24; f32 temp_f12; - UNUSED s32 pad[2]; struct SequencePlayer *seqPlayer = seqChannel->seqPlayer; u8 cmd = cmd1; f32 temp_f2; @@ -1404,8 +1388,7 @@ u8 get_instrument(struct SequenceChannel *seqChannel, u8 instId, struct Instrume struct Instrument *inst; #if defined(VERSION_EU) || defined(VERSION_SH) inst = get_instrument_inner(seqChannel->bankId, instId); - if (inst == NULL) - { + if (inst == NULL) { *instOut = NULL; return 0; } @@ -1415,8 +1398,6 @@ u8 get_instrument(struct SequenceChannel *seqChannel, u8 instId, struct Instrume instId++; return instId; #else - UNUSED u32 pad; - if (instId >= gCtlEntries[seqChannel->bankId].numInstruments) { instId = gCtlEntries[seqChannel->bankId].numInstruments; if (instId == 0) { @@ -2083,7 +2064,6 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) { case 0x88: sp5A = m64_read_s16(state); if (seq_channel_set_layer(seqChannel, loBits) == 0) { - if (1) {} seqChannel->layers[loBits]->scriptState.pc = seqPlayer->seqData + sp5A; } break; @@ -2160,9 +2140,6 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) { case 0x90: // chan_setlayer sp5A = m64_read_s16(state); if (seq_channel_set_layer(seqChannel, loBits) == 0) { -#ifdef VERSION_EU - if (1) {} -#endif seqChannel->layers[loBits]->scriptState.pc = seqPlayer->seqData + sp5A; } break; @@ -2230,9 +2207,6 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) { void sequence_player_process_sequence(struct SequencePlayer *seqPlayer) { u8 cmd; -#ifdef VERSION_SH - UNUSED u32 pad; -#endif u8 loBits; u8 temp; s32 value = 0; diff --git a/src/audio/synthesis.c b/src/audio/synthesis.c index 2499690b..289d7df4 100644 --- a/src/audio/synthesis.c +++ b/src/audio/synthesis.c @@ -310,7 +310,6 @@ void prepare_reverb_ring_buffer(s32 chunkLen, u32 updateIndex, s32 reverbIndex) s32 dstPos; s32 nSamples; s32 excessiveSamples; - s32 UNUSED pad[3]; if (reverb->downsampleRate != 1) { if (reverb->framesLeftToIgnore == 0) { // Now that the RSP has finished, downsample the samples produced two frames ago by skipping @@ -846,20 +845,14 @@ u64 *synthesis_do_one_audio_update(s16 *aiBuf, s32 bufLen, u64 *cmd, s32 updateI #ifdef VERSION_EU // Processes just one note, not all u64 *synthesis_process_note(struct Note *note, struct NoteSubEu *noteSubEu, struct NoteSynthesisState *synthesisState, UNUSED s16 *aiBuf, s32 bufLen, u64 *cmd) { - UNUSED s32 pad0[3]; #else u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd) { s32 noteIndex; // sp174 struct Note *note; // s7 - UNUSED u8 pad0[0x08]; #endif struct AudioBankSample *audioBookSample; // sp164, sp138 struct AdpcmLoop *loopInfo; // sp160, sp134 s16 *curLoadedBook = NULL; // sp154, sp130 -#ifdef VERSION_EU - UNUSED u8 padEU[0x04]; -#endif - UNUSED u8 pad8[0x04]; #ifndef VERSION_EU u16 resamplingRateFixedPoint; // sp5c, sp11A #endif @@ -869,15 +862,8 @@ u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd) { #ifdef VERSION_EU u16 resamplingRateFixedPoint; // sp5c, sp11A #endif - UNUSED u8 pad7[0x0c]; // sp100 UNUSED s32 tempBufLen; -#ifdef VERSION_EU s32 sp130 = 0; //sp128, sp104 - UNUSED u32 pad9; -#else - UNUSED u32 pad9; - s32 sp130 = 0; //sp128, sp104 -#endif s32 nAdpcmSamplesProcessed; // signed required for US s32 t0; #ifdef VERSION_EU @@ -1404,9 +1390,7 @@ u64 *final_resample(u64 *cmd, struct Note *note, s32 count, u16 pitch, u16 dmemI #endif #ifndef VERSION_EU -u64 *process_envelope(u64 *cmd, struct Note *note, s32 nSamples, u16 inBuf, s32 headsetPanSettings, - UNUSED u32 flags) { - UNUSED u8 pad[16]; +u64 *process_envelope(u64 *cmd, struct Note *note, s32 nSamples, u16 inBuf, s32 headsetPanSettings, UNUSED u32 flags) { struct VolumeChange vol; vol.sourceLeft = note->curVolLeft; vol.sourceRight = note->curVolRight; @@ -1419,16 +1403,12 @@ u64 *process_envelope(u64 *cmd, struct Note *note, s32 nSamples, u16 inBuf, s32 u64 *process_envelope_inner(u64 *cmd, struct Note *note, s32 nSamples, u16 inBuf, s32 headsetPanSettings, struct VolumeChange *vol) { - UNUSED u8 pad[3]; u8 mixerFlags; - UNUSED u8 pad2[8]; s32 rampLeft, rampRight; #elif defined(VERSION_EU) u64 *process_envelope(u64 *cmd, struct NoteSubEu *note, struct NoteSynthesisState *synthesisState, s32 nSamples, u16 inBuf, s32 headsetPanSettings, UNUSED u32 flags) { - UNUSED u8 pad1[20]; u16 sourceRight; u16 sourceLeft; - UNUSED u8 pad2[4]; u16 targetLeft; u16 targetRight; s32 mixerFlags; @@ -1627,8 +1607,6 @@ u64 *note_apply_headset_pan_effects(u64 *cmd, struct Note *note, s32 bufLen, s32 #ifdef VERSION_EU pitch = (bufLen << 0xf) / (bufLen + panShift - prevPanShift + 8); - if (pitch) { - } #else pitch = (bufLen << 0xf) / (panShift + bufLen - prevPanShift + 8); #endif diff --git a/src/audio/synthesis_sh.c b/src/audio/synthesis_sh.c index d27df362..32e70b53 100644 --- a/src/audio/synthesis_sh.c +++ b/src/audio/synthesis_sh.c @@ -68,7 +68,6 @@ void prepare_reverb_ring_buffer(s32 chunkLen, u32 updateIndex, s32 reverbIndex) s32 dstPos; s32 nSamples; s32 excessiveSamples; - s32 UNUSED pad[3]; if (reverb->downsampleRate != 1) { if (reverb->framesLeftToIgnore == 0) { // Now that the RSP has finished, downsample the samples produced two frames ago by skipping @@ -382,21 +381,16 @@ u64 *synthesis_do_one_audio_update(s16 *aiBuf, s32 bufLen, u64 *cmd, s32 updateI } u64 *synthesis_process_note(s32 noteIndex, struct NoteSubEu *noteSubEu, struct NoteSynthesisState *synthesisState, UNUSED s16 *aiBuf, s32 bufLen, u64 *cmd, s32 updateIndex) { - UNUSED s32 pad0[3]; struct AudioBankSample *audioBookSample; // sp164, sp138 struct AdpcmLoop *loopInfo; // sp160, sp134 s16 *curLoadedBook; // sp154, sp130 - UNUSED u8 padEU[0x04]; - UNUSED u8 pad8[0x04]; s32 noteFinished; // 150 t2, sp124 s32 restart; // 14c t3, sp120 s32 flags; // sp148, sp11C, t8 u16 resamplingRateFixedPoint; // sp5c, sp11A s32 nSamplesToLoad; //s0, Ec - UNUSED u8 pad7[0x0c]; // sp100 s32 sp130; //sp128, sp104 UNUSED s32 tempBufLen; - UNUSED u32 pad9; s32 t0; u8 *sampleAddr; // sp120, spF4 s32 s6; @@ -423,12 +417,8 @@ u64 *synthesis_process_note(s32 noteIndex, struct NoteSubEu *noteSubEu, struct N s32 nParts; // spE8, spBC s32 curPart; // spE4, spB8 s32 aligned; - UNUSED u32 padSH1; s32 resampledTempLen; // spD8, spAC, sp6c u16 noteSamplesDmemAddrBeforeResampling; // spD6, spAA, sp6a -- 6C - UNUSED u32 padSH2; - UNUSED u32 padSH3; - UNUSED u32 padSH4; struct Note *note; // sp58 u16 sp56; // sp56 u16 addr; diff --git a/src/boot/memory.c b/src/boot/memory.c index b5703c69..ccd14117 100644 --- a/src/boot/memory.c +++ b/src/boot/memory.c @@ -381,7 +381,6 @@ void *load_to_fixed_pool_addr(u8 *destAddr, u8 *srcStart, u8 *srcEnd) { osInvalICache(dest, destSize); osInvalDCache(dest, destSize); } - } else { } return dest; } @@ -431,9 +430,7 @@ void *load_segment_decompress(s32 segment, u8 *srcStart, u8 *srcEnd) { osSyncPrintf("end decompress\n"); set_segment_base_addr(segment, dest); main_pool_free(compressed); - } else { } - } else { } #if PUPPYPRINT_DEBUG ramsizeSegment[segment+nameTable-2] = (s32)srcEnd - (s32)srcStart; @@ -473,7 +470,6 @@ void *load_segment_decompress_heap(u32 segment, u8 *srcStart, u8 *srcEnd) { #endif set_segment_base_addr(segment, gDecompressionHeap); main_pool_free(compressed); - } else { } return gDecompressionHeap; } @@ -647,7 +643,6 @@ void *alloc_display_list(u32 size) { if (gGfxPoolEnd - size >= (u8 *) gDisplayListHead) { gGfxPoolEnd -= size; ptr = gGfxPoolEnd; - } else { } return ptr; } diff --git a/src/engine/behavior_script.c b/src/engine/behavior_script.c index 62dca63d..9988ae7b 100644 --- a/src/engine/behavior_script.c +++ b/src/engine/behavior_script.c @@ -108,12 +108,6 @@ static uintptr_t cur_obj_bhv_stack_pop(void) { return bhvAddr; } -UNUSED static void stub_behavior_script_1(void) { - for (;;) { - ; - } -} - // Command 0x22: Hides the current object. // Usage: HIDE() static s32 bhv_cmd_hide(void) { @@ -838,9 +832,6 @@ static s32 bhv_cmd_animate_texture(void) { return BHV_PROC_CONTINUE; } -void stub_behavior_script_2(void) { -} - typedef s32 (*BhvCommandProc)(void); static BhvCommandProc BehaviorCmdTable[] = { bhv_cmd_begin, diff --git a/src/engine/behavior_script.h b/src/engine/behavior_script.h index 92ba1099..2d1ff214 100644 --- a/src/engine/behavior_script.h +++ b/src/engine/behavior_script.h @@ -23,8 +23,6 @@ u16 random_u16(void); float random_float(void); s32 random_sign(void); -void stub_behavior_script_2(void); - void cur_obj_update(void); #endif // BEHAVIOR_SCRIPT_H diff --git a/src/engine/level_script.c b/src/engine/level_script.c index 892525b6..c12b5509 100644 --- a/src/engine/level_script.c +++ b/src/engine/level_script.c @@ -681,7 +681,6 @@ static void level_cmd_set_macro_objects(void) { static void level_cmd_load_area(void) { s16 areaIndex = CMD_GET(u8, 2); - UNUSED void *unused = (u8 *) sCurrentCmd + 4; stop_sounds_in_continuous_banks(); load_area(areaIndex); diff --git a/src/engine/math_util.c b/src/engine/math_util.c index 68623017..bb421ffd 100644 --- a/src/engine/math_util.c +++ b/src/engine/math_util.c @@ -65,6 +65,10 @@ void vec3s_sub(Vec3s dest, Vec3s a) { vec3_sub(dest, a); } +void vec3f_sub(Vec3f dest, Vec3f src) { + vec3_sub(dest, src); +} + /** * Convert float vector a to a short vector 'dest' by rounding the components * to the nearest integer. diff --git a/src/engine/math_util.h b/src/engine/math_util.h index 49b08830..416fab54 100644 --- a/src/engine/math_util.h +++ b/src/engine/math_util.h @@ -350,6 +350,7 @@ void vec3s_set(Vec3s dest, s16 x, s16 y, s16 z); void vec3s_add(Vec3s dest, Vec3s a); void vec3s_sum(Vec3s dest, Vec3s a, Vec3s b); void vec3s_sub(Vec3s dest, Vec3s a); +void vec3f_sub(Vec3f dest, Vec3f src); void vec3f_to_vec3s(Vec3s dest, Vec3f a); void find_vector_perpendicular_to_plane(Vec3f dest, Vec3f a, Vec3f b, Vec3f c); void vec3f_cross(Vec3f dest, Vec3f a, Vec3f b); diff --git a/src/engine/surface_collision.c b/src/engine/surface_collision.c index 6fcf28df..9a23100b 100644 --- a/src/engine/surface_collision.c +++ b/src/engine/surface_collision.c @@ -919,7 +919,7 @@ s32 unused_resolve_floor_or_ceil_collisions(s32 checkCeil, f32 *px, f32 *py, f32 nz = (*psurface)->normal.z; oo = (*psurface)->originOffset; - offset = nx * x + ny * y + nz * z + oo; + offset = (nx * x) + (ny * y) + (nz * z) + oo; distance = offset >= 0 ? offset : -offset; // Interesting surface interaction that should be surf type independent. diff --git a/src/engine/surface_load.c b/src/engine/surface_load.c index 0c38b3c0..d867c7e0 100644 --- a/src/engine/surface_load.c +++ b/src/engine/surface_load.c @@ -47,9 +47,6 @@ static struct SurfaceNode *alloc_surface_node(void) { node->next = NULL; - //! A bounds check! If there's more surface nodes than 7000 allowed, - // we, um... - // Perhaps originally just debug feedback? if (gSurfaceNodesAllocated >= SURFACE_NODE_POOL_SIZE) { gSurfacePoolError |= NOT_ENOUGH_ROOM_FOR_NODES; } @@ -66,9 +63,6 @@ static struct Surface *alloc_surface(void) { struct Surface *surface = &sSurfacePool[gSurfacesAllocated]; gSurfacesAllocated++; - //! A bounds check! If there's more surfaces than the 2300 allowed, - // we, um... - // Perhaps originally just debug feedback? if (gSurfacesAllocated >= sSurfacePoolSize) { gSurfacePoolError |= NOT_ENOUGH_ROOM_FOR_SURFACES; } diff --git a/src/game/behaviors/amp.inc.c b/src/game/behaviors/amp.inc.c index 1a63bbb2..89a22b7c 100644 --- a/src/game/behaviors/amp.inc.c +++ b/src/game/behaviors/amp.inc.c @@ -155,8 +155,6 @@ static void homing_amp_chase_loop(void) { * Give up on chasing Mario. */ static void homing_amp_give_up_loop(void) { - UNUSED u8 filler[8]; - // Move forward for 152 frames o->oForwardVel = 15.0f; diff --git a/src/game/behaviors/bbh_haunted_bookshelf.inc.c b/src/game/behaviors/bbh_haunted_bookshelf.inc.c index 8a7eff1d..6d1250fd 100644 --- a/src/game/behaviors/bbh_haunted_bookshelf.inc.c +++ b/src/game/behaviors/bbh_haunted_bookshelf.inc.c @@ -17,10 +17,6 @@ void bhv_haunted_bookshelf_loop(void) { switch (o->oAction) { case HAUNTED_BOOKSHELF_ACT_IDLE: - // ??? - if (o->oTimer == 0) { - } - // This code never runs, since the action is set to 1 directly // by bhvHauntedBookshelfManager. Maybe this was // intended to be used to set the action instead? diff --git a/src/game/behaviors/bobomb.inc.c b/src/game/behaviors/bobomb.inc.c index acffbafd..8acd1673 100644 --- a/src/game/behaviors/bobomb.inc.c +++ b/src/game/behaviors/bobomb.inc.c @@ -281,13 +281,12 @@ void bhv_bobomb_buddy_init(void) { void bobomb_buddy_act_idle(void) { s16 animFrame = o->header.gfx.animInfo.animFrame; - UNUSED s16 collisionFlags = 0; o->oBobombBuddyPosXCopy = o->oPosX; o->oBobombBuddyPosYCopy = o->oPosY; o->oBobombBuddyPosZCopy = o->oPosZ; - collisionFlags = object_step(); + object_step(); if ((animFrame == 5) || (animFrame == 16)) cur_obj_play_sound_2(SOUND_OBJ_BOBOMB_WALK); diff --git a/src/game/behaviors/boo.inc.c b/src/game/behaviors/boo.inc.c index 55fbe184..90a3c0c6 100644 --- a/src/game/behaviors/boo.inc.c +++ b/src/game/behaviors/boo.inc.c @@ -361,10 +361,7 @@ static void boo_chase_mario(f32 minDY, s16 yawIncrement, f32 mul) { } } else { o->oInteractType = 0; - // why is boo_stop not used here - o->oForwardVel = 0.0f; - o->oVelY = 0.0f; - o->oGravity = 0.0f; + boo_stop(); } } diff --git a/src/game/behaviors/bowser.inc.c b/src/game/behaviors/bowser.inc.c index a042f8bc..ee599086 100644 --- a/src/game/behaviors/bowser.inc.c +++ b/src/game/behaviors/bowser.inc.c @@ -661,7 +661,6 @@ void bowser_act_hit_mine(void) { } o->oBowserEyesShut = FALSE; // open eyes } - } else { } } @@ -749,7 +748,6 @@ void bowser_act_big_jump(void) { if (o->oBehParams2ndByte == BOWSER_BP_BITFS) { o->oAction = BOWSER_ACT_TILT_LAVA_PLATFORM; } - } else { } // Set to default action when the animation is over } else if (cur_obj_check_if_near_animation_end()) { diff --git a/src/game/behaviors/cannon.inc.c b/src/game/behaviors/cannon.inc.c index 277d0682..ff52180c 100644 --- a/src/game/behaviors/cannon.inc.c +++ b/src/game/behaviors/cannon.inc.c @@ -56,14 +56,12 @@ void opened_cannon_act_6(void) { o->oPosX += (f32)((o->oTimer / 2 & 1) - 0.5) * 4.0f; o->oPosZ += (f32)((o->oTimer / 2 & 1) - 0.5) * 4.0f; } else { - if (o->oTimer < 6) { - } else { + if (o->oTimer >= 6) { if (o->oTimer < 22) { o->oMoveAngleYaw = sins(o->oCannonAngle) * 0x4000 + ((s16)(o->oBehParams2ndByte << 8)); o->oCannonAngle += 0x400; - } else if (o->oTimer < 26) { - } else { + } else if (o->oTimer >= 26) { o->oCannonAngle = 0; o->oAction = 5; } @@ -74,14 +72,13 @@ void opened_cannon_act_6(void) { void opened_cannon_act_5(void) { if (o->oTimer == 0) cur_obj_play_sound_2(SOUND_OBJ_CANNON3); - if (o->oTimer < 4) { - } else { + if (o->oTimer >= 4) { if (o->oTimer < 20) { o->oCannonAngle += 0x400; o->oMoveAnglePitch = sins(o->oCannonAngle) * 0x2000; - } else if (o->oTimer < 25) { - } else + } else if (o->oTimer >= 25) { o->oAction = 1; + } } } diff --git a/src/game/behaviors/capswitch.inc.c b/src/game/behaviors/capswitch.inc.c index 3b400292..f3504522 100644 --- a/src/game/behaviors/capswitch.inc.c +++ b/src/game/behaviors/capswitch.inc.c @@ -1,7 +1,5 @@ // capswitch.c.inc -UNUSED u8 sCapSwitchText[] = { DIALOG_010, DIALOG_011, DIALOG_012 }; - void cap_switch_act_0(void) { o->oAnimState = o->oBehParams2ndByte; cur_obj_scale(0.5f); diff --git a/src/game/behaviors/clock_arm.inc.c b/src/game/behaviors/clock_arm.inc.c index 26ff8948..4c725bd9 100644 --- a/src/game/behaviors/clock_arm.inc.c +++ b/src/game/behaviors/clock_arm.inc.c @@ -40,7 +40,6 @@ void bhv_rotating_clock_arm_loop(void) { // Increment the action to stop animating the hands. o->oAction++; - } else { } } diff --git a/src/game/behaviors/controllable_platform.inc.c b/src/game/behaviors/controllable_platform.inc.c index 5d385b5b..376bddd3 100644 --- a/src/game/behaviors/controllable_platform.inc.c +++ b/src/game/behaviors/controllable_platform.inc.c @@ -144,7 +144,6 @@ void controllable_platform_tilt_from_mario(void) { o->oTimer = 0; o->header.gfx.node.flags &= ~GRAPH_RENDER_INVISIBLE; } - } else { } } diff --git a/src/game/behaviors/fish.inc.c b/src/game/behaviors/fish.inc.c index a6ce5499..4a064b70 100644 --- a/src/game/behaviors/fish.inc.c +++ b/src/game/behaviors/fish.inc.c @@ -158,7 +158,6 @@ static void fish_act_roam(void) { */ static void fish_act_flee(void) { f32 fishY = o->oPosY - gMarioObject->oPosY; - UNUSED s32 distance; o->oFishGoalY = gMarioObject->oPosY + o->oFishHeightOffset; // Initialize some variables when the flee action first starts. @@ -166,12 +165,6 @@ static void fish_act_flee(void) { o->oFishActiveDistance = random_float() * 300.0f; o->oFishYawVel = random_float() * 1024.0f + 1024.0f; o->oFishGoalVel = random_float() * 4.0f + 8.0f + 5.0f; - if (o->oDistanceToMario < 600.0f) { - distance = 1; - } else { - distance = (s32)(1.0 / (o->oDistanceToMario / 600.0)); - } - distance *= 127; cur_obj_play_sound_2(SOUND_GENERAL_MOVING_WATER); } diff --git a/src/game/behaviors/mips.inc.c b/src/game/behaviors/mips.inc.c index 6d10bc5a..aa4e4c75 100644 --- a/src/game/behaviors/mips.inc.c +++ b/src/game/behaviors/mips.inc.c @@ -77,10 +77,8 @@ s16 bhv_mips_find_furthest_waypoint_to_mario(void) { * Wait until Mario comes close, then resume following our path. */ void bhv_mips_act_wait_for_nearby_mario(void) { - UNUSED s16 collisionFlags = 0; - o->oForwardVel = 0.0f; - collisionFlags = object_step(); + object_step(); // If Mario is within 500 units... if (is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, 500)) { @@ -165,10 +163,8 @@ void bhv_mips_act_fall_down(void) { * Idle loop, after you catch MIPS and put him down. */ void bhv_mips_act_idle(void) { - UNUSED s16 collisionFlags = 0; - o->oForwardVel = 0; - collisionFlags = object_step(); + object_step(); // Spawn a star if he was just picked up for the first time. if (o->oMipsStarStatus == MIPS_STAR_STATUS_SHOULD_SPAWN_STAR) { diff --git a/src/game/behaviors/platform_on_track.inc.c b/src/game/behaviors/platform_on_track.inc.c index f33a1656..b43451f8 100644 --- a/src/game/behaviors/platform_on_track.inc.c +++ b/src/game/behaviors/platform_on_track.inc.c @@ -243,7 +243,6 @@ static void platform_on_track_act_fall(void) { */ static void platform_on_track_rock_ski_lift(void) { s32 targetRoll = 0; - UNUSED s32 initialRoll = o->oFaceAngleRoll; o->oFaceAngleRoll += (s32) o->oPlatformOnTrackSkiLiftRollVel; diff --git a/src/game/behaviors/seesaw_platform.inc.c b/src/game/behaviors/seesaw_platform.inc.c index 8c9e3b65..4822ec25 100644 --- a/src/game/behaviors/seesaw_platform.inc.c +++ b/src/game/behaviors/seesaw_platform.inc.c @@ -29,7 +29,6 @@ void bhv_seesaw_platform_init(void) { * Update function for bhvSeesawPlatform. */ void bhv_seesaw_platform_update(void) { - UNUSED s32 startPitch = o->oFaceAnglePitch; o->oFaceAnglePitch += (s32) o->oSeesawPlatformPitchVel; if (absf(o->oSeesawPlatformPitchVel) > 10.0f) { diff --git a/src/game/behaviors/ttc_pendulum.inc.c b/src/game/behaviors/ttc_pendulum.inc.c index b63282e2..569b4f15 100644 --- a/src/game/behaviors/ttc_pendulum.inc.c +++ b/src/game/behaviors/ttc_pendulum.inc.c @@ -78,7 +78,6 @@ void bhv_ttc_pendulum_update(void) { o->oTTCPendulumAngle += o->oTTCPendulumAngleVel; } - } else { } o->oFaceAngleRoll = (s32) o->oTTCPendulumAngle; diff --git a/src/game/behaviors/whomp.inc.c b/src/game/behaviors/whomp.inc.c index faa60853..fc3cae35 100644 --- a/src/game/behaviors/whomp.inc.c +++ b/src/game/behaviors/whomp.inc.c @@ -1,7 +1,6 @@ // whomp.c.inc void whomp_play_sfx_from_pound_animation(void) { - UNUSED s32 animFrame = o->header.gfx.animInfo.animFrame; s32 playSound = 0; if (o->oForwardVel < 5.0f) { playSound = cur_obj_check_anim_frame(0); @@ -115,8 +114,7 @@ void whomp_prepare_jump(void) { void whomp_jump(void) { if (o->oTimer == 0) o->oVelY = 40.0f; - if (o->oTimer < 8) { - } else { + if (o->oTimer >= 8) { o->oAngleVelPitch += 0x100; o->oFaceAnglePitch += o->oAngleVelPitch; if (o->oFaceAnglePitch > 0x4000) { diff --git a/src/game/behaviors/yoshi.inc.c b/src/game/behaviors/yoshi.inc.c index 38b26686..ec77889e 100644 --- a/src/game/behaviors/yoshi.inc.c +++ b/src/game/behaviors/yoshi.inc.c @@ -18,11 +18,10 @@ void bhv_yoshi_init(void) { } void yoshi_walk_loop(void) { - UNUSED s16 collisionFlags; s16 animFrame = o->header.gfx.animInfo.animFrame; o->oForwardVel = 10.0f; - collisionFlags = object_step(); + object_step(); o->oMoveAngleYaw = approach_s16_symmetric(o->oMoveAngleYaw, o->oYoshiTargetYaw, 0x500); if (is_point_close_to_object(o, o->oHomeX, 3174.0f, o->oHomeZ, 200)) o->oAction = YOSHI_ACT_IDLE; diff --git a/src/game/camera.c b/src/game/camera.c index 92dd9bc0..a467e0fa 100644 --- a/src/game/camera.c +++ b/src/game/camera.c @@ -110,11 +110,8 @@ u8 sFramesPaused; extern struct CameraFOVStatus sFOVState; extern struct TransitionInfo sModeTransition; extern struct PlayerGeometry sMarioGeometry; -extern s16 unusedFreeRoamWallYaw; extern s16 sAvoidYawVel; extern s16 sCameraYawAfterDoorCutscene; -extern s16 unusedSplinePitch; -extern s16 unusedSplineYaw; extern struct HandheldShakePoint sHandheldShakeSpline[4]; extern s16 sHandheldShakeMag; extern f32 sHandheldShakeTimer; @@ -172,7 +169,6 @@ struct CameraFOVStatus sFOVState; struct TransitionInfo sModeTransition; struct PlayerGeometry sMarioGeometry; struct Camera *gCamera; -s16 unusedFreeRoamWallYaw; s16 sAvoidYawVel; s16 sCameraYawAfterDoorCutscene; /** @@ -185,9 +181,6 @@ struct CutsceneSplinePoint sCurCreditsSplinePos[32]; */ struct CutsceneSplinePoint sCurCreditsSplineFocus[32]; -s16 unusedSplinePitch; -s16 unusedSplineYaw; - /** * The progress (from 0 to 1) through the current spline segment. * When it becomes >= 1, 1.0 is subtracted from it and sCutsceneSplineSegment is increased. @@ -418,10 +411,6 @@ u8 sCutsceneDialogResponse = DIALOG_RESPONSE_NONE; struct PlayerCameraState *sMarioCamState = &gPlayerCameraState[0]; struct PlayerCameraState *sLuigiCamState = &gPlayerCameraState[1]; Vec3f sFixedModeBasePosition = { 646.0f, 143.0f, -1513.0f }; -Vec3f sUnusedModeBasePosition_2 = { 646.0f, 143.0f, -1513.0f }; -Vec3f sUnusedModeBasePosition_3 = { 646.0f, 143.0f, -1513.0f }; -Vec3f sUnusedModeBasePosition_4 = { 646.0f, 143.0f, -1513.0f }; -Vec3f sUnusedModeBasePosition_5 = { 646.0f, 143.0f, -1513.0f }; s32 update_radial_camera(struct Camera *c, Vec3f, Vec3f); s32 update_outward_radial_camera(struct Camera *c, Vec3f, Vec3f); @@ -646,7 +635,6 @@ void unused_set_camera_pitch_shake_env(s16 shake) { void calc_y_to_curr_floor(f32 *posOff, f32 posMul, f32 posBound, f32 *focOff, f32 focMul, f32 focBound) { f32 floorHeight = sMarioGeometry.currFloorHeight; f32 waterHeight; - UNUSED s32 filler; if (!(sMarioCamState->action & ACT_FLAG_METAL_WATER)) { //! @bug this should use sMarioGeometry.waterHeight @@ -1584,11 +1572,6 @@ s32 update_boss_fight_camera(struct Camera *c, Vec3f focus, Vec3f pos) { : -gMarioStates[0].angleVel[1]); } - //! Unnecessary conditional, focusDistance is already bounded to 800 - if (focusDistance < 400.f) { - focusDistance = 400.f; - } - // Set C-Down distance and pitch. // C-Down will essentially double the distance from the center. // sLakituPitch approaches 33.75 degrees. @@ -1614,29 +1597,6 @@ u8 sDanceCutsceneTable[] = { FALSE, FALSE, FALSE, FALSE, TRUE, }; -/** - * Perhaps used by different dance cutscenes. - */ -struct UnusedDanceInfo { - Vec3f point; - f32 distTarget; - f32 distMultiplier; -}; - -struct UnusedDanceInfo unusedDanceInfo1 = { - {-3026.0f, 912.0f, -2148.0f}, - 600.0f, - 0.3f -}; - -u32 unusedDanceType = 0; -struct UnusedDanceInfo unusedDanceInfo2 = { - {-4676.0f, 917.0f, -3802.0f}, - 600.0f, - 0.3f -}; - - /** * Table that dictates camera movement in bookend room. * Due to only the X being varied in the table, this only moves along the X axis linearly. @@ -1652,9 +1612,6 @@ s32 unused_update_mode_5_camera(UNUSED struct Camera *c, UNUSED Vec3f focus, UNU return 0; } -UNUSED static void stub_camera_1(UNUSED s32 unused) { -} - void mode_boss_fight_camera(struct Camera *c) { c->nextYaw = update_boss_fight_camera(c, c->focus, c->pos); } @@ -1665,12 +1622,9 @@ void mode_boss_fight_camera(struct Camera *c) { * @see update_parallel_tracking_camera */ void mode_parallel_tracking_camera(struct Camera *c) { - s16 dummy; - radial_camera_input(c); set_fov_function(CAM_FOV_DEFAULT); c->nextYaw = update_parallel_tracking_camera(c, c->focus, c->pos); - camera_approach_s16_symmetric_bool(&dummy, 0, 0x0400); } /** @@ -2120,7 +2074,6 @@ s16 update_default_camera(struct Camera *c) { avoidStatus = rotate_camera_around_walls(c, cPos, &avoidYaw, 0x600); // If a wall is blocking the view of Mario, then rotate in the calculated direction if (avoidStatus == 3) { - unusedFreeRoamWallYaw = avoidYaw; sAvoidYawVel = yaw; sStatusFlags |= CAM_FLAG_COLLIDED_WITH_WALL; // Rotate to avoid the wall @@ -2581,9 +2534,6 @@ s32 update_c_up(UNUSED struct Camera *c, Vec3f focus, Vec3f pos) { * Make Mario's head move in C-Up mode. */ void move_mario_head_c_up(UNUSED struct Camera *c) { - UNUSED s16 pitch = sCUpCameraPitch; - UNUSED s16 yaw = sModeOffsetYaw; - sCUpCameraPitch += (s16)(gPlayer1Controller->stickY * 10.f); sModeOffsetYaw -= (s16)(gPlayer1Controller->stickX * 10.f); @@ -2773,8 +2723,7 @@ void set_camera_mode(struct Camera *c, s16 mode, s16 frames) { struct LinearTransitionPoint *start = &sModeInfo.transitionStart; struct LinearTransitionPoint *end = &sModeInfo.transitionEnd; - if (mode == CAMERA_MODE_WATER_SURFACE && gCurrLevelArea == AREA_TTM_OUTSIDE) { - } else { + if (!(mode == CAMERA_MODE_WATER_SURFACE) || !(gCurrLevelArea == AREA_TTM_OUTSIDE)) { // Clear movement flags that would affect the transition gCameraMovementFlags &= (u16)~(CAM_MOVE_RESTRICT | CAM_MOVE_ROTATE); gCameraMovementFlags |= CAM_MOVING_INTO_MODE; @@ -2828,20 +2777,10 @@ void update_lakitu(struct Camera *c) { f32 distToFloor; s16 newYaw; - if (gCameraMovementFlags & CAM_MOVE_PAUSE_SCREEN) { - } else { - if (c->cutscene) { - } - if (TRUE) { - newYaw = next_lakitu_state(newPos, newFoc, c->pos, c->focus, sOldPosition, sOldFocus, - c->nextYaw); - set_or_approach_s16_symmetric(&c->yaw, newYaw, sYawSpeed); - sStatusFlags &= ~CAM_FLAG_UNUSED_CUTSCENE_ACTIVE; - } else { - //! dead code, moved to next_lakitu_state() - vec3f_copy(newPos, c->pos); - vec3f_copy(newFoc, c->focus); - } + if (!(gCameraMovementFlags & CAM_MOVE_PAUSE_SCREEN)) { + newYaw = next_lakitu_state(newPos, newFoc, c->pos, c->focus, sOldPosition, sOldFocus, c->nextYaw); + set_or_approach_s16_symmetric(&c->yaw, newYaw, sYawSpeed); + sStatusFlags &= ~CAM_FLAG_UNUSED_CUTSCENE_ACTIVE; // Update old state vec3f_copy(sOldPosition, newPos); @@ -2976,7 +2915,6 @@ void update_camera(struct Camera *c) { #ifndef CAMERA_FIX camera_course_processing(c); #endif - stub_camera_3(c); sCButtonsPressed = find_c_buttons_pressed(sCButtonsPressed, gPlayer1Controller->buttonPressed, gPlayer1Controller->buttonDown); @@ -3083,7 +3021,6 @@ void update_camera(struct Camera *c) { #endif // Start any Mario-related cutscenes start_cutscene(c, get_cutscene_from_mario_status(c)); - stub_camera_2(c); gCheckingSurfaceCollisionsForCamera = FALSE; #ifdef PUPPYCAM if (!gPuppyCam.enabled || c->cutscene != 0 || gCurrentArea->camera->mode == CAMERA_MODE_INSIDE_CANNON) { @@ -3485,34 +3422,12 @@ Gfx *geo_camera_main(s32 callContext, struct GraphNode *g, void *context) { return NULL; } -void stub_camera_2(UNUSED struct Camera *c) { -} - -void stub_camera_3(UNUSED struct Camera *c) { -} - -void vec3f_sub(Vec3f dst, Vec3f src) { - dst[0] -= src[0]; - dst[1] -= src[1]; - dst[2] -= src[2]; -} - void object_pos_to_vec3f(Vec3f dst, struct Object *o) { - dst[0] = o->oPosX; - dst[1] = o->oPosY; - dst[2] = o->oPosZ; + vec3_copy(dst, &o->oPosVec); } void vec3f_to_object_pos(struct Object *o, Vec3f src) { - o->oPosX = src[0]; - o->oPosY = src[1]; - o->oPosZ = src[2]; -} - -void unused_object_angle_to_vec3s(Vec3s dst, struct Object *o) { - dst[0] = o->oMoveAnglePitch; - dst[1] = o->oMoveAngleYaw; - dst[2] = o->oMoveAngleRoll; + vec3_copy(&o->oPosVec, src); } /** @@ -3722,8 +3637,7 @@ void shake_camera_handheld(Vec3f pos, Vec3f focus) { Vec3f shakeOffset; Vec3f shakeSpline[4]; f32 dist; - s16 pitch; - s16 yaw; + s16 pitch, yaw; if (sHandheldShakeMag == 0) { vec3f_set(shakeOffset, 0.f, 0.f, 0.f); @@ -3842,9 +3756,7 @@ s32 update_camera_hud_status(struct Camera *c) { s32 collide_with_walls(Vec3f pos, f32 offsetY, f32 radius) { struct WallCollisionData collisionData; struct Surface *wall = NULL; - f32 normX; - f32 normY; - f32 normZ; + f32 normX, normY, normZ; f32 originOffset; f32 offset; f32 offsetAbsolute; @@ -4160,9 +4072,7 @@ f32 camera_approach_f32_symmetric(f32 current, f32 target, f32 increment) { */ void random_vec3s(Vec3s dst, s16 xRange, s16 yRange, s16 zRange) { f32 randomFloat; - f32 tempXRange; - f32 tempYRange; - f32 tempZRange; + f32 tempXRange, tempYRange, tempZRange; randomFloat = random_float(); tempXRange = xRange; @@ -4186,10 +4096,8 @@ void random_vec3s(Vec3s dst, s16 xRange, s16 yRange, s16 zRange) { s16 reduce_by_dist_from_camera(s16 value, f32 maxDist, f32 posX, f32 posY, f32 posZ) { Vec3f pos; f32 dist; - s16 pitch; - s16 yaw; - s16 goalPitch; - s16 goalYaw; + s16 pitch, yaw; + s16 goalPitch, goalYaw; s16 result = 0; // Direction from pos to (Lakitu's) goalPos f32 goalDX = gLakituState.goalPos[0] - posX; @@ -4277,19 +4185,14 @@ s32 calc_avoid_yaw(s16 yawFromMario, s16 wallYaw) { */ s32 is_surf_within_bounding_box(struct Surface *surf, f32 xMax, f32 yMax, f32 zMax) { // Surface vertex coordinates - Vec3s sx; - Vec3s sy; - Vec3s sz; + Vec3s sx, sy, sz; // Max delta between x, y, and z s16 dxMax = 0; s16 dyMax = 0; s16 dzMax = 0; // Current deltas between x, y, and z - f32 dx; - f32 dy; - f32 dz; - s32 i; - s32 j; + f32 dx, dy, dz; + s32 i, j; // result s32 smaller = FALSE; @@ -4432,16 +4335,13 @@ s16 calculate_pitch(Vec3f from, Vec3f to) { f32 dy = to[1] - from[1]; f32 dz = to[2] - from[2]; s16 pitch = atan2s(sqrtf(sqr(dx) + sqr(dz)), dy); - return pitch; } s16 calculate_yaw(Vec3f from, Vec3f to) { f32 dx = to[0] - from[0]; - UNUSED f32 dy = to[1] - from[1]; f32 dz = to[2] - from[2]; s16 yaw = atan2s(dz, dx); - return yaw; } @@ -4871,8 +4771,6 @@ s32 trigger_cutscene_dialog(s32 trigger) { if (trigger == 1) { start_object_cutscene_without_focus(CUTSCENE_READ_MESSAGE); } - if (trigger == 2) { - } return result; } @@ -5032,8 +4930,7 @@ u8 get_cutscene_from_mario_status(struct Camera *c) { //! doorStatus is never DOOR_ENTER_LOBBY when cameraEvent == 6, because //! doorStatus is only used for the star door in the lobby, which uses //! ACT_ENTERING_STAR_DOOR - if (c->mode == CAMERA_MODE_SPIRAL_STAIRS || c->mode == CAMERA_MODE_CLOSE - || c->doorStatus == DOOR_ENTER_LOBBY) { + if (c->mode == CAMERA_MODE_SPIRAL_STAIRS || c->mode == CAMERA_MODE_CLOSE || c->doorStatus == DOOR_ENTER_LOBBY) { cutscene = open_door_cutscene(CUTSCENE_DOOR_PULL_MODE, CUTSCENE_DOOR_PUSH_MODE); } else { cutscene = open_door_cutscene(CUTSCENE_DOOR_PULL, CUTSCENE_DOOR_PUSH); @@ -5194,9 +5091,6 @@ void approach_camera_height(struct Camera *c, f32 goal, f32 inc) { } } -void stub_camera_4(UNUSED s32 a, UNUSED s32 b, UNUSED s32 c, UNUSED s32 d) { -} - /** * Set the camera's focus to Mario's position, and add several relative offsets. * @@ -5298,14 +5192,10 @@ s16 next_lakitu_state(Vec3f newPos, Vec3f newFoc, Vec3f curPos, Vec3f curFoc, s16 pitchVelocity; f32 distVelocity; f32 goalDist; - UNUSED f32 unusedDist; s16 goalPitch; s16 goalYaw; - UNUSED s16 unusedPitch; - UNUSED s16 unusedYaw; f32 distTimer = sModeTransition.framesLeft; s16 angleTimer = sModeTransition.framesLeft; - UNUSED s16 inTransition = 0; Vec3f nextPos; Vec3f nextFoc; Vec3f startPos; @@ -5336,8 +5226,6 @@ s16 next_lakitu_state(Vec3f newPos, Vec3f newFoc, Vec3f curPos, Vec3f curFoc, // Transition from the last mode to the current one if (sModeTransition.framesLeft > 0) { - inTransition = 1; - vec3f_get_dist_and_angle(curFoc, curPos, &goalDist, &goalPitch, &goalYaw); distVelocity = ABS(goalDist - sModeTransition.posDist) / distTimer; pitchVelocity = ABS(goalPitch - sModeTransition.posPitch) / angleTimer; @@ -5593,8 +5481,6 @@ void cam_sl_free_roam(struct Camera *c) { * Warps the camera underneath the floor, used in HMC to move under the elevator platforms */ void move_camera_through_floor_while_descending(struct Camera *c, f32 height) { - UNUSED f32 pad; - if ((sMarioGeometry.currFloorHeight < height - 100.f) && (sMarioGeometry.prevFloorHeight > sMarioGeometry.currFloorHeight)) { c->pos[1] = height - 400.f; @@ -7021,7 +6907,6 @@ void retrieve_info_star(struct Camera *c) { * Rotate the camera's focus around the camera's position by incYaw and incPitch */ void pan_camera(struct Camera *c, s16 incPitch, s16 incYaw) { - UNUSED Vec3f unused1; f32 distCamToFocus; s16 pitch, yaw; @@ -7069,9 +6954,6 @@ void cutscene_unsoften_music(UNUSED struct Camera *c) { seq_player_unlower_volume(SEQ_PLAYER_LEVEL, 60); } -UNUSED static void stub_camera_5(UNUSED struct Camera *c) { -} - void cutscene_unused_start(UNUSED struct Camera *c) { } @@ -7279,9 +7161,8 @@ void cutscene_ending_kiss_here_we_go(struct Camera *c) { set_fov_function(CAM_FOV_DEFAULT); vec3f_set(foc, 233.f, 1068.f, -1298.f); vec3f_set(pos, -250.f, 966.f, -1111.f); - //! another double typo - approach_vec3f_asymptotic(c->pos, pos, 0.2, 0.1f, 0.2f); - approach_vec3f_asymptotic(c->focus, foc, 0.2, 0.1f, 0.2f); + approach_vec3f_asymptotic(c->pos, pos, 0.2f, 0.1f, 0.2f); + approach_vec3f_asymptotic(c->focus, foc, 0.2f, 0.1f, 0.2f); } /** @@ -9274,9 +9155,6 @@ void cutscene_unlock_key_door_focus_lock(UNUSED struct Camera *c) { approach_f32_asymptotic_bool(&sCutsceneVars[3].point[1], sMarioCamState->pos[1] + 140.f, 0.07f); } -void cutscene_unlock_key_door_stub(UNUSED struct Camera *c) { -} - /** * Move back to the previous pos and focus, stored in cvar0 and cvar1. */ @@ -9301,7 +9179,6 @@ void cutscene_unlock_key_door(UNUSED struct Camera *c) { cutscene_event(cutscene_unlock_key_door_fly_back, c, 124, -1); cutscene_event(cutscene_unlock_key_door_fov_shake, c, 79, 79); cutscene_event(cutscene_unlock_key_door_focus_lock, c, 70, 110); - cutscene_event(cutscene_unlock_key_door_stub, c, 112, 112); } /** @@ -9671,16 +9548,8 @@ void cutscene_credits(struct Camera *c) { focus = sDddSubCreditsSplineFocus; break; case AREA_CCM_OUTSIDE: - //! Checks if the "Snowman's Lost His Head" star was collected. The credits likely would - //! have avoided the snowman if the player didn't collect that star, but in the end the - //! developers decided against it. - if (save_file_get_star_flags(gCurrSaveFileNum - 1, gCurrCourseNum - 1) & 0x10) { - pos = sCcmOutsideCreditsSplinePositions; - focus = sCcmOutsideCreditsSplineFocus; - } else { - pos = sCcmOutsideCreditsSplinePositions; - focus = sCcmOutsideCreditsSplineFocus; - } + pos = sCcmOutsideCreditsSplinePositions; + focus = sCcmOutsideCreditsSplineFocus; break; default: pos = sCcmOutsideCreditsSplinePositions; @@ -9786,9 +9655,6 @@ void cutscene_double_doors_end(struct Camera *c) { sStatusFlags |= CAM_FLAG_SMOOTH_MOVEMENT; } -void cutscene_enter_painting_stub(UNUSED struct Camera *c) { -} - /** * Plays when Mario enters a painting. The camera flies up to the painting's center, then it slowly * zooms in until the star select screen appears. @@ -9799,7 +9665,6 @@ void cutscene_enter_painting(struct Camera *c) { Vec3s paintingAngle; f32 floorHeight; - cutscene_event(cutscene_enter_painting_stub, c, 0, 0); // Zoom in set_fov_function(CAM_FOV_APP_20); sStatusFlags |= CAM_FLAG_SMOOTH_MOVEMENT; @@ -9938,8 +9803,6 @@ void cutscene_exit_painting(struct Camera *c) { * Unused. Warp the camera to Mario. */ void cutscene_unused_exit_start(struct Camera *c) { - UNUSED Vec3f unused1; - UNUSED Vec3s unused2; Vec3f offset; Vec3s marioAngle; @@ -10032,8 +9895,6 @@ void cutscene_enter_cannon_raise(struct Camera *c) { * Start the cannon entering cutscene */ void cutscene_enter_cannon_start(struct Camera *c) { - UNUSED u32 cvar3Start; - UNUSED u32 cvar4Start; struct Object *o; sStatusFlags |= CAM_FLAG_SMOOTH_MOVEMENT; @@ -11142,11 +11003,6 @@ void fov_default(struct MarioState *m) { } } -//??! Literally the exact same as below -static UNUSED void unused_approach_fov_30(UNUSED struct MarioState *m) { - camera_approach_f32_symmetric_bool(&sFOVState.fov, 30.f, 1.f); -} - void approach_fov_30(UNUSED struct MarioState *m) { camera_approach_f32_symmetric_bool(&sFOVState.fov, 30.f, 1.f); } diff --git a/src/game/camera.h b/src/game/camera.h index 5ad8169f..da826ee4 100644 --- a/src/game/camera.h +++ b/src/game/camera.h @@ -686,9 +686,6 @@ void reset_camera(struct Camera *c); void init_camera(struct Camera *c); void select_mario_cam_mode(void); Gfx *geo_camera_main(s32 callContext, struct GraphNode *g, void *context); -void stub_camera_2(UNUSED struct Camera *c); -void stub_camera_3(UNUSED struct Camera *c); -void vec3f_sub(Vec3f dst, Vec3f src); void object_pos_to_vec3f(Vec3f dst, struct Object *o); void vec3f_to_object_pos(struct Object *o, Vec3f src); s32 move_point_along_spline(Vec3f p, struct CutsceneSplinePoint spline[], s16 *splineSegment, f32 *progress); diff --git a/src/game/debug.c b/src/game/debug.c index 4b240b12..58e38d72 100644 --- a/src/game/debug.c +++ b/src/game/debug.c @@ -57,34 +57,17 @@ s8 sDebugSysCursor = 0; s8 sDebugInfoButtonSeqID = 0; s16 sDebugInfoButtonSeq[] = { U_CBUTTONS, L_CBUTTONS, D_CBUTTONS, R_CBUTTONS, -1 }; -// most likely present in an ifdef DEBUG build. TODO: check DD version? -void stub_debug_1(void) { -} - -void stub_debug_2(void) { -} - -void stub_debug_3(void) { -} - -void stub_debug_4(void) { -} - /* * These 2 functions are called from the object list processor in regards to cycle * counts. They likely have stubbed out code that calculated the clock count and * its difference for consecutive calls. */ s64 get_current_clock(void) { - s64 wtf = 0; - - return wtf; + return 0; } -s64 get_clock_difference(UNUSED s64 arg0) { - s64 wtf = 0; - - return wtf; +s64 get_clock_difference(UNUSED s64 cycles) { + return 0; } /* diff --git a/src/game/envfx_bubbles.c b/src/game/envfx_bubbles.c index b313f9f2..18a30e09 100644 --- a/src/game/envfx_bubbles.c +++ b/src/game/envfx_bubbles.c @@ -148,11 +148,6 @@ void envfx_update_lava(Vec3s centerPos) { s32 i; s32 timer = gGlobalTimer; s8 chance; - UNUSED s16 centerX, centerY, centerZ; - - centerX = centerPos[0]; - centerY = centerPos[1]; - centerZ = centerPos[2]; for (i = 0; i < sBubbleParticleMaxCount; i++) { if ((gEnvFxBuffer + i)->isAlive == 0) { @@ -260,8 +255,6 @@ void envfx_update_whirlpool(void) { * 1000 units away from the source or 1500 units above it. */ s32 envfx_is_jestream_bubble_alive(s32 index) { - UNUSED s32 unk; - if (!particle_is_laterally_close(index, gEnvFxBubbleConfig[ENVFX_STATE_SRC_X], gEnvFxBubbleConfig[ENVFX_STATE_SRC_Z], 1000) || gEnvFxBubbleConfig[ENVFX_STATE_SRC_Y] + 1500 < (gEnvFxBuffer + index)->yPos) { diff --git a/src/game/game_init.c b/src/game/game_init.c index 37b96c29..3471a325 100644 --- a/src/game/game_init.c +++ b/src/game/game_init.c @@ -73,9 +73,6 @@ void *gDemoInputsMemAlloc; struct DmaHandlerList gMarioAnimsBuf; struct DmaHandlerList gDemoInputsBuf; -// fillers -UNUSED static u8 sfillerGameInit[0x90]; - // General timer that runs as the game starts u32 gGlobalTimer = 0; u8 *gAreaSkyboxStart[AREA_COUNT]; diff --git a/src/game/ingame_menu.c b/src/game/ingame_menu.c index fe8a92f4..faa78bc2 100644 --- a/src/game/ingame_menu.c +++ b/src/game/ingame_menu.c @@ -573,19 +573,14 @@ void handle_menu_scrolling(s8 scrollDirection, s8 *currentIndex, s8 minIndex, s8 } if (((index ^ gMenuHoldKeyIndex) & index) == 2) { - if (currentIndex[0] == maxIndex) { - //! Probably originally a >=, but later replaced with an == and an else statement. - currentIndex[0] = maxIndex; - } else { + if (currentIndex[0] != maxIndex) { play_sound(SOUND_MENU_CHANGE_SELECT, gGlobalSoundSource); currentIndex[0]++; } } if (((index ^ gMenuHoldKeyIndex) & index) == 1) { - if (currentIndex[0] == minIndex) { - // Same applies to here as above - } else { + if (currentIndex[0] != minIndex) { play_sound(SOUND_MENU_CHANGE_SELECT, gGlobalSoundSource); currentIndex[0]--; } @@ -813,8 +808,7 @@ void change_and_flash_dialog_text_color_lines(s8 colorMode, s8 lineNum, u8 *cust #define X_VAL3 0.0f #define Y_VAL3 16 -void handle_dialog_scroll_page_state(s8 lineNum, s8 totalLines, s8 *pageState, s8 *xMatrix, s16 *linePos) -{ +void handle_dialog_scroll_page_state(s8 lineNum, s8 totalLines, s8 *pageState, s8 *xMatrix, s16 *linePos) { gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW); if (lineNum == totalLines) { @@ -828,8 +822,7 @@ void handle_dialog_scroll_page_state(s8 lineNum, s8 totalLines, s8 *pageState, s } -void render_star_count_dialog_text(s8 *xMatrix, s16 *linePos) -{ +void render_star_count_dialog_text(s8 *xMatrix, s16 *linePos) { s8 tensDigit = gDialogVariable / 10; s8 onesDigit = gDialogVariable - (tensDigit * 10); // remainder @@ -843,9 +836,6 @@ void render_star_count_dialog_text(s8 *xMatrix, s16 *linePos) xMatrix[0] = 1; linePos[0]++; } - else { - } - if (xMatrix[0] != 1) { create_dl_translation_matrix(MENU_MTX_NOPUSH, (f32)(gDialogCharWidths[DIALOG_CHAR_SPACE] * (xMatrix[0] - 1)), 0, 0); @@ -858,8 +848,7 @@ void render_star_count_dialog_text(s8 *xMatrix, s16 *linePos) xMatrix[0] = 1; } -void render_multi_text_string_lines(s8 multiTextId, s8 lineNum, s16 *linePos, s8 linesPerBox, s8 xMatrix, s8 lowerBound) -{ +void render_multi_text_string_lines(s8 multiTextId, s8 lineNum, s16 *linePos, s8 linesPerBox, s8 xMatrix, s8 lowerBound) { s8 i; struct MultiTextEntry textLengths[2] = { { 3, { TEXT_THE_RAW } }, @@ -2038,8 +2027,7 @@ void play_star_fanfare_and_flash_hud(s32 arg, u8 starNum) { void render_course_complete_lvl_info_and_hud_str(void) { u8 textCourse[] = { TEXT_COURSE }; - UNUSED u8 textCatch[] = { TEXT_CATCH }; // unused in US - UNUSED u8 textClear[] = { TEXT_CLEAR }; + u8 textClear[] = { TEXT_CLEAR }; u8 textSymStar[] = { GLYPH_STAR, GLYPH_SPACE }; void **actNameTbl; diff --git a/src/game/interaction.c b/src/game/interaction.c index 9c9feef8..cf82c5c5 100644 --- a/src/game/interaction.c +++ b/src/game/interaction.c @@ -301,11 +301,8 @@ void mario_drop_held_object(struct MarioState *m) { obj_set_held_state(m->heldObj, bhvCarrySomethingDropped); - // ! When dropping an object instead of throwing it, it will be put at Mario's - // y-positon instead of the HOLP's y-position. This fact is often exploited when - // cloning objects. m->heldObj->oPosX = m->marioBodyState->heldObjLastPosition[0]; - m->heldObj->oPosY = m->pos[1]; + m->heldObj->oPosY = m->marioBodyState->heldObjLastPosition[1]; m->heldObj->oPosZ = m->marioBodyState->heldObjLastPosition[2]; m->heldObj->oMoveAngleYaw = m->faceAngle[1]; @@ -454,7 +451,6 @@ u32 bully_knock_back_mario(struct MarioState *mario) { s16 newMarioYaw; s16 newBullyYaw; s16 marioDYaw; - UNUSED s16 bullyDYaw; u32 bonkAction = 0; @@ -481,7 +477,6 @@ u32 bully_knock_back_mario(struct MarioState *mario) { newBullyYaw = atan2s(bullyData.velZ, bullyData.velX); marioDYaw = newMarioYaw - mario->faceAngle[1]; - bullyDYaw = newBullyYaw - bully->oMoveAngleYaw; mario->faceAngle[1] = newMarioYaw; mario->forwardVel = sqrtf(marioData.velX * marioData.velX + marioData.velZ * marioData.velZ); diff --git a/src/game/level_update.c b/src/game/level_update.c index b535342e..a39343bb 100644 --- a/src/game/level_update.c +++ b/src/game/level_update.c @@ -243,9 +243,6 @@ void fade_into_special_warp(u32 arg, u32 color) { warp_special(arg); } -void stub_level_update_1(void) { -} - void load_level_init_text(u32 arg) { s32 gotAchievement; u32 dialogID = gCurrentArea->dialog[arg]; diff --git a/src/game/macro_special_objects.c b/src/game/macro_special_objects.c index 08b62274..3ee3a1cc 100644 --- a/src/game/macro_special_objects.c +++ b/src/game/macro_special_objects.c @@ -80,9 +80,7 @@ void spawn_macro_abs_special(s32 model, const BehaviorScript *behavior, s16 x, s UNUSED static void spawn_macro_coin_unknown(const BehaviorScript *behavior, s16 a1[]) { struct Object *obj; - s16 model; - - model = bhvYellowCoin == behavior ? MODEL_YELLOW_COIN : MODEL_NONE; + ModelID model = bhvYellowCoin == behavior ? MODEL_YELLOW_COIN : MODEL_NONE; obj = spawn_object_abs_with_rot(&gMacroObjectDefaultParent, 0, model, behavior, a1[1], a1[2], a1[3], 0, convert_rotation(a1[0]), 0); @@ -104,7 +102,6 @@ struct LoadedPreset { #define MACRO_OBJ_PARAMS 4 void spawn_macro_objects(s32 areaIndex, s16 *macroObjList) { - UNUSED u32 pad5C; s32 presetID; s16 macroObject[5]; // see the 5 #define statements above @@ -267,10 +264,6 @@ void spawn_special_objects(s32 areaIndex, TerrainData **specialObjList) { if (SpecialObjectPresets[offset].preset_id == presetID) { break; } - - if (SpecialObjectPresets[offset].preset_id == 0xFF) { - } - offset++; } diff --git a/src/game/mario.c b/src/game/mario.c index 7bdb88db..c8a8623b 100644 --- a/src/game/mario.c +++ b/src/game/mario.c @@ -1040,8 +1040,6 @@ s32 set_jump_from_landing(struct MarioState *m) { * either a quicksand or steep jump. */ s32 set_jumping_action(struct MarioState *m, u32 action, u32 actionArg) { - UNUSED u32 currAction = m->action; - if (m->quicksandDepth >= 11.0f) { // Checks whether Mario is holding an object or not. if (m->heldObj == NULL) { diff --git a/src/game/mario_actions_cutscene.c b/src/game/mario_actions_cutscene.c index 67f5b01f..a10ed013 100644 --- a/src/game/mario_actions_cutscene.c +++ b/src/game/mario_actions_cutscene.c @@ -212,13 +212,6 @@ Gfx *geo_switch_peach_eyes(s32 callContext, struct GraphNode *node, UNUSED s32 c return NULL; } -// unused -UNUSED static void stub_is_textbox_active(u16 *arg) { - if (get_dialog_id() == DIALOG_NONE) { - *arg = 0; - } -} - /** * get_star_collection_dialog: Determine what dialog should show when Mario * collects a star. @@ -1479,7 +1472,6 @@ s32 act_shocked(struct MarioState *m) { } s32 act_squished(struct MarioState *m) { - UNUSED s32 pad; f32 squishAmount; f32 spaceUnderCeil; s16 surfAngle; diff --git a/src/game/mario_step.c b/src/game/mario_step.c index b500f5d5..7be63e66 100644 --- a/src/game/mario_step.c +++ b/src/game/mario_step.c @@ -59,8 +59,9 @@ void transfer_bully_speed(struct BullyCollisionData *obj1, struct BullyCollision f32 rz = obj2->posZ - obj1->posZ; //! Bully NaN crash - f32 projectedV1 = (rx * obj1->velX + rz * obj1->velZ) / (rx * rx + rz * rz); - f32 projectedV2 = (-rx * obj2->velX - rz * obj2->velZ) / (rx * rx + rz * rz); + f32 rzx = (sqr(rx) + sqr(rz)); + f32 projectedV1 = ( rx * obj1->velX + rz * obj1->velZ) / rzx; + f32 projectedV2 = (-rx * obj2->velX - rz * obj2->velZ) / rzx; // Kill speed along r. Convert one object's speed along r and transfer it to // the other object. diff --git a/src/game/mario_step.h b/src/game/mario_step.h index 5cfcb1a4..792445c0 100644 --- a/src/game/mario_step.h +++ b/src/game/mario_step.h @@ -17,20 +17,20 @@ struct BullyCollisionData { extern struct Surface gWaterSurfacePseudoFloor; f32 get_additive_y_vel_for_jumps(void); -void stub_mario_step_1(struct MarioState *); +void stub_mario_step_1(struct MarioState *m); void stub_mario_step_2(void); -void mario_bonk_reflection(struct MarioState *, u32); +void mario_bonk_reflection(struct MarioState *m, u32 negateSpeed); void transfer_bully_speed(struct BullyCollisionData *obj1, struct BullyCollisionData *obj2); void init_bully_collision_data(struct BullyCollisionData *data, f32 posX, f32 posZ, f32 forwardVel, s16 yaw, f32 conversionRatio, f32 radius); -u32 mario_update_quicksand(struct MarioState *, f32); -u32 mario_push_off_steep_floor(struct MarioState *, u32, u32); -u32 mario_update_moving_sand(struct MarioState *); -u32 mario_update_windy_ground(struct MarioState *); -void stop_and_set_height_to_floor(struct MarioState *); -s32 stationary_ground_step(struct MarioState *); -s32 perform_ground_step(struct MarioState *); -s32 perform_air_step(struct MarioState *, u32); +u32 mario_update_quicksand(struct MarioState *m, f32 sinkingSpeed); +u32 mario_push_off_steep_floor(struct MarioState *m, u32 action, u32 actionArg); +u32 mario_update_moving_sand(struct MarioState *m); +u32 mario_update_windy_ground(struct MarioState *m); +void stop_and_set_height_to_floor(struct MarioState *m); +s32 stationary_ground_step(struct MarioState *m); +s32 perform_ground_step(struct MarioState *m); +s32 perform_air_step(struct MarioState *m, u32 stepArg); #endif // MARIO_STEP_H diff --git a/src/game/obj_behaviors.c b/src/game/obj_behaviors.c index 81e9391e..f727dfb1 100644 --- a/src/game/obj_behaviors.c +++ b/src/game/obj_behaviors.c @@ -590,8 +590,6 @@ s8 obj_check_if_facing_toward_angle(u32 base, u32 goal, s16 range) { */ s8 obj_find_wall_displacement(Vec3f dist, f32 x, f32 y, f32 z, f32 radius) { struct WallCollisionData hitbox; - UNUSED u8 filler[0x20]; - hitbox.x = x; hitbox.y = y; hitbox.z = z; diff --git a/src/game/object_helpers.c b/src/game/object_helpers.c index 6f2e6af6..aad068a5 100644 --- a/src/game/object_helpers.c +++ b/src/game/object_helpers.c @@ -442,11 +442,11 @@ struct Object *spawn_object_abs_with_rot(struct Object *parent, s16 uselessArg, * a copy-paste typo by one of the programmers. */ struct Object *spawn_object_rel_with_rot(struct Object *parent, u32 model, const BehaviorScript *behavior, - s16 xOff, s16 yOff, s16 zOff, s16 rx, s16 ry, UNUSED s16 rz) { + s16 xOff, s16 yOff, s16 zOff, s16 rx, s16 ry, s16 rz) { struct Object *newObj = spawn_object_at_origin(parent, 0, model, behavior); newObj->oFlags |= OBJ_FLAG_TRANSFORM_RELATIVE_TO_PARENT; obj_set_parent_relative_pos(newObj, xOff, yOff, zOff); - obj_set_angle(newObj, rx, ry, zOff); // Nice typo you got there Nintendo. + obj_set_angle(newObj, rx, ry, rz); return newObj; } @@ -1062,10 +1062,8 @@ static void cur_obj_move_after_thrown_or_dropped(f32 forwardVel, f32 velY) { void cur_obj_get_thrown_or_placed(f32 forwardVel, f32 velY, s32 thrownAction) { if (o->behavior == segmented_to_virtual(bhvBowser)) { - // Interestingly, when bowser is thrown, he is offset slightly to - // Mario's right + // Interestingly, when bowser is thrown, he is offset slightly to Mario's right cur_obj_set_pos_relative_to_parent(-41.684f, 85.859f, 321.577f); - } else { } cur_obj_become_tangible(); @@ -1352,9 +1350,6 @@ void cur_obj_move_y(f32 gravity, f32 bounciness, f32 buoyancy) { } } -UNUSED static void stub_obj_helpers_1(void) { -} - static s32 clear_move_flag(u32 *bitSet, s32 flag) { if (*bitSet & flag) { *bitSet &= flag ^ 0xFFFFFFFF; @@ -2198,9 +2193,6 @@ void bhv_dust_smoke_loop(void) { o->oSmokeTimer++; } -UNUSED static void stub_obj_helpers_2(void) { -} - s32 cur_obj_set_direction_table(s8 *pattern) { o->oToxBoxMovementPattern = pattern; o->oToxBoxMovementStep = 0; @@ -2224,9 +2216,6 @@ s32 cur_obj_progress_direction_table(void) { return action; } -void stub_obj_helpers_3(UNUSED s32 sp0, UNUSED s32 sp4) { -} - void cur_obj_scale_over_time(s32 axis, s32 times, f32 start, f32 end) { f32 dist = end - start; f32 curr = (f32) o->oTimer / times; @@ -2251,9 +2240,6 @@ void cur_obj_set_pos_to_home_with_debug(void) { cur_obj_scale(gDebugInfo[5][3] / 100.0f + 1.0l); } -void stub_obj_helpers_4(void) { -} - s32 cur_obj_is_mario_on_platform(void) { if (gMarioObject->platform == o) { return TRUE; @@ -2341,9 +2327,6 @@ s32 is_item_in_array(s8 item, s8 *array) { return FALSE; } -UNUSED static void stub_obj_helpers_5(void) { -} - void bhv_init_room(void) { struct Surface *floor; f32 floorHeight; @@ -2501,12 +2484,8 @@ void clear_time_stop_flags(s32 flags) { s32 cur_obj_can_mario_activate_textbox(f32 radius, f32 height, UNUSED s32 unused) { if (o->oDistanceToMario < 1500.0f) { - f32 latDistToMario = lateral_dist_between_objects(o, gMarioObject); - UNUSED s16 angleFromMario = obj_angle_to_object(gMarioObject, o); - - if (latDistToMario < radius && o->oPosY < gMarioObject->oPosY + 160.0f - && gMarioObject->oPosY < o->oPosY + height && !(gMarioStates[0].action & ACT_FLAG_AIR) - && mario_ready_to_speak()) { + if (o->oPosY < gMarioObject->oPosY + 160.0f && gMarioObject->oPosY < o->oPosY + height && !(gMarioStates[0].action & ACT_FLAG_AIR) + && lateral_dist_between_objects(o, gMarioObject) < radius && mario_ready_to_speak()) { return TRUE; } } @@ -2530,7 +2509,6 @@ static void cur_obj_end_dialog(s32 dialogFlags, s32 dialogResult) { s32 cur_obj_update_dialog(s32 actionArg, s32 dialogFlags, s32 dialogID, UNUSED s32 unused) { s32 dialogResponse = DIALOG_RESPONSE_NONE; - UNUSED s32 doneTurning = TRUE; switch (o->oDialogState) { case DIALOG_STATUS_ENABLE_TIME_STOP: diff --git a/src/game/object_helpers.h b/src/game/object_helpers.h index e9a59552..7040dcfa 100644 --- a/src/game/object_helpers.h +++ b/src/game/object_helpers.h @@ -82,7 +82,7 @@ struct Object *spawn_object_abs_with_rot(struct Object *parent, s16 uselessArg, const BehaviorScript *behavior, s16 x, s16 y, s16 z, s16 rx, s16 ry, s16 rz); struct Object *spawn_object_rel_with_rot(struct Object *parent, u32 model, const BehaviorScript *behavior, - s16 xOff, s16 yOff, s16 zOff, s16 rx, s16 ry, UNUSED s16 rz); + s16 xOff, s16 yOff, s16 zOff, s16 rx, s16 ry, s16 rz); struct Object *spawn_obj_with_transform_flags(struct Object *sp20, s32 model, const BehaviorScript *behavior); struct Object *spawn_water_droplet(struct Object *parent, struct WaterDropletParams *params); struct Object *spawn_object_at_origin(struct Object *, s32, u32, const BehaviorScript *); @@ -234,7 +234,6 @@ void cur_obj_push_mario_away(f32 radius); void cur_obj_push_mario_away_from_cylinder(f32 radius, f32 extentY); s32 cur_obj_set_direction_table(s8 *a0); s32 cur_obj_progress_direction_table(void); -void stub_obj_helpers_3(UNUSED s32 sp0, UNUSED s32 sp4); void cur_obj_scale_over_time(s32 axis, s32 times, f32 start, f32 end); void cur_obj_set_pos_to_home_with_debug(void); s32 cur_obj_is_mario_on_platform(void); diff --git a/src/game/object_list_processor.c b/src/game/object_list_processor.c index 0c9bc844..267f8afb 100644 --- a/src/game/object_list_processor.c +++ b/src/game/object_list_processor.c @@ -515,9 +515,6 @@ void spawn_objects_from_info(UNUSED s32 unused, struct SpawnInfo *spawnInfo) { } } -void stub_obj_list_processor_1(void) { -} - /** * Clear objects, dynamic surfaces, and some miscellaneous level data used by objects. */ @@ -539,9 +536,6 @@ void clear_objects(void) { init_free_object_list(); clear_object_lists(gObjectListArray); - stub_behavior_script_2(); - stub_obj_list_processor_1(); - for (i = 0; i < OBJECT_POOL_CAPACITY; i++) { gObjectPool[i].activeFlags = ACTIVE_FLAG_DEACTIVATED; geo_reset_object_node(&gObjectPool[i].header.gfx); diff --git a/src/game/paintings.c b/src/game/paintings.c index f0bdcdc0..3ed2543b 100644 --- a/src/game/paintings.c +++ b/src/game/paintings.c @@ -678,8 +678,7 @@ void painting_generate_mesh(struct Painting *painting, s16 *mesh, s16 numTris) { s16 i; gPaintingMesh = mem_pool_alloc(gEffectsMemoryPool, numTris * sizeof(struct PaintingMeshVertex)); - if (gPaintingMesh == NULL) { - } + // accesses are off by 1 since the first entry is the number of vertices for (i = 0; i < numTris; i++) { gPaintingMesh[i].pos[0] = mesh[i * 3 + 1]; @@ -710,8 +709,7 @@ void painting_calculate_triangle_normals(s16 *mesh, s16 numVtx, s16 numTris) { s16 i; gPaintingTriNorms = mem_pool_alloc(gEffectsMemoryPool, numTris * sizeof(Vec3f)); - if (gPaintingTriNorms == NULL) { - } + for (i = 0; i < numTris; i++) { s16 tri = numVtx * 3 + i * 3 + 2; // Add 2 because of the 2 length entries preceding the list s16 v0 = mesh[tri]; @@ -838,9 +836,6 @@ Gfx *render_painting(u8 *img, s16 tWidth, s16 tHeight, s16 *textureMap, s16 mapV Gfx *dlist = alloc_display_list(commands * sizeof(Gfx)); Gfx *gfx = dlist; - if (verts == NULL || dlist == NULL) { - } - gLoadBlockTexture(gfx++, tWidth, tHeight, G_IM_FMT_RGBA, img); // Draw the groups of 5 first @@ -907,9 +902,6 @@ Gfx *painting_model_view_transform(struct Painting *painting) { Gfx *dlist = alloc_display_list(5 * sizeof(Gfx)); Gfx *gfx = dlist; - if (rotX == NULL || rotY == NULL || translate == NULL || dlist == NULL) { - } - guTranslate(translate, painting->posX, painting->posY, painting->posZ); guRotate(rotX, painting->pitch, 1.0f, 0.0f, 0.0f); guRotate(rotY, painting->yaw, 0.0f, 1.0f, 0.0f); diff --git a/src/game/rendering_graph_node.c b/src/game/rendering_graph_node.c index 5c00c0fe..4e30cc06 100644 --- a/src/game/rendering_graph_node.c +++ b/src/game/rendering_graph_node.c @@ -1032,7 +1032,7 @@ static s32 obj_is_in_view(struct GraphNodeObject *node, Mat4 matrix) { geo = node->sharedChild; - // ! @bug The aspect ratio is not accounted for. When the fov value is 45, + //! @bug The aspect ratio is not accounted for. When the fov value is 45, // the horizontal effective fov is actually 60 degrees, so you can see objects // visibly pop in or out at the edge of the screen. halfFov = ((gCurGraphNodeCamFrustum->fov*aspect) / 2.0f + 1.0f) * 32768.0f / 180.0f + 0.5f; diff --git a/src/game/save_file.c b/src/game/save_file.c index dde6eedf..d1647256 100644 --- a/src/game/save_file.c +++ b/src/game/save_file.c @@ -336,10 +336,7 @@ void save_file_erase(s32 fileIndex) { save_file_do_save(fileIndex); } -//! Needs to be s32 to match on -O2, despite no return value. void save_file_copy(s32 srcFileIndex, s32 destFileIndex) { - UNUSED s32 pad; - touch_high_score_ages(destFileIndex); bcopy(&gSaveBuffer.files[srcFileIndex][0], &gSaveBuffer.files[destFileIndex][0], sizeof(gSaveBuffer.files[destFileIndex][0])); @@ -460,8 +457,6 @@ void save_file_collect_star_or_key(s16 coinScore, s16 starIndex) { s32 starFlag = 1 << starIndex; #endif - UNUSED s32 flags = save_file_get_flags(); - gLastCompletedCourseNum = courseIndex + 1; gLastCompletedStarNum = starIndex + 1; sUnusedGotGlobalCoinHiScore = 0; diff --git a/src/game/screen_transition.c b/src/game/screen_transition.c index 49560303..c94ca042 100644 --- a/src/game/screen_transition.c +++ b/src/game/screen_transition.c @@ -54,7 +54,6 @@ Vtx *vertex_transition_color(struct WarpTransitionData *transData, u8 alpha) { make_vertex(verts, 1, GFX_DIMENSIONS_FROM_RIGHT_EDGE(0), 0, -1, 0, 0, r, g, b, alpha); make_vertex(verts, 2, GFX_DIMENSIONS_FROM_RIGHT_EDGE(0), SCREEN_HEIGHT, -1, 0, 0, r, g, b, alpha); make_vertex(verts, 3, GFX_DIMENSIONS_FROM_LEFT_EDGE(0), SCREEN_HEIGHT, -1, 0, 0, r, g, b, alpha); - } else { } return verts; } @@ -201,7 +200,6 @@ s32 render_textured_transition(s8 fadeTimer, s8 transTime, struct WarpTransition gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF); gSPDisplayList(gDisplayListHead++, dl_screen_transition_end); sTransitionTextureFadeCount[fadeTimer] += transData->texTimer; - } else { } return set_and_reset_transition_fade_timer(fadeTimer, transTime); } diff --git a/src/game/skybox.c b/src/game/skybox.c index 4cf27712..7875fea7 100644 --- a/src/game/skybox.c +++ b/src/game/skybox.c @@ -207,7 +207,6 @@ Vtx *make_skybox_rect(s32 tileIndex, s8 colorIndex) { sSkyboxColors[colorIndex][1], sSkyboxColors[colorIndex][2], 255); make_vertex(verts, 3, x + SKYBOX_TILE_WIDTH, y, -1, 31 << 5, 0, sSkyboxColors[colorIndex][0], sSkyboxColors[colorIndex][1], sSkyboxColors[colorIndex][2], 255); - } else { } return verts; } @@ -254,7 +253,6 @@ void *create_skybox_ortho_matrix(s8 player) { if (mtx != NULL) { guOrtho(mtx, left, right, bottom, top, 0.0f, 3.0f, 1.0f); - } else { } return mtx; diff --git a/src/goddard/debug_utils.c b/src/goddard/debug_utils.c index c18b6f12..35d0b9be 100644 --- a/src/goddard/debug_utils.c +++ b/src/goddard/debug_utils.c @@ -803,7 +803,6 @@ struct GdFile *gd_fopen(const char *filename, const char *mode) { struct GdFile *f; // sp74 char *loadedname; // sp70 u32 i; // sp6C - UNUSED u32 pad68; struct UnkBufThing buf; // sp24 u8 *bufbytes; // sp20 u8 *fileposptr; // sp1C @@ -894,7 +893,6 @@ s32 is_newline(char c) { s32 gd_fread_line(char *buf, u32 size, struct GdFile *f) { signed char c; u32 pos = 0; - UNUSED u32 pad1c; do { if (gd_fread(&c, 1, 1, f) == -1) { diff --git a/src/goddard/draw_objects.c b/src/goddard/draw_objects.c index 0e5bdff1..1b1aac24 100644 --- a/src/goddard/draw_objects.c +++ b/src/goddard/draw_objects.c @@ -59,7 +59,6 @@ static struct GdColour sClrYellow = { 1.0, 1.0, 0.0 }; // @ 801A80DC static struct GdColour sLightColours[1] = { { 1.0, 1.0, 0.0 } }; // @ 801A80E8 static struct GdColour *sSelectedColour = &sClrRed; // @ 801A80F4 struct ObjCamera *gViewUpdateCamera = NULL; // @ 801A80F8 -UNUSED static void *sUnref801A80FC = NULL; static s32 sUnreadShapeFlag = 0; // @ 801A8100 struct GdColour *sColourPalette[5] = { // @ 801A8104 &sClrWhite, &sClrYellow, &sClrRed, &sClrBlack, &sClrBlack @@ -69,20 +68,12 @@ struct GdColour *sWhiteBlack[2] = { &sClrWhite, &sClrBlack, }; -UNUSED static Mat4f sUnref801A8120 = { - { 1.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 1.0, 0.0 }, { 0.0, 0.0, 0.0, 1.0 } -}; -UNUSED static Mat4f sUnrefIden801A8160 = { - { 1.0, 0.0, 0.0, 0.0 }, { 0.0, 1.0, 0.0, 0.0 }, { 0.0, 0.0, 1.0, 0.0 }, { 0.0, 0.0, 0.0, 1.0 } -}; + static s32 sLightDlCounter = 1; // @ 801A81A0 -UNUSED static s32 sUnref801A81A4[4] = { 0 }; // bss -u8 gUnref_801B9B30[0x88]; struct ObjGroup *gGdLightGroup; // @ 801B9BB8; is this the main light group? only light group? -UNUSED static u8 sUnref_801B9BBC[0x40]; static enum SceneType sSceneProcessType; // @ 801B9C00 static s32 sUseSelectedColor; // @ 801B9C04 static s16 sPickBuffer[100]; ///< buffer of objects near click @@ -114,12 +105,6 @@ void setup_lights(void) { gd_setproperty(GD_PROP_AMB_COLOUR, 0.5f, 0.5f, 0.5f); gd_setproperty(GD_PROP_CULLING, 1.0f, 0.0f, 0.0f); // set G_CULL_BACK return; - - // dead code - gd_setproperty(GD_PROP_STUB17, 2.0f, 0.0f, 0.0f); - gd_setproperty(GD_PROP_ZBUF_FN, 24.0f, 0.0f, 0.0f); - gd_setproperty(GD_PROP_CULLING, 1.0f, 0.0f, 0.0f); - return; } /** @@ -269,8 +254,6 @@ void draw_shape_2d(struct ObjShape *shape, s32 flag, UNUSED f32 c, UNUSED f32 d, void draw_light(struct ObjLight *light) { struct GdVec3f sp94; Mat4f sp54; - UNUSED Mat4f *uMatPtr; - UNUSED f32 uMultiplier; struct ObjShape *shape; if (sSceneProcessType == FIND_PICKS) { @@ -287,13 +270,9 @@ void draw_light(struct ObjLight *light) { sp94.y = -light->unk80.y; sp94.z = -light->unk80.z; gd_create_origin_lookat(&sp54, &sp94, 0.0f); - uMultiplier = light->unk38 / 45.0; shape = gSpotShape; - uMatPtr = &sp54; } else { - uMultiplier = 1.0f; shape = light->unk9C; - uMatPtr = NULL; if (++sLightDlCounter >= 17) { sLightDlCounter = 1; } @@ -432,9 +411,7 @@ void Unknown80178ECC(f32 v0X, f32 v0Y, f32 v0Z, f32 v1X, f32 v1Y, f32 v1Z) { */ void draw_face(struct ObjFace *face) { struct ObjVertex *vtx; // 3c - f32 z; // 38 - f32 y; // 34 - f32 x; // 30 + f32 x, y, z; // 30, 34, 38 s32 i; // 20; also used to store mtl's gddl number s32 hasTextCoords; // 1c Vtx *gbiVtx; // 18 @@ -452,9 +429,6 @@ void draw_face(struct ObjFace *face) { } } } - - if (FALSE) { - } } check_tri_display(face->vtxCount); @@ -524,7 +498,6 @@ void Unknown801792F0(struct GdObj *obj) { set_cur_dynobj(obj); d_get_world_pos(&objPos); func_801A4438(objPos.x, objPos.y, objPos.z); - stub_draw_label_text(objId); } /** @@ -582,7 +555,6 @@ void draw_label(struct ObjLabel *label) { position.y += label->position.y; position.z += label->position.z; func_801A4438(position.x, position.y, position.z); - stub_draw_label_text(strbuf); } /* 227DF8 -> 227F3C; orig name: Proc80179628 */ @@ -657,11 +629,6 @@ void draw_camera(struct ObjCamera *cam) { sp44.z = cam->lookAt.z; } - if (0) { - // dead code - gd_printf("%f,%f,%f\n", cam->worldPos.x, cam->worldPos.y, cam->worldPos.z); - } - if (ABS(cam->worldPos.x - sp44.x) + ABS(cam->worldPos.z - sp44.z) == 0.0f) { gd_printf("Draw_Camera(): Zero view distance\n"); return; @@ -843,7 +810,6 @@ void draw_nothing(UNUSED struct GdObj *nop) { void draw_shape_faces(struct ObjShape *shape) { sUpdateViewState.mtlDlNum = 0; sUpdateViewState.unreadCounter = 0; - gddl_is_loading_stub_dl(FALSE); sUnreadShapeFlag = (s32) shape->flag & 1; set_render_alpha(shape->alpha); if (shape->dlNums[gGdFrameBufNum] != 0) { @@ -905,8 +871,6 @@ void draw_bone(UNUSED struct GdObj *obj) { */ void draw_joint(struct GdObj *obj) { struct ObjJoint *joint = (struct ObjJoint *) obj; - UNUSED f32 sp7C = 70.0f; - UNUSED s32 sp74 = 1; s32 colour; struct ObjShape *boneShape; @@ -1058,25 +1022,6 @@ void create_shape_mtl_gddls(struct ObjShape *shape) { } } -/** - * Uncalled function that calls a stubbed function (`stub_objects_1()`) for all - * `GdObj`s in @p grp - * - * @param grp Unknown group of objects - * @return void - * @note Not called - */ -void unref_8017AEDC(struct ObjGroup *grp) { - register struct ListNode *link = grp->firstMember; - - while (link != NULL) { - struct GdObj *obj = link->obj; - - stub_objects_1(grp, obj); - link = link->next; - } -} - /** * Start a new `GdDisplayList` struct and store its reference index * in the input `ObjShape`. @@ -1485,9 +1430,3 @@ void update_view(struct ObjView *view) { imout(); return; } -/** - * Stub function. - * @note Not Called - */ -void stub_draw_objects_1(void) { -} diff --git a/src/goddard/draw_objects.h b/src/goddard/draw_objects.h index 10051de7..efe0e53b 100644 --- a/src/goddard/draw_objects.h +++ b/src/goddard/draw_objects.h @@ -23,8 +23,6 @@ extern struct ObjCamera *gViewUpdateCamera; // bss -// this is unused, but it needs to be declared before gGdLightGroup -extern u8 gUnref_801B9B30[0x88]; extern struct ObjGroup *gGdLightGroup; // ObjGroup* of ObjLights // functions diff --git a/src/goddard/dynlist_proc.c b/src/goddard/dynlist_proc.c index f036dae4..dd04f272 100644 --- a/src/goddard/dynlist_proc.c +++ b/src/goddard/dynlist_proc.c @@ -431,8 +431,6 @@ static struct DynObjInfo *get_dynobj_info(DynObjName name) { * @note Not called */ void reset_dynamic_objs(void) { - UNUSED s32 pad; - if (sLoadedDynObjs == 0) { return; } @@ -483,8 +481,6 @@ void d_end_net_with_subgroup(DynObjName name) { */ void d_attach_joint_to_net(UNUSED s32 arg0, DynObjName name) { UNUSED struct DynObjInfo *curInfo = sDynListCurInfo; - UNUSED u32 pad[2]; - d_makeobj(D_JOINT, name); d_set_type(3); d_set_shapeptrptr(NULL); @@ -514,7 +510,6 @@ void d_make_netfromshapeid(DynObjName name) { * the shape is not moved into the dynamic list. */ void d_make_netfromshape_ptrptr(struct ObjShape **shapePtr) { - UNUSED u32 pad; struct ObjNet *net = make_netfromshape(*shapePtr); printf("dMakeNetFromShapePtrPtr\n"); @@ -528,7 +523,6 @@ void d_make_netfromshape_ptrptr(struct ObjShape **shapePtr) { * needed later. */ void add_to_dynobj_list(struct GdObj *newobj, DynObjName name) { - UNUSED u32 pad; char idbuf[0x100]; start_memtracker("dynlist"); @@ -711,9 +705,7 @@ void d_attach(DynObjName name) { * the "attach flags" of the current dynamic object to `flag` */ void d_attach_to(s32 flag, struct GdObj *obj) { - UNUSED u32 pad4C; struct ObjGroup *attgrp; - UNUSED u32 pad[2]; UNUSED struct DynObjInfo *curInfo = sDynListCurInfo; struct GdVec3f currObjPos; // transformed into attach offset struct GdVec3f objPos; @@ -835,7 +827,6 @@ void copy_bytes(u8 *src, u8 *dst, s32 num) { * rather than solely byted copied like the other types. */ void alloc_animdata(struct ObjAnimator *animator) { - UNUSED u32 pad5C; // probably should be three GdVec3fs, not triangle... // vec0 = position; vec1 = scale? rotation?; vec2 = translation struct GdTriangleF tri; //+58; temp float for converting half to f32? @@ -851,7 +842,6 @@ void alloc_animdata(struct ObjAnimator *animator) { void *allocSpace; //+30; allocated animdata space f32 allocMtxScale = 0.1f; //+2C; scale postion/rotation of GD_ANIM_SCALE3S_POS3S_ROT3S data struct AnimMtxVec *curMtxVec; //+28 - UNUSED u32 pad20; start_memtracker("animdata"); @@ -967,7 +957,6 @@ void chk_shapegen(struct ObjShape *shape) { struct ObjGroup *shapeMtls; // sp50 struct ObjGroup *shapeFaces; // sp4C struct ObjGroup *shapeVtx; // sp48 - UNUSED u32 pad44; struct ObjGroup *madeFaces; // sp40 struct ObjGroup *madeVtx; // sp3C u32 i; // sp38 @@ -1074,7 +1063,6 @@ void chk_shapegen(struct ObjShape *shape) { */ void d_set_nodegroup(DynObjName name) { struct DynObjInfo *info; // sp2C - UNUSED u32 pad[2]; if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); @@ -1140,8 +1128,6 @@ void d_set_matgroup(DynObjName name) { * ST coordinates. */ void d_set_texture_st(UNUSED f32 s, UNUSED f32 t) { - UNUSED u32 pad[2]; - if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); } @@ -1251,7 +1237,6 @@ void d_map_vertices(DynObjName name) { */ void d_set_planegroup(DynObjName name) { struct DynObjInfo *info; - UNUSED u32 pad[2]; if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); @@ -1392,7 +1377,6 @@ void d_start_group(DynObjName name) { * and this call. */ void d_end_group(DynObjName name) { - UNUSED u32 pad; struct DynObjInfo *info = get_dynobj_info(name); struct ObjGroup *dynGrp; s32 i; @@ -1413,7 +1397,6 @@ void d_end_group(DynObjName name) { * Add the current dynamic object to the dynamic `ObjGroup` `name`. */ void d_addto_group(DynObjName name) { - UNUSED u32 pad; struct DynObjInfo *info = get_dynobj_info(name); struct ObjGroup *targetGrp; @@ -1440,9 +1423,7 @@ void d_use_integer_names(s32 isIntBool) { * to `(x, y, z)`. */ void d_set_init_pos(f32 x, f32 y, f32 z) { - UNUSED u32 pad2c[3]; struct GdObj *dynobj = sDynListCurObj; // sp28 - UNUSED u32 pad[1]; if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); @@ -1899,7 +1880,6 @@ void d_set_att_offset(const struct GdVec3f *off) { */ void d_set_att_to_offset(UNUSED u32 a) { struct GdObj *dynobj; // sp3c - UNUSED u8 pad[24]; if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); @@ -2238,7 +2218,6 @@ void d_set_scale(f32 x, f32 y, f32 z) { */ void d_set_rotation(f32 x, f32 y, f32 z) { struct GdObj *dynobj; // sp2C - UNUSED u32 pad; if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); diff --git a/src/goddard/dynlists/dynlists_mario_eyebrows_mustache.c b/src/goddard/dynlists/dynlists_mario_eyebrows_mustache.c index 28569138..a697accd 100644 --- a/src/goddard/dynlists/dynlists_mario_eyebrows_mustache.c +++ b/src/goddard/dynlists/dynlists_mario_eyebrows_mustache.c @@ -41,7 +41,7 @@ struct DynList dynlist_mario_eyebrow_right_shape[] = { StartGroup(DYNOBJ_MARIO_RIGHT_EYEBROW_MTL_GROUP), MakeDynObj(D_MATERIAL, 0), SetId(0), - SetAmbient(0.0, 0.005, 0.0), // Why is green 0.005 on the right eyebrow, but 0.0 on the left eyebrow? + SetAmbient(0.0, 0.0, 0.0), SetDiffuse(0.0, 0.0, 0.0), EndGroup(DYNOBJ_MARIO_RIGHT_EYEBROW_MTL_GROUP), diff --git a/src/goddard/gd_main.c b/src/goddard/gd_main.c index 8d2c85e7..956ebf3f 100644 --- a/src/goddard/gd_main.c +++ b/src/goddard/gd_main.c @@ -14,11 +14,8 @@ // data s32 gGdMoveScene = TRUE; // @ 801A8050 -UNUSED static s32 sUnref801A8054 = TRUE; f32 D_801A8058 = -600.0f; s32 gGdUseVtxNormal = TRUE; // @ 801A805C; instead of face normals -UNUSED static s32 sUnrefScnWidth = 320; -UNUSED static s32 sUnrefScnHeight = 240; // bss struct GdControl gGdCtrl; // @ 801B9920; processed controller info diff --git a/src/goddard/joints.c b/src/goddard/joints.c index 818ab47f..fdf3c9e8 100644 --- a/src/goddard/joints.c +++ b/src/goddard/joints.c @@ -47,13 +47,9 @@ void set_joint_vecs(struct ObjJoint *, f32, f32, f32); * Controls movement of grabbable joints */ void grabbable_joint_update_func(struct ObjJoint *self) { - UNUSED u8 pad78[0xC8 - 0x78]; Mat4f *attObjMtx; - UNUSED u8 pad70[4]; struct GdVec3f offset; // difference between current position and initial position - UNUSED u8 pad50[0x10]; register struct ListNode *att; - UNUSED u8 pad48[0x8]; struct GdObj *attobj; // The joint acts somewhat like a spring in that the further it is moved @@ -137,7 +133,6 @@ void eye_joint_update_func(struct ObjJoint *self) { Mat4f *sp5C; struct GdVec3f sp50; struct GdVec3f sp44; - UNUSED u8 pad2c[0x18]; register struct ListNode *att; struct GdObj *attobj; @@ -230,7 +225,6 @@ void set_joint_vecs(struct ObjJoint *j, f32 x, f32 y, f32 z) { struct ObjJoint *make_joint(s32 flags, f32 x, f32 y, f32 z) { struct ObjJoint *j; // sp24 struct ObjJoint *oldhead; - UNUSED u32 pad1C; j = (struct ObjJoint *) make_object(OBJ_TYPE_JOINTS); sJointCount++; @@ -396,7 +390,6 @@ void func_8018F520(struct ObjBone *b) { void func_8018F89C(struct ObjBone *b) { struct ObjJoint *spAC; struct ObjJoint *spA8; - UNUSED u8 pad64[0x44]; struct ObjGroup *grp; // sp60 struct ListNode *link; // sp5c Mat4f mtx; // sp1c @@ -493,7 +486,6 @@ void add_joint2bone(struct ObjBone *b, struct ObjJoint *j) { struct ObjBone *make_bone(s32 a0, struct ObjJoint *j1, struct ObjJoint *j2, UNUSED s32 a3) { struct ObjBone *b; // sp34 struct ObjBone *oldhead; - UNUSED u32 pad1C[5]; b = (struct ObjBone *) make_object(OBJ_TYPE_BONES); sBoneCount++; @@ -523,10 +515,6 @@ struct ObjBone *make_bone(s32 a0, struct ObjJoint *j1, struct ObjJoint *j2, UNUS return b; } -/* 23E6E4 -> 23E6F8; not called */ -void stub_joints_1(UNUSED u32 a0) { -} - /* 23E6F8 -> 23E758; not called */ void func_8018FF28(struct ObjJoint *a0, struct ObjJoint *a1) { if (a1->flags & 0x1) { @@ -583,11 +571,9 @@ s32 func_8018FFE8(struct ObjBone **a0, struct ObjJoint **a1, struct ObjJoint *a2 void func_80190168(struct ObjBone *b, UNUSED struct ObjJoint *a1, UNUSED struct ObjJoint *a2, struct GdVec3f *a3) { struct GdVec3f sp7C; - UNUSED u8 pad64[0x7c - 0x64]; f32 sp60; f32 sp5C; f32 sp58; - UNUSED u8 pad1C[0x58 - 0x1C]; return; @@ -664,16 +650,11 @@ void func_80190574(s32 a0, struct ObjJoint *a1, struct ObjJoint *a2, f32 x, f32 struct ObjJoint *sp274; // = a2? struct ObjJoint *sp270; // mid-point of stack array? struct ObjJoint *sp26C; // jointstackarr[i]? curjoint? - UNUSED u32 pad268; - UNUSED u32 sp264 = 0; - UNUSED u32 sp258[3]; // unused vec? struct GdVec3f sp24C = {0, 0, 0}; struct GdVec3f sp240; - UNUSED u32 pad238[2]; s32 sp234; // i? s32 sp230; s32 sp22C = 1; - UNUSED u32 pad228; s32 sp224; s32 sp220; struct ObjJoint *sp120[0x40]; @@ -775,7 +756,6 @@ void func_801909B4(void) { /* 23F1F0 -> 23F324; not called */ void func_80190A20(void) { struct ObjJoint *j; // sp3c - UNUSED u32 pad38; struct GdVec3f vec; // sp2C struct ObjGroup *grp; struct ListNode *link; @@ -799,16 +779,13 @@ void func_80190A20(void) { } /* 23F324 -> 23F638 */ -void func_80190B54(struct ObjJoint *a0, struct ObjJoint *a1, struct GdVec3f *a2) // b0 -{ +void func_80190B54(struct ObjJoint *a0, struct ObjJoint *a1, struct GdVec3f *a2) { // b0 struct GdVec3f spA4; - UNUSED struct GdVec3f pad98; struct GdVec3f sp8C; struct GdVec3f sp80; f32 sp7C; f32 sp78; Mat4f sp38; - UNUSED u8 pad1C[0x1C]; if (a1 != NULL) { spA4.x = a1->unk3C.x; @@ -865,7 +842,6 @@ void func_80190E68(struct GdObj *obj, f32 x, f32 y, f32 z) { struct ObjJoint *sp44; struct GdObj *sp40; struct GdVec3f vec; - UNUSED u32 pad1C[6]; vec.x = x; vec.y = y; @@ -1025,10 +1001,6 @@ void reset_joint(struct ObjJoint *j) { /* 23FFF4 -> 2400C4 */ void func_80191824(struct ObjJoint *j) { - UNUSED struct ObjNet *sp14; - UNUSED u32 pad00[4]; - - sp14 = gGdSkinNet->unk1F0; if (j->flags & 0x1) { j->worldPos.x = gGdSkinNet->worldPos.x; j->worldPos.y = gGdSkinNet->worldPos.y; diff --git a/src/goddard/objects.c b/src/goddard/objects.c index 5d2f0c1b..aecb9936 100644 --- a/src/goddard/objects.c +++ b/src/goddard/objects.c @@ -118,13 +118,6 @@ void get_some_bounding_box(struct GdBoundingBox *a0) { a0->maxZ = gSomeBoundingBox.maxZ; } -/* @ 22A6A0 for 0x24 */ -void stub_objects_1(UNUSED struct ObjGroup *a0, UNUSED struct GdObj *a1) { - UNUSED u8 sp00[8]; - /* Debug stub? */ - return; -} - /** * Returns a string containing the name of the the object type */ @@ -747,11 +740,7 @@ void format_object_id(char *str, struct GdObj *obj) { struct ObjGroup *make_group(s32 count, ...) { va_list args; s32 i; - UNUSED u32 sp5C; struct GdObj *curObj; - UNUSED u32 sp54; - UNUSED u32 sp50; - UNUSED u32 sp4C; struct ObjGroup *newGroup; struct ObjGroup *oldGroupListHead; struct GdObj *vargObj; @@ -811,7 +800,6 @@ struct ObjGroup *make_group(s32 count, ...) { */ void addto_group(struct ObjGroup *group, struct GdObj *obj) { char strbuf[0x20]; - UNUSED u8 pad[0x8]; imin("addto_group"); @@ -875,12 +863,6 @@ s32 group_contains_obj(struct ObjGroup *group, struct GdObj *obj) { return FALSE; } -/* @ 22C9B8 for 0x24 */ -s32 stub_objects_2(void) { - s32 sp4 = 0; - return sp4; -} - /* @ 22CA00 for 0x88 */ static void reset_joint_or_net(struct GdObj *obj) { struct GdObj *localObjPtr = obj; @@ -915,7 +897,6 @@ s32 apply_to_obj_types_in_group(s32 types, applyproc_t func, struct ObjGroup *gr struct GdObj *linkedObj; enum ObjTypeFlag linkedObjType; applyproc_t objFn; - UNUSED u8 pad2C[0x20]; s32 fnAppliedCount; fnAppliedCount = 0; @@ -960,9 +941,7 @@ void func_8017E584(struct ObjNet *a0, struct GdVec3f *a1, struct GdVec3f *a2) { struct GdVec3f sp88; struct GdVec3f sp7C; struct GdVec3f sp70; - UNUSED u8 pad30[0x40]; // unused MyMatrix4x4? f32[4][4] f32 sp2C; - UNUSED u32 sp28; struct GdVec3f sp1C; sp70.x = a2->x; @@ -1012,12 +991,8 @@ void func_8017E584(struct ObjNet *a0, struct GdVec3f *a1, struct GdVec3f *a2) { /* @ 22D008 for 0x1B4 */ void func_8017E838(struct ObjNet *a0, struct GdVec3f *a1, struct GdVec3f *a2) { - UNUSED u32 sp84; - UNUSED u32 sp80; - UNUSED u32 sp7C; struct GdVec3f sp70; struct GdVec3f sp64; - UNUSED u8 pad24[0x40]; struct GdVec3f sp18; sp64.x = a1->x; @@ -1066,13 +1041,11 @@ void func_8017E9EC(struct ObjNet *net) { s32 transform_child_objects_recursive(struct GdObj *obj, struct GdObj *parentObj) { struct ListNode *curLink; struct ObjGroup *curGroup; - UNUSED u32 sp54; Mat4f *parentUnkMtx; Mat4f *iMtx; Mat4f *unkMtx; Mat4f *rotMtx; Mat4f *rotMtx2; - UNUSED u8 pad20[0x18]; struct GdVec3f scale; if (parentObj != NULL) { @@ -1120,13 +1093,11 @@ s32 transform_child_objects_recursive(struct GdObj *obj, struct GdObj *parentObj s32 func_8017F210(struct GdObj *a0, struct GdObj *a1) { struct ListNode *sp6C; struct ObjGroup *sp68; - UNUSED u32 sp64; UNUSED Mat4f *sp60; Mat4f *sp5C; UNUSED Mat4f *sp58; Mat4f *sp54; Mat4f *sp50; - UNUSED u8 pad38[0x18]; struct GdVec3f sp2C; s32 count = 0; @@ -1173,11 +1144,6 @@ void func_8017F3CC(struct Unk8017F3CC *a0) { gd_rotate_and_translate_vec3f(&a0->unk20, D_801B9E48); } -/* @ 22DBD4 for 0x20 */ -void stub_objects_3(UNUSED f32 a0, UNUSED struct GdObj *a1, UNUSED struct GdObj *a2) { - UNUSED u8 pad[0x30]; -} - /** * Interpolates between animation transformations `t1` and `t2`, with `dt` as * the interpolation factor (between 0 and 1). Sets the current dynobj's matrix @@ -1228,10 +1194,6 @@ void move_animator(struct ObjAnimator *animObj) { s16(*animDataCam)[6]; // camera GdPlaneH[]? struct GdObj *stubObj1 = NULL; // used only for call to stubbed function struct GdObj *stubObj2 = NULL; // used only for call to stubbed function - UNUSED s32 sp50; - UNUSED s32 sp4C; - UNUSED s32 sp48; - UNUSED struct GdVec3f unusedVec; s32 currKeyFrame; s32 nextKeyFrame; f32 dt; @@ -1260,10 +1222,6 @@ void move_animator(struct ObjAnimator *animObj) { return; } - unusedVec.x = 4.0f; - unusedVec.y = 1.0f; - unusedVec.z = 1.0f; - if (animObj->frame > (f32) animData->count) { animObj->frame = 1.0f; } else if (animObj->frame < 0.0f) { @@ -1448,7 +1406,6 @@ void move_animator(struct ObjAnimator *animObj) { } else { if (stubObj2 == NULL) { stubObj2 = linkedObj; - stub_objects_3(animObj->frame, stubObj1, stubObj2); } else { fatal_printf("Too many objects to morph"); } diff --git a/src/goddard/objects.h b/src/goddard/objects.h index bdf14c18..20981ea4 100644 --- a/src/goddard/objects.h +++ b/src/goddard/objects.h @@ -51,7 +51,6 @@ extern struct ObjGroup* gGdViewsGroup; void reset_bounding_box(void); void add_obj_pos_to_bounding_box(struct GdObj *a0); void get_some_bounding_box(struct GdBoundingBox *a0); -void stub_objects_1(UNUSED struct ObjGroup *a0, UNUSED struct GdObj *a1); struct GdObj *make_object(enum ObjTypeFlag objFlag); struct ObjZone *make_zone(struct ObjGroup *a0, struct GdBoundingBox *a1, struct ObjGroup *a2); struct ObjUnk200000 *func_8017C7A0(struct ObjVertex *a0, struct ObjFace *a1); @@ -74,7 +73,6 @@ void addto_group(struct ObjGroup *group, struct GdObj *obj); void addto_groupfirst(struct ObjGroup *group, struct GdObj *obj); s32 group_contains_obj(struct ObjGroup *group, struct GdObj *obj); void show_details(enum ObjTypeFlag type); -s32 stub_objects_2(void); s32 make_scene(void); void menu_cb_reset_positions(void); s32 apply_to_obj_types_in_group(s32 types, applyproc_t fn, struct ObjGroup *group); @@ -88,7 +86,6 @@ s32 is_point_xz_in_bounding_box(struct GdVec3f *a0, struct GdBoundingBox *a1); s32 gd_plane_point_within(struct GdBoundingBox *a0, struct GdBoundingBox *a1); s32 transform_child_objects_recursive(struct GdObj *a0, struct GdObj *a1); s32 func_8017F210(struct GdObj *a0, struct GdObj *a1); -void stub_objects_3(UNUSED f32 a0, UNUSED struct GdObj *a1, UNUSED struct GdObj *a2); void interpolate_animation_transform(struct GdAnimTransform *a0, struct GdAnimTransform *a1, f32 a2); void move_animator(struct ObjAnimator *animObj); void drag_picked_object(struct GdObj *inputObj); diff --git a/src/goddard/old_menu.c b/src/goddard/old_menu.c index e13faa59..9b6b25af 100644 --- a/src/goddard/old_menu.c +++ b/src/goddard/old_menu.c @@ -118,15 +118,12 @@ void set_static_gdgt_value(struct ObjValPtr *vp) { /* 23A488 -> 23A4D0 */ static void reset_gadget_default(struct ObjGadget *gdgt) { - UNUSED u8 pad[4]; - sCurGadgetPtr = gdgt; apply_to_obj_types_in_group(OBJ_TYPE_VALPTRS, (applyproc_t) set_static_gdgt_value, gdgt->valueGrp); } /* 23A4D0 -> 23A784 */ void adjust_gadget(struct ObjGadget *gdgt, s32 a1, s32 a2) { - UNUSED u8 pad[8]; f32 range; struct ObjValPtr *vp; @@ -165,7 +162,6 @@ void adjust_gadget(struct ObjGadget *gdgt, s32 a1, s32 a2) { /* 23A784 -> 23A940; orig name: Unknown8018BFB4 */ void reset_gadget(struct ObjGadget *gdgt) { - UNUSED u8 pad[8]; f32 range; struct ObjValPtr *vp; diff --git a/src/goddard/particles.c b/src/goddard/particles.c index 5ff5cfa2..39ae912a 100644 --- a/src/goddard/particles.c +++ b/src/goddard/particles.c @@ -489,6 +489,4 @@ void Unknown801835C8(struct ObjParticle *ptc) { /* 2320A0 -> 2320D4; pad to 2320E0 */ void func_801838D0(struct ObjParticle *ptc) { D_801B9E3C = ptc; - if (ptc->pos.y < -15.0f) { - } } diff --git a/src/goddard/renderer.c b/src/goddard/renderer.c index a0c98c72..87b75fba 100644 --- a/src/goddard/renderer.c +++ b/src/goddard/renderer.c @@ -91,20 +91,12 @@ struct DynListBankInfo { #if defined(VERSION_EU) || defined(VERSION_SH) static OSMesgQueue D_801BE830; // controller msg queue static OSMesg D_801BE848[10]; -u8 EUpad1[0x40]; static OSMesgQueue D_801BE8B0; static OSMesgQueue sGdDMAQueue; // @ 801BE8C8 -// static u32 unref_801be870[16]; -// static u32 unref_801be8e0[25]; -// static u32 unref_801be948[13]; -u8 EUpad2[0x64]; static OSMesg sGdMesgBuf[1]; // @ 801BE944 -u8 EUpad3[0x34]; static OSMesg sGdDMACompleteMsg; // msg buf for D_801BE8B0 queue static OSIoMesg sGdDMAReqMesg; static struct ObjView *D_801BE994; // store if View flag 0x40 set - -u8 EUpad4[0x88]; #endif static OSContStatus D_801BAE60[4]; static OSContPad sGdContPads[4]; // @ 801BAE70 @@ -113,10 +105,8 @@ static u8 D_801BAEA0; static struct ObjGadget *sTimerGadgets[GD_NUM_TIMERS]; // @ 801BAEA8 static u32 D_801BAF28; // RAM addr offset? static s16 sTriangleBuf[13][8]; // [[s16; 8]; 13]? vert indices? -UNUSED static u32 unref_801bb000[3]; static u8 *sMemBlockPoolBase; // @ 801BB00C static u32 sAllocMemory; // @ 801BB010; malloc-ed bytes -UNUSED static u32 unref_801bb014; static s32 D_801BB018; static s32 D_801BB01C; static void *sLoadedTextures[0x10]; // texture pointers @@ -136,11 +126,8 @@ static s32 sVertexBufStartIndex; // Vtx start in GD Dl static struct ObjView *sCarSceneView; // @ 801BB0D0 static s32 sUpdateYoshiScene; // @ 801BB0D4; update dl Vtx from ObjVertex? static s32 sUpdateMarioScene; // @ 801BB0D8; update dl Vtx from ObjVertex? -UNUSED static u32 unref_801bb0dc; static s32 sUpdateCarScene; // @ 801BB0E0; guess, not really used -UNUSED static u32 unref_801bb0e4; static struct GdVec3f sTextDrawPos; // position to draw text? only set in one function, never used -UNUSED static u32 unref_801bb0f8[2]; static Mtx sIdnMtx; // @ 801BB100 static Mat4f sInitIdnMat4; // @ 801BB140 static s8 sVtxCvrtNormBuf[3]; // @ 801BB180 @@ -170,21 +157,16 @@ static LookAt D_801BE7D0[3]; #if defined(VERSION_JP) || defined(VERSION_US) static OSMesgQueue D_801BE830; // controller msg queue static OSMesg D_801BE848[10]; -UNUSED static u32 unref_801be870[16]; UNUSED static OSMesgQueue D_801BE8B0; static OSMesgQueue sGdDMAQueue; // @ 801BE8C8 -UNUSED static u32 unref_801be8e0[25]; static OSMesg sGdMesgBuf[1]; // @ 801BE944 -UNUSED static u32 unref_801be948[13]; static OSMesg sGdDMACompleteMsg; // msg buf for D_801BE8B0 queue static OSIoMesg sGdDMAReqMesg; static struct ObjView *D_801BE994; // store if View flag 0x40 set #endif // data -UNUSED static u32 unref_801a8670 = 0; static s32 D_801A8674 = 0; -UNUSED static u32 unref_801a8678 = 0; static s32 D_801A867C = 0; static s32 D_801A8680 = 0; static f32 sTracked1FrameTime = 0.0f; // @ 801A8684 @@ -199,11 +181,9 @@ static struct GdTimer *D_801A86A4 = NULL; // timer for dlgen, dynamics, or rcp static struct GdTimer *D_801A86A8 = NULL; // timer for dlgen, dynamics, or rcp static struct GdTimer *D_801A86AC = NULL; // timer for dlgen, dynamics, or rcp s32 gGdFrameBufNum = 0; // @ 801A86B0 -UNUSED static u32 unref_801a86B4 = 0; static struct ObjShape *sHandShape = NULL; // @ 801A86B8 static s32 D_801A86BC = 1; static s32 D_801A86C0 = 0; // gd_dl id for something? -UNUSED static u32 unref_801a86C4 = 10; static s32 sMtxParamType = G_MTX_PROJECTION; UNUSED static struct GdVec3f D_801A86CC = { 1.0f, 1.0f, 1.0f }; static struct ObjView *sActiveView = NULL; // @ 801A86D8 current view? used when drawing dl @@ -214,7 +194,6 @@ static struct ObjView *sMenuView = NULL; // @ 801A86E8 static u32 sItemsInMenu = 0; // @ 801A86EC static s32 sDebugViewsCount = 0; // number of elements in the sDebugViews array static s32 sCurrDebugViewIndex = 0; // @ 801A86F4; timing activate cool down counter? -UNUSED static u32 unref_801a86F8 = 0; static struct GdDisplayList *sCurrentGdDl = NULL; // @ 801A86FC static u32 sGdDlCount = 0; // @ 801A8700 static struct DynListBankInfo sDynLists[] = { // @ 801A8704 @@ -312,14 +291,6 @@ static Vtx_t gd_vertex_star[] = { {{-64, 128, 0}, 0, { 0, 0}, {0x00, 0x00, 0x7F}}, }; -//! no references to these vertices -UNUSED static Vtx_t gd_unused_vertex[] = { - {{16384, 0, 0}, 0, {0, 16384}, {0x00, 0x00, 0x00}}, - {{ 0, 0, 16384}, 0, {0, 0}, {0x00, 0x00, 0x40}}, - {{ 0, 0, 0}, 0, {0, 0}, {0x00, 0x00, 0x00}}, - {{ 0, 0, 0}, 0, {0, 0}, {0x00, 0x00, 0x00}}, -}; - static Gfx gd_dl_star_common[] = { gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA), gsSPClearGeometryMode(G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR), @@ -694,42 +665,13 @@ static Gfx gd_dl_rdp_init[] = { gsSPEndDisplayList(), }; -UNUSED static u32 gd_unused_pad1 = 0; - float sGdPerspTimer = 1.0; -UNUSED static u32 gd_unused_pad2 = 0; - UNUSED static Gfx gd_texture4_dummy_aligner1[] = { gsDPPipeSync(), gsSPEndDisplayList(), }; -static Vtx_t gd_unused_mesh_vertex_group1[] = { - {{-8, 8, 0}, 0, { 0, 0}, { 0x00, 0x00, 0x00, 0xFF}}, - {{ 8, -2, 0}, 0, { 0, 0}, { 0x00, 0x00, 0x00, 0xFF}}, - {{ 2, -8, 0}, 0, { 0, 0}, { 0x00, 0x00, 0x00, 0xFF}}, -}; - -static Vtx_t gd_unused_mesh_vertex_group2[] = { - {{-6, 6, 0}, 0, { 0, 0}, { 0xFF, 0xFF, 0xFF, 0xFF}}, - {{ 7, -3, 0}, 0, { 0, 0}, { 0xFF, 0x00, 0x00, 0xFF}}, - {{ 3, -7, 0}, 0, { 0, 0}, { 0xFF, 0x00, 0x00, 0xFF}}, -}; - -UNUSED static Gfx gd_dl_unused_mesh[] = { - gsDPPipeSync(), - gsDPSetRenderMode(G_RM_OPA_SURF, G_RM_OPA_SURF2), - gsSPClearGeometryMode(0xFFFFFFFF), - gsSPSetGeometryMode(G_SHADING_SMOOTH | G_SHADE), - gsDPPipeSync(), - gsSPVertex(gd_unused_mesh_vertex_group1, 3, 0), - gsSP1Triangle(0, 1, 2, 0x0), - gsSPVertex(gd_unused_mesh_vertex_group2, 3, 0), - gsSP1Triangle(0, 1, 2, 0x0), - gsSPEndDisplayList(), -}; - static Gfx gd_dl_sprite_start_tex_block[] = { gsDPPipeSync(), gsDPSetCycleType(G_CYC_1CYCLE), @@ -870,14 +812,11 @@ f64 gd_sqrt_d(f64 x) { /* 249BCC -> 24A19C */ void gd_printf(const char *format, ...) { s32 i; - UNUSED u32 pad158; char c; char f; - UNUSED u32 pad150; char buf[0x100]; char *csr = buf; char spec[8]; // specifier string - UNUSED u32 pad40; union PrintVal val; va_list args; @@ -970,8 +909,7 @@ void gd_printf(const char *format, ...) { /* 24A19C -> 24A1D4 */ void gd_exit(UNUSED s32 code) { gd_printf("exit\n"); - while (TRUE) { - } + while (TRUE) {} } /* 24A1D4 -> 24A220; orig name: func_8019BA04 */ @@ -1051,10 +989,7 @@ void draw_indexed_dl(s32 dlNum, s32 gfxIdx) { /* 24A598 -> 24A610; orig name: func_8019BDC8 */ void branch_cur_dl_to_num(s32 dlNum) { - Gfx *dl; - UNUSED u32 pad[2]; - - dl = sGdDLArray[dlNum]->gfx; + Gfx *dl = sGdDLArray[dlNum]->gfx; gSPDisplayList(next_gfx(), GD_VIRTUAL_TO_PHYSICAL(dl)); } @@ -1144,8 +1079,6 @@ void gd_add_to_heap(void *addr, u32 size) { /* 24AAE0 -> 24AB7C */ void gdm_init(void *blockpool, u32 size) { - UNUSED u32 pad; - imin("gdm_init"); // Align downwards? size = (size - 8) & ~7; @@ -1199,8 +1132,6 @@ struct ObjView *make_view_withgrp(char *name, struct ObjGroup *grp) { /* 24AD14 -> 24AEB8 */ void gdm_maketestdl(s32 id) { - UNUSED u32 pad[3]; - imin("gdm_maketestdl"); switch (id) { case 0: @@ -1293,7 +1224,6 @@ s32 gd_sfx_to_play(void) { Gfx *gdm_gettestdl(s32 id) { struct GdObj *dobj; struct GdDisplayList *gddl; - UNUSED u32 pad28[2]; struct GdVec3f vec; start_timer("dlgen"); @@ -1966,9 +1896,7 @@ void func_801A0038(void) { /* 24E840 -> 24E9BC */ void gd_dl_flush_vertices(void) { - UNUSED u32 pad; s32 i; - UNUSED s32 startvtx = sVertexBufStartIndex; if (sVertexBufCount != 0) { // load vertex data @@ -2030,16 +1958,13 @@ void branch_to_gddl(s32 dlNum) { // phong shading function? void gd_dl_hilite(s32 idx, // material GdDl number; offsets into hilite array struct ObjCamera *cam, UNUSED struct GdVec3f *arg2, UNUSED struct GdVec3f *arg3, - struct GdVec3f *arg4, // vector to light source? - struct GdColour *colour // light color -) { - UNUSED u32 pad2[24]; + struct GdVec3f *arg4, // vector to light source? + struct GdColour *colour) { // light color Hilite *hilite; // 4c struct GdVec3f sp40; f32 sp3C; // magnitude of sp40 f32 sp38; f32 sp34; - UNUSED u32 pad[6]; sp38 = 32.0f; // x scale factor? sp34 = 32.0f; // y scale factor? @@ -2078,7 +2003,6 @@ void gd_dl_hilite(s32 idx, // material GdDl number; offsets into hilite array * Adds some display list commands that perform lighting for a material */ s32 gd_dl_material_lighting(s32 id, struct GdColour *colour, s32 material) { - UNUSED u32 pad60[2]; s32 i; s32 numLights = sNumLights; s32 scaledColours[3]; @@ -2089,10 +2013,6 @@ s32 gd_dl_material_lighting(s32 id, struct GdColour *colour, s32 material) { } switch (material) { case GD_MTL_TEX_OFF: - gddl_is_loading_stub_dl(FALSE); - gddl_is_loading_stub_dl(FALSE); - gddl_is_loading_stub_dl(FALSE); - gddl_is_loading_stub_dl(FALSE); gddl_is_loading_shine_dl(FALSE); gddl_is_loading_shine_dl(FALSE); gddl_is_loading_shine_dl(FALSE); @@ -2100,7 +2020,6 @@ s32 gd_dl_material_lighting(s32 id, struct GdColour *colour, s32 material) { numLights = NUMLIGHTS_2; break; case GD_MTL_STUB_DL: - gddl_is_loading_stub_dl(TRUE); break; case GD_MTL_SHINE_DL: gddl_is_loading_shine_dl(TRUE); @@ -2112,7 +2031,6 @@ s32 gd_dl_material_lighting(s32 id, struct GdColour *colour, s32 material) { case GD_MTL_BREAK: break; default: - gddl_is_loading_stub_dl(FALSE); gddl_is_loading_shine_dl(FALSE); DL_CURRENT_LIGHT(sCurrentGdDl).a.l.col[0] = colour->r * 255.0f; @@ -2287,10 +2205,6 @@ void gd_set_one_cycle(void) { update_render_mode(); } -/* 250B44 -> 250B58 */ -void gddl_is_loading_stub_dl(UNUSED s32 dlLoad) { -} - /* 250B58 -> 250C18 */ void gddl_is_loading_shine_dl(s32 dlLoad) { if (dlLoad) { @@ -2529,7 +2443,6 @@ s32 gd_getproperty(s32 prop, UNUSED void *arg1) { /* 251E18 -> 2522B0 */ void gd_setproperty(enum GdProperty prop, f32 f1, f32 f2, f32 f3) { - UNUSED f32 sp3C = 1.0f; s32 parm; switch (prop) { @@ -2736,8 +2649,6 @@ void func_801A4438(f32 x, f32 y, f32 z) { /* 252C70 -> 252DB4 */ s32 gd_gentexture(void *texture, s32 fmt, s32 size, UNUSED u32 arg3, UNUSED u32 arg4) { - UNUSED s32 sp2C; - UNUSED s32 sp28 = 1; s32 dl; // 24 switch (fmt) { @@ -2754,7 +2665,6 @@ s32 gd_gentexture(void *texture, s32 fmt, s32 size, UNUSED u32 arg3, UNUSED u32 switch (size) { case 33: size = 2; - sp2C = 16; break; default: fatal_printf("gd_gentexture(): bad size"); @@ -2789,13 +2699,6 @@ void func_801A4848(s32 linkDl) { sCurrentGdDl = curDl; } -/* 2530A8 -> 2530C0 */ -void stub_draw_label_text(UNUSED char *s) { - UNUSED u32 pad2; - UNUSED char *save = s; - UNUSED u8 pad[0x18]; -} - /* 2530C0 -> 2530D8; orig name: func_801A48F0 */ void set_active_view(struct ObjView *v) { sActiveView = v; @@ -2908,10 +2811,7 @@ void Proc801A5110(struct ObjView *view) { /* 253938 -> 2539DC; orig name: func_801A5168 */ void update_view_and_dl(struct ObjView *view) { - UNUSED u32 pad; - s32 prevFlags; // 18 - - prevFlags = view->flags; + s32 prevFlags = view->flags; update_view(view); if (prevFlags & VIEW_UPDATE) { sCurrentGdDl = sMHeadMainDls[gGdFrameBufNum]; @@ -2924,7 +2824,6 @@ void update_view_and_dl(struct ObjView *view) { /* 253BC8 -> 2540E0 */ void gd_init(void) { s32 i; // 34 - UNUSED u32 pad30; s8 *data; // 2c imin("gd_init"); @@ -3166,7 +3065,6 @@ void Unknown801A5FF8(struct ObjGroup *arg0) { struct ObjView *menuview; // 3c UNUSED struct ObjLabel *label; // 38 struct ObjGroup *menugrp; // 34 - UNUSED u32 pad2C[2]; d_start_group("menug"); sMenuGadgets[0] = d_makeobj(D_GADGET, "menu0"); @@ -3284,7 +3182,6 @@ void view_proc_print_timers(struct ObjView *self) { void make_timer_gadgets(void) { struct ObjLabel *timerLabel; struct ObjGroup *timerg; - UNUSED u32 pad6C; struct ObjView *timersview; struct ObjGadget *bar1; struct ObjGadget *bar2; diff --git a/src/goddard/renderer.h b/src/goddard/renderer.h index f4a990c3..799f2164 100644 --- a/src/goddard/renderer.h +++ b/src/goddard/renderer.h @@ -98,7 +98,6 @@ void set_Vtx_norm_buf_1(struct GdVec3f *norm); void set_Vtx_norm_buf_2(struct GdVec3f *norm); void set_gd_mtx_parameters(s32 params); void gd_set_one_cycle(void); -void gddl_is_loading_stub_dl(UNUSED s32 dlLoad); void start_view_dl(struct ObjView *view); void border_active_view(void); void gd_shading(s32 model); @@ -113,7 +112,6 @@ long defpup(UNUSED const char *menufmt, ...); void menu_cb_control_type(u32); void menu_cb_recalibrate_controller(u32); void func_801A4438(f32 x, f32 y, f32 z); -void stub_draw_label_text(UNUSED char *s); void set_active_view(struct ObjView *v); void func_801A520C(void); void gd_init(void); diff --git a/src/goddard/shape_helper.c b/src/goddard/shape_helper.c index 75f29b95..ac3ac53e 100644 --- a/src/goddard/shape_helper.c +++ b/src/goddard/shape_helper.c @@ -49,9 +49,7 @@ static struct GdAnimTransform unusedAnimData3[] = { UNUSED static struct AnimDataInfo unusedAnim3 = { ARRAY_COUNT(unusedAnimData3), GD_ANIM_SCALE3F_ROT3F_POS3F_2, unusedAnimData3 }; -UNUSED static s32 sUnref801A838C[6] = { 0 }; struct ObjShape *sSimpleShape = NULL; -UNUSED static s32 sUnref801A83A8[31] = { 0 }; UNUSED static struct DynList sSimpleDylist[8] = { // unused BeginList(), StartGroup("simpleg"), @@ -86,35 +84,24 @@ UNUSED static struct DynList sDynlist801A8604[4] = { static f64 D_801A8668 = 0.0; // bss -UNUSED static u8 sUnrefSpaceB00[0x2C]; // @ 801BAB00 static struct ObjGroup *sCubeShapeGroup; // @ 801BAB2C -UNUSED static u8 sUnrefSpaceB30[0xC]; // @ 801BAB30 static struct ObjShape *sCubeShape; // @ 801BAB3C -UNUSED static u8 sUnrefSpaceB40[0x8]; // @ 801BAB40 static char sGdLineBuf[0x100]; // @ 801BAB48 static s32 sGdLineBufCsr; // @ 801BAC48 static struct GdFile *sGdShapeFile; // @ 801BAC4C static struct ObjShape *sGdShapeListHead; // @ 801BAC50 static u32 sGdShapeCount; // @ 801BAC54 -UNUSED static u8 sUnrefSpaceC58[0x8]; // @ 801BAC58 static struct GdVec3f D_801BAC60; -UNUSED static u32 sUnrefSpaceC6C; // @ 801BAC6C -UNUSED static u32 sUnrefSpaceC70; // @ 801BAC70 static struct ObjPlane *D_801BAC74; static struct ObjPlane *D_801BAC78; // sShapeNetHead? -UNUSED static u8 sUnrefSpaceC80[0x1C]; // @ 801BAC80 static struct ObjFace *D_801BAC9C; static struct ObjFace *D_801BACA0; -UNUSED static u8 sUnrefSpaceCA8[0x10]; // @ 801BACA8 /// factor for scaling vertices in an `ObjShape` when calling `scale_verts_in_shape()` static struct GdVec3f sVertexScaleFactor; /// factor for translating vertices in an `ObjShape` when calling `translate_verts_in_shape()` static struct GdVec3f sVertexTranslateOffset; -UNUSED static u8 sUnrefSpaceCD8[0x30]; // @ 801BACD8 static struct ObjGroup *D_801BAD08; // group of planes from make_netfromshape -UNUSED static u8 sUnrefSpaceD10[0x20]; // @ 801BAD10 static struct GdVec3f sShapeCenter; // printed with "c=" -UNUSED static u8 sUnrefSpaceD40[0x120]; // @ 801BAD40 // Forward Declarations struct ObjMaterial *find_or_add_new_mtl(struct ObjGroup *, s32, f32, f32, f32); @@ -131,7 +118,6 @@ void func_80197280(void) { * Computes the normal vector for a face based on three of its vertices. */ void calc_face_normal(struct ObjFace *face) { - UNUSED u32 pad5C; struct GdVec3f p1; struct GdVec3f p2; struct GdVec3f p3; @@ -139,7 +125,6 @@ void calc_face_normal(struct ObjFace *face) { struct ObjVertex *vtx1; struct ObjVertex *vtx2; struct ObjVertex *vtx3; - UNUSED u32 pad1C; f32 mul = 1000.0f; imin("calc_facenormal"); @@ -260,7 +245,6 @@ void add_3_vtx_to_face(struct ObjFace *face, struct ObjVertex *vtx1, struct ObjV struct ObjShape *make_shape(s32 flag, const char *name) { struct ObjShape *newShape; struct ObjShape *curShapeHead; - UNUSED u32 pad; newShape = (struct ObjShape *) make_object(OBJ_TYPE_SHAPES); @@ -463,11 +447,6 @@ s32 getint(s32 *intPtr) { return !!bufCsr; } -/* @ 246838 for 0x14 */ -void Unknown80198068(UNUSED f32 a0) { - printf("max=%f\n", a0); -} - /* @ 24684C for 0x6C */ void func_8019807C(struct ObjVertex *vtx) { gd_rot_2d_vec(D_801BAC60.x, &vtx->pos.y, &vtx->pos.z); @@ -602,7 +581,6 @@ void Unknown801985E8(struct ObjShape *shape) { /* @ 246ED4 for 0x4FC; orig name: func_80198704 */ void get_3DG1_shape(struct ObjShape *shape) { - UNUSED u8 pad78[8]; struct GdVec3f tempNormal; /* maybe? */ s32 curFaceVtx; s32 faceVtxID; @@ -721,7 +699,6 @@ void get_3DG1_shape(struct ObjShape *shape) { /* @ 2473D0 for 0x390; orig name: func_80198C00 */ void get_OBJ_shape(struct ObjShape *shape) { - UNUSED u8 pad7D54[4]; struct GdColour faceClr; s32 curFaceVtx; s32 faceVtxIndex; @@ -909,15 +886,12 @@ void read_ARK_shape(struct ObjShape *shape, char *fileName) { } data; } vtx; - UNUSED u8 pad54[4]; struct GdVec3f sp48; struct ObjFace *sp44; // newly made face with mtl sp34; struct ObjFace *sp40 = NULL; // first made face struct ObjVertex *sp3C; // newly made vtx struct ObjVertex *sp38 = NULL; // first made vtx struct ObjMaterial *sp34; // found or new mtl for face - UNUSED s32 sp30 = 0; - UNUSED s32 sp2C = 0; shape->mtlGroup = make_group(0); @@ -1028,29 +1002,23 @@ struct GdFile *get_shape_from_file(struct ObjShape *shape, char *fileName) { /* @ 247F78 for 0x69c; orig name: Unknown801997A8 */ struct ObjShape *make_grid_shape(enum ObjTypeFlag gridType, s32 a1, s32 a2, s32 a3, s32 a4) { - UNUSED u32 pad1074; void *objBuf[32][32]; // vertex or particle depending on gridType f32 sp70; f32 sp6C; f32 sp68; - UNUSED u32 pad64; - UNUSED u32 pad60; f32 sp5C; s32 parI; s32 row; s32 col; - UNUSED s32 sp4C = 0; struct ObjShape *gridShape; f32 sp44; struct ObjFace *sp40 = NULL; // first made shape? struct ObjGroup *parOrVtxGrp; // group of made particles or vertices (based on gridType) - UNUSED u32 pad38; struct ObjGroup *mtlGroup; struct GdVec3f *sp30; // GdVec3f* ? from gd_get_colour struct GdVec3f *sp2C; //^ struct ObjMaterial *mtl1; // first made material struct ObjMaterial *mtl2; // second made material - UNUSED u32 pad20; sp30 = (struct GdVec3f *) gd_get_colour(a1); sp2C = (struct GdVec3f *) gd_get_colour(a2); @@ -1140,11 +1108,6 @@ struct ObjShape *make_grid_shape(enum ObjTypeFlag gridType, s32 a1, s32 a2, s32 return gridShape; } -/* @ 248614 for 0x44 */ -void Unknown80199E44(UNUSED s32 a0, struct GdObj *a1, struct GdObj *a2, UNUSED s32 a3) { - UNUSED struct ObjGroup *sp1C = make_group(2, a1, a2); -} - /* @ 248658 for 0x5c */ void Unknown80199E88(struct ObjFace *face) { D_801BAC74 = make_plane(FALSE, face); @@ -1280,9 +1243,7 @@ void animate_mario_head_normal(struct ObjAnimator *self) { */ s32 load_mario_head(void (*aniFn)(struct ObjAnimator *)) { struct ObjNet *sp54; // net made with sp48 group - UNUSED u8 pad4C[0x54 - 0x4c]; struct ObjGroup *sp48; // Joint group - UNUSED u8 pad40[0x48 - 0x40]; struct ObjGroup *mainShapesGrp; struct GdObj *sp38; // object list head before making a bunch of joints struct GdObj *faceJoint; // joint on the face that `grabberJoint` pulls @@ -1505,14 +1466,3 @@ struct ObjGroup *Unknown8019ADC4(UNUSED u32 a0) { return gGdLightGroup; } - -/* @ 249694 for 0x5c */ -struct ObjGroup *Unknown8019AEC4(UNUSED u32 a0) { - UNUSED u32 sp24; - UNUSED u32 sp20; - UNUSED struct GdObj *sp1C; - - sp1C = gGdObjectList; - gGdLightGroup = make_group(0); - return gGdLightGroup; -} diff --git a/src/goddard/skin.c b/src/goddard/skin.c index de820bcf..02964eac 100644 --- a/src/goddard/skin.c +++ b/src/goddard/skin.c @@ -80,11 +80,9 @@ void reset_net(struct ObjNet *net) { /* 240A64 -> 240ACC */ void func_80192294(struct ObjNet *net) { - UNUSED s32 sp1C = 0; - if (net->attachedToObj == NULL) { restart_timer("childpos"); - sp1C = transform_child_objects_recursive(&net->header, NULL); + transform_child_objects_recursive(&net->header, NULL); split_timer("childpos"); } } @@ -92,8 +90,6 @@ void func_80192294(struct ObjNet *net) { /* 240ACC -> 240B84 */ void func_801922FC(struct ObjNet *net) { struct ObjGroup *group; // 24 - UNUSED u32 pad18[2]; - gGdSkinNet = net; // TODO: netype constants? if (net->netType == 4) { @@ -198,46 +194,13 @@ void collision_something_801926A4(struct ObjNet *net) { net->torque.y *= 0.9; //? 0.9f } -/* 2412A0 -> 24142C; not called */ -void func_80192AD0(struct ObjNet *net) { - UNUSED u32 pad64; - struct ObjGroup *sp60; - UNUSED u32 pad20[0x10]; - UNUSED u32 sp1C; - struct ObjNet *sp18; - - if ((sp60 = net->unk1C8) == NULL) { - return; - } - - sp18 = net->unk1F0; - net->worldPos.x = net->unk1F4.x; - net->worldPos.y = net->unk1F4.y; - net->worldPos.z = net->unk1F4.z; - gd_rotate_and_translate_vec3f(&net->worldPos, &sp18->mat128); - - net->worldPos.x += net->unk1F0->worldPos.x; - net->worldPos.y += net->unk1F0->worldPos.y; - net->worldPos.z += net->unk1F0->worldPos.z; - net->unk200.x = 0.0f; - net->unk200.y = 10.0f; - net->unk200.z = -4.0f; - gd_rotate_and_translate_vec3f(&net->unk200, &sp18->mat128); - - apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t) func_80191824, sp60); - func_80191E88(sp60); - apply_to_obj_types_in_group(OBJ_TYPE_BONES, (applyproc_t) func_8018F328, net->unk20C); -} - /* 24142C -> 24149C; orig name: func_80192C5C */ void move_bonesnet(struct ObjNet *net) { - struct ObjGroup *sp24; - UNUSED u32 pad18[3]; - + struct ObjGroup *group; imin("move_bonesnet"); gd_set_identity_mat4(&D_801B9DC8); - if ((sp24 = net->unk1C8) != NULL) { - apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t) func_801913C0, sp24); + if ((group = net->unk1C8) != NULL) { + apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t) func_801913C0, group); } imout(); } @@ -346,7 +309,6 @@ void convert_gd_verts_to_Vn(struct ObjGroup *grp) { /* 241AB4 -> 241BCC; orig name: func_801932E4 */ void convert_gd_verts_to_Vtx(struct ObjGroup *grp) { - UNUSED u32 pad24[6]; register struct VtxLink *vtxlink; // a1 #ifndef GBI_FLOATS register s16 *vtxcoords; // a2 diff --git a/src/goddard/skin_movement.c b/src/goddard/skin_movement.c index 7105ec76..902758be 100644 --- a/src/goddard/skin_movement.c +++ b/src/goddard/skin_movement.c @@ -66,8 +66,6 @@ void scale_verts(struct ObjGroup *a0) { /* @ 23000C for 0x58; orig name: func8018183C*/ void move_skin(struct ObjNet *net) { - UNUSED u8 pad1C[8]; - if (net->shapePtr != NULL) { scale_verts(net->shapePtr->scaledVtxGroup); } @@ -110,7 +108,6 @@ void func_80181894(struct ObjJoint *joint) { /* @ 2301A0 for 0x110 */ void reset_weight_vtx(struct ObjVertex *vtx) { struct GdVec3f localVec; - UNUSED u8 pad24[0x10]; if (sResetWeightVtxNum++ == sResetCurWeight->vtxId) { // found matching vertex sResetCurWeight->vtx = vtx; @@ -128,16 +125,13 @@ void reset_weight_vtx(struct ObjVertex *vtx) { } void reset_weight(struct ObjWeight *weight) { - UNUSED u32 vtxCount; - UNUSED u32 pad20; struct ObjGroup *skinGroup; sResetCurWeight = weight; sResetWeightVtxNum = 0; if ((skinGroup = gGdSkinNet->skinGrp) != NULL) { // Go through every vertex in the skin group, and reset the weight if the vertex is managed by the weight - vtxCount = - apply_to_obj_types_in_group(OBJ_TYPE_VERTICES, (applyproc_t) reset_weight_vtx, skinGroup); + apply_to_obj_types_in_group(OBJ_TYPE_VERTICES, (applyproc_t) reset_weight_vtx, skinGroup); } else { fatal_printf("reset_weight(): Skin net has no SkinGroup"); } diff --git a/src/menu/intro_geo.c b/src/menu/intro_geo.c index debb2fd0..934e89b3 100644 --- a/src/menu/intro_geo.c +++ b/src/menu/intro_geo.c @@ -3,6 +3,7 @@ #include "game/memory.h" #include "game/segment2.h" #include "game/segment7.h" +#include "engine/math_util.h" #include "intro_geo.h" #include "sm64.h" #include "textures.h" @@ -28,9 +29,6 @@ struct GraphNodeMore { }; // intro geo bss -#ifdef VERSION_SH -static u16 *sFrameBuffers[3]; -#endif static s32 sGameOverFrameCounter; static s32 sGameOverTableIndex; static s16 sIntroFrameCounter; @@ -46,9 +44,6 @@ Gfx *geo_intro_super_mario_64_logo(s32 state, struct GraphNode *node, UNUSED voi Mtx *scaleMat; f32 *scaleTable1 = segmented_to_virtual(intro_seg7_table_scale_1); f32 *scaleTable2 = segmented_to_virtual(intro_seg7_table_scale_2); - f32 scaleX; - f32 scaleY; - f32 scaleZ; if (state != 1) { sIntroFrameCounter = 0; @@ -57,30 +52,23 @@ Gfx *geo_intro_super_mario_64_logo(s32 state, struct GraphNode *node, UNUSED voi scaleMat = alloc_display_list(sizeof(*scaleMat)); dl = alloc_display_list(4 * sizeof(*dl)); dlIter = dl; + Vec3f scale; // determine scale based on the frame counter if (sIntroFrameCounter >= 0 && sIntroFrameCounter < INTRO_STEPS_ZOOM_IN) { // zooming in - scaleX = scaleTable1[sIntroFrameCounter * 3]; - scaleY = scaleTable1[sIntroFrameCounter * 3 + 1]; - scaleZ = scaleTable1[sIntroFrameCounter * 3 + 2]; + vec3_copy(scale, &scaleTable1[sIntroFrameCounter * 3]); } else if (sIntroFrameCounter >= INTRO_STEPS_ZOOM_IN && sIntroFrameCounter < INTRO_STEPS_HOLD_1) { // holding - scaleX = 1.0f; - scaleY = 1.0f; - scaleZ = 1.0f; + vec3_same(scale, 1.0f); } else if (sIntroFrameCounter >= INTRO_STEPS_HOLD_1 && sIntroFrameCounter < INTRO_STEPS_ZOOM_OUT) { // zooming out - scaleX = scaleTable2[(sIntroFrameCounter - INTRO_STEPS_HOLD_1) * 3]; - scaleY = scaleTable2[(sIntroFrameCounter - INTRO_STEPS_HOLD_1) * 3 + 1]; - scaleZ = scaleTable2[(sIntroFrameCounter - INTRO_STEPS_HOLD_1) * 3 + 2]; + vec3_copy(scale, &scaleTable2[(sIntroFrameCounter - INTRO_STEPS_HOLD_1) * 3]); } else { // disappeared - scaleX = 0.0f; - scaleY = 0.0f; - scaleZ = 0.0f; + vec3_zero(scale); } - guScale(scaleMat, scaleX, scaleY, scaleZ); + guScale(scaleMat, scale[0], scale[1], scale[2]); gSPMatrix(dlIter++, scaleMat, G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_PUSH); gSPDisplayList(dlIter++, &intro_seg7_dl_main_logo); // draw model