diff --git a/src/code_3bf0_len_6f0.c b/src/code_3bf0_len_6f0.c index b1d772eaa7..fd97f0571a 100644 --- a/src/code_3bf0_len_6f0.c +++ b/src/code_3bf0_len_6f0.c @@ -5,9 +5,9 @@ void func_800287F0(void) { GameStatus* gameStatus; GameStatus* gameStatus2; - gameStatus = *gGameStatusPtr; + gameStatus = GAME_STATUS; gameStatus->stickX = 0; - gameStatus2 = *gGameStatusPtr; + gameStatus2 = GAME_STATUS; gameStatus->currentButtons = 0; gameStatus->pressedButtons = 0; gameStatus->heldButtons = 0; @@ -15,7 +15,7 @@ void func_800287F0(void) { // TODO: macro { - GameStatus* gameStatus = *gGameStatusPtr; + GameStatus* gameStatus = GAME_STATUS; gameStatus->prevButtons = 0; gameStatus->unk_50[0] = 4; gameStatus->unk_48[0] = 15; diff --git a/src/code_42e0_len_1f60.c b/src/code_42e0_len_1f60.c index e2d578e7de..4970ab5780 100644 --- a/src/code_42e0_len_1f60.c +++ b/src/code_42e0_len_1f60.c @@ -62,7 +62,7 @@ INCLUDE_ASM(s32, "code_42e0_len_1f60", func_80029860); s32 _advance_rng(void) { s32* rngVal = &gRandSeed; - (*gGameStatusPtr)->nextRNG = *rngVal = (*rngVal * 0x5D588B65) + 1; + GAME_STATUS->nextRNG = *rngVal = (*rngVal * 0x5D588B65) + 1; return *rngVal; } @@ -106,7 +106,7 @@ f32 get_clamped_angle_diff(f32 a, f32 b) { INCLUDE_ASM(f32, "code_42e0_len_1f60", atan2, f32 startX, f32 startZ, f32 endX, f32 endZ); f32 get_player_normal_yaw(void) { - return atan2(0, 0, (*gGameStatusPtr)->playerTraceNormal.x, (*gGameStatusPtr)->playerTraceNormal.z); + return atan2(0, 0, GAME_STATUS->playerTraceNormal.x, GAME_STATUS->playerTraceNormal.z); } INCLUDE_ASM(s32, "code_42e0_len_1f60", get_player_normal_pitch); diff --git a/src/code_7bb60_len_41b0.c b/src/code_7bb60_len_41b0.c index d15e76094d..f0c2e10003 100644 --- a/src/code_7bb60_len_41b0.c +++ b/src/code_7bb60_len_41b0.c @@ -190,18 +190,6 @@ void set_action_state(s32 actionState) { } INCLUDE_ASM(s32, "code_7bb60_len_41b0", update_locomotion_state); -/*void update_locomotion_state(void) { - PlayerStatus* playerStatus = &gPlayerStatus; - ActionState actionState = ActionState_WALK; - - if (!is_ability_active(Ability_SLOW_GO)) { - actionState = ActionState_WALK; - if (SQ(playerStatus->stickAxis[0]) + SQ(playerStatus->stickAxis[1]) >= 0xBD2) { - actionState = ActionState_RUN; - } - } - set_action_state(actionState); -}*/ // todo these floats don't work #ifdef NON_MATCHING diff --git a/src/code_80850_len_3060.c b/src/code_80850_len_3060.c index 083ab8bfae..fa0bc1af7f 100644 --- a/src/code_80850_len_3060.c +++ b/src/code_80850_len_3060.c @@ -280,7 +280,7 @@ void coin_counter_draw_content(UNK_TYPE arg0, s32 posX, s32 posY) { UiStatus* uiStatus = &gUIStatus; s32 iconIndex; - if ((gPlayerData.coins != uiStatus->displayCoins) && (((*gGameStatusPtr)->frameCounter % 3) == 0)) { + if ((gPlayerData.coins != uiStatus->displayCoins) && ((GAME_STATUS->frameCounter % 3) == 0)) { play_sound(0x211); } @@ -514,7 +514,7 @@ s32 is_status_menu_visible(void) { } void status_menu_start_blinking_hp(void) { - GameStatus* gameStatus = (*gGameStatusPtr); + GameStatus* gameStatus = GAME_STATUS; UiStatus* uiStatus = &gUIStatus; UiStatus* uiStatus2 = &gUIStatus; @@ -539,7 +539,7 @@ void status_menu_stop_blinking_hp(void) { } void status_menu_start_blinking_fp(void) { - GameStatus* gameStatus = (*gGameStatusPtr); + GameStatus* gameStatus = GAME_STATUS; UiStatus* uiStatus = &gUIStatus; UiStatus* uiStatus2 = &gUIStatus; @@ -563,7 +563,7 @@ void status_menu_stop_blinking_fp(void) { } void status_menu_start_blinking_coins(void) { - GameStatus* gameStatus = (*gGameStatusPtr); + GameStatus* gameStatus = GAME_STATUS; UiStatus* uiStatus = &gUIStatus; UiStatus* uiStatus2 = &gUIStatus; diff --git a/src/code_dbd70_len_700.c b/src/code_dbd70_len_700.c index bdcd8704a0..74d8abe458 100644 --- a/src/code_dbd70_len_700.c +++ b/src/code_dbd70_len_700.c @@ -7,7 +7,7 @@ void default_trigger_function_handler(s32* arg0) { INCLUDE_ASM(s32, "code_dbd70_len_700", clear_trigger_data); void init_trigger_list(void) { - if ((*gGameStatusPtr)->isBattle == 0) { + if (!GAME_STATUS->isBattle) { *gCurrentTriggerListPtr = gTriggerList1; } else { *gCurrentTriggerListPtr = gTriggerList2; diff --git a/src/code_dc470_len_14c0.c b/src/code_dc470_len_14c0.c index d0151b6166..c561cd055b 100644 --- a/src/code_dc470_len_14c0.c +++ b/src/code_dc470_len_14c0.c @@ -27,7 +27,7 @@ void load_map_bg(char* optAssetName) { } void func_80145DF8(void) { - GameStatus* gameStatus = *gGameStatusPtr; + GameStatus* gameStatus = GAME_STATUS; D_801595A0 = 0; D_8014F12F = 0; @@ -36,7 +36,7 @@ void func_80145DF8(void) { } void read_background_size(BackgroundHeader* bg) { - GameStatus* gameStatus = *gGameStatusPtr; + GameStatus* gameStatus = GAME_STATUS; gameStatus->backgroundMaxW = bg->width; gameStatus->backgroundMaxH = bg->height; @@ -48,7 +48,7 @@ void read_background_size(BackgroundHeader* bg) { } void set_background_size(s16 startX, s16 startY, s16 sizeX, s16 sizeY) { - GameStatus* gameStatus = *gGameStatusPtr; + GameStatus* gameStatus = GAME_STATUS; gameStatus->enableBackground &= ~1; gameStatus->backgroundMaxW = startX; diff --git a/src/code_dd930_len_1c0.c b/src/code_dd930_len_1c0.c index 1ca60069e4..a7f425eb0a 100644 --- a/src/code_dd930_len_1c0.c +++ b/src/code_dd930_len_1c0.c @@ -58,7 +58,7 @@ s32 play_ambient_sounds(s32 arg0, s32 arg1) { struct_80147230* temp1 = &D_8015C7C0; struct_80147230* temp2 = &D_8015C7C0; - if ((*gGameStatusPtr)->musicEnabled == 0) { + if (!GAME_STATUS->musicEnabled) { func_800554A4(temp1->unk8, arg1); temp1->unk0 &= ~1; return 1; diff --git a/src/code_e92d0_len_5da0.c b/src/code_e92d0_len_5da0.c index 2d143eaab0..a82787d431 100644 --- a/src/code_e92d0_len_5da0.c +++ b/src/code_e92d0_len_5da0.c @@ -1273,17 +1273,17 @@ ApiStatus GotoMapByID(ScriptInstance* script, s32 isInitialCall) { } ApiStatus GetEntryID(ScriptInstance* script, s32 isInitialCall) { - set_variable(script, *script->ptrReadPos, (*gGameStatusPtr)->entryID); + set_variable(script, *script->ptrReadPos, GAME_STATUS->entryID); return ApiStatus_DONE2; } ApiStatus GetMapID(ScriptInstance* script, s32 isInitialCall) { - set_variable(script, *script->ptrReadPos, (*gGameStatusPtr)->mapID); + set_variable(script, *script->ptrReadPos, GAME_STATUS->mapID); return ApiStatus_DONE2; } ApiStatus GetLoadType(ScriptInstance* script, s32 isInitialCall) { - set_variable(script, *script->ptrReadPos, (*gGameStatusPtr)->loadType != 0); + set_variable(script, *script->ptrReadPos, GAME_STATUS->loadType != 0); return ApiStatus_DONE2; } diff --git a/src/code_e940_len_290.c b/src/code_e940_len_290.c index a0d35da10a..0ca21de69c 100644 --- a/src/code_e940_len_290.c +++ b/src/code_e940_len_290.c @@ -22,13 +22,13 @@ void step_init_state(void) { gameStatus->mapID = 0; gameStatus->entryID = 0; - (*gGameStatusPtr)->unk_76 = 0; - (*gGameStatusPtr)->disableScripts = 0; - (*gGameStatusPtr)->unk_7D = 0; - (*gGameStatusPtr)->unk_A8 = -1; - (*gGameStatusPtr)->unk_AA = 0; - (*gGameStatusPtr)->unk_A9 = -1; - (*gGameStatusPtr)->demoState = 0; + GAME_STATUS->unk_76 = 0; + GAME_STATUS->disableScripts = 0; + GAME_STATUS->unk_7D = 0; + GAME_STATUS->unk_A8 = -1; + GAME_STATUS->unk_AA = 0; + GAME_STATUS->unk_A9 = -1; + GAME_STATUS->demoState = 0; general_heap_create(); func_8011D890(); diff --git a/src/code_ebd0_len_6a0.c b/src/code_ebd0_len_6a0.c index 1b8301d968..0d491e9182 100644 --- a/src/code_ebd0_len_6a0.c +++ b/src/code_ebd0_len_6a0.c @@ -1,13 +1,13 @@ #include "common.h" void intro_logos_set_fade_alpha(s16 new_alpha) { - GameStatus* gameStatus = *gGameStatusPtr; + GameStatus* gameStatus = GAME_STATUS; gameStatus->bootAlpha = new_alpha; } void intro_logos_set_fade_color(s16 arg0) { - GameStatus* gameStatus = *gGameStatusPtr; + GameStatus* gameStatus = GAME_STATUS; gameStatus->bootRed = arg0; gameStatus->bootGreen = arg0; @@ -15,7 +15,7 @@ void intro_logos_set_fade_color(s16 arg0) { } s16 intro_logos_fade_in(subtract_val) { - GameStatus* gameStatus = *gGameStatusPtr; + GameStatus* gameStatus = GAME_STATUS; if (gameStatus->bootAlpha != 0) { gameStatus->bootAlpha -= subtract_val; @@ -29,7 +29,7 @@ s16 intro_logos_fade_in(subtract_val) { } s16 intro_logos_fade_out(add_val) { - GameStatus* gameStatus = *gGameStatusPtr; + GameStatus* gameStatus = GAME_STATUS; if (gameStatus->bootAlpha != 0xFF) { gameStatus->bootAlpha += add_val;