//
// KeybindingsLayer::buildControllerGlyph from 0x9952b8 to 0x9955d8 (800 bytes)
//
// 3 xrefs:
// > KeybindingsLayer::buildContentForTab @ 0x9964ec
// > ControllerInputNode::refreshVisuals @ 0xc96188
// > ??> @ 0xefa40
//
// This function is hookable on this platform (idp: arm, 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 12:58:01 +0000
//
__int64 __fastcall KeybindingsLayer::buildControllerGlyph(KeybindingsLayer *this, char *a2, bool *a3)
{
unsigned int v3; // w2
__int64 result; // x0
char *v5; // x0
float v6; // s10
float v7; // s11
char *v8; // x0
float v9; // s9
const char *v10; // x1
__int64 v11; // x20
__int64 v12; // x21
const cocos2d::CCSize *v13; // x0
float v14; // s8
void (__fastcall *v15)(__int64, _BYTE *); // x22
float v16; // [xsp+68h] [xbp+68h] BYREF
float v17; // [xsp+6Ch] [xbp+6Ch]
_BYTE v18[8]; // [xsp+70h] [xbp+70h] BYREF
v3 = (_DWORD)this - 1001;
if ( (unsigned int)((_DWORD)this - 1001) > 0x2B || ((unsigned __int8)this & 1) != 0 )
{
*a2 = 0;
if ( v3 > 0x1A )
{
LABEL_8:
switch ( (int)this )
{
case 1029:
v6 = 1.0;
v8 = "controllerBtn_LThumb_001.png";
v9 = 0.0;
v7 = 90.0;
goto LABEL_25;
case 1031:
v6 = -1.0;
v8 = "controllerBtn_LThumb_001.png";
v9 = 0.0;
v7 = 270.0;
goto LABEL_25;
case 1033:
v6 = 0.0;
v9 = -1.0;
v8 = "controllerBtn_LThumb_001.png";
v7 = 0.0;
goto LABEL_25;
case 1035:
v6 = 0.0;
v7 = 180.0;
v8 = "controllerBtn_LThumb_001.png";
v9 = 1.0;
goto LABEL_25;
case 1037:
v6 = 1.0;
v8 = "controllerBtn_RThumb_001.png";
v9 = 0.0;
v7 = 90.0;
goto LABEL_25;
case 1039:
v6 = -1.0;
v8 = "controllerBtn_RThumb_001.png";
v9 = 0.0;
v7 = 270.0;
goto LABEL_25;
case 1041:
v6 = 0.0;
v9 = -1.0;
v8 = "controllerBtn_RThumb_001.png";
v7 = 0.0;
goto LABEL_25;
case 1043:
v6 = 0.0;
v8 = "controllerBtn_RThumb_001.png";
v9 = 1.0;
v7 = 180.0;
LABEL_25:
v11 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)v8, a2);
if ( !v11 )
goto LABEL_5;
v12 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"edit_leftBtn_001.png", v10);
if ( v12 )
{
v13 = (const cocos2d::CCSize *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v11 + 328LL))(v11);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v16, v13);
v14 = (float)((float)(v17 + v17) / 26.0) + (float)(v16 * 0.3);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v12 + 360LL))(v12, v7);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v12 + 160LL))(v12, 0.378);
v15 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v12 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v18,
(float)(v9 * v14) + (float)(v16 * 0.5),
(float)(v6 * v14) + (float)(v17 * 0.5));
v15(v12, v18);
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)v11 + 464LL))(v11, v12, 1);
}
result = v11;
break;
default:
LABEL_5:
result = 0;
break;
}
return result;
}
}
else
{
LODWORD(this) = (_DWORD)this - 1;
v3 = (_DWORD)this - 1001;
*a2 = 1;
}
switch ( v3 )
{
case 0u:
v5 = "controllerBtn_A_001.png";
break;
case 2u:
v5 = "controllerBtn_B_001.png";
break;
case 4u:
v5 = "controllerBtn_Y_001.png";
break;
case 6u:
v5 = "controllerBtn_X_001.png";
break;
case 8u:
v5 = "controllerBtn_Start_001.png";
break;
case 0xAu:
v5 = "controllerBtn_Back_001.png";
break;
case 0xCu:
v5 = "controllerBtn_RB_001.png";
break;
case 0xEu:
v5 = "controllerBtn_LB_001.png";
break;
case 0x10u:
v5 = "controllerBtn_RT_001.png";
break;
case 0x12u:
v5 = "controllerBtn_LT_001.png";
break;
case 0x14u:
v5 = "controllerBtn_DPad_Up_001.png";
break;
case 0x16u:
v5 = "controllerBtn_DPad_Down_001.png";
break;
case 0x18u:
v5 = "controllerBtn_DPad_Left_001.png";
break;
case 0x1Au:
v5 = "controllerBtn_DPad_Right_001.png";
break;
default:
goto LABEL_8;
}
return cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)v5, a2);
}