summaryrefslogtreecommitdiff
path: root/src/code
diff options
context:
space:
mode:
authorcadmic <cadmic24@gmail.com>2024-06-10 07:07:51 -0700
committerGitHub <noreply@github.com>2024-06-10 10:07:51 -0400
commiteb660765b12e54c9ed57da39ceecfef471a14bff (patch)
tree97a9f9c8f1a938df6ca531141d2825b39a41d80d /src/code
parente88084fe6539f0fa98a3e90055dccb8cf0407498 (diff)
Change linker script so gGameOverTimer can be in z_game_over.c (#1939)
* Change linker script so gGameOverTimer can be in z_game_over.c * gGameOverTimer -> sGameOverTimer * include_data_only_with_rodata -> include_data_only_within_rodata
Diffstat (limited to 'src/code')
-rw-r--r--src/code/z_game_over.c29
-rw-r--r--src/code/z_message_PAL.c9
2 files changed, 14 insertions, 24 deletions
diff --git a/src/code/z_game_over.c b/src/code/z_game_over.c
index 796ce358d..b282fc9e7 100644
--- a/src/code/z_game_over.c
+++ b/src/code/z_game_over.c
@@ -13,8 +13,7 @@ void GameOver_FadeInLights(PlayState* play) {
}
}
-// This variable cannot be moved into this file as all of z_message_PAL rodata is in the way
-extern s16 gGameOverTimer;
+s16 sGameOverTimer = 0;
void GameOver_Update(PlayState* play) {
GameOverContext* gameOverCtx = &play->gameOverCtx;
@@ -74,7 +73,7 @@ void GameOver_Update(PlayState* play) {
gSaveContext.hudVisibilityModeTimer = 0; // false, HUD_VISIBILITY_NO_CHANGE
Environment_InitGameOverLights(play);
- gGameOverTimer = 20;
+ sGameOverTimer = 20;
if (1) {}
rumbleStrength = R_GAME_OVER_RUMBLE_STRENGTH;
@@ -92,9 +91,9 @@ void GameOver_Update(PlayState* play) {
break;
case GAMEOVER_DEATH_DELAY_MENU:
- gGameOverTimer--;
+ sGameOverTimer--;
- if (gGameOverTimer == 0) {
+ if (sGameOverTimer == 0) {
play->pauseCtx.state = PAUSE_STATE_8;
gameOverCtx->state++;
Rumble_Reset();
@@ -103,13 +102,13 @@ void GameOver_Update(PlayState* play) {
case GAMEOVER_REVIVE_START:
gameOverCtx->state++;
- gGameOverTimer = 0;
+ sGameOverTimer = 0;
Environment_InitGameOverLights(play);
Letterbox_SetSizeTarget(32);
return;
case GAMEOVER_REVIVE_RUMBLE:
- gGameOverTimer = 50;
+ sGameOverTimer = 50;
gameOverCtx->state++;
if (1) {}
@@ -123,28 +122,28 @@ void GameOver_Update(PlayState* play) {
break;
case GAMEOVER_REVIVE_WAIT_GROUND:
- gGameOverTimer--;
+ sGameOverTimer--;
- if (gGameOverTimer == 0) {
- gGameOverTimer = 64;
+ if (sGameOverTimer == 0) {
+ sGameOverTimer = 64;
gameOverCtx->state++;
}
break;
case GAMEOVER_REVIVE_WAIT_FAIRY:
- gGameOverTimer--;
+ sGameOverTimer--;
- if (gGameOverTimer == 0) {
- gGameOverTimer = 50;
+ if (sGameOverTimer == 0) {
+ sGameOverTimer = 50;
gameOverCtx->state++;
}
break;
case GAMEOVER_REVIVE_FADE_OUT:
Environment_FadeOutGameOverLights(play);
- gGameOverTimer--;
+ sGameOverTimer--;
- if (gGameOverTimer == 0) {
+ if (sGameOverTimer == 0) {
gameOverCtx->state = GAMEOVER_INACTIVE;
}
break;
diff --git a/src/code/z_message_PAL.c b/src/code/z_message_PAL.c
index 126841cea..027e66c21 100644
--- a/src/code/z_message_PAL.c
+++ b/src/code/z_message_PAL.c
@@ -3358,12 +3358,3 @@ void Message_SetTables(void) {
sFraMessageEntryTablePtr = sFraMessageEntryTable;
sStaffMessageEntryTablePtr = sStaffMessageEntryTable;
}
-
-#if OOT_DEBUG
-// Appears to be file padding
-UNK_TYPE D_80153D7C = 0x00000000;
-#endif
-
-// This should be part of z_game_over.c, but cannot be moved there as the entire
-// late_rodata section of this file is in the way
-s16 gGameOverTimer = 0;