//
// MusicDownloadManager::downloadSFX from 0x459fe0 to 0x45a100 (288 bytes)
//
// 2 xrefs:
// > CustomSongWidget::processNextMultiAsset @ 0x3dffe8
// > CustomSFXWidget::startDownload @ 0x56df02
//
// 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 MusicDownloadManager::downloadSFX(MusicDownloadManager *a1, int a2)
{
char *SFXDownloadKey; // r11
cocos2d::CCObject *Request; // [sp+14h] [bp-30h]
GameToolbox v6; // [sp+1Ch] [bp-28h] BYREF
_BYTE v7[4]; // [sp+20h] [bp-24h] BYREF
_BYTE v8[4]; // [sp+24h] [bp-20h] BYREF
int v9; // [sp+28h] [bp-1Ch] BYREF
char *v10; // [sp+2Ch] [bp-18h] BYREF
char *v11[3]; // [sp+30h] [bp-14h] BYREF
if ( *((_DWORD *)a1->m_customContentURL.m_data.m_data - 3) )
{
SFXDownloadKey = (char *)MusicDownloadManager::getSFXDownloadKey(a1, a2);
if ( !MusicDownloadManager::isDLActive(a1, SFXDownloadKey) )
{
GameToolbox::intToString(&v6, a2);
sub_776584((int)v7, "/sfx/s");
sub_77441C(v7, &v6);
sub_774544((int)v7, ".ogg");
sub_775C20(&v9);
MusicDownloadManager::generateCustomContentURL((int)v8, (int)a1, &v9);
sub_774008(&v9);
sub_775C20(&v10);
sub_775C20(v11);
v11[2] = nullptr;
v11[1] = (char *)MusicDownloadManager::onDownloadSFXCompleted;
Request = (cocos2d::CCObject *)MusicDownloadManager::ProcessHttpGetRequest(
a1,
&v10,
v11,
(int)MusicDownloadManager::onDownloadSFXCompleted,
0,
5,
10);
sub_774008(v11);
sub_774008(&v10);
MusicDownloadManager::addDLToActive(a1, SFXDownloadKey, Request);
sub_774008(v8);
sub_774008(v7);
sub_774008(&v6);
}
}
}