From d191e8714e0b05ab8305951adff89542eb83e7c8 Mon Sep 17 00:00:00 2001 From: cadmic Date: Mon, 19 Aug 2024 14:58:31 -0700 Subject: [PATCH] Allow building the Debug ROM without debug features (#2052) * Allow building the Debug ROM without debug features * Fix bss * Add comment * Reword again * Fix bss --- include/segment_symbols.h | 5 +++-- src/code/main.c | 2 +- src/code/z_actor.c | 2 +- src/code/z_demo.c | 2 +- src/code/z_message.c | 2 ++ src/code/z_play.c | 2 +- src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c | 2 ++ src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c | 2 ++ src/overlays/actors/ovl_Fishing/z_fishing.c | 2 +- src/overlays/actors/ovl_player_actor/z_player.c | 6 +++--- 10 files changed, 17 insertions(+), 10 deletions(-) diff --git a/include/segment_symbols.h b/include/segment_symbols.h index 21fd52f0ab..4e0ce0bbd4 100644 --- a/include/segment_symbols.h +++ b/include/segment_symbols.h @@ -648,7 +648,9 @@ DECLARE_ROM_SEGMENT(spot20_room_0) DECLARE_ROM_SEGMENT(ganon_tou_room_0) -#if OOT_DEBUG +// Room symbols for compiling test scenes, these are not wrapped in an `#if OOT_DEBUG` +// so that debug ROMs (including gc-eu-mq-dbg) can be built with OOT_DEBUG=0. + DECLARE_ROM_SEGMENT(test01_room_0) DECLARE_ROM_SEGMENT(besitu_room_0) @@ -670,6 +672,5 @@ DECLARE_ROM_SEGMENT(testroom_room_1) DECLARE_ROM_SEGMENT(testroom_room_2) DECLARE_ROM_SEGMENT(testroom_room_3) DECLARE_ROM_SEGMENT(testroom_room_4) -#endif #endif diff --git a/src/code/main.c b/src/code/main.c index 3dada11023..6ba4e17af1 100644 --- a/src/code/main.c +++ b/src/code/main.c @@ -7,7 +7,7 @@ s32 gScreenWidth = SCREEN_WIDTH; s32 gScreenHeight = SCREEN_HEIGHT; u32 gSystemHeapSize = 0; -#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0" +#pragma increment_block_number "gc-eu:224 gc-eu-mq:224 gc-jp:224 gc-jp-ce:224 gc-jp-mq:224 gc-us:224 gc-us-mq:224" PreNmiBuff* gAppNmiBufferPtr; Scheduler gScheduler; diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 89dd9400c7..0be5916674 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -8,7 +8,7 @@ #include "assets/objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h" #include "assets/objects/object_bdoor/object_bdoor.h" -#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0" +#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" static CollisionPoly* sCurCeilingPoly; static s32 sCurCeilingBgId; diff --git a/src/code/z_demo.c b/src/code/z_demo.c index 5d7dd7f3e8..36ae51e991 100644 --- a/src/code/z_demo.c +++ b/src/code/z_demo.c @@ -120,7 +120,7 @@ u16 gCamAtSplinePointsAppliedFrame; u16 gCamEyePointAppliedFrame; u16 gCamAtPointAppliedFrame; -#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0" +#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192 gc-us-mq:192" // Cam ID to return to when a scripted cutscene is finished s16 sReturnToCamId; diff --git a/src/code/z_message.c b/src/code/z_message.c index 620a6d0868..2266cd1f9f 100644 --- a/src/code/z_message.c +++ b/src/code/z_message.c @@ -3,6 +3,8 @@ #include "terminal.h" #include "assets/textures/parameter_static/parameter_static.h" +#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" + s16 sTextFade = false; // original name: key_off_flag ? u8 D_8014B2F4 = 0; diff --git a/src/code/z_play.c b/src/code/z_play.c index 5323a2c692..135f24c75e 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -4,7 +4,7 @@ #include "z64frame_advance.h" -#pragma increment_block_number "gc-eu:24 gc-eu-mq:24 gc-jp:24 gc-jp-ce:24 gc-jp-mq:24 gc-us:24 gc-us-mq:24" +#pragma increment_block_number "gc-eu:252 gc-eu-mq:252 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0" TransitionTile gTransitionTile; s32 gTransitionTileState; diff --git a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c index e5f79ee068..b579b60429 100644 --- a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c +++ b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c @@ -10,6 +10,8 @@ #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "terminal.h" +#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" + #define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_5) #define MO_WATER_LEVEL(play) play->colCtx.colHeader->waterBoxes[0].ySurface diff --git a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c index d4b3b38d23..67f804e26a 100644 --- a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c +++ b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c @@ -10,6 +10,8 @@ #include "overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" +#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" + #define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_5 | ACTOR_FLAG_10) #define vParity actionVar diff --git a/src/overlays/actors/ovl_Fishing/z_fishing.c b/src/overlays/actors/ovl_Fishing/z_fishing.c index 0f94da285a..943a999520 100644 --- a/src/overlays/actors/ovl_Fishing/z_fishing.c +++ b/src/overlays/actors/ovl_Fishing/z_fishing.c @@ -14,7 +14,7 @@ #include "cic6105.h" #endif -#pragma increment_block_number "gc-eu:197 gc-eu-mq:197 gc-jp:199 gc-jp-ce:199 gc-jp-mq:199 gc-us:199 gc-us-mq:199" +#pragma increment_block_number "gc-eu:171 gc-eu-mq:171 gc-jp:173 gc-jp-ce:173 gc-jp-mq:173 gc-us:173 gc-us-mq:173" #define FLAGS ACTOR_FLAG_4 diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index a1894e51ad..368c8f2e61 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -354,19 +354,19 @@ void Player_Action_CsAction(Player* this, PlayState* play); // .bss part 1 -#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0" +#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" static s32 D_80858AA0; // TODO: There's probably a way to match BSS ordering with less padding by spreading the variables out and moving // data around. It would be easier if we had more options for controlling BSS ordering in debug. -#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" +#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192 gc-us-mq:192" static s32 D_80858AA4; static Vec3f sInteractWallCheckResult; static Input* sControlInput; -#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192 gc-us-mq:192" +#pragma increment_block_number "gc-eu:224 gc-eu-mq:224 gc-jp:224 gc-jp-ce:224 gc-jp-mq:224 gc-us:224 gc-us-mq:224" // .data