//
// ControllerInputNode::init from 0x765464 to 0x76580c (936 bytes)
//
// 1 xrefs:
// > ControllerInputNode::create @ 0x7658aa
//
// 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:59:07 +0000
//
int __fastcall ControllerInputNode::init(
ControllerInputNode *this,
InputCaptureDelegate *a2,
const cocos2d::CCSize *a3)
{
const char *v6; // r1
int v7; // r11
int v8; // r0
float v9; // s15
float v10; // s16
void (__fastcall *v11)(ControllerInputNode *, _DWORD *); // r6
float v12; // s15
float v13; // s16
void (__fastcall *v14)(ControllerInputNode *, _DWORD *); // r6
float v15; // s17
float v16; // s15
int v17; // r0
float v18; // s15
int v19; // r6
void (__fastcall *v20)(int, _DWORD *); // r7
float v21; // s17
int v22; // r0
cocos2d::CCMenu *v23; // r0
int v24; // r6
cocos2d::CCDirector *v25; // r0
int v26; // r0
cocos2d::CCTouchDispatcher *v27; // r0
cocos2d::CCDirector *isUsingForcePrio; // r0
void (__fastcall *v29)(int, int); // r5
int v30; // r0
int v31; // r0
int v32; // r9
char *v33; // r5
cocos2d::CCSprite *v34; // r0
const char *v35; // r1
float v36; // r8
int v37; // r8
int v38; // r0
char *v39; // r0
int v40; // r0
_DWORD *v41; // r3
int v42; // r0
int v43; // r1
int v44; // r8
void (__fastcall *v46)(int, _DWORD); // [sp+8h] [bp-44h]
void (__fastcall *v47)(int, _BYTE *); // [sp+8h] [bp-44h]
void (__fastcall *v48)(int, _DWORD); // [sp+8h] [bp-44h]
int v49; // [sp+14h] [bp-38h]
int v50; // [sp+14h] [bp-38h]
int v51; // [sp+18h] [bp-34h] BYREF
_BYTE v52[8]; // [sp+1Ch] [bp-30h] BYREF
_BYTE v53[8]; // [sp+24h] [bp-28h] BYREF
_BYTE v54[8]; // [sp+2Ch] [bp-20h] BYREF
_BYTE v55[8]; // [sp+34h] [bp-18h] BYREF
_DWORD v56[2]; // [sp+3Ch] [bp-10h] BYREF
v7 = cocos2d::CCNode::init(this);
if ( !v7 )
return 0;
*((_DWORD *)this + 66) = a2;
v8 = cocos2d::CCSprite::create((cocos2d::CCSprite *)"controller_outline.png", v6);
*((_DWORD *)this + 70) = v8;
if ( !v8 )
return 0;
v9 = *(float *)a3;
v10 = *((float *)a3 + 1);
v11 = *(void (__fastcall **)(ControllerInputNode *, _DWORD *))(*(_DWORD *)this + 160);
v12 = v9 / 400.0;
v13 = v10 / 276.0;
if ( v12 <= v13 )
v13 = v12;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v56, v13 * 400.0, v13 * 276.0);
v11(this, v56);
v14 = *(void (__fastcall **)(ControllerInputNode *, _DWORD *))(*(_DWORD *)this + 148);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v56, 0.5, 0.5);
v14(this, v56);
v15 = *(float *)(*(int (__fastcall **)(ControllerInputNode *))(*(_DWORD *)this + 164))(this);
v16 = *(float *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 70) + 164))(*((_DWORD *)this + 70));
v17 = *((_DWORD *)this + 70);
v18 = v15 / v16;
*((float *)this + 69) = v18;
(*(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v17 + 80))(v17, LODWORD(v18));
(*(void (__fastcall **)(_DWORD, void *))(**((_DWORD **)this + 70) + 480))(*((_DWORD *)this + 70), &unk_BF09BF);
v19 = *((_DWORD *)this + 70);
v20 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v19 + 92);
v21 = *(float *)(*(int (__fastcall **)(ControllerInputNode *))(*(_DWORD *)this + 164))(this);
v22 = (*(int (__fastcall **)(ControllerInputNode *))(*(_DWORD *)this + 164))(this);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v56, v21 * 0.5, (float)(*(float *)(v22 + 4) * 0.5) + 10.0);
v20(v19, v56);
v23 = (cocos2d::CCMenu *)(*(int (__fastcall **)(ControllerInputNode *, _DWORD))(*(_DWORD *)this + 228))(
this,
*((_DWORD *)this + 70));
v24 = cocos2d::CCMenu::create(v23);
(*(void (__fastcall **)(int, void *))(*(_DWORD *)v24 + 92))(v24, &unk_D2DFF0);
v25 = (cocos2d::CCDirector *)(*(int (__fastcall **)(ControllerInputNode *, int, int))(*(_DWORD *)this + 232))(
this,
v24,
2);
v26 = cocos2d::CCDirector::sharedDirector(v25);
v27 = (cocos2d::CCTouchDispatcher *)(*(int (__fastcall **)(int))(*(_DWORD *)v26 + 80))(v26);
isUsingForcePrio = (cocos2d::CCDirector *)cocos2d::CCTouchDispatcher::isUsingForcePrio(v27);
if ( isUsingForcePrio )
{
v29 = *(void (__fastcall **)(int, int))(*(_DWORD *)v24 + 512);
v30 = cocos2d::CCDirector::sharedDirector(isUsingForcePrio);
v31 = (*(int (__fastcall **)(int))(*(_DWORD *)v30 + 80))(v30);
v29(v24, *(_DWORD *)(v31 + 100) - 1);
}
v32 = 0;
v33 = (char *)&unk_C74AD8;
do
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v52, v13 * *((float *)v33 + 2), v13 * *((float *)v33 + 3));
v34 = (cocos2d::CCSprite *)cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v53, (const cocos2d::CCPoint *)v52);
v36 = *(float *)v33;
if ( *(_DWORD *)v33 )
{
if ( LODWORD(v36) == 1 )
{
v51 = cocos2d::CCSprite::create(v34);
v49 = v51;
v47 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v51 + 160);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v55, 17.0, 17.0);
v47(v49, v55);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v54,
(float)*((int *)v33 + 4) * 15.0,
(float)*((int *)v33 + 5) * 15.0);
cocos2d::CCPoint::operator+(v55, v52, v54);
cocos2d::CCPoint::operator=(v53, v55);
v39 = (char *)this + 320;
}
else
{
v51 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_select_001.png", v35);
v50 = v51;
v48 = *(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v51 + 80);
v40 = (*(int (__fastcall **)(int))(*(_DWORD *)v51 + 164))(v51);
v48(v50, 14.0 / *(float *)(v40 + 4));
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v54,
(float)*((int *)v33 + 4) * 20.0,
(float)*((int *)v33 + 5) * 20.0);
cocos2d::CCPoint::operator+(v55, v52, v54);
cocos2d::CCPoint::operator=(v53, v55);
v39 = (char *)this + 8 * LODWORD(v36) + 312;
}
cocos2d::CCPoint::operator=(v39, v52);
}
else
{
v51 = cocos2d::CCSprite::createWithSpriteFrameName(*((cocos2d::CCSprite **)v33 + 1), v35);
v37 = v51;
v46 = *(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v51 + 80);
v38 = (*(int (__fastcall **)(int))(*(_DWORD *)v51 + 164))(v51);
v46(v37, 22.0 / *(float *)(v38 + 4));
}
v41 = *((_DWORD **)this + 72);
if ( v41 == *((_DWORD **)this + 73) )
{
std::vector::__push_back_slow_path((int)this + 284, &v51);
}
else
{
if ( v41 )
*v41 = v51;
*((_DWORD *)this + 72) += 4;
}
v56[0] = ControllerInputNode::onButton;
v33 += 28;
v56[1] = 0;
v42 = CCMenuItemSpriteExtra::create(v51, 0, (int)this, (int)ControllerInputNode::onButton, 0);
v43 = v32++;
v44 = v42;
(*(void (__fastcall **)(int, int))(*(_DWORD *)v42 + 36))(v42, v43);
(*(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v44 + 92))(v44, v53);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v24 + 228))(v24, v44);
}
while ( v32 != 21 );
ControllerInputNode::refreshVisuals(this);
return v7;
}