//
// StartPosLayer::init from 0x6acd28 to 0x6ad57c (2132 bytes)
//
// 1 xrefs:
// > StartPosLayer::create @ 0x6ad65c
//
// 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:37 +0000
//
GameManager *__fastcall StartPosLayer::init(StartPosLayer *this, StartPosObject *a2)
{
cocos2d::CCDirector *v3; // r0
cocos2d::CCMenu *WinSize; // r0
int v5; // r0
int v6; // r7
const cocos2d::CCPoint *v7; // r11
void (__fastcall *v8)(int, _DWORD *); // r9
ButtonSprite *v9; // r0
int v10; // r11
const cocos2d::CCPoint *v11; // r9
void (__fastcall *v12)(int, _BYTE *); // r8
float v13; // s17
float v14; // s17
float v15; // s20
float v16; // s18
float v17; // s19
int v19; // [sp+10h] [bp-D4h]
GameManager *v20; // [sp+20h] [bp-C4h]
float v21; // [sp+34h] [bp-B0h] BYREF
float v22; // [sp+38h] [bp-ACh]
_BYTE v23[8]; // [sp+3Ch] [bp-A8h] BYREF
_BYTE v24[8]; // [sp+44h] [bp-A0h] BYREF
_BYTE v25[8]; // [sp+4Ch] [bp-98h] BYREF
_DWORD v26[2]; // [sp+54h] [bp-90h] BYREF
int v27[3]; // [sp+5Ch] [bp-88h] BYREF
int v28; // [sp+68h] [bp-7Ch] BYREF
int v29; // [sp+6Ch] [bp-78h]
int v30; // [sp+70h] [bp-74h]
int v31; // [sp+74h] [bp-70h] BYREF
int v32; // [sp+78h] [bp-6Ch] BYREF
int v33; // [sp+7Ch] [bp-68h]
int v34; // [sp+80h] [bp-64h]
_BYTE v35[8]; // [sp+84h] [bp-60h] BYREF
float v36; // [sp+8Ch] [bp-58h]
char v37; // [sp+90h] [bp-54h]
int v38; // [sp+94h] [bp-50h]
int v39; // [sp+98h] [bp-4Ch]
char v40; // [sp+9Ch] [bp-48h]
float v41; // [sp+A0h] [bp-44h]
float v42; // [sp+A4h] [bp-40h]
int v43; // [sp+A8h] [bp-3Ch]
int v44; // [sp+ACh] [bp-38h]
int v45; // [sp+B0h] [bp-34h]
int v46; // [sp+B4h] [bp-30h]
char v47; // [sp+B8h] [bp-2Ch]
char v48; // [sp+B9h] [bp-2Bh]
int v49; // [sp+BCh] [bp-28h]
int v50[3]; // [sp+C0h] [bp-24h] BYREF
float v51; // [sp+CCh] [bp-18h]
int v52[3]; // [sp+D0h] [bp-14h] BYREF
if ( !a2 )
return nullptr;
*((_DWORD *)this + 178) = a2;
cocos2d::CCObject::retain(a2);
v20 = SetupTriggerPopup::init(this, nullptr, nullptr, 400.0, 280.0, (_BYTE *)&dword_0 + 1, 0.0);
if ( !v20 )
return nullptr;
v3 = (cocos2d::CCDirector *)SetupTriggerPopup::preSetup(this);
*((_BYTE *)this + 468) = 1;
cocos2d::CCDirector::sharedDirector(v3);
WinSize = (cocos2d::CCMenu *)cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v21);
v5 = cocos2d::CCMenu::create(WinSize);
*((_DWORD *)this + 111) = v5;
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v5, 10);
v28 = 0;
v29 = 0;
v30 = 0;
std::string::__init(&v28, "Start Pos", 9u);
v31 = 0;
v32 = 0;
v33 = 0;
std::string::__init(
&v31,
"Y Velocity: Adds speed up or down.\n"
"Spawn Group ID: Spawns a specific Group ID.\n"
"P2 Group ID: If not '0', spawns player 2 at this Group ID.\n"
"SP Name: Gives the start position a name in menus.\n"
"Free: Removes borders for certain game modes.\n"
"Reset: Resets the camera.\n"
"Inactive: Disables the start position for immediate spawning. Can still switch to it using start position sw"
"itcher.\n"
"Online: Shows the start position in the Practice mode switcher when the level is played online.",
0x218u);
v6 = InfoAlertButton::create((char *)&v28, (int)&v31, 1063675494);
std::string::~string((int)&v31);
std::string::~string((int)&v28);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v6);
v7 = *((const cocos2d::CCPoint **)this + 111);
v8 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v6 + 92);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v25,
(float)((float)(*((float *)this + 139) * 0.5) + (float)(v21 * 0.5)) - 2.0,
(float)((float)(*((float *)this + 140) * 0.5) + (float)(v22 * 0.5)) - 2.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v26, v7);
v8(v6, v26);
v9 = ButtonSprite::create(
(ButtonSprite *)"OK",
(const char *)&word_28,
0,
0.8,
1,
"goldFont.fnt",
"GJ_button_01.png",
(const char *)0x41F00000,
*(float *)&v19);
v26[0] = 684;
v26[1] = 1;
v10 = CCMenuItemSpriteExtra::create((int)v9, 0, (int)this, 684, 1);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v10);
v11 = *((const cocos2d::CCPoint **)this + 111);
v12 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v10 + 92);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v24,
v21 * 0.5,
(float)((float)(v22 * 0.5) - (float)(*((float *)this + 140) * 0.5)) + 25.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v25, v11);
v12(v10, v25);
StartPosLayer::addModeButtons(this);
StartPosLayer::addSpeedButtons(this);
v13 = *((float *)this + 139);
v31 = 0;
v32 = 0;
v33 = 0;
v14 = v13 * 0.5;
v15 = (float)((float)(v21 * 0.5) - v14) + 35.0;
v16 = (float)((float)(v21 * 0.5) + v14) - 35.0;
v17 = (float)((float)(*((float *)this + 140) * 0.5) + (float)(v22 * 0.5)) - 40.0;
std::string::__init(&v31, "Flip", 4u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v25, v15, v17);
SetupTriggerPopup::createToggleValueControl((int)this, -1, (int)&v31, (const cocos2d::CCPoint *)v25, 1, 0, 0, 1.0);
std::string::~string((int)&v31);
v31 = 0;
v32 = 0;
v33 = 0;
std::string::__init(&v31, "Mini", 4u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v25, v15, v17 - 50.0);
SetupTriggerPopup::createToggleValueControl((int)this, -2, (int)&v31, (const cocos2d::CCPoint *)v25, 1, 0, 0, 1.0);
std::string::~string((int)&v31);
v31 = 0;
v32 = 0;
v33 = 0;
std::string::__init(&v31, "Dual", 4u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v25, v15, v17 - 100.0);
SetupTriggerPopup::createToggleValueControl((int)this, -3, (int)&v31, (const cocos2d::CCPoint *)v25, 1, 0, 0, 1.0);
std::string::~string((int)&v31);
v31 = 0;
v32 = 0;
v33 = 0;
std::string::__init(&v31, "Mirror", 6u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v25, v15, v17 - 150.0);
SetupTriggerPopup::createToggleValueControl((int)this, -4, (int)&v31, (const cocos2d::CCPoint *)v25, 1, 0, 0, 1.0);
std::string::~string((int)&v31);
v31 = 0;
v32 = 0;
v33 = 0;
std::string::__init(&v31, "Free", 4u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v25, v15, v17 - 200.0);
SetupTriggerPopup::createToggleValueControl((int)this, -5, (int)&v31, (const cocos2d::CCPoint *)v25, 1, 0, 0, 1.0);
std::string::~string((int)&v31);
v31 = 0;
v32 = 0;
v33 = 0;
std::string::__init(&v31, "Rotate", 6u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v25, v16, v17);
SetupTriggerPopup::createToggleValueControl((int)this, -6, (int)&v31, (const cocos2d::CCPoint *)v25, 1, 0, 0, 1.0);
std::string::~string((int)&v31);
v31 = 0;
v32 = 0;
v33 = 0;
std::string::__init(&v31, "Reverse", 7u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v25, v16, v17 - 50.0);
SetupTriggerPopup::createToggleValueControl((int)this, -7, (int)&v31, (const cocos2d::CCPoint *)v25, 1, 0, 0, 1.0);
std::string::~string((int)&v31);
v31 = 0;
v32 = 0;
v33 = 0;
std::string::__init(&v31, "Reset", 5u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v25, v16, v17 - 100.0);
SetupTriggerPopup::createToggleValueControl((int)this, -8, (int)&v31, (const cocos2d::CCPoint *)v25, 1, 0, 0, 1.0);
std::string::~string((int)&v31);
v31 = 0;
v32 = 0;
v33 = 0;
std::string::__init(&v31, "Inactive", 8u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v25, v16, v17 - 150.0);
SetupTriggerPopup::createToggleValueControl((int)this, -9, (int)&v31, (const cocos2d::CCPoint *)v25, 1, 0, 0, 1.0);
std::string::~string((int)&v31);
v31 = 0;
v32 = 0;
v33 = 0;
std::string::__init(&v31, "Online", 6u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v25, v16, v17 - 200.0);
SetupTriggerPopup::createToggleValueControl((int)this, -10, (int)&v31, (const cocos2d::CCPoint *)v25, 1, 0, 0, 1.0);
std::string::~string((int)&v31);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v23, v21 * 0.5, (float)(v22 * 0.5) - 15.0);
v31 = 0;
v32 = 0;
v33 = 0;
v34 = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v35, (const cocos2d::CCPoint *)&unk_D2D640);
v38 = 2;
v46 = 2;
v39 = 6;
v40 = 1;
v36 = 1.0;
v37 = 0;
v43 = 0;
v41 = 0.0;
v44 = 0;
v45 = 0;
v42 = 0.0;
v47 = 0;
v48 = 0;
v49 = 1116471296;
memset(v50, 0, sizeof(v50));
std::string::__init(v50, "goldFont.fnt", 0xCu);
v51 = 0.0;
memset(v52, 0, sizeof(v52));
std::string::__init(v52, "Num", 3u);
v31 = -13;
std::string::assign(&v32, "Y Velocity:");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v24, -70.0, 0.0);
cocos2d::CCPoint::operator+(v25, v23, v24);
cocos2d::CCPoint::operator=(v35, v25);
v37 = 1;
v36 = 0.6;
v40 = 0;
v48 = 1;
v51 = 0.7;
v38 = 1;
SetupTriggerPopup::createValueControlAdvanced((cocos2d::CCDictionary **)this, (ValueControlSettings *)&v31);
memset(v27, 0, sizeof(v27));
std::string::__init(v27, "Spawn Group ID:", 0xFu);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v24, 70.0, 0.0);
cocos2d::CCPoint::operator+(v25, v23, v24);
IDNameInput::create((int)this, (int)this + 440, 1, -14, (int)v27, (int)v25, 0.6, 6, 0, 0, 0);
std::string::~string((int)v27);
v28 = 0;
v29 = 0;
v30 = 0;
std::string::__init(&v28, "P2 Group ID:", 0xCu);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v24, -70.0, -55.0);
cocos2d::CCPoint::operator+(v25, v23, v24);
IDNameInput::create((int)this, (int)this + 440, 1, -15, (int)&v28, (int)v25, 0.6, 6, 0, 0, 0);
std::string::~string((int)&v28);
v31 = -16;
std::string::assign(&v32, "SP Name:");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v24, 70.0, -55.0);
cocos2d::CCPoint::operator+(v25, v23, v24);
cocos2d::CCPoint::operator=(v35, v25);
v38 = 4;
v39 = 20;
v49 = 1124859904;
std::string::assign(v52, "Name");
SetupTriggerPopup::createValueControlAdvanced((cocos2d::CCDictionary **)this, (ValueControlSettings *)&v31);
cocos2d::CCDictionary::objectForKey(*((cocos2d::CCDictionary **)this + 144), -16);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v25,
v21 * 0.5,
(float)((float)(v22 * 0.5) - (float)(*((float *)this + 140) * 0.5)) + 20.0);
cocos2d::CCPoint::operator=(v23, v25);
v49 = 1116471296;
v39 = 6;
v31 = -11;
std::string::assign(&v32, "Order:");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v24, -90.0, 0.0);
cocos2d::CCPoint::operator+(v25, v23, v24);
cocos2d::CCPoint::operator=(v35, v25);
v40 = 1;
v38 = 3;
SetupTriggerPopup::createValueControlAdvanced((cocos2d::CCDictionary **)this, (ValueControlSettings *)&v31);
v31 = -12;
std::string::assign(&v32, "Channel:");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v24, 90.0, 0.0);
cocos2d::CCPoint::operator+(v25, v23, v24);
cocos2d::CCPoint::operator=(v35, v25);
SetupTriggerPopup::createValueControlAdvanced((cocos2d::CCDictionary **)this, (ValueControlSettings *)&v31);
SetupTriggerPopup::postSetup(this);
std::string::~string((int)v52);
std::string::~string((int)v50);
std::string::~string((int)&v32);
return v20;
}