//
// UILayer::refreshDpad from 0x6f0268 to 0x6f03dc (372 bytes)
//
// 4 xrefs:
// > UILayer::reapplyLevelControls @ 0x6f03ec
// > UILayer::togglePlatformerMode @ 0x6f041c
// > PlayLayer::resume @ 0x7000c8
// > ??> @ 0xa5b68
//
// 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:51:48 +0000
//
__int64 __fastcall UILayer::refreshDpad(UILayer *this)
{
__int64 v3; // x0
int v4; // w25
unsigned __int64 GameVariable; // x0
GameManager *v6; // x0
__int64 v7; // x21
cocos2d::CCDirector *v8; // x0
unsigned int v9; // w19
cocos2d::CCDirector *v10; // x0
int v11; // w24
GJUINode *v12; // x22
__int64 DpadSetting; // x0
GameManager *v14; // x0
__int64 v15; // [xsp+68h] [xbp+68h] BYREF
_BYTE v16[40]; // [xsp+70h] [xbp+70h] BYREF
if ( *((_BYTE *)this + 596) )
{
UILayer::resolveLevelControls(this);
v3 = *((_QWORD *)this + 80);
if ( !v3 || *(_QWORD *)(v3 + 152) == *(_QWORD *)(v3 + 160) )
{
v14 = (GameManager *)GameManager::sharedState((GameManager *)v3);
v4 = 0;
GameVariable = (unsigned __int8)GameManager::getGameVariable(v14, "0113");
}
else
{
v4 = 1;
GameVariable = *(_DWORD *)(v3 + 68) != 0;
}
*((_BYTE *)this + 625) = GameVariable;
v6 = (GameManager *)GameManager::sharedState((GameManager *)GameVariable);
v7 = 0;
v8 = (cocos2d::CCDirector *)GameManager::prepareDPadSettings(v6);
v9 = 0;
v10 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v8);
cocos2d::CCDirector::getWinSize(&v15, v10);
if ( *((_BYTE *)this + 624) )
v11 = 4;
else
v11 = 1;
do
{
v12 = (GJUINode *)cocos2d::CCArray::objectAtIndex(*((cocos2d::CCArray **)this + 77), v9);
if ( v4
&& (int)v9 < (int)(-286331153
* ((__int64)(*(_QWORD *)(*((_QWORD *)this + 80) + 160LL)
- *(_QWORD *)(*((_QWORD *)this + 80) + 152LL)) >> 2)) )
{
LevelControlConfig::resolveSlot();
GJUINode::loadFromConfig(v12, (__int64)v16);
}
else
{
DpadSetting = getDpadSetting(v9, *((_BYTE *)this + 624));
GJUINode::loadFromConfig(v12, DpadSetting);
}
++v9;
v7 += 60;
}
while ( v9 != v11 );
}
return _stack_chk_guard;
}