//
// CustomSFXWidget::updateSFXInfo from 0x6a6580 to 0x6a6c22 (1698 bytes)
//
// 9 xrefs:
// > CustomSFXWidget::deleteSFX @ 0x6a6c86
// > CustomSFXWidget::updateSFXObject @ 0x6a6d9c
// > CustomSFXWidget::downloadFailed @ 0x6a6dcc
// > CustomSFXWidget::onToggleFavorite @ 0x6a6e30
// > CustomSFXWidget::onToggleSelect @ 0x6a6e52
// > CustomSFXWidget::updateDownloadProgress @ 0x6a6e96
// > CustomSFXWidget::songStateChanged @ 0x6a6eb0
// > CustomSFXWidget::updateLengthMod @ 0x6a6eca
// > CustomSFXWidget::init @ 0x6a7c6a
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:56:31 +0000
//
int __fastcall CustomSFXWidget::updateSFXInfo(CustomSFXWidget *this)
{
void (*v2)(void); // r3
MusicDownloadManager *v3; // r0
int v4; // r3
const char *v5; // r1
cocos2d::CCString *v6; // r0
char *v7; // r0
const char *v8; // r8
char *v9; // r2
cocos2d::CCString *v10; // r0
char *CString; // r0
int v12; // r5
char *v13; // r1
float v14; // s15
float v15; // s14
double v16; // d6
float v17; // s15
cocos2d::CCString *v18; // r0
char *v19; // r0
int v20; // r3
int v21; // r5
unsigned int v22; // r8
MusicDownloadManager *v23; // r0
unsigned int v24; // r2
int v25; // r0
int v26; // r6
cocos2d::CCSpriteFrameCache *v27; // r0
void (__fastcall *v28)(int, int); // r5
cocos2d::CCSpriteFrameCache *v29; // r0
const char *v30; // r1
void (*v31)(void); // r3
MusicDownloadManager *v32; // r0
MusicDownloadManager *v33; // r0
int v34; // r6
int v35; // r1
int v36; // r0
MusicDownloadManager *v37; // r0
MusicDownloadManager *v38; // r5
MusicDownloadManager *v39; // r0
unsigned int v40; // r2
_BOOL4 isSFXFavorite; // r0
MusicDownloadManager *v42; // r0
unsigned int v43; // r2
_BOOL4 v44; // r6
void (__fastcall *v45)(MusicDownloadManager *, int); // r8
cocos2d::CCSpriteFrameCache *v46; // r0
const char *v47; // r1
int v48; // r0
int v49; // r0
cocos2d::CCSpriteFrameCache *v50; // r5
void (__fastcall *v51)(cocos2d::CCSpriteFrameCache *, int); // r6
cocos2d::CCSpriteFrameCache *v52; // r8
int v53; // r0
const char *v54; // r1
int v55; // r0
int v56; // r5
float v57; // s15
int v58; // r3
cocos2d::CCLabelBMFont *v59; // r5
int v60; // r0
float v61; // r3
float v62; // s14
cocos2d::CCLabelBMFont *v63; // r0
float v64; // r1
float v65; // r1
int v66; // r9
void (__fastcall *v67)(int, _BYTE *); // r10
int v68; // r11
float v69; // s16
float v70; // r0
int v71; // r6
void (__fastcall *v72)(int, int); // r8
int v73; // r0
float *v74; // r0
int v75; // s15
cocos2d::CCLabelBMFont *v76; // r5
float v77; // s16
float v78; // s16
int v79; // r0
float v80; // s15
float v81; // s16
float v82; // s15
int v83; // r6
float v84; // r0
int v85; // r6
const cocos2d::CCPoint *v86; // r11
void (__fastcall *v87)(int, _BYTE *); // r10
cocos2d::CCSpriteFrameCache *v89; // r0
int v90; // r0
_BYTE v91[8]; // [sp+Ch] [bp-38h] BYREF
_BYTE v92[8]; // [sp+14h] [bp-30h] BYREF
_BYTE v93[8]; // [sp+1Ch] [bp-28h] BYREF
int v94[2]; // [sp+24h] [bp-20h] BYREF
char *v95; // [sp+2Ch] [bp-18h]
int v96[3]; // [sp+30h] [bp-14h] BYREF
v2 = *(void (**)(void))(**((_DWORD **)this + 70) + 464);
if ( !*((_DWORD *)this + 68) )
{
v2();
v3 = (MusicDownloadManager *)(*(int (__fastcall **)(_DWORD, void *))(**((_DWORD **)this + 71) + 464))(
*((_DWORD *)this + 71),
&unk_B6B226);
goto LABEL_26;
}
v2();
v94[0] = 0;
v94[1] = 0;
v95 = nullptr;
v4 = *((_DWORD *)this + 68);
if ( *(_BYTE *)(v4 + 68) )
{
v5 = (const char *)cocos2d::CCArray::count(*(cocos2d::CCArray **)(v4 + 112));
v6 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"Files: %i", v5);
}
else
{
if ( !*((_BYTE *)this + 352) )
{
v8 = *(const char **)(v4 + 52);
formatBytes(v96, *(_DWORD *)(v4 + 60));
if ( (v96[0] & 1) != 0 )
v9 = (char *)v96[2];
else
v9 = (char *)v96 + 1;
v10 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"ID: %i Size: %s", v8, v9);
CString = (char *)cocos2d::CCString::getCString(v10);
std::string::assign(v94, CString);
std::string::~string((int)v96);
goto LABEL_12;
}
v6 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", *(const char **)(v4 + 52));
}
v7 = (char *)cocos2d::CCString::getCString(v6);
std::string::assign(v94, v7);
LABEL_12:
v12 = *(_DWORD *)(*((_DWORD *)this + 68) + 64);
if ( v12 > 0 )
{
v14 = (float)v12 / 100.0;
v15 = *((float *)this + 90);
v16 = v14;
if ( v15 <= 0.0 || v15 == 1.0 )
{
if ( (v94[0] & 1) != 0 )
v18 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%s (%.2f s)", v95, v16);
else
v18 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%s (%.2f s)",
(const char *)v94 + 1,
v16);
}
else
{
v17 = v14 / v15;
if ( (v94[0] & 1) != 0 )
v18 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%s (%.2f s) (%.2f s)",
v95,
v16,
v17);
else
v18 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%s (%.2f s) (%.2f s)",
(const char *)v94 + 1,
v16,
v17);
}
v19 = (char *)cocos2d::CCString::getCString(v18);
std::string::assign(v94, v19);
}
if ( (v94[0] & 1) != 0 )
v13 = v95;
else
v13 = (char *)v94 + 1;
(*(void (__fastcall **)(_DWORD, char *))(**((_DWORD **)this + 71) + 464))(*((_DWORD *)this + 71), v13);
v3 = (MusicDownloadManager *)std::string::~string((int)v94);
LABEL_26:
v20 = *((_DWORD *)this + 68);
if ( !v20 || (v21 = *(unsigned __int8 *)(v20 + 68), *(_BYTE *)(v20 + 68)) )
{
(*(void (__fastcall **)(_DWORD, _DWORD))(**((_DWORD **)this + 73) + 172))(*((_DWORD *)this + 73), 0);
(*(void (__fastcall **)(_DWORD, _DWORD))(**((_DWORD **)this + 74) + 172))(*((_DWORD *)this + 74), 0);
(*(void (__fastcall **)(_DWORD, _DWORD))(**((_DWORD **)this + 75) + 172))(*((_DWORD *)this + 75), 0);
(*(void (__fastcall **)(_DWORD, _DWORD))(**((_DWORD **)this + 76) + 172))(*((_DWORD *)this + 76), 0);
v31 = *(void (**)(void))(**((_DWORD **)this + 77) + 172);
LABEL_46:
v31();
CustomSFXWidget::hideLoadingArt(this);
goto LABEL_47;
}
v22 = *(_DWORD *)(v20 + 52);
v23 = (MusicDownloadManager *)MusicDownloadManager::sharedState(v3);
if ( MusicDownloadManager::isSFXDownloaded(v23, v22, v24) )
{
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 73) + 172))(*((_DWORD *)this + 73), v21);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 74) + 172))(*((_DWORD *)this + 74), v21);
(*(void (__fastcall **)(_DWORD, _DWORD))(**((_DWORD **)this + 77) + 172))(
*((_DWORD *)this + 77),
*((unsigned __int8 *)this + 348));
v25 = *((_DWORD *)this + 75);
if ( *((_BYTE *)this + 348) && *((_DWORD *)this + 86) )
{
(*(void (__fastcall **)(int, int))(*(_DWORD *)v25 + 172))(v25, 1);
v26 = (*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 75) + 536))(*((_DWORD *)this + 75));
if ( (*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 86) + 4))(*((_DWORD *)this + 86)) == v22
&& (*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 86) + 8))(*((_DWORD *)this + 86)) == *(_DWORD *)(*((_DWORD *)this + 68) + 72) )
{
v27 = (cocos2d::CCSpriteFrameCache *)(*(int (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 75) + 528))(
*((_DWORD *)this + 75),
v21);
v28 = *(void (__fastcall **)(int, int))(*(_DWORD *)v26 + 580);
v29 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v27);
v30 = "GJ_selectSongOnBtn_001.png";
}
else
{
v89 = (cocos2d::CCSpriteFrameCache *)(*(int (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 75) + 528))(
*((_DWORD *)this + 75),
1);
v28 = *(void (__fastcall **)(int, int))(*(_DWORD *)v26 + 580);
v29 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v89);
v30 = "GJ_selectSongBtn_001.png";
}
v90 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v29, v30);
v28(v26, v90);
}
else
{
(*(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v25 + 172))(v25, 0);
}
v31 = *(void (**)(void))(**((_DWORD **)this + 76) + 172);
goto LABEL_46;
}
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 75) + 172))(*((_DWORD *)this + 75), v21);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 76) + 172))(*((_DWORD *)this + 76), v21);
v32 = (MusicDownloadManager *)(*(int (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 77) + 172))(
*((_DWORD *)this + 77),
v21);
v33 = (MusicDownloadManager *)MusicDownloadManager::sharedState(v32);
if ( MusicDownloadManager::isRunningActionForSongID(v33, *((const char **)this + 89)) )
v34 = 1;
else
v34 = *((unsigned __int8 *)this + 351);
if ( v34 )
v35 = 0;
else
v35 = *((unsigned __int8 *)this + 350);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 73) + 172))(*((_DWORD *)this + 73), v35);
if ( v34 )
v21 = *((unsigned __int8 *)this + 350);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 74) + 172))(*((_DWORD *)this + 74), v21);
LABEL_47:
v36 = *((_DWORD *)this + 78);
if ( v36 && *((_DWORD *)this + 68) )
{
v37 = (MusicDownloadManager *)(*(int (__fastcall **)(int))(*(_DWORD *)v36 + 536))(v36);
v38 = v37;
if ( *(int *)(*((_DWORD *)this + 68) + 72) <= 0 )
{
v42 = (MusicDownloadManager *)MusicDownloadManager::sharedState(v37);
isSFXFavorite = MusicDownloadManager::isSFXFavorite(v42, *(_DWORD *)(*((_DWORD *)this + 68) + 52), v43);
}
else
{
v39 = (MusicDownloadManager *)MusicDownloadManager::sharedState(v37);
isSFXFavorite = MusicDownloadManager::isCustomSFXFavorite(v39, *(_DWORD *)(*((_DWORD *)this + 68) + 72), v40);
}
v44 = isSFXFavorite;
v45 = *(void (__fastcall **)(MusicDownloadManager *, int))(*(_DWORD *)v38 + 580);
v46 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache((cocos2d::CCSpriteFrameCache *)isSFXFavorite);
if ( v44 )
v47 = "gj_heartOn_001.png";
else
v47 = "gj_heartOff_001.png";
v48 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v46, v47);
v45(v38, v48);
}
v49 = *((_DWORD *)this + 81);
if ( v49 && *((_DWORD *)this + 68) )
{
v50 = (cocos2d::CCSpriteFrameCache *)(*(int (__fastcall **)(int))(*(_DWORD *)v49 + 536))(v49);
v51 = *(void (__fastcall **)(cocos2d::CCSpriteFrameCache *, int))(*(_DWORD *)v50 + 580);
v52 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v50);
v53 = *((_DWORD *)this + 86);
if ( v53 )
{
if ( (*(int (__fastcall **)(int, _DWORD))(*(_DWORD *)v53 + 28))(v53, *(_DWORD *)(*((_DWORD *)this + 68) + 72)) )
v54 = "GJ_checkOn_001.png";
else
v54 = "GJ_checkOff_001.png";
}
else
{
v54 = "GJ_checkOff_001.png";
}
v55 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v52, v54);
v51(v50, v55);
}
if ( *((_BYTE *)this + 353) )
{
v56 = 2;
}
else if ( *((_DWORD *)this + 80) )
{
v56 = 2;
}
else
{
v56 = 1;
}
if ( *((_DWORD *)this + 79) )
{
v56 = 3;
}
else if ( *((_DWORD *)this + 80) && *((_BYTE *)this + 353) )
{
v56 = 3;
}
if ( *((_DWORD *)this + 81) )
{
if ( *((_BYTE *)this + 353) )
v56 = 4;
else
v56 = 3;
}
if ( *((_BYTE *)this + 352) )
{
if ( v56 == 4 )
{
v65 = 130.0;
}
else if ( v56 == 3 )
{
v65 = 150.0;
}
else
{
v65 = 200.0;
}
cocos2d::CCLabelBMFont::limitLabelWidth(*((cocos2d::CCLabelBMFont **)this + 70), v65, 0.4, 0.0);
v66 = *((_DWORD *)this + 71);
v67 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v66 + 92);
v68 = (*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 70) + 96))(*((_DWORD *)this + 70));
v69 = *(float *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 70) + 164))(*((_DWORD *)this + 70));
v70 = (*(float (__fastcall **)(_DWORD))(**((_DWORD **)this + 70) + 84))(*((_DWORD *)this + 70));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v92, (float)(v69 * v70) + 5.0, 0.0);
cocos2d::CCPoint::operator+(v93, v68, v92);
v67(v66, v93);
v71 = *((_DWORD *)this + 72);
v72 = *(void (__fastcall **)(int, int))(*(_DWORD *)v71 + 92);
v73 = (*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 71) + 96))(*((_DWORD *)this + 71));
v72(v71, v73);
v74 = (float *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 73) + 96))(*((_DWORD *)this + 73));
v75 = v56;
v76 = *((cocos2d::CCLabelBMFont **)this + 71);
v77 = *v74 - (float)((float)v75 * 20.0);
v78 = (float)(v77 - 10.0) - (*(float (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_DWORD *)v76 + 112))(v76);
*(float *)&v79 = COERCE_FLOAT(CustomSFXWidget::infoBtnWidth(this));
v61 = 0.4;
v80 = *(float *)&v79;
v63 = v76;
v64 = v78 - v80;
}
else
{
if ( v56 == 4 )
{
v57 = 155.0;
}
else if ( v56 == 3 )
{
v57 = 185.0;
}
else
{
v57 = 210.0;
if ( v56 != 2 )
v57 = 240.0;
}
v58 = *((_DWORD *)this + 68);
if ( v58 && *(_BYTE *)(v58 + 68) )
v57 = v57 - 50.0;
cocos2d::CCLabelBMFont::limitLabelWidth(*((cocos2d::CCLabelBMFont **)this + 70), v57, 0.5, 0.0);
v59 = *((cocos2d::CCLabelBMFont **)this + 71);
*(float *)&v60 = COERCE_FLOAT(CustomSFXWidget::infoBtnWidth(this));
v61 = 0.45;
v62 = *(float *)&v60;
v63 = v59;
v64 = 255.0 - v62;
}
cocos2d::CCLabelBMFont::limitLabelWidth(v63, v64, 0.6, v61);
if ( *((_DWORD *)this + 82) )
{
v81 = *(float *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 71) + 164))(*((_DWORD *)this + 71));
v82 = COERCE_FLOAT((*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 71) + 84))(*((_DWORD *)this + 71)));
v83 = (*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 71) + 96))(*((_DWORD *)this + 71));
v84 = COERCE_FLOAT(CustomSFXWidget::infoBtnWidth(this));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v93, (float)((float)(v81 * v82) + (float)(v84 * 0.5)) + 2.0, 0.0);
cocos2d::CCPoint::operator+(v91, v83, v93);
v85 = *((_DWORD *)this + 82);
v86 = *((const cocos2d::CCPoint **)this + 69);
v87 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v85 + 92);
cocos2d::CCNode::convertToWorldSpace((cocos2d::CCNode *)v92, this);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v93, v86);
v87(v85, v93);
}
return (*(int (__fastcall **)(_DWORD, _DWORD))(**((_DWORD **)this + 77) + 172))(*((_DWORD *)this + 77), 0);
}