//
// SetupShaderEffectPopup::setupSplitScreen from 0xa07dbc to 0xa08424 (1640 bytes)
//
// 2 xrefs:
// > SetupShaderEffectPopup::init @ 0xa08558
// > ??> @ 0x9cc48
//
// 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 SetupShaderEffectPopup::setupSplitScreen(SetupShaderEffectPopup *a1)
{
void *v2; // x0
void *v3; // x0
void *v4; // x0
cocos2d::CCDirector *v5; // x0
void *v6; // x0
void *v7; // x0
void *v8; // x0
void *v9; // x0
void *v10; // x0
float v11; // s2
unsigned int *v12; // x1
int v13; // w2
unsigned int *v14; // x1
int v15; // w2
unsigned int *v16; // x1
int v17; // w2
unsigned int *v18; // x1
int v19; // w2
unsigned int *v20; // x1
int v21; // w2
unsigned int *v22; // x1
int v23; // w2
unsigned int *v24; // x1
int v25; // w2
unsigned int *v26; // x21
int v27; // w1
float v28; // [xsp+70h] [xbp+70h]
float v29; // [xsp+74h] [xbp+74h]
cocos2d::CCPoint v30; // [xsp+78h] [xbp+78h] BYREF
cocos2d::CCPoint v31; // [xsp+80h] [xbp+80h] BYREF
cocos2d::CCPoint v32; // [xsp+88h] [xbp+88h] BYREF
__int64 v33; // [xsp+90h] [xbp+90h] BYREF
cocos2d::CCPoint v34; // 0:s0.4,4:s1.4
sub_D153B8((int)&v33, "Setup Split Screen");
SetupTriggerPopup::addTitle((__int64)a1);
v2 = (void *)(v33 - 24);
if ( (__int64 *)(v33 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v12 = (unsigned int *)(v33 - 8);
do
v13 = __ldaxr(v12);
while ( __stlxr(v13 - 1, v12) );
}
else
{
v13 = *(_DWORD *)(v33 - 8);
*(_DWORD *)(v33 - 8) = v13 - 1;
}
if ( v13 <= 0 )
operator delete(v2);
}
sub_D153B8((int)&v32, "Help");
sub_D153B8(
(int)&v33,
"Splits the screen in several sections.\n"
"Use X and Y set which direction to split in.\n"
"TargetX and TargetY set how many sections to add.\n"
"FadeTime is time until final state is reached.");
SetupTriggerPopup::addHelpButton((__int64)a1, 1.0);
v3 = (void *)(v33 - 24);
if ( (__int64 *)(v33 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v14 = (unsigned int *)(v33 - 8);
do
v15 = __ldaxr(v14);
while ( __stlxr(v15 - 1, v14) );
}
else
{
v15 = *(_DWORD *)(v33 - 8);
*(_DWORD *)(v33 - 8) = v15 - 1;
}
if ( v15 <= 0 )
operator delete(v3);
}
v4 = (void *)(*(_QWORD *)&v32 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v32 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v16 = (unsigned int *)(*(_QWORD *)&v32 - 8LL);
do
v17 = __ldaxr(v16);
while ( __stlxr(v17 - 1, v16) );
}
else
{
v17 = *(_DWORD *)(*(_QWORD *)&v32 - 8LL);
*(_DWORD *)(*(_QWORD *)&v32 - 8LL) = v17 - 1;
}
if ( v17 <= 0 )
operator delete(v4);
}
v5 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v5);
cocos2d::CCPoint::CCPoint(&v30, v28 * 0.5, (float)(v29 * 0.5) + 85.0);
sub_D153B8((int)&v33, "TargetX:");
cocos2d::CCPoint::CCPoint(&v31, -100.0, 0.0);
cocos2d::CCPoint::operator+(&v32, &v30, &v31);
SetupTriggerPopup::createValueControl(a1, 0xB4u, 0.7, -4.0, 3.0, (__int64)&v33, &v32);
v6 = (void *)(v33 - 24);
if ( (__int64 *)(v33 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v18 = (unsigned int *)(v33 - 8);
do
v19 = __ldaxr(v18);
while ( __stlxr(v19 - 1, v18) );
}
else
{
v19 = *(_DWORD *)(v33 - 8);
*(_DWORD *)(v33 - 8) = v19 - 1;
}
if ( v19 <= 0 )
operator delete(v6);
}
sub_D153B8((int)&v33, "TargetY:");
cocos2d::CCPoint::CCPoint(&v31, 100.0, 0.0);
cocos2d::CCPoint::operator+(&v32, &v30, &v31);
SetupTriggerPopup::createValueControl(a1, 0xBDu, 0.7, -4.0, 3.0, (__int64)&v33, &v32);
v7 = (void *)(v33 - 24);
if ( (__int64 *)(v33 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v20 = (unsigned int *)(v33 - 8);
do
v21 = __ldaxr(v20);
while ( __stlxr(v21 - 1, v20) );
}
else
{
v21 = *(_DWORD *)(v33 - 8);
*(_DWORD *)(v33 - 8) = v21 - 1;
}
if ( v21 <= 0 )
operator delete(v7);
}
sub_D153B8((int)&v33, "FadeTime:");
cocos2d::CCPoint::CCPoint(&v31, -100.0, -50.0);
cocos2d::CCPoint::operator+(&v32, &v30, &v31);
SetupTriggerPopup::createValueControl(a1, 0xAu, 0.7, 0.0, 0.0, (__int64)&v33, &v32);
v8 = (void *)(v33 - 24);
if ( (__int64 *)(v33 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v22 = (unsigned int *)(v33 - 8);
do
v23 = __ldaxr(v22);
while ( __stlxr(v23 - 1, v22) );
}
else
{
v23 = *(_DWORD *)(v33 - 8);
*(_DWORD *)(v33 - 8) = v23 - 1;
}
if ( v23 <= 0 )
operator delete(v8);
}
sub_D153B8((int)&v33, "Use X");
cocos2d::CCPoint::CCPoint(&v31, 45.0, -55.0);
cocos2d::CCPoint::operator+(&v32, &v30, &v31);
SetupTriggerPopup::createToggleValueControl(a1, 188, 1.0, (__int64)&v33, &v32, 0, 0, 0);
v9 = (void *)(v33 - 24);
if ( (__int64 *)(v33 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v24 = (unsigned int *)(v33 - 8);
do
v25 = __ldaxr(v24);
while ( __stlxr(v25 - 1, v24) );
}
else
{
v25 = *(_DWORD *)(v33 - 8);
*(_DWORD *)(v33 - 8) = v25 - 1;
}
if ( v25 <= 0 )
operator delete(v9);
}
sub_D153B8((int)&v33, "Use Y");
cocos2d::CCPoint::CCPoint(&v31, 130.0, -55.0);
cocos2d::CCPoint::operator+(&v32, &v30, &v31);
SetupTriggerPopup::createToggleValueControl(a1, 190, 1.0, (__int64)&v33, &v32, 0, 0, 0);
v10 = (void *)(v33 - 24);
if ( (__int64 *)(v33 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v26 = (unsigned int *)(v33 - 8);
do
v27 = __ldaxr(v26);
while ( __stlxr(v27 - 1, v26) );
}
else
{
v27 = *(_DWORD *)(v33 - 8);
*(_DWORD *)(v33 - 8) = v27 - 1;
}
if ( v27 <= 0 )
operator delete(v10);
}
cocos2d::CCPoint::CCPoint(&v32, 0.0, -100.0);
cocos2d::CCPoint::operator+(&v33, &v30, &v32);
v34.x = 1.0;
SetupTriggerPopup::createEasingControls(a1, v34, v11, (int)&v33, 0);
}