Do not do VBlankIntrWait if using the wireless adapter (#3730)

* Do not do VBlankIntrWait if using the wireless adapter

Desynchronization can occur otherwise.

* Fix formatting

Co-authored-by: LOuroboros <lunosouroboros@gmail.com>

---------

Co-authored-by: LOuroboros <lunosouroboros@gmail.com>
This commit is contained in:
AtariDreams 2024-03-19 07:29:47 -04:00 committed by GitHub
parent f419de24d9
commit 21ed70c007
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -455,7 +455,18 @@ static void IntrDummy(void)
static void WaitForVBlank(void)
{
gMain.intrCheck &= ~INTR_FLAG_VBLANK;
VBlankIntrWait();
if (gWirelessCommType != 0)
{
// Desynchronization may occur if wireless adapter is connected
// and we call VBlankIntrWait();
while (!(gMain.intrCheck & INTR_FLAG_VBLANK))
;
}
else
{
VBlankIntrWait();
}
}
void SetTrainerHillVBlankCounter(u32 *counter)