//
// FMODAudioEngine::waitUntilSoundReady from 0x5abd04 to 0x5abdb4 (176 bytes)
//
// 3 xrefs:
// > FMODAudioEngine::setMusicTimeMS @ 0x5b3c2c
// > FMODAudioEngine::preloadMusic @ 0x5b66c0
// > ??> @ 0x7d1d8
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
FMOD_OPENSTATE FMODAudioEngine::waitUntilSoundReady(FMODAudioEngine *a1, FMOD::Sound *a2)
{
FMOD_OPENSTATE result; // w0
FMOD_OPENSTATE v5; // [xsp+44h] [xbp+44h] BYREF
if ( !a2 )
return FMOD_OPENSTATE_ERROR;
do
{
a1->m_lastResult = FMOD::Sound::getOpenState(a2, &v5, nullptr, nullptr, nullptr);
ERRCHECK_fn();
result = v5;
}
while ( (v5 & 0xFFFFFFFD) != 0 && v5 != FMOD_OPENSTATE_PLAYING );
return result;
}