//
// GJGarageLayer::setupSpecialPage from 0x50edd0 to 0x50f1a4 (980 bytes)
//
// 1 xrefs:
// > GJGarageLayer::setupPage @ 0x50f1e2
//
// 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:51:30 +0000
//
int *__fastcall GJGarageLayer::setupSpecialPage(const cocos2d::CCPoint **this)
{
int v2; // r0
cocos2d::CCArray *Items; // r6
int v4; // r0
int *v5; // r9
int v6; // r1
int v7; // r3
void (__fastcall *v8)(int *, _DWORD *); // r10
const cocos2d::CCPoint *v9; // r11
cocos2d::CCArray *v10; // r8
int v11; // r7
int *v12; // r7
int v13; // r1
int v14; // r3
void (__fastcall *v15)(int *, _DWORD *); // r8
const cocos2d::CCPoint *v16; // r9
cocos2d::CCMenuItem *v17; // r1
int v18; // r7
int v19; // r10
const cocos2d::CCPoint *v20; // r9
const char *v21; // r1
int *result; // r0
int *v23; // r11
int v24; // r0
int v25; // r0
GJItemIcon *v26; // r6
int v27; // r0
int isItemEnabled; // r0
float v29; // s17
_DWORD *v30; // r5
void (__fastcall *v31)(_DWORD *, int); // r8
int v32; // r0
float v33; // s16
int v34; // r0
int v35; // r1
GameStatsManager *isIconUnlocked; // [sp+1Ch] [bp-50h]
int ItemUnlockState; // [sp+20h] [bp-4Ch]
void (__fastcall *v38)(GJItemIcon *, _BYTE *); // [sp+28h] [bp-44h]
int (__fastcall *v39)(_DWORD *, _BYTE *); // [sp+2Ch] [bp-40h]
float v40; // [sp+34h] [bp-38h] BYREF
float v41; // [sp+38h] [bp-34h]
_BYTE v42[8]; // [sp+3Ch] [bp-30h] BYREF
_BYTE v43[8]; // [sp+44h] [bp-28h] BYREF
_BYTE v44[8]; // [sp+4Ch] [bp-20h] BYREF
_BYTE v45[8]; // [sp+54h] [bp-18h] BYREF
_DWORD v46[2]; // [sp+5Ch] [bp-10h] BYREF
cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)this);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v40);
v2 = (int)*(this + 100);
if ( v2 )
{
(*(void (__fastcall **)(int))(*(_DWORD *)v2 + 268))(v2);
*(this + 100) = nullptr;
}
Items = GJGarageLayer::getItems((GameManager *)this, 0x63u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v46, v40 * 0.5, (float)((float)(v41 * 0.5) - 5.0) - 60.0);
v4 = ListButtonBar::create(Items, (const cocos2d::CCPoint *)v46, 12, 3, 5.0, 5.0, 25.0, 220.0, (_BYTE *)&dword_0 + 1);
*(this + 100) = (const cocos2d::CCPoint *)v4;
BoomScrollLayer::togglePageIndicators(*(_DWORD *)(v4 + 264), 0);
(*((void (__fastcall **)(const cocos2d::CCPoint **, _DWORD, int))*this + 58))(this, *(this + 100), 100);
v5 = (int *)*(this + 97);
v6 = (int)*(this + 99);
v7 = *v5;
if ( v6 )
{
v8 = *(void (__fastcall **)(int *, _DWORD *))(v7 + 92);
v9 = (const cocos2d::CCPoint *)(*(int (__fastcall **)(_DWORD))(*(_DWORD *)v6 + 256))(*(this + 99));
(*(void (__fastcall **)(_DWORD))(*(_DWORD *)*(this + 99) + 96))(*(this + 99));
cocos2d::CCNode::convertToWorldSpace((cocos2d::CCNode *)v46, v9);
v8(v5, v46);
(*(void (__fastcall **)(_DWORD, int))(*(_DWORD *)*(this + 97) + 172))(*(this + 97), 1);
}
else
{
(*(void (__fastcall **)(_DWORD, _DWORD))(v7 + 172))(*(this + 97), 0);
}
v10 = GJGarageLayer::getItems((GameManager *)this, 0x65u);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v46,
v40 * 0.5,
(float)((float)((float)(v41 * 0.5) - 5.0) - 60.0) - 30.0);
v11 = ListButtonBar::create(v10, (const cocos2d::CCPoint *)v46, 12, 3, 5.0, 5.0, 25.0, 220.0, (_BYTE *)&dword_0 + 1);
BoomScrollLayer::togglePageIndicators(*(_DWORD *)(v11 + 264), 0);
(*(void (__fastcall **)(_DWORD, int, int))(*(_DWORD *)*(this + 100) + 232))(*(this + 100), v11, 100);
v12 = (int *)*(this + 98);
v13 = (int)*(this + 99);
v14 = *v12;
if ( v13 )
{
v15 = *(void (__fastcall **)(int *, _DWORD *))(v14 + 92);
v16 = (const cocos2d::CCPoint *)(*(int (__fastcall **)(_DWORD))(*(_DWORD *)v13 + 256))(*(this + 99));
(*(void (__fastcall **)(_DWORD))(*(_DWORD *)*(this + 99) + 96))(*(this + 99));
cocos2d::CCNode::convertToWorldSpace((cocos2d::CCNode *)v46, v16);
v15(v12, v46);
(*(void (__fastcall **)(_DWORD, int))(*(_DWORD *)*(this + 98) + 172))(*(this + 98), 1);
}
else
{
(*(void (__fastcall **)(_DWORD, _DWORD))(v14 + 172))(*(this + 98), 0);
}
v18 = 18;
v19 = 0;
v20 = (const cocos2d::CCPoint *)cocos2d::CCMenu::create(nullptr, v17);
(*(void (__fastcall **)(_DWORD, const cocos2d::CCPoint *, int))(*(_DWORD *)*(this + 100) + 232))(
*(this + 100),
v20,
1000);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v42,
(float)((float)(v40 * 0.5) - 137.5) - 27.5,
(float)((float)((float)(v41 * 0.5) - 5.0) - 60.0) - 30.0);
cocos2d::CCNode::convertToWorldSpace((cocos2d::CCNode *)v46, *(this + 100));
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v43, v20);
result = (int *)cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"playerSquare_001.png", v21);
v23 = result;
do
{
v24 = GameManager::sharedState((GameManager *)result);
isIconUnlocked = (GameStatsManager *)GameManager::isIconUnlocked(v24, v18, 0x64u);
v25 = GameStatsManager::sharedState(isIconUnlocked);
ItemUnlockState = GameStatsManager::getItemUnlockState(v25, v18);
result = GJItemIcon::createBrowserItem(12, v18);
v26 = (GJItemIcon *)result;
if ( isIconUnlocked )
{
v27 = GameStatsManager::sharedState((GameStatsManager *)result);
isItemEnabled = GameStatsManager::isItemEnabled(v27, 12, v18);
result = (int *)GJItemIcon::toggleEnabledState((unsigned int)v26, isItemEnabled);
}
if ( v26 )
{
v29 = COERCE_FLOAT(GJItemIcon::scaleForType(12));
(*(void (__fastcall **)(GJItemIcon *, float))(*(_DWORD *)v26 + 80))(v26, COERCE_FLOAT(LODWORD(v29)));
v46[1] = 0;
v46[0] = GJGarageLayer::onToggleItem;
v30 = (_DWORD *)CCMenuItemSpriteExtra::create((int)v26, 0, (int)this, (int)GJGarageLayer::onToggleItem, 0);
v31 = *(void (__fastcall **)(_DWORD *, int))(*v30 + 160);
v32 = (*(int (__fastcall **)(int *))(*v23 + 164))(v23);
v31(v30, v32);
v38 = *(void (__fastcall **)(GJItemIcon *, _BYTE *))(*(_DWORD *)v26 + 92);
v33 = *(float *)(*(int (__fastcall **)(_DWORD *))(*v30 + 164))(v30);
v34 = (*(int (__fastcall **)(_DWORD *))(*v30 + 164))(v30);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v45, v33 * 0.5, *(float *)(v34 + 4) * 0.5);
v38(v26, v45);
(*(void (__fastcall **)(_DWORD *, int))(*v30 + 36))(v30, v18);
v30[96] = 100;
(*(void (__fastcall **)(const cocos2d::CCPoint *, _DWORD *))(*(_DWORD *)v20 + 228))(v20, v30);
v35 = 30 * v19++;
v39 = *(int (__fastcall **)(_DWORD *, _BYTE *))(*v30 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v44, (float)v35, 0.0);
cocos2d::CCPoint::operator+(v45, v43, v44);
result = (int *)v39(v30, v45);
if ( !isIconUnlocked )
{
if ( ItemUnlockState )
result = (int *)GJItemIcon::changeToLockedState(v26, 1.0 / v29);
else
result = (int *)GJItemIcon::darkenStoreItem((int)v26, (GJItemIcon *)&byte_5);
}
}
++v18;
}
while ( v18 != 21 );
return result;
}