diff --git a/bin/segment2.c b/bin/segment2.c index b7076e901..b10412813 100644 --- a/bin/segment2.c +++ b/bin/segment2.c @@ -2237,12 +2237,6 @@ ROM_ASSET_LOAD_TEXTURE(texture_waterbox_mist, "textures/segment2/segment2.13458. ROM_ASSET_LOAD_TEXTURE(texture_waterbox_lava, "textures/segment2/segment2.13C58.rgba16.inc.c", 0x00108a40, 48390, 0x00016ab8, 2048); -// Unreferenced light group -UNUSED static const Lights1 segment2_lights_unused = gdSPDefLights1( - 0x40, 0x40, 0x40, - 0xff, 0xff, 0xff, 0x28, 0x28, 0x28 -); - // 0x02014470 - 0x020144B0 static const Mtx matrix_identity = { {{1.0f, 0.0f, 0.0f, 0.0f}, diff --git a/data/dynos_bin_actor.cpp b/data/dynos_bin_actor.cpp index c90138424..bd207a7c7 100644 --- a/data/dynos_bin_actor.cpp +++ b/data/dynos_bin_actor.cpp @@ -263,9 +263,6 @@ void DynOS_Actor_GeneratePack(const SysPath &aPackFolder) { if (fs_sys_dir_exists(_Folder.c_str())) { _GfxData->mModelIdentifier = 0; - // Remember the geo layout count - UNUSED s32 prevGeoLayoutCount = _GfxData->mGeoLayouts.Count(); - DynOS_Read_Source(_GfxData, fstring("%s/texture.inc.c", _Folder.c_str())); DynOS_Read_Source(_GfxData, fstring("%s/model.inc.c", _Folder.c_str())); DynOS_Read_Source(_GfxData, fstring("%s/geo.inc.c", _Folder.c_str())); diff --git a/data/dynos_bin_behavior.cpp b/data/dynos_bin_behavior.cpp index 517c819f6..1142265bc 100644 --- a/data/dynos_bin_behavior.cpp +++ b/data/dynos_bin_behavior.cpp @@ -1928,7 +1928,6 @@ DataNode *FindDataNode(DataNodes &aDataNodes, String &aName, u32 aModelIde static BehaviorScript ParseBehaviorScriptSymbolArgInternal(GfxData *aGfxData, DataNode *aNode, u64 &aTokenIndex, bool *found) { String _Arg = aNode->mTokens[aTokenIndex++]; - UNUSED u64 _ModelIdentifier = aNode->mModelIdentifier; *found = true; // Remove (de-)referencing diff --git a/data/dynos_bin_lvl.cpp b/data/dynos_bin_lvl.cpp index 846108050..64c6e8a58 100644 --- a/data/dynos_bin_lvl.cpp +++ b/data/dynos_bin_lvl.cpp @@ -390,7 +390,6 @@ DataNode* FindDataNode(DataNodes& aDataNodes, String& aName, u32 aModelIde static LevelScript ParseLevelScriptSymbolArgInternal(GfxData* aGfxData, DataNode* aNode, u64& aTokenIndex, bool* found) { String _Arg = aNode->mTokens[aTokenIndex++]; - UNUSED u64 _ModelIdentifier = aNode->mModelIdentifier; *found = true; // Integers diff --git a/data/dynos_bin_pointer.cpp b/data/dynos_bin_pointer.cpp index 366a8fac3..96524cfd7 100644 --- a/data/dynos_bin_pointer.cpp +++ b/data/dynos_bin_pointer.cpp @@ -196,7 +196,6 @@ static PointerData GetDataFromPointer(const void* aPtr, GfxData* aGfxData) { // Vertices String _VtxArrayName = ""; - UNUSED uintptr_t _VtxArrayStart = 0; for (auto& _Node : aGfxData->mVertices) { if (_Node->mData == aPtr) { return { _Node->mName, _Offset }; diff --git a/src/audio/heap.c b/src/audio/heap.c index a07ba672d..8390cbda7 100644 --- a/src/audio/heap.c +++ b/src/audio/heap.c @@ -422,11 +422,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 diff --git a/src/engine/behavior_script.c b/src/engine/behavior_script.c index e26c3ea35..a9c827b77 100644 --- a/src/engine/behavior_script.c +++ b/src/engine/behavior_script.c @@ -147,12 +147,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) { diff --git a/src/engine/surface_collision.c b/src/engine/surface_collision.c index 268c3f892..0adddf9c5 100644 --- a/src/engine/surface_collision.c +++ b/src/engine/surface_collision.c @@ -573,8 +573,6 @@ f32 unused_obj_find_floor_height(struct Object *obj) { */ struct FloorGeometry sFloorGeo; -UNUSED static u8 unused8038BE50[0x40]; - /** * Return the floor height underneath (xPos, yPos, zPos) and populate `floorGeo` * with data about the floor's normal vector and origin offset. Also update diff --git a/src/game/object_helpers.c b/src/game/object_helpers.c index 94bb18076..17706b909 100644 --- a/src/game/object_helpers.c +++ b/src/game/object_helpers.c @@ -1731,9 +1731,6 @@ void cur_obj_move_y(f32 gravity, f32 bounciness, f32 buoyancy) { } } -UNUSED static void stub_obj_helpers_1(void) { -} - void cur_obj_unused_resolve_wall_collisions(f32 offsetY, f32 radius) { if (!o) { return; } if (radius > 0.1L) { @@ -2723,9 +2720,6 @@ void bhv_dust_smoke_loop(void) { o->oSmokeTimer++; } -UNUSED static void stub_obj_helpers_2(void) { -} - s32 cur_obj_set_direction_table(s8 *a0) { if (!o) { return 0; } o->oToxBoxMovementPattern = a0; @@ -2910,9 +2904,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) { if (!o) { return; } struct Surface *floor; diff --git a/src/goddard/draw_objects.c b/src/goddard/draw_objects.c index 58599299f..e0f601a3f 100644 --- a/src/goddard/draw_objects.c +++ b/src/goddard/draw_objects.c @@ -61,7 +61,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 @@ -71,20 +70,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 diff --git a/src/goddard/gd_main.c b/src/goddard/gd_main.c index 225eb3198..33b0bf79b 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/old_menu.c b/src/goddard/old_menu.c index 3587d182e..b8f2fc6f6 100644 --- a/src/goddard/old_menu.c +++ b/src/goddard/old_menu.c @@ -23,7 +23,6 @@ // bss static char sDefSettingsMenuStr[0x100]; static struct GdVec3f sStaticVec; -UNUSED static struct GdVec3f unusedVec; static struct ObjGadget *sCurGadgetPtr; // forward declarations diff --git a/src/goddard/renderer.c b/src/goddard/renderer.c index aa62816be..635d057ff 100644 --- a/src/goddard/renderer.c +++ b/src/goddard/renderer.c @@ -111,10 +111,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 @@ -134,11 +132,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 @@ -168,21 +163,15 @@ 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]; 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 -UNUSED 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 @@ -197,11 +186,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; static struct GdVec3f D_801A86CC = { 1.0f, 1.0f, 1.0f }; static struct ObjView *sActiveView = NULL; // @ 801A86D8 current view? used when drawing dl @@ -212,7 +199,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 UNUSED static struct DynListBankInfo sDynLists[] = { // @ 801A8704 @@ -223,16 +209,9 @@ UNUSED static struct DynListBankInfo sDynLists[] = { // @ 801A8704 }; // textures and display list data -UNUSED static Gfx gd_texture1_dummy_aligner1[] = { // @ 801A8728 - gsSPEndDisplayList(), -}; ROM_ASSET_LOAD_TEXTURE(gd_texture_hand_open, "textures/intro_raw/hand_open.rgba16.inc.c", 0x00258d80, 2048, 0x00000000, 2048); -UNUSED static Gfx gd_texture2_dummy_aligner1[] = { - gsSPEndDisplayList() -}; - ROM_ASSET_LOAD_TEXTURE(gd_texture_hand_closed, "textures/intro_raw/hand_closed.rgba16.inc.c", 0x00259588, 2048, 0x00000000, 2048); ROM_ASSET_LOAD_TEXTURE(gd_texture_red_star_0, "textures/intro_raw/red_star_0.rgba16.inc.c", 0x00259d88, 2048, 0x00000000, 2048); @@ -274,14 +253,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), @@ -630,10 +601,6 @@ static Gfx *gd_silver_sparkle_dl_array[] = { #endif }; -UNUSED static Gfx gd_texture3_dummy_aligner1[] = { - gsSPEndDisplayList(), -}; - ROM_ASSET_LOAD_TEXTURE(gd_texture_mario_face_shine, "textures/intro_raw/mario_face_shine.ia8.inc.c", 0x00265350, 1024, 0x00000000, 1024); static Gfx gd_dl_mario_face_shine[] = { @@ -673,42 +640,8 @@ 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), diff --git a/src/goddard/shape_helper.c b/src/goddard/shape_helper.c index 2e58f52d0..3aedd8e1f 100644 --- a/src/goddard/shape_helper.c +++ b/src/goddard/shape_helper.c @@ -28,61 +28,7 @@ struct ObjShape *gShapeRedSpark = NULL; // @ 801A82EC struct ObjShape *gShapeSilverSpark = NULL; // @ 801A82F0 struct ObjShape *gShapeRedStar = NULL; // @ 801A82F4 struct ObjShape *gShapeSilverStar = NULL; // @ 801A82F8 - -// Not sure what this data is, but it looks like stub animation data - -UNUSED static struct GdAnimTransform unusedAnimData1[] = { - { {1.0, 1.0, 1.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0} }, -}; - -UNUSED static struct AnimDataInfo unusedAnim1 = { ARRAY_COUNT(unusedAnimData1), GD_ANIM_SCALE3F_ROT3F_POS3F_2, unusedAnimData1 }; - -UNUSED static struct GdAnimTransform unusedAnimData2[] = { - { {1.0, 1.0, 1.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0} }, -}; - -UNUSED static struct AnimDataInfo unusedAnim2 = { ARRAY_COUNT(unusedAnimData2), GD_ANIM_SCALE3F_ROT3F_POS3F_2, unusedAnimData2 }; - -UNUSED static struct GdAnimTransform unusedAnimData3[] = { - { {1.0, 1.0, 1.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0} }, -}; - -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"), - MakeDynObj(D_NET, "simple"), - SetType(3), - SetShapePtrPtr(&sSimpleShape), - EndGroup("simpleg"), - UseObj("simpleg"), - EndList(), -}; -static struct DynList sDynlist801A84E4[3] = { - BeginList(), - SetFlag(0x1800), - EndList(), -}; -UNUSED static struct DynList sDynlist801A85B3[5] = { - BeginList(), CallList(sDynlist801A84E4), SetFlag(0x400), SetFriction(0.04, 0.01, 0.01), - EndList(), -}; -UNUSED static struct DynList sDynlist801A85A4[4] = { - BeginList(), - CallList(sDynlist801A84E4), - SetFriction(0.04, 0.01, 0.01), - EndList(), -}; -UNUSED static struct DynList sDynlist801A8604[4] = { - BeginList(), - CallList(sDynlist801A84E4), - SetFriction(0.005, 0.005, 0.005), - EndList(), -}; static f64 D_801A8668 = 0.0; // bss diff --git a/src/pc/rom_assets.h b/src/pc/rom_assets.h index 46ac124eb..b9ab584ca 100644 --- a/src/pc/rom_assets.h +++ b/src/pc/rom_assets.h @@ -52,7 +52,6 @@ __attribute__((constructor)) static void _name ## _rom_assets_queue () { \ } #define ROM_ASSET_LOAD_MARIO_ANIM(_name, _ptr, _physicalAddress, _physicalSize, _segmentedAddress, _segmentedSize) \ -UNUSED static u16 _name[(_segmentedSize) / 2] = { 0 }; \ __attribute__((constructor)) static void _name ## _rom_assets_queue () { \ rom_assets_queue(_ptr, ROM_ASSET_ANIM, _physicalAddress, _physicalSize, _segmentedAddress, _segmentedSize); \ }