//
// SelectSettingLayer::init from 0x6aa66c to 0x6aaa54 (1000 bytes)
//
// 1 xrefs:
// > SelectSettingLayer::create @ 0x6aab1c
//
// 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:34 +0000
//
int __fastcall SelectSettingLayer::init(int a1, int a2, unsigned int a3)
{
int v6; // r10
cocos2d::CCObject *v7; // r0
int v8; // r0
int v9; // r3
cocos2d::CCMenu *v10; // r0
int v11; // r0
cocos2d::CCDirector *v12; // r0
const cocos2d::CCPoint *v13; // r6
unsigned int v14; // r3
int v15; // r8
float v16; // s19
char *v17; // r7
int v18; // r6
void (__fastcall *v19)(int, _DWORD *); // r9
void (__fastcall *v20)(int, _DWORD *); // r9
const char *v21; // r2
int v22; // r6
void (__fastcall *v23)(int, _DWORD *); // r7
int v24; // r5
cocos2d::CCArray *v25; // r0
cocos2d::CCObject *v26; // r0
cocos2d::CCArray *v27; // r0
const char *v28; // r1
cocos2d::CCSprite *v29; // r0
cocos2d::CCObject *v30; // r7
int v31; // r0
cocos2d::CCObject *v32; // r6
float v33; // r0
ButtonSprite *v34; // r0
int v35; // r8
const cocos2d::CCPoint *v36; // r11
int v37; // r2
float v39; // [sp+10h] [bp-5Ch]
void (__fastcall *v40)(int, _BYTE *); // [sp+10h] [bp-5Ch]
cocos2d::CCArray *v41; // [sp+14h] [bp-58h]
void (__fastcall *v42)(cocos2d::CCObject *, _DWORD *); // [sp+18h] [bp-54h]
float v43; // [sp+20h] [bp-4Ch] BYREF
float v44; // [sp+24h] [bp-48h]
_BYTE v45[8]; // [sp+28h] [bp-44h] BYREF
_BYTE v46[8]; // [sp+30h] [bp-3Ch] BYREF
_BYTE v47[8]; // [sp+38h] [bp-34h] BYREF
unsigned int (__fastcall *v48)(SelectSettingLayer *, cocos2d::CCObject *, int); // [sp+40h] [bp-2Ch]
int v49; // [sp+44h] [bp-28h]
int v50[3]; // [sp+48h] [bp-24h] BYREF
_DWORD v51[4]; // [sp+54h] [bp-18h] BYREF
v51[0] = -1778384896;
v6 = cocos2d::CCLayerColor::initWithColor(a1, v51);
if ( !v6 )
return 0;
v7 = FLAlertLayer::incrementForcePrio((cocos2d::CCObject *)a1);
v8 = cocos2d::CCLayer::create(v7);
v9 = *(_DWORD *)a1;
*(_DWORD *)(a1 + 460) = v8;
v10 = (cocos2d::CCMenu *)(*(int (__fastcall **)(int, int))(v9 + 228))(a1, v8);
v11 = cocos2d::CCMenu::create(v10);
*(_DWORD *)(a1 + 444) = v11;
(*(void (__fastcall **)(_DWORD, int, int))(**(_DWORD **)(a1 + 460) + 232))(*(_DWORD *)(a1 + 460), v11, 10);
*(_DWORD *)(a1 + 528) = a2;
v12 = (cocos2d::CCDirector *)SelectSettingLayer::valueToIdx(a2, a3);
*(_DWORD *)(a1 + 524) = v12;
cocos2d::CCDirector::sharedDirector(v12);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v43);
v13 = *(const cocos2d::CCPoint **)(a1 + 444);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v51, v43 * 0.5, (float)(v44 * 0.5) + 5.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v45, v13);
v14 = *(_DWORD *)(a1 + 528);
if ( v14 <= 1 )
{
v15 = 8;
v16 = 42.0;
v17 = "Select Mode";
v39 = 0.9;
}
else
{
if ( v14 != 2 )
return 0;
v15 = 5;
v16 = 60.0;
v17 = "Select Speed";
v39 = 0.8;
}
(*(void (__fastcall **)(int, int))(*(_DWORD *)a1 + 500))(a1, 1);
(*(void (__fastcall **)(int, int))(*(_DWORD *)a1 + 536))(a1, 1);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v51, 0.0, 0.0, 80.0, 80.0);
v18 = cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", v51);
v19 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v18 + 160);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v51, 360.0, 160.0);
v19(v18, v51);
(*(void (__fastcall **)(_DWORD, int, int))(**(_DWORD **)(a1 + 460) + 232))(*(_DWORD *)(a1 + 460), v18, -1);
v20 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v18 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v51, v43 * 0.5, v44 * 0.5);
v20(v18, v51);
v22 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)v17, "bigFont.fnt", v21);
v23 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v22 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v51, v43 * 0.5, (float)((float)(v44 * 0.5) + 80.0) - 20.0);
v24 = 0;
v23(v22, v51);
(*(void (__fastcall **)(_DWORD, int))(**(_DWORD **)(a1 + 460) + 228))(*(_DWORD *)(a1 + 460), v22);
v25 = (cocos2d::CCArray *)(*(int (__fastcall **)(int, int))(*(_DWORD *)v22 + 80))(v22, 1063675494);
v26 = (cocos2d::CCObject *)cocos2d::CCArray::create(v25);
*(_DWORD *)(a1 + 520) = v26;
v27 = (cocos2d::CCArray *)cocos2d::CCObject::retain(v26);
v41 = (cocos2d::CCArray *)cocos2d::CCArray::create(v27);
do
{
SelectSettingLayer::frameForItem(v50, *(_DWORD *)(a1 + 528), v24);
if ( (v50[0] & 1) != 0 )
v29 = (cocos2d::CCSprite *)v50[2];
else
v29 = (cocos2d::CCSprite *)((char *)v50 + 1);
v30 = (cocos2d::CCObject *)cocos2d::CCSprite::createWithSpriteFrameName(v29, v28);
cocos2d::CCArray::addObject(*(cocos2d::CCArray **)(a1 + 520), v30);
(*(void (__fastcall **)(cocos2d::CCObject *, float))(*(_DWORD *)v30 + 80))(v30, COERCE_FLOAT(LODWORD(v39)));
v48 = SelectSettingLayer::onSelect;
v49 = 0;
v31 = CCMenuItemSpriteExtra::create((int)v30, 0, a1, (int)SelectSettingLayer::onSelect, 0);
v32 = (cocos2d::CCObject *)v31;
if ( a2 == 1 && (v24 == 4 || v24 == 7) )
{
(*(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v31 + 528))(v31, 0);
(*(void (__fastcall **)(cocos2d::CCObject *, int))(*(_DWORD *)v30 + 456))(v30, 125);
}
(*(void (__fastcall **)(cocos2d::CCObject *, int))(*(_DWORD *)v32 + 36))(v32, v24);
(*(void (__fastcall **)(_DWORD, cocos2d::CCObject *))(**(_DWORD **)(a1 + 444) + 228))(*(_DWORD *)(a1 + 444), v32);
cocos2d::CCArray::addObject(v41, v32);
v42 = *(void (__fastcall **)(cocos2d::CCObject *, _DWORD *))(*(_DWORD *)v32 + 92);
v33 = floorf((float)(v24 / v15));
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v47,
(float)((float)((float)((float)-v15 * 0.5) * v16) + (float)((float)(v24 % v15) * v16)) + (float)(v16 * 0.5),
v33 * -35.0);
cocos2d::CCPoint::operator+(v51, v45, v47);
v42(v32, v51);
++v24;
std::string::~string((int)v50);
}
while ( v24 != v15 );
*(_DWORD *)(a1 + 500) = -1;
cocos2d::CCArray::removeAllObjects(v41);
v34 = ButtonSprite::create(
(ButtonSprite *)"OK",
(const char *)&word_28,
0,
0.8,
1,
"goldFont.fnt",
"GJ_button_01.png",
(const char *)0x41F00000,
v39);
v51[0] = SelectSettingLayer::onClose;
v51[1] = 0;
v35 = CCMenuItemSpriteExtra::create((int)v34, 0, a1, (int)SelectSettingLayer::onClose, 0);
(*(void (__fastcall **)(_DWORD, int))(**(_DWORD **)(a1 + 444) + 228))(*(_DWORD *)(a1 + 444), v35);
v36 = *(const cocos2d::CCPoint **)(a1 + 444);
v40 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v35 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v46, v43 * 0.5, (float)((float)(v44 * 0.5) - 80.0) + 25.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v47, v36);
v40(v35, v47);
SelectSettingLayer::onSelect((SelectSettingLayer *)a1, nullptr, v37);
*(_BYTE *)(a1 + 468) = 1;
return v6;
}