Merge pull request #2392 from gruxor/wait-fix

Replaced busy-wait loops
This commit is contained in:
Eduardo Quezada D'Ottone 2022-10-17 15:34:22 -03:00 committed by GitHub
commit c57ab9e529
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View file

@ -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)

View file

@ -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))
{