//
// SetupSFXPopup::init from 0x1405dc700 to 0x1405dd963 (4707 bytes)
//
// 2 xrefs:
// > SetupSFXPopup::create @ 0x1405dc6b7
// > ??> @ 0x14092ecac
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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:34:59 +0000
//
// Hidden C++ exception states: #wind=3
char __fastcall SetupSFXPopup::init(__int64 a1, int a2, int a3, int a4)
{
char result; // al
unsigned __int8 v7; // r14
_QWORD *v8; // r9
_QWORD *v9; // rcx
const char *v10; // rdx
__int64 v11; // r8
__int64 v12; // rcx
__int64 v13; // rax
__int64 v14; // rax
__int64 v15; // rax
__int64 v16; // rax
__int64 v17; // rax
__int64 v18; // rax
__int64 v19; // rdx
__int64 v20; // rax
__int64 v21; // rax
__int64 v22; // rax
int v23; // r9d
__int64 v24; // rdx
__int64 v25; // rax
int *v26; // rdx
__int64 v27; // rax
int v28; // eax
__int64 v29; // rax
__int64 v30; // rax
__int64 v31; // rax
__int64 v32; // rax
__int64 v33; // rax
__int64 v34; // rax
int v35; // r9d
__int64 v36; // rax
int v37; // r9d
__int64 v38; // rax
__int64 v39; // rax
__int64 v40; // rax
__int64 v41; // rax
struct cocos2d::CCSprite *v42; // rax
int v43; // ebx
cocos2d::CCObject *v44; // rdi
__int64 v45; // rax
__int64 v46; // rbx
__int64 v47; // rax
float v48; // xmm0_4
int v49[2]; // [rsp+88h] [rbp-80h] BYREF
__int128 v50; // [rsp+90h] [rbp-78h] BYREF
__int64 v51; // [rsp+A0h] [rbp-68h]
__int64 v52; // [rsp+A8h] [rbp-60h]
int v53; // [rsp+B0h] [rbp-58h] BYREF
__int128 *v54; // [rsp+B8h] [rbp-50h] BYREF
__int128 v55; // [rsp+C0h] [rbp-48h] BYREF
__int64 v56; // [rsp+D0h] [rbp-38h]
__int64 v57; // [rsp+D8h] [rbp-30h]
_BYTE v58[8]; // [rsp+E0h] [rbp-28h] BYREF
__int128 *v59; // [rsp+E8h] [rbp-20h] BYREF
_BYTE v60[8]; // [rsp+F0h] [rbp-18h] BYREF
float v61; // [rsp+F8h] [rbp-10h] BYREF
float v62; // [rsp+FCh] [rbp-Ch]
_BYTE v63[152]; // [rsp+100h] [rbp-8h] BYREF
result = SetupTriggerPopup::init(a1, a2, a3, a4, 1133248512, 1, 0);
if ( result )
{
*(_DWORD *)(a1 + 1044) = a4;
v7 = a4 & 1;
*(_BYTE *)(a1 + 744) = 1;
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 1096LL))(a1);
v51 = 11;
v52 = 15;
*(_QWORD *)&v50 = 0x6769725420584653LL;
*((_QWORD *)&v50 + 1) = 7497063;
SetupTriggerPopup::addTitle(a1, &v50);
v50 = 0;
v51 = 2;
v52 = 15;
strcpy((char *)&v50, "OK");
SetupTriggerPopup::addCloseButton(a1, &v50);
*(_QWORD *)v49 = &v50;
v50 = 0;
v51 = 0;
v52 = 0;
v8 = sub_14003D460(0x1A0u);
*(_QWORD *)&v50 = v8;
v51 = 409;
v52 = 415;
v9 = v8;
v10 = "Lets you start a specified sound effect (browser top right).\n"
"Unique ID is used to refer to a specific sound effect in the level while SFXGroup refers to mu"
"ltiple.\n"
"Start, End, FadeIn, and FadeOut are in milliseconds.\n"
"Ignore Volume Test does not ignore sound effects regardless of whether any volume setting is 0.\n"
"Page 4 lets you change the volume depending on proximity.";
v11 = 3;
do
{
*(_OWORD *)v9 = *(_OWORD *)v10;
*((_OWORD *)v9 + 1) = *((_OWORD *)v10 + 1);
*((_OWORD *)v9 + 2) = *((_OWORD *)v10 + 2);
*((_OWORD *)v9 + 3) = *((_OWORD *)v10 + 3);
*((_OWORD *)v9 + 4) = *((_OWORD *)v10 + 4);
*((_OWORD *)v9 + 5) = *((_OWORD *)v10 + 5);
*((_OWORD *)v9 + 6) = *((_OWORD *)v10 + 6);
v9 += 16;
*((_OWORD *)v9 - 1) = *((_OWORD *)v10 + 7);
v10 += 128;
--v11;
}
while ( v11 );
*(_OWORD *)v9 = *(_OWORD *)v10;
v9[2] = *((_QWORD *)v10 + 2);
*((_BYTE *)v9 + 24) = v10[24];
*((_BYTE *)v8 + 409) = 0;
v55 = 0;
v56 = 4;
v57 = 15;
strcpy((char *)&v55, "Help");
SetupTriggerPopup::addHelpButton(a1, &v55, &v50);
if ( !v7 )
SetupTriggerPopup::createMultiTriggerItemsDefault(a1);
*(_BYTE *)(a1 + 888) = v7 ^ 1;
v13 = cocos2d::CCDirector::sharedDirector(v12);
cocos2d::CCDirector::getWinSize(v13, &v61);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v60, v61 * 0.5, v62 * 0.5);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v58, v61 * 0.5, (float)(v62 * 0.5) + 10.0);
*(_QWORD *)v49 = &v50;
v50 = 0;
v51 = 6;
v52 = 15;
strcpy((char *)&v50, "Speed:");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v54, -91.0, -0.0);
cocos2d::CCPoint::operator+(v58, &v53, v14);
SetupTriggerPopup::createValueControlAdvanced(
a1,
404,
(unsigned int)&v50,
(unsigned int)&v53,
1059481190,
0,
2,
6,
0,
-1052770304,
1094713344,
0,
0,
1,
2,
0);
v54 = &v50;
v50 = 0;
v51 = 6;
v52 = 15;
strcpy((char *)&v50, "Pitch:");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v49, 91.0, -0.0);
cocos2d::CCPoint::operator+(v58, &v53, v15);
SetupTriggerPopup::createValueControlAdvanced(
a1,
405,
(unsigned int)&v50,
(unsigned int)&v53,
1059481190,
0,
2,
6,
0,
-1052770304,
1094713344,
0,
0,
1,
2,
0);
v54 = &v50;
v51 = 7;
v52 = 15;
v50 = 0x3A656D756C6F56uLL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v49, -91.0, -39.0);
cocos2d::CCPoint::operator+(v58, &v53, v16);
SetupTriggerPopup::createValueControlAdvanced(
a1,
406,
(unsigned int)&v50,
(unsigned int)&v53,
1059481190,
0,
1,
6,
0,
0,
0x40000000,
0,
0,
1,
2,
0);
v53 = 404;
*(_BYTE *)sub_14016EE40((__int64 *)(a1 + 856), &v53) = 1;
v53 = 405;
*(_BYTE *)sub_14016EE40((__int64 *)(a1 + 856), &v53) = 1;
v53 = 406;
*(_BYTE *)sub_14016EE40((__int64 *)(a1 + 856), &v53) = 1;
v54 = &v50;
v50 = 0;
v51 = 6;
v52 = 15;
strcpy((char *)&v50, "Reverb");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v49, 21.0, -39.0);
cocos2d::CCPoint::operator+(v58, &v53, v17);
SetupTriggerPopup::createToggleValueControl(a1, 407, (unsigned int)&v50, (unsigned int)&v53, 0, 0, 0, 1065353216);
v54 = &v50;
v50 = 0;
v51 = 3;
v52 = 15;
LODWORD(v50) = 5523014;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v49, 127.0, -39.0);
cocos2d::CCPoint::operator+(v58, &v53, v18);
SetupTriggerPopup::createToggleValueControl(a1, 412, (unsigned int)&v50, (unsigned int)&v53, 0, 0, 0, 1065353216);
if ( v7 )
{
SetupAudioTriggerPopup::addTimeControls(a1, v19, 10.0);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v59, -91.0, -78.0);
cocos2d::CCPoint::operator+(v58, v49, v27);
v26 = v49;
}
else
{
v54 = &v55;
v55 = 0;
v56 = 4;
v57 = 15;
strcpy((char *)&v55, "Loop");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v49, 21.0, -78.0);
cocos2d::CCPoint::operator+(v58, &v53, v20);
SetupTriggerPopup::createToggleValueControl(a1, 413, (unsigned int)&v55, (unsigned int)&v53, 0, 0, 0, 1065353216);
v54 = &v55;
v56 = 8;
v57 = 15;
v55 = 0x64616F6C0A657250uLL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v49, 127.0, -78.0);
cocos2d::CCPoint::operator+(v58, &v53, v21);
SetupTriggerPopup::createToggleValueControl(a1, 433, (unsigned int)&v55, (unsigned int)&v53, 0, 0, 0, 1065353216);
v54 = &v50;
v50 = 0;
v51 = 0;
v52 = 0;
*(_QWORD *)&v50 = sub_14003D460(0x20u);
v51 = 19;
v52 = 31;
strcpy((char *)v50, "GJ_plus3Btn_001.png");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v49, 94.0, -39.0);
cocos2d::CCPoint::operator+(v58, &v53, v22);
SetupTriggerPopup::createPlusButton(a1, 2, (int)&v53, v23, &v50, 0, 0);
SetupAudioTriggerPopup::addTimeControls(a1, v24, 10.0);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v54, -50.0, -40.0);
cocos2d::CCPoint::operator+(v60, &v53, v25);
v26 = &v53;
}
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v63, (const struct cocos2d::CCPoint *)v26);
v59 = &v50;
v51 = 12;
v52 = 15;
strcpy((char *)&v50, "MinInterval:");
BYTE13(v50) = 0;
HIWORD(v50) = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v54, (const struct cocos2d::CCPoint *)v63);
SetupTriggerPopup::createValueControlAdvanced(
a1,
434,
(unsigned int)&v50,
v28,
1059481190,
0,
1,
6,
0,
0,
1065353216,
2 * (v7 ^ 1),
0,
v7,
2,
0);
if ( !v7 )
{
v59 = &v50;
*((_QWORD *)&v50 + 1) = 14916;
v51 = 10;
v52 = 15;
*(_QWORD *)&v50 = 0x4920657571696E55LL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v54, -50.0, 60.0);
cocos2d::CCPoint::operator+(v60, v49, v29);
SetupTriggerPopup::createValueControlAdvanced(
a1,
416,
(unsigned int)&v50,
(unsigned int)v49,
1059481190,
1,
3,
10,
1,
0,
1120403456,
2,
0,
0,
2,
0);
v59 = &v55;
v56 = 8;
v57 = 15;
v55 = 0x657571696E557349uLL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v54, 50.0, 60.0);
cocos2d::CCPoint::operator+(v60, v49, v30);
SetupTriggerPopup::createToggleValueControl(a1, 415, (unsigned int)&v55, (unsigned int)v49, 0, 2, 0, 1065353216);
v59 = &v50;
*((_QWORD *)&v50 + 1) = 58;
v51 = 9;
v52 = 15;
*(_QWORD *)&v50 = 0x70756F7247584653LL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v54, -50.0, 0.0);
cocos2d::CCPoint::operator+(v60, v49, v31);
SetupTriggerPopup::createValueControlAdvanced(
a1,
455,
(unsigned int)&v50,
(unsigned int)v49,
1059481190,
1,
2,
6,
1,
0,
1148846080,
2,
0,
0,
2,
0);
v59 = &v55;
v56 = 8;
v57 = 15;
v55 = 0x656469727265764FuLL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v54, 50.0, 10.0);
cocos2d::CCPoint::operator+(v60, v49, v32);
SetupTriggerPopup::createToggleValueControl(a1, 420, (unsigned int)&v55, (unsigned int)v49, 0, 2, 0, 1065353216);
v59 = &v50;
v50 = 0;
v51 = 0;
v52 = 0;
*(_QWORD *)&v50 = sub_14003D460(0x20u);
v51 = 18;
v52 = 31;
strcpy((char *)v50, "Ignore\nVolume\nTest");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v54, 50.0, -40.0);
cocos2d::CCPoint::operator+(v60, v49, v33);
SetupTriggerPopup::createToggleValueControl(a1, 489, (unsigned int)&v50, (unsigned int)v49, 0, 2, 0, 1065353216);
v59 = &v55;
v55 = 0;
v56 = 0;
v57 = 15;
LOBYTE(v55) = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v54, 10.0, 83.0);
cocos2d::CCPoint::operator+(v60, v49, v34);
SetupTriggerPopup::createPlusButton(a1, 0, (int)v49, v35, &v55, 2, 0);
v59 = &v55;
v55 = 0;
v56 = 0;
v57 = 15;
LOBYTE(v55) = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v54, 10.0, 23.0);
cocos2d::CCPoint::operator+(v60, v49, v36);
SetupTriggerPopup::createPlusButton(a1, 1, (int)v49, v37, &v55, 2, 0);
SetupAudioTriggerPopup::addProxVolControls(a1, 3u);
v59 = &v55;
v56 = 8;
v57 = 15;
v55 = 0x2D2B206465657053uLL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v54, -91.0, -0.0);
cocos2d::CCPoint::operator+(v58, v49, v38);
SetupTriggerPopup::createValueControlAdvanced(
a1,
596,
(unsigned int)&v55,
(unsigned int)v49,
1059481190,
0,
2,
6,
0,
0,
1094713344,
4,
0,
1,
2,
0);
v59 = &v55;
v56 = 8;
v57 = 15;
v55 = 0x2D2B206863746950uLL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v54, 91.0, -0.0);
cocos2d::CCPoint::operator+(v58, v49, v39);
SetupTriggerPopup::createValueControlAdvanced(
a1,
597,
(unsigned int)&v55,
(unsigned int)v49,
1059481190,
0,
2,
6,
0,
0,
1094713344,
4,
0,
1,
2,
0);
v59 = &v50;
*((_QWORD *)&v50 + 1) = 45;
v51 = 9;
v52 = 15;
*(_QWORD *)&v50 = 0x2B20656D756C6F56LL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v54, -91.0, -39.0);
cocos2d::CCPoint::operator+(v58, v49, v40);
SetupTriggerPopup::createValueControlAdvanced(
a1,
598,
(unsigned int)&v50,
(unsigned int)v49,
1059481190,
0,
1,
6,
0,
0,
1065353216,
4,
0,
1,
2,
0);
v53 = 596;
*(_BYTE *)sub_14016EE40((__int64 *)(a1 + 856), &v53) = 1;
v53 = 597;
*(_BYTE *)sub_14016EE40((__int64 *)(a1 + 856), &v53) = 1;
v53 = 598;
*(_BYTE *)sub_14016EE40((__int64 *)(a1 + 856), &v53) = 1;
v59 = &v50;
HIDWORD(v50) = 0;
v51 = 11;
v52 = 15;
strcpy((char *)&v50, "Pitch\nSteps");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v54, 21.0, -39.0);
cocos2d::CCPoint::operator+(v58, v49, v41);
SetupTriggerPopup::createToggleValueControl(a1, 599, (unsigned int)&v50, (unsigned int)v49, 0, 4, 0, 1065353216);
}
v42 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_menuBtn_001.png");
v43 = (int)v42;
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v42 + 160LL))(v42);
v44 = CCMenuItemSpriteExtra::create(v43, 0, a1, (__int64)SetupSFXPopup::onBrowseSFX);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v44);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v59,
(float)(*(float *)(a1 + 732) * 0.5) - 22.0,
(float)(*(float *)(a1 + 736) * 0.5) - 22.0);
cocos2d::CCPoint::operator+(v60, v49, v45);
v46 = *(_QWORD *)v44;
cocos2d::CCNode::convertToNodeSpace(*(_QWORD *)(a1 + 552), &v54, v49);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v46 + 184))(v44, v47);
*(_DWORD *)(a1 + 1024) = (int)(*(float (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1168LL))(a1, 392);
SetupSFXPopup::createSFXWidget(a1);
SetupTriggerPopup::createPageButtons(a1);
v48 = (*(float (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1168LL))(a1, 427);
SetupTriggerPopup::goToPage(a1, (unsigned int)(int)v48, 0);
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 1136LL))(a1);
*(_BYTE *)(a1 + 744) = 0;
return 1;
}
return result;
}