diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 95346d6c..aacc4d22 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,13 +42,6 @@ jobs: - name: Checkout if: ${{ github.event_name == 'push' }} uses: actions/checkout@master - - - name: Checkout gh-pages - if: ${{ github.event_name == 'push' }} - uses: actions/checkout@master - with: - path: gh-pages - ref: gh-pages - name: Checkout agbcc uses: actions/checkout@master @@ -58,8 +51,11 @@ jobs: - name: Install tools run: | - sudo apt update && sudo apt install gcc-arm-none-eabi binutils-arm-none-eabi + sudo apt update && sudo apt install gcc-arm-none-eabi binutils-arm-none-eabi xorg-dev python3 -m pip install gitpython + # build-essential, git, and libpng-dev are already installed + # gcc-arm-none-eabi is only needed for the modern build + # as an alternative to dkP - name: Install agbcc run: | @@ -78,7 +74,6 @@ jobs: python3 scripts/progress.py text - name: Generate reports - if: ${{ github.event_name == 'push' }} run: | mkdir -p gh-pages/reports mkdir -p gh-pages/maps @@ -88,8 +83,37 @@ jobs: python3 scripts/progress.py shield-json -m > gh-pages/reports/progress-sa1-shield-matching.json echo "REPORTS_COMMIT_MSG=$( git log --format=%s ${GITHUB_SHA} )" >> $GITHUB_ENV cp sa1.map gh-pages/maps/${GITHUB_SHA}.map - - - name: Update reports + + - name: Upload progress + if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' }} + uses: actions/upload-artifact@v7 + with: + path: | + gh-pages + + publish-progress: + name: Publish progress + runs-on: ubuntu-24.04 + needs: [build-gba] + # Only able to run from repo pull requests (by maintainers, or on the main branch via push) + if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' }} + permissions: + contents: write + steps: + - name: Checkout gh-pages + uses: actions/checkout@master + with: + path: gh-pages + ref: gh-pages + - name: Download progress + uses: actions/download-artifact@v7 + with: + path: | + gh-pages + - run: | + cd gh-pages + git status + - name: Publish reports if: ${{ github.event_name == 'push' }} uses: EndBug/add-and-commit@v7 with: diff --git a/include/constants/zones.h b/include/constants/zones.h index d715f635..1c93a6fd 100644 --- a/include/constants/zones.h +++ b/include/constants/zones.h @@ -89,9 +89,9 @@ #define IS_EXTRA_STAGE(lvl) ((lvl) == LEVEL_INDEX(ZONE_FINAL, ACT_THE_MOON)) #define IS_FINAL_OR_EXTRA_STAGE(lvl) ((IS_FINAL_STAGE(lvl)) || (IS_EXTRA_STAGE(lvl))) -#define ZONE_TIME_TO_INT(minutes, seconds) (int)(((minutes * 60.) + seconds) * GBA_FRAMES_PER_SECOND) -#define TIMER_WARNING_BEGIN (ZONE_TIME_TO_INT(0, 20)) -#define MAX_COURSE_TIME (ZONE_TIME_TO_INT(10, 0)) +#define TIME(minutes, seconds) (int)(((minutes * 60.) + seconds) * GBA_FRAMES_PER_SECOND) +#define TIMER_WARNING_BEGIN (TIME(0, 20)) +#define MAX_COURSE_TIME (TIME(10, 0)) #define SPECIAL_STAGE_REQUIRED_SP_RING_COUNT 7 diff --git a/include/game/parameters/characters.h b/include/game/parameters/characters.h index c240f6a9..15d23a63 100644 --- a/include/game/parameters/characters.h +++ b/include/game/parameters/characters.h @@ -28,9 +28,9 @@ #define PLAYER_MAX_FLOATING_SPEED (2.25) // NOTE: Equal in SA1 and SA2! -#define PLAYER_INVULNERABLE_DURATION ZONE_TIME_TO_INT(0, 2) -#define PLAYER_INVINCIBLE_DURATION ZONE_TIME_TO_INT(0, 20) -#define PLAYER_SPEED_UP_DURATION ZONE_TIME_TO_INT(0, 20) +#define PLAYER_INVULNERABLE_DURATION TIME(0, 2) +#define PLAYER_INVINCIBLE_DURATION TIME(0, 20) +#define PLAYER_SPEED_UP_DURATION TIME(0, 20) #define PLAYER_SPEED_UP_MUSIC_TEMPO Q(2.0) #define PLAYER_AIR_SPEED_MAX 15.0 @@ -39,13 +39,13 @@ #define TRICK__STOP_N_SLAM__DROP_SPEED Q(0.21875) /*** Cream ***/ -#define CREAM_FLYING_DURATION ZONE_TIME_TO_INT(0, 4) +#define CREAM_FLYING_DURATION TIME(0, 4) /*** Tails ***/ // NOTE: Unlike Cream, Tails does fly for 8 seconds, but his initial value gets set to 4. // For some reason they lower his timer only every 2nd frame (in PlayerCB_8012C2C), // instead of using a bigger value from the get-go, even though they gave him a // 4-byte timer. -#define TAILS_FLYING_DURATION (ZONE_TIME_TO_INT(0, 8) / 2) +#define TAILS_FLYING_DURATION (TIME(0, 8) / 2) #endif // GUARD_PARAMETERS_CHARACTERS_H \ No newline at end of file diff --git a/src/game/egg_rocket_transitions.c b/src/game/egg_rocket_transitions.c index 13b09fdf..b4af7037 100644 --- a/src/game/egg_rocket_transitions.c +++ b/src/game/egg_rocket_transitions.c @@ -357,7 +357,7 @@ NONMATCH("asm/non_matching/game/egg_rocket_trans__Task_80294A8.inc", void Task_8 if (gGameMode == GAME_MODE_SINGLE_PLAYER) { gStageFlags |= FLAGS_EXECUTE_HBLANK_COPY; - gCourseTime = ZONE_TIME_TO_INT(5, 0); + gCourseTime = TIME(5, 0); } } @@ -368,7 +368,7 @@ NONMATCH("asm/non_matching/game/egg_rocket_trans__Task_80294A8.inc", void Task_8 if (gGameMode == GAME_MODE_SINGLE_PLAYER) { gStageFlags |= FLAGS_EXECUTE_HBLANK_COPY; - gCourseTime = ZONE_TIME_TO_INT(5, 0); + gCourseTime = TIME(5, 0); } } @@ -399,7 +399,7 @@ void Task_80297E8(void) if (--shake->unkC == 0) { if (gGameMode == GAME_MODE_SINGLE_PLAYER) { gStageFlags |= STAGE_FLAG__TIMER_REVERSED; - gCourseTime = ZONE_TIME_TO_INT(5, 0); + gCourseTime = TIME(5, 0); } gPlayer.moveState &= ~MOVESTATE_IGNORE_INPUT; @@ -415,7 +415,7 @@ void CreateEggRocketLaunchScreenShakeEffect() struct Task *t = TaskCreate(Task_80298C0, sizeof(EggRocketScreenShake), 0x4000, 0, NULL); EggRocketScreenShake *shake = TASK_DATA(t); - shake->unkC = ZONE_TIME_TO_INT(0, 1); + shake->unkC = TIME(0, 1); CreateScreenShake(0x800, 8, 16, 10, SCREENSHAKE_VERTICAL); @@ -429,7 +429,7 @@ void Task_80298C0() EggRocketScreenShake *shake = TASK_DATA(gCurTask); if (--shake->unkC == 0) { - shake->unkC = ZONE_TIME_TO_INT(0, 5); + shake->unkC = TIME(0, 5); CreateScreenShake(0x800, 8, 16, 300, (SCREENSHAKE_VERTICAL | SCREENSHAKE_RANDOM_VALUE)); gCurTask->main = Task_80297E8; } diff --git a/src/game/enemies/boss_3_egg_ball.c b/src/game/enemies/boss_3_egg_ball.c index 40f7b743..8c6058d8 100644 --- a/src/game/enemies/boss_3_egg_ball.c +++ b/src/game/enemies/boss_3_egg_ball.c @@ -287,7 +287,7 @@ void CreateEntity_EggBall(MapEntity *me, u16 regionX, u16 regionY, u8 id) t = TaskCreate(Task_PipeInitialDelay, sizeof(EggBall_Pipe), 0x2200U, 0U, TaskDestructor_8030754); strc = TASK_DATA(t); strc->unk44 = i; - strc->delay = ZONE_TIME_TO_INT(0, 1.5); + strc->delay = TIME(0, 1.5); strc->unk3C = unk3C = gUnknown_084ACDD2[i][0][0]; strc->unk3E = unk3E = gUnknown_084ACDD2[i][0][1]; strc->base.regionX = boss->base.regionX; diff --git a/src/game/enemies/bosses_egg_mobile.c b/src/game/enemies/bosses_egg_mobile.c index 3ac258cc..d054b8f6 100644 --- a/src/game/enemies/bosses_egg_mobile.c +++ b/src/game/enemies/bosses_egg_mobile.c @@ -102,7 +102,7 @@ void Task_EggMobileAscent() UpdateSpriteAnimation(s2); DisplaySprite(s2); - if (eggMobile->stunDelay > ZONE_TIME_TO_INT(0, 0.75)) { + if (eggMobile->stunDelay > TIME(0, 0.75)) { eggMobile->offsetY -= Q(1); if (eggMobile->offsetY <= -Q(80)) { diff --git a/src/game/enemies/bosses_misc.c b/src/game/enemies/bosses_misc.c index aa70a7f3..160025fa 100644 --- a/src/game/enemies/bosses_misc.c +++ b/src/game/enemies/bosses_misc.c @@ -234,7 +234,7 @@ void Task_801623C() if ((Coll_Player_Entity_Intersection(s, capsule->worldX, capsule->worldY, p) & 0x80000) || (Coll_Player_Entity_Intersection(s2, capsule->worldX, capsule->worldY, p) & 0x80000)) { - p->timerInvulnerability = ZONE_TIME_TO_INT(0, 2); + p->timerInvulnerability = TIME(0, 2); if (I(p->qWorldX) < gCamera.x + (DISPLAY_WIDTH / 2)) { p->qSpeedAirX = -Q(2); sideX = (capsule->worldX + s->hitboxes[0].b.left) - p->spriteOffsetX; diff --git a/src/game/enemies/fireball.c b/src/game/enemies/fireball.c index 80e13967..3232a720 100644 --- a/src/game/enemies/fireball.c +++ b/src/game/enemies/fireball.c @@ -9,7 +9,7 @@ #include "constants/zones.h" #define NUM_SPARKS 2 -#define FIREBALL_SPAWN_RATE ZONE_TIME_TO_INT(0, 4) +#define FIREBALL_SPAWN_RATE TIME(0, 4) typedef struct { /* 0x00 */ MapEntity *me; diff --git a/src/game/enemies/mirror.c b/src/game/enemies/mirror.c index 03cc53c1..f8fb77bc 100644 --- a/src/game/enemies/mirror.c +++ b/src/game/enemies/mirror.c @@ -178,7 +178,7 @@ void Task_MirrorShoot(void) } } - if (mirror->frames == ZONE_TIME_TO_INT(0, 1)) { + if (mirror->frames == TIME(0, 1)) { s->variant = 0; gCurTask->main = Task_Mirror; } diff --git a/src/game/enemies/mole.c b/src/game/enemies/mole.c index 89c625d9..fa47833c 100644 --- a/src/game/enemies/mole.c +++ b/src/game/enemies/mole.c @@ -82,7 +82,7 @@ void Task_Mole(void) return; } - if (++mole->frames >= ZONE_TIME_TO_INT(0, 1)) { + if (++mole->frames >= TIME(0, 1)) { mole->frames = 0; s->variant = 1; @@ -118,7 +118,7 @@ void Task_Mole_8071640(void) return; } - if (++mole->frames >= ZONE_TIME_TO_INT(0, 1)) { + if (++mole->frames >= TIME(0, 1)) { mole->frames = 0; s->variant = 0; gCurTask->main = Task_Mole; diff --git a/src/game/game_over.c b/src/game/game_over.c index 453959e6..85780043 100644 --- a/src/game/game_over.c +++ b/src/game/game_over.c @@ -253,7 +253,7 @@ void Task_GameOverScreenInit(void) screen->frames = ++frames; - if (frames >= ZONE_TIME_TO_INT(0, 1)) { + if (frames >= TIME(0, 1)) { screen->s.frameFlags = 0; screen->s2.frameFlags = 0; gCurTask->main = Task_8056100; @@ -297,7 +297,7 @@ void Task_8056100(void) screen->frames = ++frames; - if (frames >= ZONE_TIME_TO_INT(0, 1.5)) { + if (frames >= TIME(0, 1.5)) { gCurTask->main = Task_805618C; } @@ -324,7 +324,7 @@ void Task_805618C(void) screen->frames = ++frames; - if (frames >= ZONE_TIME_TO_INT(0, 2)) { + if (frames >= TIME(0, 2)) { s->frameFlags = SPRITE_OAM_ORDER(2); s2->frameFlags = SPRITE_OAM_ORDER(2); @@ -678,7 +678,7 @@ NONMATCH("asm/non_matching/game/game_over__Task_805676C.inc", void Task_805676C( } } - if (unk24 >= ZONE_TIME_TO_INT(0, 20)) { + if (unk24 >= TIME(0, 20)) { gCurTask->main = Task_DestroyGameOverD; } diff --git a/src/game/interactables/boulder_spawner.c b/src/game/interactables/boulder_spawner.c index de149932..12c7552f 100644 --- a/src/game/interactables/boulder_spawner.c +++ b/src/game/interactables/boulder_spawner.c @@ -17,7 +17,7 @@ #include "constants/vram_hardcoded.h" #include "constants/zones.h" -#define BOULDER_SPAWN_RATE ZONE_TIME_TO_INT(0, 2) +#define BOULDER_SPAWN_RATE TIME(0, 2) typedef struct { /* 0x00 */ SpriteBase base; diff --git a/src/game/interactables/stage_goal.c b/src/game/interactables/stage_goal.c index 1971fcee..f37bbf85 100644 --- a/src/game/interactables/stage_goal.c +++ b/src/game/interactables/stage_goal.c @@ -311,7 +311,7 @@ void Task_StageGoal2(void) if (count == 0) { gStageFlags |= STAGE_FLAG__TIMER_REVERSED; - gCourseTime = ZONE_TIME_TO_INT(1, 0); + gCourseTime = TIME(1, 0); } gPlayer.moveState |= MOVESTATE_IGNORE_INPUT; @@ -371,7 +371,7 @@ void Task_StageGoal2(void) } gStageFlags |= STAGE_FLAG__TIMER_REVERSED; - gCourseTime = ZONE_TIME_TO_INT(1, 0); + gCourseTime = TIME(1, 0); gPlayer.moveState |= MOVESTATE_IGNORE_INPUT; gPlayer.heldInput = DPAD_RIGHT; diff --git a/src/game/interactables/underwater_lava_platform.c b/src/game/interactables/underwater_lava_platform.c index e8a236f9..11401d85 100644 --- a/src/game/interactables/underwater_lava_platform.c +++ b/src/game/interactables/underwater_lava_platform.c @@ -16,7 +16,7 @@ #include "constants/songs.h" #include "constants/zones.h" -#define LAVA_SPURT_RATE ZONE_TIME_TO_INT(0, 1.7) +#define LAVA_SPURT_RATE TIME(0, 1.7) typedef struct { /* 0x00 */ SpriteBase base; diff --git a/src/game/multiplayer/hud.c b/src/game/multiplayer/hud.c index 7764b877..3d016d14 100644 --- a/src/game/multiplayer/hud.c +++ b/src/game/multiplayer/hud.c @@ -115,12 +115,12 @@ NONMATCH("asm/non_matching/game/multiplayer/results_2__Task_ChaoHuntHUD.inc", vo hud = TASK_DATA(gCurTask); // Show the red timer every 2 frames, lasting 2 frames - if (((u32)gCourseTime < ZONE_TIME_TO_INT(1, 0)) && (gCourseTime & 2)) { + if (((u32)gCourseTime < TIME(1, 0)) && (gCourseTime & 2)) { timerSprites = hud->spritesB; } else { timerSprites = hud->spritesA; } - if (!(1 & gStageFlags) && (gCourseTime < ZONE_TIME_TO_INT(1, 0)) && (Mod(gCourseTime, 60) == 0)) { + if (!(1 & gStageFlags) && (gCourseTime < TIME(1, 0)) && (Mod(gCourseTime, 60) == 0)) { m4aSongNumStart(SE_TIMER); } s = &timerSprites[10]; diff --git a/src/game/multiplayer/mp_player.c b/src/game/multiplayer/mp_player.c index 54a00d36..376a1504 100644 --- a/src/game/multiplayer/mp_player.c +++ b/src/game/multiplayer/mp_player.c @@ -1948,7 +1948,7 @@ bool32 SA2_LABEL(sub_8018300)(void) if (gMultiplayerCharacters[mpp->unk56] == 3) { if (s->graphics.anim == SA1_ANIM_CHAR(AMY, BOOSTLESS_ATTACK) || s->graphics.anim == SA1_ANIM_CHAR(AMY, 56)) { gPlayer.itemEffect |= PLAYER_ITEM_EFFECT__MP_SLOW_DOWN; - gPlayer.timerSpeedup = ZONE_TIME_TO_INT(0, 10); + gPlayer.timerSpeedup = TIME(0, 10); gPlayer.itemEffect &= ~PLAYER_ITEM_EFFECT__SPEED_UP; CreateItemTask_Confusion(gPlayer.character); m4aMPlayTempoControl(&gMPlayInfo_BGM, Q(0.5)); diff --git a/src/game/multiplayer/multiplayer_event_mgr.c b/src/game/multiplayer/multiplayer_event_mgr.c index a1065124..7a0342d5 100644 --- a/src/game/multiplayer/multiplayer_event_mgr.c +++ b/src/game/multiplayer/multiplayer_event_mgr.c @@ -123,7 +123,7 @@ void ReceiveRoomEvent_ItemEffect(union MultiSioData *recv, u8 i) || ((gMultiplayerConnections & (0x10 << (i))) >> ((i + 4)) != (gMultiplayerConnections & (0x10 << (SIO_MULTI_CNT->id))) >> (SIO_MULTI_CNT->id + 4))) { gPlayer.itemEffect |= PLAYER_ITEM_EFFECT__CONFUSION; - gPlayer.timerConfusion = ZONE_TIME_TO_INT(0, 10); + gPlayer.timerConfusion = TIME(0, 10); CreateItemTask_Confusion(gPlayer.character); #if (GAME == GAME_SA2) m4aSongNumStart(SE_ITEM_CONFUSION); @@ -177,7 +177,7 @@ void ReceiveRoomEvent_ItemEffect(union MultiSioData *recv, u8 i) gPlayer.layer = (mpp->unk54 >> 7) & 1; gPlayer.moveState |= MOVESTATE_IN_AIR; mpp->unk60 = 30; - gPlayer.timerInvulnerability = ZONE_TIME_TO_INT(0, 2); + gPlayer.timerInvulnerability = TIME(0, 2); gCamera.x = (I(gPlayer.qWorldX) + gCamera.shiftX) - (DISPLAY_WIDTH / 2); gCamera.y = (I(gPlayer.qWorldY) + gCamera.shiftY) - (DISPLAY_HEIGHT / 2); #if (GAME == GAME_SA2) @@ -192,7 +192,7 @@ void ReceiveRoomEvent_ItemEffect(union MultiSioData *recv, u8 i) || ((gMultiplayerConnections & (0x10 << (i))) >> ((i + 4)) != (gMultiplayerConnections & (0x10 << (SIO_MULTI_CNT->id))) >> (SIO_MULTI_CNT->id + 4))) { gPlayer.itemEffect |= PLAYER_ITEM_EFFECT__MP_SLOW_DOWN; - gPlayer.timerSpeedup = ZONE_TIME_TO_INT(0, 10); + gPlayer.timerSpeedup = TIME(0, 10); gPlayer.itemEffect &= ~PLAYER_ITEM_EFFECT__SPEED_UP; CreateItemTask_Confusion(gPlayer.character); m4aMPlayTempoControl(&gMPlayInfo_BGM, Q(0.5)); @@ -304,7 +304,7 @@ NONMATCH("asm/non_matching/game/multiplayer/evt_mgr__ReceiveRoomEvent_ReachedSta if (count2 == 0 && !(gStageFlags & 1)) { gStageFlags |= 4; - gCourseTime = ZONE_TIME_TO_INT(1, 0); + gCourseTime = TIME(1, 0); }; if ((count3 + 1) >= (u32)(count - 1) || gGameMode == GAME_MODE_MULTI_PLAYER || gGameMode == GAME_MODE_TEAM_PLAY) { diff --git a/src/game/sa1_sa2_shared/demo_manager.c b/src/game/sa1_sa2_shared/demo_manager.c index 57af1f17..a15b0d69 100644 --- a/src/game/sa1_sa2_shared/demo_manager.c +++ b/src/game/sa1_sa2_shared/demo_manager.c @@ -21,11 +21,11 @@ #if (GAME == GAME_SA1) #define DEMO_SPRITE_PRIO 1 #define DEMO_OAM_ORDER 15 -#define DEMO_PLAYBACK_TIME ZONE_TIME_TO_INT(0, 30) +#define DEMO_PLAYBACK_TIME TIME(0, 30) #elif (GAME == GAME_SA2) #define DEMO_SPRITE_PRIO 0 #define DEMO_OAM_ORDER 1 -#define DEMO_PLAYBACK_TIME ZONE_TIME_TO_INT(0, 24.5) +#define DEMO_PLAYBACK_TIME TIME(0, 24.5) #endif typedef struct { diff --git a/src/game/sa1_sa2_shared/itembox.c b/src/game/sa1_sa2_shared/itembox.c index 482fd69f..b0df895f 100644 --- a/src/game/sa1_sa2_shared/itembox.c +++ b/src/game/sa1_sa2_shared/itembox.c @@ -26,8 +26,8 @@ #include "constants/songs.h" #include "constants/zones.h" -#define ITEM_DURATION_INVINCIBILITY ZONE_TIME_TO_INT(0, 20) -#define ITEM_DURATION_SPEED_UP ZONE_TIME_TO_INT(0, 20) +#define ITEM_DURATION_INVINCIBILITY TIME(0, 20) +#define ITEM_DURATION_SPEED_UP TIME(0, 20) typedef struct { /* 0x00|0x00 */ SpriteBase base; diff --git a/src/game/stage/player.c b/src/game/stage/player.c index 9ecb8624..80e402a7 100644 --- a/src/game/stage/player.c +++ b/src/game/stage/player.c @@ -503,7 +503,7 @@ void InitializePlayer(Player *p) p->stoodObj = NULL; p->itemEffect = PLAYER_ITEM_EFFECT__NONE; p->SA2_LABEL(unk2A) = 0; - p->SA2_LABEL(unk72) = ZONE_TIME_TO_INT(0, 6); + p->SA2_LABEL(unk72) = TIME(0, 6); p->SA2_LABEL(unk7E) = 0; p->SA2_LABEL(unk7C) = 0; p->SA2_LABEL(unk82) = Q(1); @@ -3897,7 +3897,7 @@ void Task_PlayerDied(void) if (DeadPlayerLeftScreen(&gPlayer, &gCamera, gPlayer.qWorldY)) { player_0_Task *gt = TASK_DATA(gCurTask); - gt->unk4 = ZONE_TIME_TO_INT(0, 1); + gt->unk4 = TIME(0, 1); #if (GAME == GAME_SA2) gPlayer.moveState |= MOVESTATE_100000; if (IS_MULTI_PLAYER) { @@ -4244,7 +4244,7 @@ NONMATCH("asm/non_matching/game/stage/Player__Task_804597C.inc", void Task_80459 } // Inline of Player_InitializeDrowning? - gPartner.framesUntilDrownCountDecrement = ZONE_TIME_TO_INT(0, 1); + gPartner.framesUntilDrownCountDecrement = TIME(0, 1); gPartner.secondsUntilDrown = 30; if (gPartner.playerID == 0) { @@ -4355,7 +4355,7 @@ void Task_8045B38(void) partner->moveState &= ~MOVESTATE_20; // Inline of Player_InitializeDrowning? - partner->framesUntilDrownCountDecrement = ZONE_TIME_TO_INT(0, 1); + partner->framesUntilDrownCountDecrement = TIME(0, 1); partner->secondsUntilDrown = 30; if (partner->playerID == PLAYER_1) { @@ -4591,7 +4591,7 @@ NONMATCH("asm/non_matching/game/stage/Player__sa2__sub_802486C.inc", void SA2_LA #if (GAME == GAME_SA1) if ((p->qSpeedGround != Q(0)) || (p->heldInput & (DPAD_ANY | A_BUTTON | B_BUTTON))) { - p->SA2_LABEL(unk72) = ZONE_TIME_TO_INT(0, 6); + p->SA2_LABEL(unk72) = TIME(0, 6); } #endif @@ -5745,7 +5745,7 @@ void Player_8047280(Player *p) } } -void sub_80472AC(Player *p) { p->SA2_LABEL(unk72) = ZONE_TIME_TO_INT(0, 6); } +void sub_80472AC(Player *p) { p->SA2_LABEL(unk72) = TIME(0, 6); } void sub_80472B8(Player *p) { diff --git a/src/game/stage/player_tails.c b/src/game/stage/player_tails.c index 263ff4dc..b6543fc8 100644 --- a/src/game/stage/player_tails.c +++ b/src/game/stage/player_tails.c @@ -332,7 +332,7 @@ void Player_Tails_InitFlying(Player *p) PLAYERFN_CHANGE_SHIFT_OFFSETS(p, 6, 14); } - p->w.tf.flyingDuration = ZONE_TIME_TO_INT(0, 4); + p->w.tf.flyingDuration = TIME(0, 4); Player_Tails_8047990(p); } diff --git a/src/game/stage/results.c b/src/game/stage/results.c index 36593782..f858a10a 100644 --- a/src/game/stage/results.c +++ b/src/game/stage/results.c @@ -235,7 +235,7 @@ NONMATCH("asm/non_matching/game/stage/results__CreateStageResults.inc", u32 Crea } if (gCurrentLevel == LEVEL_INDEX(ZONE_6, ACT_1)) { - const s32 countDown = ZONE_TIME_TO_INT(3, 0); + const s32 countDown = TIME(3, 0); if (gCheckpointTime <= +countDown) { courseTime = 1; } else { @@ -254,23 +254,23 @@ NONMATCH("asm/non_matching/game/stage/results__CreateStageResults.inc", u32 Crea gMusicManagerState.unk0 = 0xFF; - if (courseTime >= ZONE_TIME_TO_INT(6, 0)) { + if (courseTime >= TIME(6, 0)) { timeScore = 0; - } else if (courseTime >= ZONE_TIME_TO_INT(5, 0)) { + } else if (courseTime >= TIME(5, 0)) { timeScore = 500; - } else if (courseTime >= ZONE_TIME_TO_INT(4, 0)) { + } else if (courseTime >= TIME(4, 0)) { timeScore = 1000; - } else if (courseTime >= ZONE_TIME_TO_INT(3, 0)) { + } else if (courseTime >= TIME(3, 0)) { timeScore = 2000; - } else if (courseTime >= ZONE_TIME_TO_INT(2, 0)) { + } else if (courseTime >= TIME(2, 0)) { timeScore = 3000; - } else if (courseTime >= ZONE_TIME_TO_INT(1, 30)) { + } else if (courseTime >= TIME(1, 30)) { timeScore = 4000; - } else if (courseTime >= ZONE_TIME_TO_INT(1, 0)) { + } else if (courseTime >= TIME(1, 0)) { timeScore = 5000; - } else if (courseTime >= ZONE_TIME_TO_INT(0, 50)) { + } else if (courseTime >= TIME(0, 50)) { timeScore = 10000; - } else if (courseTime >= ZONE_TIME_TO_INT(0, 30)) { + } else if (courseTime >= TIME(0, 30)) { timeScore = 50000; } else { timeScore = 80000; diff --git a/src/game/stage/stage.c b/src/game/stage/stage.c index ddf816b6..b6613d3c 100644 --- a/src/game/stage/stage.c +++ b/src/game/stage/stage.c @@ -122,21 +122,21 @@ void GameStageStart(void) gMPStageStartFrameCount = gFrameCount; } - gCheckpointTime = ZONE_TIME_TO_INT(0, 0); + gCheckpointTime = TIME(0, 0); #if (GAME == GAME_SA1) if ((gGameMode == GAME_MODE_MULTI_PLAYER_COLLECT_RINGS) || (gGameMode == GAME_MODE_CHAO_HUNT)) { - gCourseTime = ZONE_TIME_TO_INT(3, 0); + gCourseTime = TIME(3, 0); } else if (gGameMode == GAME_MODE_TEAM_PLAY) { - gCourseTime = ZONE_TIME_TO_INT(5, 0); + gCourseTime = TIME(5, 0); } else { - gCourseTime = ZONE_TIME_TO_INT(0, 0); + gCourseTime = TIME(0, 0); } #elif (GAME == GAME_SA2) if (gGameMode != GAME_MODE_MULTI_PLAYER_COLLECT_RINGS) { - gCourseTime = ZONE_TIME_TO_INT(0, 0); + gCourseTime = TIME(0, 0); } else { - gCourseTime = ZONE_TIME_TO_INT(3, 0); + gCourseTime = TIME(3, 0); } #endif @@ -710,7 +710,7 @@ void StageInit_Zone6Act1(void) if (gGameMode == GAME_MODE_SINGLE_PLAYER) { gStageFlags |= STAGE_FLAG__TIMER_REVERSED; - gCourseTime = ZONE_TIME_TO_INT(5, 0); + gCourseTime = TIME(5, 0); } } @@ -724,7 +724,7 @@ void StageInit_Zone6Act1(void) if (gGameMode == GAME_MODE_SINGLE_PLAYER) { gStageFlags |= STAGE_FLAG__TIMER_REVERSED; - gCourseTime = ZONE_TIME_TO_INT(5, 0); + gCourseTime = TIME(5, 0); } } @@ -736,7 +736,7 @@ void StageInit_Zone6Act1(void) if (gGameMode == GAME_MODE_SINGLE_PLAYER) { gStageFlags |= STAGE_FLAG__TIMER_REVERSED; - gCourseTime = ZONE_TIME_TO_INT(5, 0); + gCourseTime = TIME(5, 0); } } } diff --git a/src/game/stage/ui.c b/src/game/stage/ui.c index 0f8e1492..0d89af76 100644 --- a/src/game/stage/ui.c +++ b/src/game/stage/ui.c @@ -245,13 +245,13 @@ void StageUI_DrawTimer(u32 courseTime) s16 redOffset; if (gStageFlags & STAGE_FLAG__TIMER_REVERSED) { - if ((gCourseTime < ZONE_TIME_TO_INT(1, 0)) && (gStageTime & 0x10)) { + if ((gCourseTime < TIME(1, 0)) && (gStageTime & 0x10)) { redOffset = 11; } else { redOffset = 0; } } else { - if ((gCourseTime > ZONE_TIME_TO_INT(9, 0)) && (gStageTime & 0x10)) { + if ((gCourseTime > TIME(9, 0)) && (gStageTime & 0x10)) { redOffset = 11; } else { redOffset = 0; diff --git a/src/game/stage/ui_z.c b/src/game/stage/ui_z.c index 76b38bf4..ce4a198c 100644 --- a/src/game/stage/ui_z.c +++ b/src/game/stage/ui_z.c @@ -522,7 +522,7 @@ NONMATCH("asm/non_matching/game/stage/ui__Task_8055458.inc", void Task_8055458(v mpp->unk5C &= ~0x2; } - gPlayer.timerInvulnerability = ZONE_TIME_TO_INT(0, 2); + gPlayer.timerInvulnerability = TIME(0, 2); } // _08055622 diff --git a/src/game/time_over.c b/src/game/time_over.c index 4f2c31bd..13d1e65a 100644 --- a/src/game/time_over.c +++ b/src/game/time_over.c @@ -90,14 +90,14 @@ void Task_TimeOverTimerUpdate() TimeOverState *state = TASK_DATA(overTimer->t); state->timer = overTimer->timer; - if (overTimer->timer > ZONE_TIME_TO_INT(0, 3.5)) { + if (overTimer->timer > TIME(0, 3.5)) { if (gCurrentLevel == LEVEL_INDEX(ZONE_6, ACT_1)) { gCamera.SA2_LABEL(unk50) |= 0x2000; } sub_805423C(&state->strc0); } - if (++overTimer->timer > ZONE_TIME_TO_INT(0, 5.5)) { + if (++overTimer->timer > TIME(0, 5.5)) { TaskDestroy(overTimer->t); TaskDestroy(gCurTask); @@ -120,10 +120,10 @@ void Task_TimeOverStateUpdate() TimeOverState *state = TASK_DATA(gCurTask); timer = state->timer; - if (timer > ZONE_TIME_TO_INT(0, 2.0)) { + if (timer > TIME(0, 2.0)) { state->s2.x = state->s.x = (DISPLAY_WIDTH / 2); - } else if (timer > ZONE_TIME_TO_INT(0, 0.5)) { - state->s2.x = state->s.x = (DISPLAY_WIDTH + 60) - ((timer - ZONE_TIME_TO_INT(0, 0.5)) * 2); + } else if (timer > TIME(0, 0.5)) { + state->s2.x = state->s.x = (DISPLAY_WIDTH + 60) - ((timer - TIME(0, 0.5)) * 2); } s = &state->s; diff --git a/tools/_shared/arena_alloc/Makefile b/tools/_shared/arena_alloc/Makefile index 7566e0c3..0ca13e05 100644 --- a/tools/_shared/arena_alloc/Makefile +++ b/tools/_shared/arena_alloc/Makefile @@ -3,7 +3,7 @@ CC = gcc SOURCE = arena_alloc.c -# Clear the default suffixes +# Clear the default suffixes (needed to fix build race condition) .SUFFIXES: .PHONY: all clean diff --git a/tools/_shared/c_header_parser/Makefile b/tools/_shared/c_header_parser/Makefile index dd0acca3..711ef312 100644 --- a/tools/_shared/c_header_parser/Makefile +++ b/tools/_shared/c_header_parser/Makefile @@ -8,6 +8,9 @@ SRCS = c_header_parser.c CFLAGS = -I $(ARENA_ALLOC_DIR) -Wall -Wextra -Werror $(NO_ERROR) -std=gnu11 -O2 +# Clear the default suffixes (needed to fix build race condition) +.SUFFIXES: + .PHONY: all clean all: libc_header_parser.a diff --git a/tools/_shared/csv_conv/Makefile b/tools/_shared/csv_conv/Makefile index 0aab418d..a786f725 100644 --- a/tools/_shared/csv_conv/Makefile +++ b/tools/_shared/csv_conv/Makefile @@ -9,6 +9,9 @@ SRCS = csv_conv.c CFLAGS = -I $(CSV_CONV_DIR) -Wall -Wextra -Werror $(NO_ERROR) -std=gnu11 -O2 LDFLAGS = +# Clear the default suffixes (needed to fix build race condition) +.SUFFIXES: + .PHONY: all clean all: libcsv_conv.a