diff --git a/include/f_op/f_op_camera.h b/include/f_op/f_op_camera.h index ab9b8ab9d..39111e37d 100644 --- a/include/f_op/f_op_camera.h +++ b/include/f_op/f_op_camera.h @@ -1,10 +1,8 @@ #ifndef F_F_OP_CAMERA_H_ #define F_F_OP_CAMERA_H_ -#include "d/d_cam_param.h" #include "d/d_camera.h" #include "f_op/f_op_view.h" -#include "global.h" typedef struct leafdraw_method_class leafdraw_method_class; diff --git a/include/weak_bss_3569.h b/include/weak_bss_3569.h new file mode 100644 index 000000000..9444c6e5e --- /dev/null +++ b/include/weak_bss_3569.h @@ -0,0 +1,12 @@ +#ifndef WEAK_BSS_3569_H +#define WEAK_BSS_3569_H + +// Fake header. +// This is some kind of weak objects that get included in the .bss sections of several TUs. +// Its true source is currently unknown, so include this header in TUs that need it to match for now. + +#include "dolphin/mtx/vec.h" + +static Vec bss_3569; + +#endif /* WEAK_BSS_3569_H */ diff --git a/include/weak_bss_936_to_1036.h b/include/weak_bss_936_to_1036.h new file mode 100644 index 000000000..d4be24287 --- /dev/null +++ b/include/weak_bss_936_to_1036.h @@ -0,0 +1,30 @@ +#ifndef WEAK_BSS_936_TO_1036_H +#define WEAK_BSS_936_TO_1036_H + +// Fake header. +// These are some kind of weak objects that get included in the .bss sections of several TUs. +// Their true source is currently unknown, so include this header in TUs that need them to match for now. + +#include "global.h" + +#include "weak_bss_3569.h" // IWYU pragma: keep + +// They each have size 1, and alignment 1 in the debug maps, but alignment 4 in the non-debug maps. +static u8 bss_1036 ALIGN_DECL(4); +static u8 bss_1034 ALIGN_DECL(4); +static u8 bss_1032 ALIGN_DECL(4); +static u8 bss_1031 ALIGN_DECL(4); +static u8 bss_1026 ALIGN_DECL(4); +static u8 bss_1024 ALIGN_DECL(4); +static u8 bss_1022 ALIGN_DECL(4); +static u8 bss_1021 ALIGN_DECL(4); +static u8 bss_984 ALIGN_DECL(4); +static u8 bss_982 ALIGN_DECL(4); +static u8 bss_980 ALIGN_DECL(4); +static u8 bss_979 ALIGN_DECL(4); +static u8 bss_941 ALIGN_DECL(4); +static u8 bss_939 ALIGN_DECL(4); +static u8 bss_937 ALIGN_DECL(4); +static u8 bss_936 ALIGN_DECL(4); + +#endif /* WEAK_BSS_936_TO_1036_H */ diff --git a/include/weak_data_1811.h b/include/weak_data_1811.h new file mode 100644 index 000000000..1252c91ea --- /dev/null +++ b/include/weak_data_1811.h @@ -0,0 +1,22 @@ +#ifndef WEAK_DATA_1811_H +#define WEAK_DATA_1811_H + +// Fake header. +// @1811 is a weak object that gets included in the .data sections of several TUs. +// Its true source is this line: +// u8 attnFnTbl[] = { GX_AF_NONE, GX_AF_SPEC, GX_AF_NONE, GX_AF_SPOT }; +// Which appears in the weak function J3DColorChan::getAttnFn, which is supposed to go in a header. +// But for some reason, that line causes the weak objects to appear in .rodata. +// So for now, that function is moved to the .cpp file, and TUs that need this object should include this header. + +#include "weak_data_2100_2080.h" // IWYU pragma: keep + +static u8 data_1811[] = {0x02, 0x00, 0x02, 0x01}; + +// This object is strange, as it has no symbol associated with it. +// It always seems to come after @1811 ends at offset 0x1C, getting padded to start at 0x20 and ending at 0x30. +// It being an array of two doubles is guessed based on how it looks and its apparently 0x8 byte alignment. +// Its actual purpose is unknown since it's never used. +static f64 data_no_symbol_3_5[2] = {3.0, 0.5}; + +#endif /* WEAK_DATA_1811_H */ diff --git a/include/weak_data_2100_2080.h b/include/weak_data_2100_2080.h new file mode 100644 index 000000000..f66af5afb --- /dev/null +++ b/include/weak_data_2100_2080.h @@ -0,0 +1,17 @@ +#ifndef WEAK_DATA_2100_2080_H +#define WEAK_DATA_2100_2080_H + +// Fake header. +// These are weak objects that get included in the .data sections of several TUs. +// Their true source is likely this line of code that appears twice in J3DJoint.h: +// J3DSys::mParentS = (Vec){1.0f, 1.0f, 1.0f}; +// But for some reason, that line causes the weak objects to appear in .rodata. +// So for now, the line is commented out, and TUs that need these objects should include this header. +// Note: For d_snap and J3DUClipper, these objects *are* supposed to appear in .rodata, but those are the only ones. + +#include "dolphin/mtx/vec.h" + +static Vec data_2100 = {1.0f, 1.0f, 1.0f}; +static Vec data_2080 = {1.0f, 1.0f, 1.0f}; + +#endif /* WEAK_DATA_2100_2080_H */ diff --git a/src/JSystem/J3DGraphBase/J3DSys.cpp b/src/JSystem/J3DGraphBase/J3DSys.cpp index 8e910641c..cbfed0a8d 100644 --- a/src/JSystem/J3DGraphBase/J3DSys.cpp +++ b/src/JSystem/J3DGraphBase/J3DSys.cpp @@ -5,9 +5,7 @@ #include "JSystem/J3DGraphBase/J3DSys.h" #include "JSystem/J3DGraphBase/J3DGD.h" -#include "JSystem/J3DGraphBase/J3DTexture.h" #include "JSystem/J3DGraphBase/J3DTevs.h" -#include "JSystem/J3DGraphBase/J3DShape.h" #include "dolphin/os/OS.h" #include "global.h" diff --git a/src/d/actor/d_a_agb.cpp b/src/d/actor/d_a_agb.cpp index bd01b2031..6d6c76aff 100644 --- a/src/d/actor/d_a_agb.cpp +++ b/src/d/actor/d_a_agb.cpp @@ -24,11 +24,8 @@ #include "d/actor/d_a_bomb.h" #include "stdio.h" -static u8 dummy_3569[0xC]; - -// Needed for the .data section to match. -static Vec dummy_2100 = {1.0f, 1.0f, 1.0f}; -static Vec dummy_2080 = {1.0f, 1.0f, 1.0f}; +#include "weak_bss_3569.h" // IWYU pragma: keep +#include "weak_data_2100_2080.h" // IWYU pragma: keep static mDoDvdThd_toMainRam_c* l_gbaCommand; diff --git a/src/d/actor/d_a_agbsw0.cpp b/src/d/actor/d_a_agbsw0.cpp index 176b3786e..b0d2ef0af 100644 --- a/src/d/actor/d_a_agbsw0.cpp +++ b/src/d/actor/d_a_agbsw0.cpp @@ -6,11 +6,7 @@ #include "global.h" #include "d/d_procname.h" -// need to figure out what's putting this data in front of a bunch of rels with the compiler-generated symbol names -static f32 dummy[3] = {1.0f, 1.0f, 1.0f}; -static f32 dummy2[3] = {1.0f, 1.0f, 1.0f}; -static u8 dummy3[4] = {0x02, 0x00, 0x02, 0x01}; -static f64 dummy4[2] = {3.0, 0.5}; +#include "weak_data_1811.h" // IWYU pragma: keep #include "d/actor/d_a_agbsw0.h" #include "f_op/f_op_actor_mng.h" diff --git a/src/d/actor/d_a_am.cpp b/src/d/actor/d_a_am.cpp index 10e3b3ef9..9c3eadeed 100644 --- a/src/d/actor/d_a_am.cpp +++ b/src/d/actor/d_a_am.cpp @@ -25,11 +25,7 @@ #include "d/actor/d_a_bomb.h" #include "d/actor/d_a_bomb2.h" -// Needed for the .data section to match. -static f32 dummy1[3] = {1.0f, 1.0f, 1.0f}; -static f32 dummy2[3] = {1.0f, 1.0f, 1.0f}; -static u8 dummy3[4] = {0x02, 0x00, 0x02, 0x01}; -static f64 dummy4[2] = {3.0, 0.5}; +#include "weak_data_1811.h" // IWYU pragma: keep enum Action { ACTION_DOUSA = 0x0, diff --git a/src/d/actor/d_a_am2.cpp b/src/d/actor/d_a_am2.cpp index 6b5d494f1..78bbd3dd8 100644 --- a/src/d/actor/d_a_am2.cpp +++ b/src/d/actor/d_a_am2.cpp @@ -19,14 +19,10 @@ #include "d/d_jnt_hit.h" #include "d/d_cc_uty.h" #include "SSystem/SComponent/c_lib.h" -#include "f_op/f_op_camera_mng.h" +#include "f_op/f_op_camera.h" #include "f_op/f_op_kankyo_mng.h" -// Needed for the .data section to match. -static f32 dummy1[3] = {1.0f, 1.0f, 1.0f}; -static f32 dummy2[3] = {1.0f, 1.0f, 1.0f}; -static u8 dummy3[4] = {0x02, 0x00, 0x02, 0x01}; -static f64 dummy4[2] = {3.0, 0.5}; +#include "weak_data_1811.h" // IWYU pragma: keep enum Action { ACTION_DOUSA = 0x0, diff --git a/src/d/actor/d_a_arrow.cpp b/src/d/actor/d_a_arrow.cpp index b5a8056f9..b0072683f 100644 --- a/src/d/actor/d_a_arrow.cpp +++ b/src/d/actor/d_a_arrow.cpp @@ -23,9 +23,7 @@ u32 daPy_py_c::checkPlayerFly() const { return 0; } #include "d/d_s_play.h" #include "d/res/res_link.h" -// Needed for the .data section to match. -static f32 dummy1[3] = {1.0f, 1.0f, 1.0f}; -static f32 dummy2[3] = {1.0f, 1.0f, 1.0f}; +#include "weak_data_2100_2080.h" // IWYU pragma: keep s16 daArrow_c::m_count; diff --git a/src/d/actor/d_a_att.cpp b/src/d/actor/d_a_att.cpp index 4dba34974..aa787c6cd 100644 --- a/src/d/actor/d_a_att.cpp +++ b/src/d/actor/d_a_att.cpp @@ -10,11 +10,7 @@ #include "d/actor/d_a_bgn.h" #if VERSION == VERSION_USA -// Needed for the .data section to match. -static Vec dummy_2100 = {1.0f, 1.0f, 1.0f}; -static Vec dummy_2080 = {1.0f, 1.0f, 1.0f}; -static u8 dummy_1811[] = {0x02, 0x00, 0x02, 0x01}; -static f64 dummy4[2] = {3.0, 0.5}; +#include "weak_data_1811.h" // IWYU pragma: keep #endif static bgn_class* boss; diff --git a/src/d/actor/d_a_auction.cpp b/src/d/actor/d_a_auction.cpp index 6298d9788..fe0249d5d 100644 --- a/src/d/actor/d_a_auction.cpp +++ b/src/d/actor/d_a_auction.cpp @@ -11,6 +11,9 @@ #include "d/d_procname.h" #include "m_Do/m_Do_controller_pad.h" +#include "weak_bss_936_to_1036.h" // IWYU pragma: keep +#include "weak_data_1811.h" // IWYU pragma: keep + struct NpcDatStruct { /* 0x00 */ f32 field_0x00; /* 0x04 */ f32 field_0x04; @@ -34,8 +37,6 @@ struct NpcCameraDatStruct { /* 0x0A */ s16 field_0x0A; }; -static u8 dummy_bss[0x4C]; - static cXyz l_camera_pos[3][2] = { cXyz(-265.0f, 48.0f, -631.0f), cXyz(332.0f, 232.0f, 286.0f), @@ -51,12 +52,6 @@ static cXyz l_camera_pos[3][2] = { static daAuction_HIO_c l_HIO; #endif -// Needed for the .data section to match. -static f32 dummy1[3] = {1.0f, 1.0f, 1.0f}; -static f32 dummy2[3] = {1.0f, 1.0f, 1.0f}; -static u8 dummy3[4] = {0x02, 0x00, 0x02, 0x01}; -static f64 dummy4[2] = {3.0f, 0.5f}; - static daAuction_c::ItemData l_item_dat[] = { {dItem_JOY_PENDANT_e, 0x1D10, 40, 0x0F01}, diff --git a/src/d/actor/d_a_bflower.cpp b/src/d/actor/d_a_bflower.cpp index 11a43d458..bda5df3cb 100644 --- a/src/d/actor/d_a_bflower.cpp +++ b/src/d/actor/d_a_bflower.cpp @@ -10,12 +10,9 @@ #include "d/actor/d_a_player_main.h" #include "d/actor/d_a_bomb2.h" -static cXyz bomb_offset(0.0f, 0.0f, 0.0f); +#include "weak_data_1811.h" // IWYU pragma: keep -static f32 dummy1[3] = {1.0f, 1.0f, 1.0f}; -static f32 dummy2[3] = {1.0f, 1.0f, 1.0f}; -static u8 dummy3[4] = {0x02, 0x00, 0x02, 0x01}; -static f64 dummy4[2] = {3.0f, 0.5f}; +static cXyz bomb_offset(0.0f, 0.0f, 0.0f); static dCcD_SrcCyl l_cyl_src = { // dCcD_SrcGObjInf diff --git a/src/d/actor/d_a_bita.cpp b/src/d/actor/d_a_bita.cpp index 8e985c626..ac04b792f 100644 --- a/src/d/actor/d_a_bita.cpp +++ b/src/d/actor/d_a_bita.cpp @@ -15,16 +15,7 @@ #include "m_Do/m_Do_ext.h" #include "m_Do/m_Do_mtx.h" -static Vec dummy1 = { 1.0f, 1.0f, 1.0f }; -static Vec dummy2 = { 1.0f, 1.0f, 1.0f }; -static struct { - u32 m0; - f32 m1; - f32 m2; - f32 m3; - f32 m4; - f32 m5; -} dummy3 = { 0x02000201, 0.0f, 2.125f, 0.0f, 1.75f, 0.0f }; +#include "weak_data_1811.h" // IWYU pragma: keep static btd_class* btd = NULL; diff --git a/src/d/actor/d_a_bk.cpp b/src/d/actor/d_a_bk.cpp index 982903cf7..62e0be34e 100644 --- a/src/d/actor/d_a_bk.cpp +++ b/src/d/actor/d_a_bk.cpp @@ -26,7 +26,8 @@ #include "d/d_snap.h" #include "JSystem/JUtility/JUTReport.h" -static u8 dummy[0x49]; +#include "weak_bss_936_to_1036.h" // IWYU pragma: keep +#include "weak_data_1811.h" // IWYU pragma: keep static u8 hio_set; static u8 another_hit; @@ -34,12 +35,6 @@ static fopAc_ac_c* ken; static s8 search_sp; static bkHIO_c l_bkHIO; -// Needed for the .data section to match. -static Vec dummy_2100 = {1.0f, 1.0f, 1.0f}; -static Vec dummy_2080 = {1.0f, 1.0f, 1.0f}; -static u8 dummy_1811[] = {0x02, 0x00, 0x02, 0x01}; -static f64 dummy4[2] = {3.0, 0.5}; - static dCcG_At_Spl bk_at_kind[] = { dCcG_At_Spl_UNK0, dCcG_At_Spl_UNK1, dCcG_At_Spl_UNK0 }; static int bk_attack_ready_SE[] = { JA_SE_CV_BK_KAMAE, JA_SE_CV_BK_KAMAE, -0xDCF }; // TODO what is -0xDCF? static int bk_attack_go_SE[] = { JA_SE_CV_BK_ATTACK_S, JA_SE_CV_BK_ATTACK_L, -0xDCF }; // TODO what is -0xDCF? diff --git a/src/d/actor/d_a_boko.cpp b/src/d/actor/d_a_boko.cpp index 900d7139c..fc594d802 100644 --- a/src/d/actor/d_a_boko.cpp +++ b/src/d/actor/d_a_boko.cpp @@ -8,7 +8,7 @@ #include "d/d_procname.h" #include "d/d_bg_s_lin_chk.h" -static u8 dummy_bss[0x4C]; +#include "weak_bss_936_to_1036.h" // IWYU pragma: keep static cXyz l_break_particle_offset(0.0f, 0.0f, 30.0f); dBgS_ObjGndChk daBoko_c::m_ground_check; @@ -21,7 +21,8 @@ static u8 l_HIO; /* 000000EC-0000017C .text keDraw__8daBoko_cFv */ void daBoko_c::keDraw() { - mpLineMat->update(0xA, 1.25f, (GXColor){0xFF, 0x64, 0x00, 0xFF}, 2, &tevStr); + GXColor color = {0xFF, 0x64, 0x00, 0xFF}; + mpLineMat->update(0xA, 1.25f, color, 2, &tevStr); dComIfGd_set3DlineMat(mpLineMat); } diff --git a/src/d/actor/d_a_bomb2.cpp b/src/d/actor/d_a_bomb2.cpp index 65dc5ac5e..f984e310d 100644 --- a/src/d/actor/d_a_bomb2.cpp +++ b/src/d/actor/d_a_bomb2.cpp @@ -14,9 +14,7 @@ #include "f_op/f_op_kankyo_mng.h" #include "m_Do/m_Do_mtx.h" -// Needed for the .data section to match. -static f32 dummy1[3] = {1.0f, 1.0f, 1.0f}; -static f32 dummy2[3] = {1.0f, 1.0f, 1.0f}; +#include "weak_data_2100_2080.h" // IWYU pragma: keep namespace daBomb2 { namespace { diff --git a/src/d/actor/d_a_bomb3.inc b/src/d/actor/d_a_bomb3.inc index addc816e9..a613af1f8 100644 --- a/src/d/actor/d_a_bomb3.inc +++ b/src/d/actor/d_a_bomb3.inc @@ -15,9 +15,7 @@ #include "m_Do/m_Do_lib.h" #include "d/res/res_vbakh.h" -// Needed for the .data section to match. -static f32 dummy1[3] = {1.0f, 1.0f, 1.0f}; -static f32 dummy2[3] = {1.0f, 1.0f, 1.0f}; +#include "weak_data_2100_2080.h" // IWYU pragma: keep namespace { enum AttrSt_e { diff --git a/src/d/actor/d_a_deku_item.cpp b/src/d/actor/d_a_deku_item.cpp index 0d778b64d..df7acaf0a 100644 --- a/src/d/actor/d_a_deku_item.cpp +++ b/src/d/actor/d_a_deku_item.cpp @@ -8,11 +8,7 @@ #include "d/d_com_inf_game.h" #include "d/d_procname.h" -// Needed for the .data section to match. -static f32 dummy1[3] = {1.0f, 1.0f, 1.0f}; -static f32 dummy2[3] = {1.0f, 1.0f, 1.0f}; -static u8 dummy3[4] = {0x02, 0x00, 0x02, 0x01}; -static f64 dummy4[2] = {3.0, 0.5}; +#include "weak_data_1811.h" // IWYU pragma: keep const char daDekuItem_c::m_arcname[] = "Deku"; diff --git a/src/d/actor/d_a_demo_item.cpp b/src/d/actor/d_a_demo_item.cpp index b8b29c3a5..870bcbd64 100644 --- a/src/d/actor/d_a_demo_item.cpp +++ b/src/d/actor/d_a_demo_item.cpp @@ -14,7 +14,7 @@ #include "m_Do/m_Do_mtx.h" #include "f_op/f_op_camera.h" -static u8 dummy[0x4C]; // TODO +#include "weak_bss_936_to_1036.h" // IWYU pragma: keep const int daDitem_c::m_rot_time = 8*30; diff --git a/src/d/actor/d_a_esa.cpp b/src/d/actor/d_a_esa.cpp index bd97560bf..f0c5f9ead 100644 --- a/src/d/actor/d_a_esa.cpp +++ b/src/d/actor/d_a_esa.cpp @@ -4,17 +4,18 @@ // #include "d/actor/d_a_esa.h" -#include "d/res/res_link.h" -#include "JSystem/JKernel/JKRHeap.h" -#include "f_op/f_op_actor_mng.h" +#include "d/actor/d_a_player.h" +#include "d/actor/d_a_sea.h" +#include "d/d_bg_s_gnd_chk.h" +#include "d/d_bg_s_lin_chk.h" #include "d/d_s_play.h" #include "d/d_com_inf_game.h" #include "d/d_procname.h" #include "d/d_bg_s_func.h" -#include "d/actor/d_a_sea.h" -#include "d/actor/d_a_player_main.h" +#include "d/res/res_link.h" +#include "f_op/f_op_actor_mng.h" -static Vec bss_3569; +#include "weak_bss_3569.h" // IWYU pragma: keep /* 800E7E60-800E7EA8 .text daEsa_Draw__FP9esa_class */ static BOOL daEsa_Draw(esa_class* i_this) { diff --git a/src/d/actor/d_a_ghostship.cpp b/src/d/actor/d_a_ghostship.cpp index 2289bb539..001665471 100644 --- a/src/d/actor/d_a_ghostship.cpp +++ b/src/d/actor/d_a_ghostship.cpp @@ -13,11 +13,7 @@ #include "d/d_kankyo_wether.h" #include "d/res/res_cloth.h" -// Needed for .data to match. -static f32 dummy1[3] = {1.0f, 1.0f, 1.0f}; -static f32 dummy2[3] = {1.0f, 1.0f, 1.0f}; -static u8 dummy3[4] = {0x02, 0x00, 0x02, 0x01}; -static f64 dummy4[2] = {3.0, 0.5}; +#include "weak_data_1811.h" // IWYU pragma: keep const u32 daGhostship_c::m_heapsize = 0x1EA0; const char daGhostship_c::m_arc_name[] = "Ayush"; diff --git a/src/d/actor/d_a_grass.cpp b/src/d/actor/d_a_grass.cpp index 34092fba9..b31046ca8 100644 --- a/src/d/actor/d_a_grass.cpp +++ b/src/d/actor/d_a_grass.cpp @@ -9,12 +9,11 @@ #include "d/d_com_inf_game.h" #include "d/d_flower.h" #include "d/d_grass.h" -#include "d/d_item_data.h" #include "d/d_procname.h" #include "d/d_tree.h" #include "SSystem/SComponent/c_sxyz.h" -static u8 dummy[0x4C]; +#include "weak_bss_936_to_1036.h" // IWYU pragma: keep namespace daGrass_prm { inline s8 getItemNo(grass_class* ac) { return (fopAcM_GetParam(ac) >> 6) & 0x3F; } diff --git a/src/d/actor/d_a_hookshot.cpp b/src/d/actor/d_a_hookshot.cpp index 647a51be4..d6e69ba2a 100644 --- a/src/d/actor/d_a_hookshot.cpp +++ b/src/d/actor/d_a_hookshot.cpp @@ -11,9 +11,7 @@ #include "d/d_procname.h" #include "global.h" -// Needed for the .data section to match. -static Vec dummy_2100 = {1.0f, 1.0f, 1.0f}; -static Vec dummy_2080 = {1.0f, 1.0f, 1.0f}; +#include "weak_data_2100_2080.h" // IWYU pragma: keep static u8 l_chainS3TCTEX[] ALIGN_DECL(32) = { 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, diff --git a/src/d/actor/d_a_ib.cpp b/src/d/actor/d_a_ib.cpp index 974dfd675..81590467e 100644 --- a/src/d/actor/d_a_ib.cpp +++ b/src/d/actor/d_a_ib.cpp @@ -14,9 +14,7 @@ #include "global.h" #include "m_Do/m_Do_mtx.h" -// Needed for the .data section to match. -static f32 dummy1[3] = {1.0f, 1.0f, 1.0f}; -static f32 dummy2[3] = {1.0f, 1.0f, 1.0f}; +#include "weak_data_2100_2080.h" // IWYU pragma: keep struct daIball_c__data { /* 0x00 */ u8 m00; diff --git a/src/d/actor/d_a_item.cpp b/src/d/actor/d_a_item.cpp index 0f9862532..78e7aa1ab 100644 --- a/src/d/actor/d_a_item.cpp +++ b/src/d/actor/d_a_item.cpp @@ -14,9 +14,7 @@ #include "m_Do/m_Do_mtx.h" #include "m_Do/m_Do_controller_pad.h" -// Needed for the .data section to match. -static f32 dummy1[3] = {1.0f, 1.0f, 1.0f}; -static f32 dummy2[3] = {1.0f, 1.0f, 1.0f}; +#include "weak_data_2100_2080.h" // IWYU pragma: keep s32 daItem_c::m_timer_max = 10000; diff --git a/src/d/actor/d_a_lod_bg.cpp b/src/d/actor/d_a_lod_bg.cpp index c063b9f19..40dcb94a1 100644 --- a/src/d/actor/d_a_lod_bg.cpp +++ b/src/d/actor/d_a_lod_bg.cpp @@ -14,16 +14,7 @@ #include "JSystem/J3DGraphLoader/J3DModelLoader.h" #include -static Vec dummy1 = { 1.0f, 1.0f, 1.0f }; -static Vec dummy2 = { 1.0f, 1.0f, 1.0f }; -static struct { - u32 m0; - f32 m1; - f32 m2; - f32 m3; - f32 m4; - f32 m5; -} dummy3 = { 0x02000201, 0.0f, 2.125f, 0.0f, 1.75f, 0.0f }; +#include "weak_data_1811.h" // IWYU pragma: keep const char daLodbg_c::LodAllPath[] = "/res/Stage/sea/LODALL.arc"; diff --git a/src/d/actor/d_a_movie_player.cpp b/src/d/actor/d_a_movie_player.cpp index 3ef89ae56..a83c31994 100644 --- a/src/d/actor/d_a_movie_player.cpp +++ b/src/d/actor/d_a_movie_player.cpp @@ -15,24 +15,7 @@ #include "dolphin/os/OSMessage.h" #include "dolphin/base/PPCArch.h" -static Vec bss_3569; -// Not sure what these are, but they have size 1, and alignment 1 in the debug maps, but alignment 4 in the non-debug maps. -static u8 bss_1036 ALIGN_DECL(4); -static u8 bss_1034 ALIGN_DECL(4); -static u8 bss_1032 ALIGN_DECL(4); -static u8 bss_1031 ALIGN_DECL(4); -static u8 bss_1026 ALIGN_DECL(4); -static u8 bss_1024 ALIGN_DECL(4); -static u8 bss_1022 ALIGN_DECL(4); -static u8 bss_1021 ALIGN_DECL(4); -static u8 bss_984 ALIGN_DECL(4); -static u8 bss_982 ALIGN_DECL(4); -static u8 bss_980 ALIGN_DECL(4); -static u8 bss_979 ALIGN_DECL(4); -static u8 bss_941 ALIGN_DECL(4); -static u8 bss_939 ALIGN_DECL(4); -static u8 bss_937 ALIGN_DECL(4); -static u8 bss_936 ALIGN_DECL(4); +#include "weak_bss_936_to_1036.h" // IWYU pragma: keep static u8 THPStatistics[0x460]; // TODO diff --git a/src/d/actor/d_a_npc_bs1.cpp b/src/d/actor/d_a_npc_bs1.cpp index 3ca8750a6..abcfad1f9 100644 --- a/src/d/actor/d_a_npc_bs1.cpp +++ b/src/d/actor/d_a_npc_bs1.cpp @@ -21,11 +21,7 @@ #include "m_Do/m_Do_mtx.h" #include "m_Do/m_Do_controller_pad.h" -// Needed for the .data section to match. -static Vec dummy_2100 = {1.0f, 1.0f, 1.0f}; -static Vec dummy_2080 = {1.0f, 1.0f, 1.0f}; -static u8 dummy_1811[] = {0x02, 0x00, 0x02, 0x01}; -static f64 dummy4[2] = {3.0, 0.5}; +#include "weak_data_1811.h" // IWYU pragma: keep static fpc_ProcID l_msgId; static msg_class* l_msg; diff --git a/src/d/actor/d_a_npc_btsw2.cpp b/src/d/actor/d_a_npc_btsw2.cpp index 158f96ef7..5573af62e 100644 --- a/src/d/actor/d_a_npc_btsw2.cpp +++ b/src/d/actor/d_a_npc_btsw2.cpp @@ -13,13 +13,8 @@ #include "m_Do/m_Do_ext.h" #include "m_Do/m_Do_mtx.h" -// Needed for the .data section to match. -static f32 dummy1[3] = {1.0f, 1.0f, 1.0f}; -static f32 dummy2[3] = {1.0f, 1.0f, 1.0f}; -static u8 dummy3[4] = {0x02, 0x00, 0x02, 0x01}; -static f64 dummy4[2] = {3.0, 0.5}; - -static u8 dummy[0x4C]; +#include "weak_bss_936_to_1036.h" // IWYU pragma: keep +#include "weak_data_1811.h" // IWYU pragma: keep static daNpc_Btsw2_HIO_c l_HIO; diff --git a/src/d/actor/d_a_npc_ji1.cpp b/src/d/actor/d_a_npc_ji1.cpp index cf371f076..5638ccf6d 100644 --- a/src/d/actor/d_a_npc_ji1.cpp +++ b/src/d/actor/d_a_npc_ji1.cpp @@ -13,17 +13,11 @@ #include "d/d_lib.h" #include "f_op/f_op_msg.h" +#include "weak_data_1811.h" // IWYU pragma: keep +#include "weak_bss_936_to_1036.h" // IWYU pragma: keep + static void daNpc_Ji1_setHairAngle(daNpc_Ji1_c*); -// Needed for the .data section to match. -static f32 dummy1[3] = {1.0f, 1.0f, 1.0f}; -static f32 dummy2[3] = {1.0f, 1.0f, 1.0f}; -static u8 dummy3[4] = {0x02, 0x00, 0x02, 0x01}; -static f64 dummy4[2] = {3.0, 0.5}; - -// There's also a bunch of unreferenced stuff at the start of .bss -static u8 dummy5[0x4C]; - static daNpc_Ji1_HIO_c l_HIO; static fpc_ProcID l_msgId; diff --git a/src/d/actor/d_a_npc_kamome.cpp b/src/d/actor/d_a_npc_kamome.cpp index 3e5a479f9..842a3a30e 100644 --- a/src/d/actor/d_a_npc_kamome.cpp +++ b/src/d/actor/d_a_npc_kamome.cpp @@ -16,14 +16,10 @@ #include "d/d_snap.h" #include "d/d_camera.h" -// Needed for the .data section to match. -static f32 dummy1[3] = {1.0f, 1.0f, 1.0f}; -static f32 dummy2[3] = {1.0f, 1.0f, 1.0f}; -static u8 dummy3[4] = {0x02, 0x00, 0x02, 0x01}; -static f64 dummy4[2] = {3.0, 0.5}; +#include "weak_bss_936_to_1036.h" // IWYU pragma: keep +#include "weak_data_1811.h" // IWYU pragma: keep static char* l_staff_name = "HyoiKam"; -static u8 temp[0x4C]; // TODO static daNpc_kam_HIO_c l_HIO; static int l_hio_counter; static fpc_ProcID l_msgId; diff --git a/src/d/actor/d_a_npc_md.cpp b/src/d/actor/d_a_npc_md.cpp index 6d2ec1a59..324e4fda0 100644 --- a/src/d/actor/d_a_npc_md.cpp +++ b/src/d/actor/d_a_npc_md.cpp @@ -16,13 +16,8 @@ #include "d/d_camera.h" #include "d/d_detect.h" -// Needed for the .data section to match. -static f32 dummy1[3] = {1.0f, 1.0f, 1.0f}; -static f32 dummy2[3] = {1.0f, 1.0f, 1.0f}; -static u8 dummy3[4] = {0x02, 0x00, 0x02, 0x01}; -static f64 dummy4[2] = {3.0, 0.5}; - -static u8 temp[0x4C]; // TODO +#include "weak_data_1811.h" // IWYU pragma: keep +#include "weak_bss_936_to_1036.h" // IWYU pragma: keep static daNpc_Md_HIO_c l_HIO; diff --git a/src/d/actor/d_a_npc_nz.cpp b/src/d/actor/d_a_npc_nz.cpp index 7125d967e..5145418cf 100644 --- a/src/d/actor/d_a_npc_nz.cpp +++ b/src/d/actor/d_a_npc_nz.cpp @@ -12,13 +12,8 @@ #include "d/d_item.h" #include "d/d_procname.h" -static u8 dummy_bss[0x4C]; - -// need to figure out what's putting this data in front of a bunch of rels -static f32 dummy[3] = {1.0f, 1.0f, 1.0f}; -static f32 dummy2[3] = {1.0f, 1.0f, 1.0f}; -static u8 dummy3[4] = {0x02, 0x00, 0x02, 0x01}; -static f64 dummy4[2] = {3.0, 0.5}; +#include "weak_bss_936_to_1036.h" // IWYU pragma: keep +#include "weak_data_1811.h" // IWYU pragma: keep const char daNpc_Nz_c::m_arc_name[] = "NZ"; const char daNpc_Nz_c::m_bdl_arc_name[] = "Npcnz"; diff --git a/src/d/actor/d_a_npc_os.cpp b/src/d/actor/d_a_npc_os.cpp index 650ad943f..8bb7af031 100644 --- a/src/d/actor/d_a_npc_os.cpp +++ b/src/d/actor/d_a_npc_os.cpp @@ -12,13 +12,8 @@ #include "m_Do/m_Do_controller_pad.h" #include "d/actor/d_a_player_main.h" -// Needed for the .data section to match. -static f32 dummy1[3] = {1.0f, 1.0f, 1.0f}; -static f32 dummy2[3] = {1.0f, 1.0f, 1.0f}; -static u8 dummy3[4] = {0x02, 0x00, 0x02, 0x01}; -static f64 dummy4[2] = {3.0, 0.5}; - -static u8 temp[0x4C]; // TODO +#include "weak_bss_936_to_1036.h" // IWYU pragma: keep +#include "weak_data_1811.h" // IWYU pragma: keep static daNpc_Os_HIO_c l_HIO; static s32 l_hio_counter = 0; diff --git a/src/d/actor/d_a_npc_people.cpp b/src/d/actor/d_a_npc_people.cpp index 843516828..18394ff8e 100644 --- a/src/d/actor/d_a_npc_people.cpp +++ b/src/d/actor/d_a_npc_people.cpp @@ -18,13 +18,9 @@ #include "f_op/f_op_actor_mng.h" #include "m_Do/m_Do_lib.h" -extern dCcD_SrcCyl dNpc_cyl_src; +#include "weak_data_1811.h" // IWYU pragma: keep -// Needed for the .data section to match. -static f32 dummy1[3] = {1.0f, 1.0f, 1.0f}; -static f32 dummy2[3] = {1.0f, 1.0f, 1.0f}; -static u8 dummy3[4] = {0x02, 0x00, 0x02, 0x01}; -static f64 dummy4[2] = {3.0, 0.5}; +extern dCcD_SrcCyl dNpc_cyl_src; static char* l_npc_staff_id[] = { "Uo1", diff --git a/src/d/actor/d_a_npc_roten.cpp b/src/d/actor/d_a_npc_roten.cpp index bacea5ef3..952f3a570 100644 --- a/src/d/actor/d_a_npc_roten.cpp +++ b/src/d/actor/d_a_npc_roten.cpp @@ -14,13 +14,9 @@ #include "d/d_a_obj.h" #include "d/d_snap.h" -extern dCcD_SrcCyl dNpc_cyl_src; +#include "weak_data_1811.h" // IWYU pragma: keep -// Needed for the .data section to match. -static Vec dummy1 = {1.0f, 1.0f, 1.0f}; -static Vec dummy2 = {1.0f, 1.0f, 1.0f}; -static u8 dummy3[] = {0x02, 0x00, 0x02, 0x01}; -static f64 dummy4[2] = {3.0, 0.5}; +extern dCcD_SrcCyl dNpc_cyl_src; static const char* l_arcname_tbl[] = { "Ro", diff --git a/src/d/actor/d_a_obj_Ygush00.cpp b/src/d/actor/d_a_obj_Ygush00.cpp index f4d4c2369..99a0c745b 100644 --- a/src/d/actor/d_a_obj_Ygush00.cpp +++ b/src/d/actor/d_a_obj_Ygush00.cpp @@ -15,16 +15,12 @@ #include "m_Do/m_Do_ext.h" #include "m_Do/m_Do_mtx.h" +#include "weak_data_1811.h" // IWYU pragma: keep + namespace { static const char l_arcname[] = "Ygush00"; }; -// Needed for the .data section to match. -static f32 dummy1[3] = {1.0f, 1.0f, 1.0f}; -static f32 dummy2[3] = {1.0f, 1.0f, 1.0f}; -static u8 dummy3[4] = {0x02, 0x00, 0x02, 0x01}; -static f64 dummy4[2] = {3.0, 0.5}; - /* 00000078-0000009C .text solidHeapCB__14daObjYgush00_cFP10fopAc_ac_c */ BOOL daObjYgush00_c::solidHeapCB(fopAc_ac_c* ac) { return ((daObjYgush00_c*)ac)->create_heap(); diff --git a/src/d/actor/d_a_obj_bscurtain.cpp b/src/d/actor/d_a_obj_bscurtain.cpp index fef4167f3..c79307b4e 100644 --- a/src/d/actor/d_a_obj_bscurtain.cpp +++ b/src/d/actor/d_a_obj_bscurtain.cpp @@ -6,16 +6,14 @@ #include "d/actor/d_a_obj_bscurtain.h" #include "d/res/res_ptc.h" #include "f_op/f_op_actor_mng.h" -#include "JSystem/JParticle/JPAParticle.h" #include "JSystem/JUtility/JUTAssert.h" #include "d/d_bg_w.h" #include "d/d_com_inf_game.h" #include "d/d_procname.h" #include "m_Do/m_Do_ext.h" -#include "m_Do/m_Do_hostIO.h" #include "m_Do/m_Do_mtx.h" -static u8 dummy[0x4C]; // TODO +#include "weak_bss_936_to_1036.h" // IWYU pragma: keep daObj_Bscurtain_HIO_c l_HIO; diff --git a/src/d/actor/d_a_obj_eskban.cpp b/src/d/actor/d_a_obj_eskban.cpp index cb95f21b0..f7dc2b05c 100644 --- a/src/d/actor/d_a_obj_eskban.cpp +++ b/src/d/actor/d_a_obj_eskban.cpp @@ -3,25 +3,16 @@ // Translation Unit: d_a_obj_eskban.cpp // -#include "f_op/f_op_actor_mng.h" - #include "d/d_procname.h" #include "d/d_com_inf_game.h" #include "d/actor/d_a_obj_eskban.h" #include "d/res/res_eskban.h" +#include "f_op/f_op_actor_mng.h" -/* .bss alignment */ -static u8 dummy[0x4c]; +#include "weak_bss_936_to_1036.h" // IWYU pragma: keep +#include "weak_data_1811.h" // IWYU pragma: keep namespace daObjEskban { -/* .data alignment, seemingly unused by this unit */ -static Vec _data_align[4] = { - {1, 1, 1}, - {1, 1, 1}, - {9.40453e-38 /* possibly not actually a float? */, 0, 2.125}, - {0, 1.75, 0}, -}; - Mtx Act_c::M_tmp_mtx; const char Act_c::M_arcname[7] = "Eskban"; const char Act_c::M_evname[7] = "Eskban"; diff --git a/src/d/actor/d_a_obj_ferris.cpp b/src/d/actor/d_a_obj_ferris.cpp index a8f98dab7..a46fdd4ae 100644 --- a/src/d/actor/d_a_obj_ferris.cpp +++ b/src/d/actor/d_a_obj_ferris.cpp @@ -12,7 +12,7 @@ #include "m_Do/m_Do_ext.h" #include "m_Do/m_Do_mtx.h" -static u8 dummy[0x4C]; +#include "weak_bss_936_to_1036.h" // IWYU pragma: keep namespace daObjFerris { namespace { diff --git a/src/d/actor/d_a_obj_figure.cpp b/src/d/actor/d_a_obj_figure.cpp index 3c745c4aa..616f63406 100644 --- a/src/d/actor/d_a_obj_figure.cpp +++ b/src/d/actor/d_a_obj_figure.cpp @@ -14,7 +14,7 @@ #include "d/actor/d_a_player_main.h" #include "m_Do/m_Do_controller_pad.h" -static u8 dummy_bss[0x4C]; +#include "weak_bss_936_to_1036.h" // IWYU pragma: keep #define TOTAL_FIGURE_COUNT 0x86 diff --git a/src/d/actor/d_a_obj_hole.cpp b/src/d/actor/d_a_obj_hole.cpp index 5ff939fef..16fa199b3 100644 --- a/src/d/actor/d_a_obj_hole.cpp +++ b/src/d/actor/d_a_obj_hole.cpp @@ -16,12 +16,7 @@ #include "m_Do/m_Do_ext.h" #include "m_Do/m_Do_mtx.h" - -// Needed for the .data section to match. -static f32 dummy1[3] = {1.0f, 1.0f, 1.0f}; -static f32 dummy2[3] = {1.0f, 1.0f, 1.0f}; -static u8 dummy3[4] = {0x02, 0x00, 0x02, 0x01}; -static f64 dummy4[2] = {3.0, 0.5}; +#include "weak_data_1811.h" // IWYU pragma: keep static daObj_Hole_HIO_c l_HIO; diff --git a/src/d/actor/d_a_obj_homensmoke.cpp b/src/d/actor/d_a_obj_homensmoke.cpp index 094fc0339..17f0a4546 100644 --- a/src/d/actor/d_a_obj_homensmoke.cpp +++ b/src/d/actor/d_a_obj_homensmoke.cpp @@ -9,7 +9,7 @@ #include "m_Do/m_Do_mtx.h" #include "d/d_com_inf_game.h" -static u8 temp[0x4C]; +#include "weak_bss_936_to_1036.h" // IWYU pragma: keep namespace daObjHomensmoke { /* 000000EC-00000230 .text set_mtx__Q215daObjHomensmoke5Act_cFv */ diff --git a/src/d/actor/d_a_obj_ladder.cpp b/src/d/actor/d_a_obj_ladder.cpp index 3fc0be8a2..a2472e02a 100644 --- a/src/d/actor/d_a_obj_ladder.cpp +++ b/src/d/actor/d_a_obj_ladder.cpp @@ -8,11 +8,7 @@ #include "d/d_com_inf_game.h" #include "d/d_procname.h" -// Needed for .data to match. -static f32 dummy1[3] = {1.0f, 1.0f, 1.0f}; -static f32 dummy2[3] = {1.0f, 1.0f, 1.0f}; -static u8 dummy3[4] = {0x02, 0x00, 0x02, 0x01}; -static f64 dummy4[2] = {3.0, 0.5}; +#include "weak_data_1811.h" // IWYU pragma: keep Mtx daObjLadder::Act_c::M_tmp_mtx; diff --git a/src/d/actor/d_a_obj_movebox.cpp b/src/d/actor/d_a_obj_movebox.cpp index 6e15d5636..26ec4b4f1 100644 --- a/src/d/actor/d_a_obj_movebox.cpp +++ b/src/d/actor/d_a_obj_movebox.cpp @@ -6,12 +6,8 @@ #include "global.h" #include "d/d_procname.h" -// Needed for the .data and .bss sections to match. -static f32 dummy1[3] = {1.0f, 1.0f, 1.0f}; -static f32 dummy2[3] = {1.0f, 1.0f, 1.0f}; -static u8 dummy3[4] = {0x02, 0x00, 0x02, 0x01}; -static f64 dummy4[2] = {3.0, 0.5}; -static u8 dummy5[0x4C]; +#include "weak_bss_936_to_1036.h" // IWYU pragma: keep +#include "weak_data_1811.h" // IWYU pragma: keep #include "d/actor/d_a_obj_movebox.h" #include "d/res/res_ecube.h" diff --git a/src/d/actor/d_a_obj_mtest.cpp b/src/d/actor/d_a_obj_mtest.cpp index e660fe49b..3e8d98258 100644 --- a/src/d/actor/d_a_obj_mtest.cpp +++ b/src/d/actor/d_a_obj_mtest.cpp @@ -12,12 +12,8 @@ #include "d/d_com_inf_game.h" #include "m_Do/m_Do_mtx.h" -// Needed for the .data and .bss sections to match. -static f32 dummy1[3] = {1.0f, 1.0f, 1.0f}; -static f32 dummy2[3] = {1.0f, 1.0f, 1.0f}; -static u8 dummy3[4] = {0x02, 0x00, 0x02, 0x01}; -static f64 dummy4[2] = {3.0, 0.5}; -static u8 dummy5[0x4C]; +#include "weak_bss_936_to_1036.h" // IWYU pragma: keep +#include "weak_data_1811.h" // IWYU pragma: keep char* daObjMtest::Act_c::M_arcname[Type_Max] = { "Mtest", diff --git a/src/d/actor/d_a_obj_paper.cpp b/src/d/actor/d_a_obj_paper.cpp index 1a1745b7b..7136440b4 100644 --- a/src/d/actor/d_a_obj_paper.cpp +++ b/src/d/actor/d_a_obj_paper.cpp @@ -20,11 +20,7 @@ #include "m_Do/m_Do_ext.h" #include "m_Do/m_Do_mtx.h" -// Needed for the .data section to match. -static f32 dummy1[3] = {1.0f, 1.0f, 1.0f}; -static f32 dummy2[3] = {1.0f, 1.0f, 1.0f}; -static u8 dummy3[4] = {0x02, 0x00, 0x02, 0x01}; -static f64 dummy4[2] = {3.0f, 0.5f}; +#include "weak_data_1811.h" // IWYU pragma: keep namespace daObjPaper { namespace { diff --git a/src/d/actor/d_a_obj_timer.cpp b/src/d/actor/d_a_obj_timer.cpp index 03066701b..fe383b237 100644 --- a/src/d/actor/d_a_obj_timer.cpp +++ b/src/d/actor/d_a_obj_timer.cpp @@ -5,13 +5,9 @@ #include "d/actor/d_a_obj_timer.h" #include "d/d_procname.h" -#include "d/d_com_inf_game.h" +#include "d/d_com_inf_game.h" // IWYU pragma: keep // Needed for dComIfGs_isSwitch inline definition -// Needed for the .data section to match. -static f32 dummy1[3] = {1.0f, 1.0f, 1.0f}; -static f32 dummy2[3] = {1.0f, 1.0f, 1.0f}; -static u8 dummy3[4] = {0x02, 0x00, 0x02, 0x01}; -static f64 dummy4[2] = {3.0, 0.5}; +#include "weak_data_1811.h" // IWYU pragma: keep /* 00000078-00000114 .text _create__Q210daObjTimer5Act_cFv */ s32 daObjTimer::Act_c::_create() { diff --git a/src/d/actor/d_a_obj_toripost.cpp b/src/d/actor/d_a_obj_toripost.cpp index 14e023c72..74489b86f 100644 --- a/src/d/actor/d_a_obj_toripost.cpp +++ b/src/d/actor/d_a_obj_toripost.cpp @@ -18,6 +18,8 @@ #include "m_Do/m_Do_ext.h" #include "m_Do/m_Do_mtx.h" +#include "weak_data_1811.h" // IWYU pragma: keep + extern dScnPly_reg_HIO_c g_regHIO; const char daObjTpost_c::m_arc_name[] = "Toripost"; @@ -75,12 +77,6 @@ const s32 daObjTpost_c::m_send_price[] = { static daObjTpost_HIO_c l_HIO; -// need to figure out what's putting this data in front of a bunch of rels with the compiler-generated symbol names -static Vec dummy = {1.0f, 1.0f, 1.0f}; -static Vec dummy2 = {1.0f, 1.0f, 1.0f}; -static u8 dummy3[4] = {0x02, 0x00, 0x02, 0x01}; -static f64 dummy4[2] = {3.0, 0.5}; - /* 000000EC-0000010C .text createHeap_CB__FP10fopAc_ac_c */ static BOOL createHeap_CB(fopAc_ac_c* i_this) { return static_cast(i_this)->_createHeap(); diff --git a/src/d/actor/d_a_obj_vgnfd.cpp b/src/d/actor/d_a_obj_vgnfd.cpp index e97808309..5b6a1261a 100644 --- a/src/d/actor/d_a_obj_vgnfd.cpp +++ b/src/d/actor/d_a_obj_vgnfd.cpp @@ -9,16 +9,7 @@ #include "d/res/res_vgnfd.h" #include "JSystem/JUtility/JUTAssert.h" -static Vec dummy1 = { 1.0f, 1.0f, 1.0f }; -static Vec dummy2 = { 1.0f, 1.0f, 1.0f }; -static struct { - u32 m0; - f32 m1; - f32 m2; - f32 m3; - f32 m4; - f32 m5; -} dummy3 = { 0x02000201, 0.0f, 2.125f, 0.0f, 1.75f, 0.0f }; +#include "weak_data_1811.h" // IWYU pragma: keep const s32 daObjVgnfd_c::M_bdl_table[] = { VGNFD_BDL_VGNFD0, diff --git a/src/d/actor/d_a_pedestal.cpp b/src/d/actor/d_a_pedestal.cpp index 1c8ab1458..04c652395 100644 --- a/src/d/actor/d_a_pedestal.cpp +++ b/src/d/actor/d_a_pedestal.cpp @@ -7,11 +7,7 @@ #include "d/d_procname.h" #include "d/res/res_hdai1.h" -// Needed for the .data section to match. -static f32 dummy1[3] = {1.0f, 1.0f, 1.0f}; -static f32 dummy2[3] = {1.0f, 1.0f, 1.0f}; -static u8 dummy3[4] = {0x02, 0x00, 0x02, 0x01}; -static f64 dummy4[2] = {3.0, 0.5}; +#include "weak_data_1811.h" // IWYU pragma: keep namespace daPedestal { diff --git a/src/d/actor/d_a_pirate_flag.cpp b/src/d/actor/d_a_pirate_flag.cpp index ba37b954a..87f2e6c12 100644 --- a/src/d/actor/d_a_pirate_flag.cpp +++ b/src/d/actor/d_a_pirate_flag.cpp @@ -10,30 +10,8 @@ #include "d/actor/d_a_obj_pirateship.h" #include "d/d_kankyo_wether.h" -static Vec bss_3569; -// Not sure what these are, but they have size 1, and alignment 1 in the debug maps, but alignment 4 in the non-debug maps. -static u8 bss_1036 ALIGN_DECL(4); -static u8 bss_1034 ALIGN_DECL(4); -static u8 bss_1032 ALIGN_DECL(4); -static u8 bss_1031 ALIGN_DECL(4); -static u8 bss_1026 ALIGN_DECL(4); -static u8 bss_1024 ALIGN_DECL(4); -static u8 bss_1022 ALIGN_DECL(4); -static u8 bss_1021 ALIGN_DECL(4); -static u8 bss_984 ALIGN_DECL(4); -static u8 bss_982 ALIGN_DECL(4); -static u8 bss_980 ALIGN_DECL(4); -static u8 bss_979 ALIGN_DECL(4); -static u8 bss_941 ALIGN_DECL(4); -static u8 bss_939 ALIGN_DECL(4); -static u8 bss_937 ALIGN_DECL(4); -static u8 bss_936 ALIGN_DECL(4); - -// Needed for the .data section to match. -static Vec dummy_2100 = {1.0f, 1.0f, 1.0f}; -static Vec dummy_2080 = {1.0f, 1.0f, 1.0f}; -static u8 dummy_1811[] = {0x02, 0x00, 0x02, 0x01}; -static f64 dummy4[2] = {3.0, 0.5}; +#include "weak_bss_936_to_1036.h" // IWYU pragma: keep +#include "weak_data_1811.h" // IWYU pragma: keep static Vec l_pos[25] = { {0.0f, 2200.0f, 0.0f}, diff --git a/src/d/actor/d_a_player.cpp b/src/d/actor/d_a_player.cpp index 66b73ae9a..7d1916e5f 100644 --- a/src/d/actor/d_a_player.cpp +++ b/src/d/actor/d_a_player.cpp @@ -6,7 +6,7 @@ #include "dolphin/types.h" #include "d/actor/d_a_player.h" #include "d/d_com_inf_game.h" -#include "f_op/f_op_camera_mng.h" +#include "f_op/f_op_camera.h" /* 801028FC-80102940 .text changePlayer__9daPy_py_cFP10fopAc_ac_c */ void daPy_py_c::changePlayer(fopAc_ac_c* newPlayer) { diff --git a/src/d/actor/d_a_player_dproc.inc b/src/d/actor/d_a_player_dproc.inc index b2108d3c9..f26badf50 100644 --- a/src/d/actor/d_a_player_dproc.inc +++ b/src/d/actor/d_a_player_dproc.inc @@ -11,6 +11,8 @@ */ #include "d/actor/d_a_player_main.h" +#include "d/actor/d_a_itembase.h" +#include "d/d_procname.h" /* 8012CD60-8012CDD4 .text getDemoLookActor__9daPy_lk_cFv */ void daPy_lk_c::getDemoLookActor() { diff --git a/src/d/actor/d_a_player_food.inc b/src/d/actor/d_a_player_food.inc index 392f8dead..0e1fe9b8a 100644 --- a/src/d/actor/d_a_player_food.inc +++ b/src/d/actor/d_a_player_food.inc @@ -12,7 +12,7 @@ #include "d/actor/d_a_player_main.h" #include "d/actor/d_a_player_HIO.h" -#include "f_op/f_op_camera.h" +#include "d/d_camera.h" #include "d/d_com_inf_game.h" #include "d/d_item_data.h" #include "d/d_procname.h" diff --git a/src/d/actor/d_a_player_main.cpp b/src/d/actor/d_a_player_main.cpp index 56c930504..13142f63d 100644 --- a/src/d/actor/d_a_player_main.cpp +++ b/src/d/actor/d_a_player_main.cpp @@ -33,7 +33,8 @@ #include "SSystem/SComponent/c_counter.h" #include "m_Do/m_Do_graphic.h" -static u8 dummy[0xC]; +#include "weak_bss_3569.h" // IWYU pragma: keep + JGeometry::TVec3 l_hammer_splash_particle_scale(0.67f, 0.67f, 0.67f); #include "d/actor/d_a_player_main_data.inc" diff --git a/src/d/actor/d_a_player_main_data.inc b/src/d/actor/d_a_player_main_data.inc index f20650121..9cdeb5ddb 100644 --- a/src/d/actor/d_a_player_main_data.inc +++ b/src/d/actor/d_a_player_main_data.inc @@ -2,9 +2,7 @@ #include "d/actor/d_a_player_main.h" #include "d/actor/d_a_player_main_data.h" -// Needed for the .data section to match. -static Vec dummy_2100 = {1.0f, 1.0f, 1.0f}; -static Vec dummy_2080 = {1.0f, 1.0f, 1.0f}; +#include "weak_data_2100_2080.h" // IWYU pragma: keep char l_arcName[] = "Link"; diff --git a/src/d/actor/d_a_player_sword.inc b/src/d/actor/d_a_player_sword.inc index 7220c98d5..a436e63f3 100644 --- a/src/d/actor/d_a_player_sword.inc +++ b/src/d/actor/d_a_player_sword.inc @@ -13,7 +13,6 @@ #include "d/actor/d_a_player_main.h" #include "d/actor/d_a_player_hio.h" #include "JSystem/J3DGraphLoader/J3DAnmLoader.h" -#include "JSystem/JKernel/JKRSolidHeap.h" /* 80154B80-80154FBC .text setSwordModel__9daPy_lk_cFi */ void daPy_lk_c::setSwordModel(BOOL r28) { diff --git a/src/d/actor/d_a_player_tact.inc b/src/d/actor/d_a_player_tact.inc index c1bde9f16..28fdae769 100644 --- a/src/d/actor/d_a_player_tact.inc +++ b/src/d/actor/d_a_player_tact.inc @@ -12,8 +12,8 @@ #include "d/actor/d_a_player_main.h" #include "d/actor/d_a_player_main_data.h" -#include "f_op/f_op_camera.h" #include "JSystem/J3DGraphLoader/J3DAnmLoader.h" +#include "d/d_camera.h" #include "d/d_procname.h" #include "d/actor/d_a_ship.h" #include "d/actor/d_a_player_HIO.h" diff --git a/src/d/actor/d_a_rd.cpp b/src/d/actor/d_a_rd.cpp index 8d42833f0..e8f275d0d 100644 --- a/src/d/actor/d_a_rd.cpp +++ b/src/d/actor/d_a_rd.cpp @@ -19,13 +19,8 @@ #include "d/d_item_data.h" #include "m_Do/m_Do_controller_pad.h" -// Needed for the .data section to match. -static Vec dummy1 = {1.0f, 1.0f, 1.0f}; -static Vec dummy2 = {1.0f, 1.0f, 1.0f}; -static u8 dummy3[4] = {0x02, 0x00, 0x02, 0x01}; -static f64 dummy4[2] = {3.0, 0.5}; - -static u8 dummy5[0x4C]; +#include "weak_bss_936_to_1036.h" // IWYU pragma: keep +#include "weak_data_1811.h" // IWYU pragma: keep static daRd_HIO_c l_HIO; diff --git a/src/d/actor/d_a_sail.cpp b/src/d/actor/d_a_sail.cpp index 30ef953a2..b57bdbb7c 100644 --- a/src/d/actor/d_a_sail.cpp +++ b/src/d/actor/d_a_sail.cpp @@ -14,30 +14,8 @@ #include "m_Do/m_Do_mtx.h" #include "SSystem/SComponent/c_lib.h" -static Vec bss_3569; -// Not sure what these are, but they have size 1, and alignment 1 in the debug maps, but alignment 4 in the non-debug maps. -static u8 bss_1036 ALIGN_DECL(4); -static u8 bss_1034 ALIGN_DECL(4); -static u8 bss_1032 ALIGN_DECL(4); -static u8 bss_1031 ALIGN_DECL(4); -static u8 bss_1026 ALIGN_DECL(4); -static u8 bss_1024 ALIGN_DECL(4); -static u8 bss_1022 ALIGN_DECL(4); -static u8 bss_1021 ALIGN_DECL(4); -static u8 bss_984 ALIGN_DECL(4); -static u8 bss_982 ALIGN_DECL(4); -static u8 bss_980 ALIGN_DECL(4); -static u8 bss_979 ALIGN_DECL(4); -static u8 bss_941 ALIGN_DECL(4); -static u8 bss_939 ALIGN_DECL(4); -static u8 bss_937 ALIGN_DECL(4); -static u8 bss_936 ALIGN_DECL(4); - -// Needed for the .data section to match. -static f32 dummy1[3] = {1.0f, 1.0f, 1.0f}; -static f32 dummy2[3] = {1.0f, 1.0f, 1.0f}; -static u8 dummy3[4] = {0x02, 0x00, 0x02, 0x01}; -static f64 dummy4[2] = {3.0, 0.5}; +#include "weak_bss_936_to_1036.h" // IWYU pragma: keep +#include "weak_data_1811.h" // IWYU pragma: keep static daObjPirateship::Act_c* l_p_ship; static daSail_HIO_c l_HIO; diff --git a/src/d/actor/d_a_syan.cpp b/src/d/actor/d_a_syan.cpp index c9c33b44e..ed8a1aafc 100644 --- a/src/d/actor/d_a_syan.cpp +++ b/src/d/actor/d_a_syan.cpp @@ -10,16 +10,7 @@ #include "d/d_s_play.h" #include "d/res/res_syan.h" -static Vec dummy1 = { 1.0f, 1.0f, 1.0f }; -static Vec dummy2 = { 1.0f, 1.0f, 1.0f }; -static struct { - u32 m0; - f32 m1; - f32 m2; - f32 m3; - f32 m4; - f32 m5; -} dummy3 = { 0x02000201, 0.0f, 2.125f, 0.0f, 1.75f, 0.0f }; +#include "weak_data_1811.h" // IWYU pragma: keep static f32 b_pos_x[6] = { 870.0f, 420.0f, -420.0f, -880.0f, -400.0f, 440.0f }; static f32 b_pos_y[6] = { -560.0f, -760.0f, -630.0f, -710.0f, -670.0f, -690.0f }; diff --git a/src/d/actor/d_a_tag_ghostship.cpp b/src/d/actor/d_a_tag_ghostship.cpp index 54c1fe2b7..469ccafeb 100644 --- a/src/d/actor/d_a_tag_ghostship.cpp +++ b/src/d/actor/d_a_tag_ghostship.cpp @@ -7,11 +7,7 @@ #include "d/d_com_inf_game.h" #include "d/d_procname.h" -// Needed for .data to match. -static f32 dummy1[3] = {1.0f, 1.0f, 1.0f}; -static f32 dummy2[3] = {1.0f, 1.0f, 1.0f}; -static u8 dummy3[4] = {0x02, 0x00, 0x02, 0x01}; -static f64 dummy4[2] = {3.0, 0.5}; +#include "weak_data_1811.h" // IWYU pragma: keep static daTag_Gship_HIO_c l_HIO; diff --git a/src/d/actor/d_a_tag_msg.cpp b/src/d/actor/d_a_tag_msg.cpp index 696e66246..a60af66d2 100644 --- a/src/d/actor/d_a_tag_msg.cpp +++ b/src/d/actor/d_a_tag_msg.cpp @@ -6,26 +6,9 @@ #include "d/actor/d_a_player_main.h" #include "d/d_com_inf_game.h" #include "d/d_procname.h" -#include "global.h" -static Vec bss_3569; -// Not sure what these are, but they have size 1, and alignment 1 in the debug maps, but alignment 4 in the non-debug maps. -static u8 bss_1036 ALIGN_DECL(4); -static u8 bss_1034 ALIGN_DECL(4); -static u8 bss_1032 ALIGN_DECL(4); -static u8 bss_1031 ALIGN_DECL(4); -static u8 bss_1026 ALIGN_DECL(4); -static u8 bss_1024 ALIGN_DECL(4); -static u8 bss_1022 ALIGN_DECL(4); -static u8 bss_1021 ALIGN_DECL(4); -static u8 bss_984 ALIGN_DECL(4); -static u8 bss_982 ALIGN_DECL(4); -static u8 bss_980 ALIGN_DECL(4); -static u8 bss_979 ALIGN_DECL(4); -static u8 bss_941 ALIGN_DECL(4); -static u8 bss_939 ALIGN_DECL(4); -static u8 bss_937 ALIGN_DECL(4); -static u8 bss_936 ALIGN_DECL(4); +#include "weak_bss_936_to_1036.h" // IWYU pragma: keep + static fpc_ProcID l_msgId; static msg_class* l_msg; static u8 msg_mode; diff --git a/src/d/actor/d_a_tbox.cpp b/src/d/actor/d_a_tbox.cpp index 459d450dd..5fb54015c 100644 --- a/src/d/actor/d_a_tbox.cpp +++ b/src/d/actor/d_a_tbox.cpp @@ -17,7 +17,7 @@ #include "m_Do/m_Do_ext.h" #include "m_Do/m_Do_graphic.h" #include "m_Do/m_Do_hostIO.h" -#include "m_do/m_Do_mtx.h" +#include "m_Do/m_Do_mtx.h" #define DEMO_PROC_WAIT 0 @@ -35,13 +35,9 @@ #define FUNC_TYPE_EXTRA_SAVE_INFO 7 #define FUNC_TYPE_EXTRA_SAVE_INFO_SPAWN 8 -extern dCcD_SrcCyl dNpc_cyl_src; +#include "weak_data_1811.h" // IWYU pragma: keep -// Needed for the .data section to match. -static f32 dummy1[3] = {1.0f, 1.0f, 1.0f}; -static f32 dummy2[3] = {1.0f, 1.0f, 1.0f}; -static u8 dummy3[4] = {0x02, 0x00, 0x02, 0x01}; -static f64 dummy4[2] = {3.0, 0.5}; +extern dCcD_SrcCyl dNpc_cyl_src; static daTbox_HIO_c l_HIO; diff --git a/src/d/actor/d_a_wall.cpp b/src/d/actor/d_a_wall.cpp index 49e78c42c..d3d2af3c1 100644 --- a/src/d/actor/d_a_wall.cpp +++ b/src/d/actor/d_a_wall.cpp @@ -13,11 +13,7 @@ #include "f_op/f_op_actor_mng.h" #include "m_Do/m_Do_mtx.h" -// Needed for the .data section to match. -static Vec dummy_2100 = {1.0f, 1.0f, 1.0f}; -static Vec dummy_2080 = {1.0f, 1.0f, 1.0f}; -static u8 dummy_1811[] = {0x02, 0x00, 0x02, 0x01}; -static f64 dummy4[2] = {3.0, 0.5}; +#include "weak_data_1811.h" // IWYU pragma: keep const s16 daWall_c::m_heapsize[3] = { 0x1160, diff --git a/src/d/actor/d_a_warpfout.cpp b/src/d/actor/d_a_warpfout.cpp index 39860a1a5..f285a5dab 100644 --- a/src/d/actor/d_a_warpfout.cpp +++ b/src/d/actor/d_a_warpfout.cpp @@ -8,9 +8,7 @@ #include "d/d_com_inf_game.h" #include "d/d_procname.h" -static Vec unkVecs[] = {{1, 1, 1}, {1, 1, 1}}; -static int unkInt[] = {0x02000201, 0x00000000}; -static f64 unkf64[] = {3, 0.5}; +#include "weak_data_1811.h" // IWYU pragma: keep static daWarpfout_c::EventActionInitFunc event_init_tbl[] = { &daWarpfout_c::initWarp1, &daWarpfout_c::initWarp2, &daWarpfout_c::initWarp3, diff --git a/src/d/d_com_static.cpp b/src/d/d_com_static.cpp index f696dd93e..8a85e7749 100644 --- a/src/d/d_com_static.cpp +++ b/src/d/d_com_static.cpp @@ -39,7 +39,7 @@ #include "d/actor/d_a_npc_bs1.h" #include "SSystem/SComponent/c_counter.h" -static Vec dummy_3569; +#include "weak_bss_3569.h" // IWYU pragma: keep s32 daLodbg_c::sObjectCount; JKRExpHeap* daLodbg_c::sLocalHeap; diff --git a/src/d/d_drawlist.cpp b/src/d/d_drawlist.cpp index e0dfd2590..2f5c94d36 100644 --- a/src/d/d_drawlist.cpp +++ b/src/d/d_drawlist.cpp @@ -21,6 +21,8 @@ #include "SSystem/SComponent/c_bg_s_shdw_draw.h" #include "global.h" +#include "weak_bss_3569.h" // IWYU pragma: keep + class ShdwDrawPoly_c : public cBgS_ShdwDraw { public: virtual ~ShdwDrawPoly_c() {} @@ -37,8 +39,6 @@ public: /* 0x3C */ dDlst_shadowPoly_c* mPoly; }; // Size: 0x40 -Vec dummy0; - GXTexObj dDlst_shadowControl_c::mSimpleTexObj; static Vec dummy1 = { 1.0f, 1.0f, 1.0f }; diff --git a/src/d/d_item_data.cpp b/src/d/d_item_data.cpp index da7ffacb9..294d7fd6b 100644 --- a/src/d/d_item_data.cpp +++ b/src/d/d_item_data.cpp @@ -114,9 +114,7 @@ #include "d/res/res_vtin5.h" #include "d/res/res_vbeso.h" -// Needed for the .data section to match. -static f32 dummy1[3] = {1.0f, 1.0f, 1.0f}; -static f32 dummy2[3] = {1.0f, 1.0f, 1.0f}; +#include "weak_data_2100_2080.h" // IWYU pragma: keep /* 80383F20-803840E0 .data item_arcname_tbl__10dItem_data */ char* dItem_data::item_arcname_tbl[0x70] = { diff --git a/src/d/d_kankyo.cpp b/src/d/d_kankyo.cpp index 63aab0a01..a7edca6e2 100644 --- a/src/d/d_kankyo.cpp +++ b/src/d/d_kankyo.cpp @@ -23,15 +23,13 @@ #include "m_Do/m_Do_printf.h" #include "math.h" +#include "weak_data_2100_2080.h" // IWYU pragma: keep + class sub_kankyo__class : public kankyo_class { }; #include "d/d_kankyo_dayproc.inc" -// stripped or compiler generated? -static Vec unused_lit_2100[] = {1.0f, 1.0f, 1.0f}; -static Vec unused_lit_210c[] = {1.0f, 1.0f, 1.0f}; - struct dKy_setLight__Status { /* 0x00 */ Vec mPos; /* 0x0C */ Vec mPos2; diff --git a/src/d/d_magma.cpp b/src/d/d_magma.cpp index e8ed54109..f6765a9ff 100644 --- a/src/d/d_magma.cpp +++ b/src/d/d_magma.cpp @@ -9,11 +9,12 @@ #include "d/res/res_magma.h" #include "m_Do/m_Do_mtx.h" #include "m_Do/m_Do_lib.h" -#include "JSystem/JKernel/JKRHeap.h" // #pragma sym on -static Vec dummy_3569; +#include "weak_bss_3569.h" // IWYU pragma: keep +#include "weak_data_2100_2080.h" // IWYU pragma: keep + Mtx l_kuroOrthoMtx; Mtx l_colOrthoMtx; GXTexObj dMagma_packet_c::mKuroTexObj; @@ -22,10 +23,6 @@ GXTexObj dMagma_packet_c::mColTexObj; Mtx dMagma_packet_c::mFloorMtx; Mtx dMagma_packet_c::mBallMtx; -// Needed for the .data section to match. -static Vec dummy_2100 = {1.0f, 1.0f, 1.0f}; -static Vec dummy_2080 = {1.0f, 1.0f, 1.0f}; - Vec l_YfloorPos[] = { { -500.0f, -0.0f, 500.0f }, { 500.0f, -0.0f, 500.0f }, diff --git a/src/d/d_meter.cpp b/src/d/d_meter.cpp index 229fb8a43..8082300a3 100644 --- a/src/d/d_meter.cpp +++ b/src/d/d_meter.cpp @@ -15,7 +15,7 @@ #include "d/d_timer.h" #include "stdio.h" -u8 dummy_3569[0xC]; +#include "weak_bss_3569.h" // IWYU pragma: keep dMeter_info_c dMeter_Info; fopMsgM_pane_class item_parts; diff --git a/src/d/d_npc.cpp b/src/d/d_npc.cpp index b08da24bb..97ff2e63f 100644 --- a/src/d/d_npc.cpp +++ b/src/d/d_npc.cpp @@ -9,13 +9,10 @@ #include "f_op/f_op_actor_mng.h" #include "f_op/f_op_msg_mng.h" #include "SSystem/SComponent/c_math.h" -#include "JSystem/JGeometry.h" #include "m_Do/m_Do_mtx.h" #include "d/d_item_data.h" -// Needed for the .data section to match. -static Vec dummy_2100 = {1.0f, 1.0f, 1.0f}; -static Vec dummy_2080 = {1.0f, 1.0f, 1.0f}; +#include "weak_data_2100_2080.h" // IWYU pragma: keep /* 8021A7B4-8021A858 .text angCalcS__14dNpc_JntCtrl_cFPssss */ bool dNpc_JntCtrl_c::angCalcS(s16* out, s16 targetY, s16 speed, s16 maxVel) { diff --git a/src/d/d_particle.cpp b/src/d/d_particle.cpp index 6582f306b..a309c681f 100644 --- a/src/d/d_particle.cpp +++ b/src/d/d_particle.cpp @@ -24,10 +24,8 @@ #include "m_Do/m_Do_lib.h" #include "stdio.h" -static f32 dummy_2100[3] = {1.0f, 1.0f, 1.0f}; -static f32 dummy_2080[3] = {1.0f, 1.0f, 1.0f}; - -static Vec dummy_3569; +#include "weak_bss_3569.h" // IWYU pragma: keep +#include "weak_data_2100_2080.h" // IWYU pragma: keep /* 8007A4D8-8007A514 .text __ct__18dPa_modelEmitter_cFv */ dPa_modelEmitter_c::dPa_modelEmitter_c() { diff --git a/src/d/d_s_name.cpp b/src/d/d_s_name.cpp index e33840169..eedccd673 100644 --- a/src/d/d_s_name.cpp +++ b/src/d/d_s_name.cpp @@ -31,8 +31,7 @@ #include "JSystem/J2DGraph/J2DScreen.h" #include "JSystem/JKernel/JKRExpHeap.h" -static Vec lit_2100 = {1.0f, 1.0f, 1.0f}; -static Vec lit_2080 = {1.0f, 1.0f, 1.0f}; +#include "weak_data_2100_2080.h" // IWYU pragma: keep dSn_HIO_c g_snHIO; diff --git a/src/d/d_s_play.cpp b/src/d/d_s_play.cpp index aff9ac167..f26a97029 100644 --- a/src/d/d_s_play.cpp +++ b/src/d/d_s_play.cpp @@ -39,7 +39,7 @@ #include "m_Do/m_Do_machine.h" #include -static Vec dummy_3569; +#include "weak_bss_3569.h" // IWYU pragma: keep static const int PRELOAD_RES_MAX = 0x23; static const int PRELOAD_DYL_MAX = 0x1B; diff --git a/src/d/d_stage.cpp b/src/d/d_stage.cpp index e93a44945..ebdd9f576 100644 --- a/src/d/d_stage.cpp +++ b/src/d/d_stage.cpp @@ -11,7 +11,6 @@ #include "d/actor/d_a_player_main.h" #include "d/actor/d_a_ship.h" #include "d/d_bg_s.h" -#include "d/d_bg_s_gnd_chk.h" #include "d/d_com_inf_game.h" #include "d/d_path.h" #include "d/d_procname.h" @@ -23,6 +22,8 @@ #include "m_Do/m_Do_mtx.h" #include "d/actor/d_a_sea.h" +#include "weak_bss_3569.h" // IWYU pragma: keep + /* 80040900-80040938 .text set__18dStage_nextStage_cFPCcScsScSc */ void dStage_nextStage_c::set(const char* i_stage, s8 i_roomId, s16 i_point, s8 i_layer, s8 i_wipe) { if (!mEnable) { @@ -38,8 +39,6 @@ void dStage_SetErrorRoom() {} /* 8004093C-80040940 .text dStage_SetErrorStage__Fv */ void dStage_SetErrorStage() {} -static Vec dummy; - dStage_KeepTresureInfo TresureInfo; dStage_KeepDoorInfo DoorInfo; @@ -175,7 +174,7 @@ void dStage_roomControl_c::setStayNo(int i_roomNo) { mOldStayNo = mStayNo; mStayNo = i_roomNo; - if (mStayNo == 0xFF) { + if (mStayNo == 0xFF) { // Bug: Comparing s8 to 0xFF is always false. return; } diff --git a/src/f_op/f_op_actor_mng.cpp b/src/f_op/f_op_actor_mng.cpp index 6e82af2c3..380c7b3d7 100644 --- a/src/f_op/f_op_actor_mng.cpp +++ b/src/f_op/f_op_actor_mng.cpp @@ -27,11 +27,11 @@ #include "JSystem/JUtility/JUTAssert.h" #include "SSystem/SComponent/c_malloc.h" +#include "weak_bss_3569.h" // IWYU pragma: keep + #define MAKE_ITEM_PARAMS(itemNo, itemBitNo, switchNo2, type, action) \ ((itemNo & 0xFF) << 0 | (itemBitNo & 0xFF) << 0x8 | switchNo2 << 0x10 | (type & 0x3) << 0x18 | (action & 0x3F) << 0x1A) -static Vec dummy_3569; - /* 80024060-80024104 .text fopAcM_setStageLayer__FPv */ void fopAcM_setStageLayer(void* pProc) { scene_class* stageProc = fopScnM_SearchByID(dStage_roomControl_c::getProcID()); diff --git a/src/m_Do/m_Do_audio.cpp b/src/m_Do/m_Do_audio.cpp index c36c470bf..79b978c08 100644 --- a/src/m_Do/m_Do_audio.cpp +++ b/src/m_Do/m_Do_audio.cpp @@ -8,7 +8,6 @@ #include "JSystem/JAudio/JAISequenceMgr.h" #include "JSystem/JAudio/JAIStreamMgr.h" #include "JSystem/JKernel/JKRSolidHeap.h" -#include "JSystem/JUtility/JUTConsole.h" #include "SSystem/SComponent/c_lib.h" #include "d/d_com_inf_game.h" #include "m_Do/m_Do_controller_pad.h" @@ -16,7 +15,7 @@ #include "m_Do/m_Do_ext.h" #include "m_Do/m_Do_printf.h" -u8 dummy_3569[0xC]; +#include "weak_bss_3569.h" // IWYU pragma: keep JAIZelInst mDoAud_zelAudio_c::mTact; mDoAud_zelAudio_c g_mDoAud_zelAudio; diff --git a/src/m_Do/m_Do_main.cpp b/src/m_Do/m_Do_main.cpp index 75c2fd576..8fa32230c 100644 --- a/src/m_Do/m_Do_main.cpp +++ b/src/m_Do/m_Do_main.cpp @@ -26,6 +26,8 @@ #include "m_Do/m_Do_machine.h" #include "m_Do/m_Do_printf.h" +#include "weak_data_2100_2080.h" // IWYU pragma: keep + class JUTGamePad; /* 800056E0-80005748 .text version_check__Fv */ @@ -51,10 +53,6 @@ void HeapCheck::CheckHeap1() { mMaxTotalFreeSize = freeSize; } -// unused data? -static u32 lit_2100[] = {0x3F800000, 0x3F800000, 0x3F800000}; -static u32 lit_2080[] = {0x3F800000, 0x3F800000, 0x3F800000}; - char mDoMain::COPYDATE_STRING[18] = "??/??/?? ??:??:??"; static HeapCheck RootHeapCheck = { diff --git a/src/m_Do/m_Do_mtx.cpp b/src/m_Do/m_Do_mtx.cpp index db3139aa5..5e1763deb 100644 --- a/src/m_Do/m_Do_mtx.cpp +++ b/src/m_Do/m_Do_mtx.cpp @@ -6,10 +6,11 @@ #include "m_Do/m_Do_mtx.h" #include "dolphin/mtx/mtx.h" #include "JSystem/JUtility/JUTAssert.h" -#include "JSystem/JMath/JMath.h" #include "SSystem/SComponent/c_m3d.h" #include "SSystem/SComponent/c_math.h" +#include "weak_bss_3569.h" // IWYU pragma: keep + /* 8000CB48-8000CBEC .text mDoMtx_XYZrotM__FPA4_fsss */ void mDoMtx_XYZrotM(Mtx mtx, s16 x, s16 y, s16 z) { Mtx tmp; @@ -280,8 +281,6 @@ void mDoMtx_MtxToRot(const Mtx m, csXyz* o_rot) { } } -static u8 lit_3569[12]; - Mtx mDoMtx_stack_c::now; Mtx mDoMtx_stack_c::buffer[16]; @@ -349,7 +348,7 @@ mDoMtx_stack_c mDoMtx_stack; mDoMtx_quatStack_c mDoMtx_quatStack; -extern Mtx g_mDoMtx_identity = { +Mtx g_mDoMtx_identity = { {1.0f, 0.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 1.0f, 0.0f},