From 610a8efb7d1f50c222d2bbd7b8cb299728605fde Mon Sep 17 00:00:00 2001 From: gruxor Date: Mon, 17 Oct 2022 11:21:06 -0400 Subject: [PATCH] Replaced busy-wait loops --- src/main.c | 4 +--- src/pokemon_debug.c | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main.c b/src/main.c index 99d2610bb3..3a306b2cf8 100644 --- a/src/main.c +++ b/src/main.c @@ -408,9 +408,7 @@ static void IntrDummy(void) static void WaitForVBlank(void) { gMain.intrCheck &= ~INTR_FLAG_VBLANK; - - while (!(gMain.intrCheck & INTR_FLAG_VBLANK)) - ; + VBlankIntrWait(); } void SetTrainerHillVBlankCounter(u32 *counter) diff --git a/src/pokemon_debug.c b/src/pokemon_debug.c index 8a047e3979..447590e280 100644 --- a/src/pokemon_debug.c +++ b/src/pokemon_debug.c @@ -1380,7 +1380,7 @@ static void UpdateSubmenuOneOptionValue(u8 taskId, bool8 increment) UpdateBattlerValue(data); ReloadPokemonSprites(data); - while (!(gMain.intrCheck & INTR_FLAG_VBLANK)); + VBlankIntrWait(); PlaySE(SE_DEX_SCROLL); } break; @@ -1499,7 +1499,7 @@ static void Handle_Input_Debug_Pokemon(u8 taskId) PrintDigitChars(data); UpdateBattlerValue(data); ReloadPokemonSprites(data); - while (!(gMain.intrCheck & INTR_FLAG_VBLANK)); + VBlankIntrWait(); PlaySE(SE_DEX_SCROLL); } @@ -1531,7 +1531,7 @@ static void Handle_Input_Debug_Pokemon(u8 taskId) ResetOffsetSpriteValues(data); } PlaySE(SE_DEX_SCROLL); - while (!(gMain.intrCheck & INTR_FLAG_VBLANK)); + VBlankIntrWait(); } else if (JOY_NEW(DPAD_UP)) {