//
// SongInfoLayer::addLinkRows from 0x53ab20 to 0x53acd4 (436 bytes)
//
// 2 xrefs:
// > SongInfoLayer::init @ 0x53b6f2
// > SongInfoLayer::init @ 0x53b7b6
//
// 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:52:14 +0000
//
cocos2d::CCArray *__fastcall SongInfoLayer::addLinkRows(int a1, _DWORD *a2, float a3, int a4)
{
unsigned int v6; // r5
unsigned int v7; // r6
cocos2d::CCArray *WinSize; // r0
int v10; // r2
cocos2d::CCArray *result; // r0
cocos2d::CCArray *v12; // r8
ButtonSprite *v13; // r0
cocos2d::CCObject *v14; // r10
int *v15; // r0
int v16; // r1
float v17; // r0
float v18; // [sp+10h] [bp-44h]
cocos2d::CCPoint *v19; // [sp+1Ch] [bp-38h]
cocos2d::CCPoint *v20; // [sp+1Ch] [bp-38h]
float v21[2]; // [sp+20h] [bp-34h] BYREF
_BYTE v22[8]; // [sp+28h] [bp-2Ch] BYREF
_BYTE v23[8]; // [sp+30h] [bp-24h] BYREF
int (__fastcall *v24)(SongInfoLayer *, cocos2d::CCObject *); // [sp+38h] [bp-1Ch]
int v25; // [sp+3Ch] [bp-18h]
char v26; // [sp+40h] [bp-14h] BYREF
char v27; // [sp+41h] [bp-13h] BYREF
ButtonSprite *v28; // [sp+48h] [bp-Ch]
v6 = 3 * a4;
v7 = 0;
cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)a1);
WinSize = (cocos2d::CCArray *)cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v21);
v10 = a2[1];
if ( v6 >= (v10 - *a2) >> 5 )
v6 = (v10 - *a2) >> 5;
result = (cocos2d::CCArray *)cocos2d::CCArray::create(WinSize);
v12 = result;
while ( v7 != v6 )
{
GJLinkObject::getTitle((GJLinkObject *)&v26);
if ( (v26 & 1) != 0 )
v13 = v28;
else
v13 = (ButtonSprite *)&v27;
v19 = ButtonSprite::create(
v13,
(const char *)&dword_54 + 3,
0,
0.6,
1,
"bigFont.fnt",
"GJ_button_05.png",
(const char *)0x41D80000,
v18);
std::string::~string((int)&v26);
v24 = SongInfoLayer::onLink;
v25 = 0;
v14 = (cocos2d::CCObject *)CCMenuItemSpriteExtra::create((int)v19, 0, a1, (int)SongInfoLayer::onLink, 0);
(*(void (__fastcall **)(cocos2d::CCObject *, int))(*(_DWORD *)v14 + 36))(
v14,
-1431655765 * ((*(_DWORD *)(a1 + 556) - *(_DWORD *)(a1 + 552)) >> 2));
v15 = *(int **)(a1 + 556);
v16 = *a2 + 32 * v7 + 20;
if ( v15 == *(int **)(a1 + 560) )
{
std::vector::__push_back_slow_path((int *)(a1 + 552), v16);
}
else
{
if ( v15 )
std::string::basic_string(v15, v16);
*(_DWORD *)(a1 + 556) += 12;
}
(*(void (__fastcall **)(_DWORD, cocos2d::CCObject *))(**(_DWORD **)(a1 + 444) + 228))(*(_DWORD *)(a1 + 444), v14);
cocos2d::CCArray::addObject(v12, v14);
result = (cocos2d::CCArray *)cocos2d::CCArray::count(v12);
if ( result == (cocos2d::CCArray *)((char *)&dword_0 + 3) || v7 + 1 == v6 )
{
v20 = *(cocos2d::CCPoint **)(a1 + 444);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v22, v21[0] * 0.5, a3 - (float)(int)(34 * (v7 / 3)));
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v23, v20);
v17 = GameToolbox::alignItemsHorisontally(*(float *)&v12, 14.0, (int)v23, 0);
result = (cocos2d::CCArray *)cocos2d::CCArray::create((cocos2d::CCArray *)LODWORD(v17));
v12 = result;
}
++v7;
}
return result;
}