//
// FMODAudioEngine::updateChannel from 0x10013c758 to 0x10013c928 (464 bytes)
//
// 9 xrefs:
// > GJBaseGameLayer::applySFXEditTrigger @ 0x100205350
// > GJBaseGameLayer::applySFXEditTrigger @ 0x100205388
// > GJBaseGameLayer::processActivatedAudioTriggers @ 0x100206ce8
// > GJBaseGameLayer::processActivatedAudioTriggers @ 0x100206e60
// > GJBaseGameLayer::processActivatedAudioTriggers @ 0x100206e7c
// > GJBaseGameLayer::processSongState @ 0x1002072e4
// > GJBaseGameLayer::processSongState @ 0x100207308
// > GJBaseGameLayer::processSongState @ 0x10020735c
// > GJBaseGameLayer::processSongState @ 0x100207380
//
// 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
//
void __fastcall FMODAudioEngine::updateChannel(
FMODAudioEngine *a1,
int a2,
AudioTargetType a3,
AudioModType a4,
float a5,
float a6)
{
__int64 v12; // x8
__int64 v13; // x23
int v14; // s0
std::unordered_map *p_m_pitchForMusicChannels; // x0
__int64 v16; // [xsp+8h] [xbp-68h] BYREF
int v17; // [xsp+10h] [xbp-60h]
float v18; // [xsp+14h] [xbp-5Ch]
int v19; // [xsp+18h] [xbp-58h]
char v20; // [xsp+1Ch] [xbp-54h]
_DWORD v21[2]; // [xsp+20h] [xbp-50h] BYREF
int v22; // [xsp+28h] [xbp-48h] BYREF
v21[1] = a4;
v22 = a2;
v12 = 560;
if ( a3 == MusicChannel )
v12 = 608;
if ( a3 == SFXGroup )
v13 = 584;
else
v13 = v12;
v21[0] = a2;
sub_10001BCE8((__int64)a1 + v13);
if ( a5 > 0.0 )
{
if ( a4 == Pitch )
{
if ( a3 == MusicChannel )
{
v16 = (__int64)&v22;
p_m_pitchForMusicChannels = &a1->m_audioState.m_pitchForMusicChannels;
}
else
{
v16 = (__int64)&v22;
if ( a3 == SFXGroup )
p_m_pitchForMusicChannels = &a1->m_audioState.m_pitchForEffectGroups;
else
p_m_pitchForMusicChannels = &a1->m_audioState.m_pitchForEffectChannels;
}
}
else
{
v14 = 0;
if ( a4 )
{
LABEL_24:
LODWORD(v16) = 0;
*((float *)&v16 + 1) = a5;
v17 = v14;
v18 = a6;
v19 = v14;
v20 = 0;
sub_100140FE8((char *)a1 + v13, v21, v21, &v16);
return;
}
if ( a3 == MusicChannel )
{
v16 = (__int64)&v22;
p_m_pitchForMusicChannels = &a1->m_audioState.m_volumeForMusicChannels;
}
else if ( a3 == SFXGroup )
{
v16 = 0x3FF0000000000000LL;
sub_100140DB8(&a1->m_audioState.m_volumeForEffectGroups, &v22, &v22, &v16);
v16 = (__int64)&v22;
p_m_pitchForMusicChannels = &a1->m_audioState.m_volumeForEffectGroups;
}
else
{
v16 = (__int64)&v22;
p_m_pitchForMusicChannels = &a1->m_audioState.m_volumeForEffectChannels;
}
}
v14 = *((_DWORD *)sub_10001D150(
(unsigned __int64)p_m_pitchForMusicChannels,
&v22,
(__int64)&unk_100637FD3,
(_DWORD **)&v16)
+ 5);
goto LABEL_24;
}
if ( a4 == Pitch )
{
FMODAudioEngine::setChannelPitch(a1, a2, a3, a6);
}
else if ( a4 == Volume )
{
FMODAudioEngine::setChannelVolume(a1, a2, a3, a6);
}
}