//
// SimplePlayer::updatePlayerFrame from 0x140382a80 to 0x140382fc4 (1348 bytes)
//
// 16 xrefs:
// > CharacterColorPage::init @ 0x1400a0ff8
// > CharacterColorPage::toggleShip @ 0x1400a165e
// > ThreadViewPopup::mountVirtualRow @ 0x1400e2228
// > sub_1400F78D0 @ 0x1400f7a0e
// > CommentCell::loadFromComment @ 0x1401524eb
// > GJScoreCell::loadFromScore @ 0x140155577
// > GJLevelScoreCell::loadFromScore @ 0x14015729b
// > GJCompactUserCell::buildUserRow @ 0x140158066
// > GJThreadCell::loadFromThread @ 0x140159c71
// > GJBaseGameLayer::playExitDualEffect @ 0x14031e6e0
// > GJGarageLayer::init @ 0x14037c3db
// > GJGarageLayer::onSelect @ 0x14038004c
// > SimplePlayer::init @ 0x1403823fb
// > GJItemIcon::init @ 0x140383902
// > ProfilePage::loadPageFromUserInfo @ 0x140553ba6
// > ??> @ 0x1409229dc
//
// This function is hookable on this platform (idp: pc, 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 11:31:06 +0000
//
// Hidden C++ exception states: #wind=2
void __fastcall SimplePlayer::updatePlayerFrame(__int64 a1, unsigned __int64 a2, unsigned int a3)
{
int v4; // r15d
unsigned __int64 v7; // rdx
int v8; // edi
__int64 v9; // rcx
__int64 v10; // rcx
bool v11; // bl
unsigned int v12; // r15d
__int64 *v13; // rcx
__int64 v14; // rcx
__int64 v15; // rax
__int64 v16; // rdx
__int64 v17; // rdx
cocos2d::CCString *v18; // rax
unsigned int CString; // r12d
void **v20; // rdx
cocos2d::CCString *v21; // rax
unsigned int v22; // r13d
unsigned int v23; // edi
void **v24; // rdx
cocos2d::CCString *v25; // rax
void **v26; // rdx
cocos2d::CCString *v27; // rax
const char *v28; // rbx
void **v29; // rdx
cocos2d::CCString *v30; // rax
const char *v31; // rax
__int64 *v32; // rdi
__int64 v33; // rdi
__int64 v34; // rbx
float v35; // xmm2_4
__int64 v36; // rax
void *v37; // rcx
void *v38; // [rsp+30h] [rbp-30h] BYREF
void *Block[2]; // [rsp+38h] [rbp-28h] BYREF
__int64 v40; // [rsp+48h] [rbp-18h]
unsigned __int64 v41; // [rsp+50h] [rbp-10h]
v4 = a2;
*(_OWORD *)Block = 0;
v41 = 15;
LOBYTE(Block[0]) = 0;
v7 = 0x140000000uLL;
switch ( a3 )
{
case 1u:
v40 = 4;
strcpy((char *)Block, "ship");
v8 = 169;
break;
case 2u:
v40 = 11;
strcpy((char *)Block, "player_ball");
v8 = 118;
break;
case 3u:
v40 = 4;
strcpy((char *)Block, "bird");
v8 = 149;
break;
case 4u:
v40 = 4;
strcpy((char *)Block, "dart");
v8 = 96;
break;
case 5u:
v40 = 5;
strcpy((char *)Block, "robot");
v8 = 68;
break;
case 6u:
LODWORD(Block[0]) = 1684631667;
v8 = 69;
goto LABEL_10;
case 7u:
v40 = 5;
strcpy((char *)Block, "swing");
v8 = 43;
break;
case 8u:
v40 = 7;
Block[0] = (void *)0x6B63617074656ALL;
v8 = 8;
break;
default:
v7 = a2;
LODWORD(Block[0]) = 2036427888;
v8 = 485;
LABEL_10:
BYTE6(Block[0]) = 0;
WORD2(Block[0]) = 29285;
v40 = 6;
break;
}
v9 = *(_QWORD *)(a1 + 640);
if ( v9 )
{
LOBYTE(v7) = a3 == 5;
(*(void (__fastcall **)(__int64, unsigned __int64))(*(_QWORD *)v9 + 336LL))(v9, v7);
}
v10 = *(_QWORD *)(a1 + 648);
if ( v10 )
{
LOBYTE(v7) = a3 == 6;
(*(void (__fastcall **)(__int64, unsigned __int64))(*(_QWORD *)v10 + 336LL))(v10, v7);
}
v11 = a3 - 5 > 1;
(*(void (__fastcall **)(_QWORD, bool))(**(_QWORD **)(a1 + 600) + 336LL))(*(_QWORD *)(a1 + 600), v11);
(*(void (__fastcall **)(_QWORD, bool))(**(_QWORD **)(a1 + 608) + 336LL))(*(_QWORD *)(a1 + 608), v11);
(*(void (__fastcall **)(_QWORD, bool))(**(_QWORD **)(a1 + 616) + 336LL))(*(_QWORD *)(a1 + 616), v11);
if ( v4 < v8 )
v8 = v4;
v12 = 1;
if ( v8 > 1 )
v12 = v8;
v13 = (__int64 *)qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v38 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v38);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v13 = (__int64 *)qword_14090BFD0;
}
GameManager::loadIcon(v13, v12, a3, *(_DWORD *)(a1 + 664));
if ( a3 != 5 )
{
if ( a3 == 6 )
{
v14 = *(_QWORD *)(a1 + 648);
if ( v14 )
goto LABEL_23;
SimplePlayer::createSpiderSprite((__int64 *)a1, v12);
LOBYTE(v17) = 1;
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 648) + 336LL))(*(_QWORD *)(a1 + 648), v17);
goto LABEL_42;
}
v18 = cocos2d::CCString::createWithFormat("%s_%02d_001.png", (const char *)Block, v12);
CString = (unsigned int)cocos2d::CCString::getCString(v18);
v20 = Block;
if ( v41 > 0xF )
v20 = (void **)Block[0];
v21 = cocos2d::CCString::createWithFormat("%s_%02d_2_001.png", (const char *)v20, v12);
v22 = (unsigned int)cocos2d::CCString::getCString(v21);
v23 = 0;
if ( a3 == 3 )
{
v24 = Block;
if ( v41 > 0xF )
v24 = (void **)Block[0];
v25 = cocos2d::CCString::createWithFormat("%s_%02d_3_001.png", (const char *)v24, v12);
v23 = (unsigned int)cocos2d::CCString::getCString(v25);
}
v26 = Block;
if ( v41 > 0xF )
v26 = (void **)Block[0];
v27 = cocos2d::CCString::createWithFormat("%s_%02d_glow_001.png", (const char *)v26, v12);
v28 = cocos2d::CCString::getCString(v27);
v29 = Block;
if ( v41 > 0xF )
v29 = (void **)Block[0];
v30 = cocos2d::CCString::createWithFormat("%s_%02d_extra_001.png", (const char *)v29, v12);
v31 = cocos2d::CCString::getCString(v30);
SimplePlayer::setFrames(a1, CString, v22, v23, (__int64)v28, (__int64)v31);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 600) + 160LL))(*(_QWORD *)(a1 + 600));
v32 = *(__int64 **)(a1 + 600);
if ( a3 == 2 )
{
(*(void (__fastcall **)(_QWORD))(*v32 + 160))(*(_QWORD *)(a1 + 600));
v33 = **(_QWORD **)(a1 + 600);
v34 = *(_QWORD *)(a1 + 600);
}
else
{
v33 = *v32;
v34 = *(_QWORD *)(a1 + 600);
if ( a3 == 3 )
{
v35 = -7.0;
goto LABEL_41;
}
}
v35 = 0.0;
LABEL_41:
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v38, 0.0, v35);
(*(void (__fastcall **)(__int64, __int64))(v33 + 184))(v34, v36);
goto LABEL_42;
}
v14 = *(_QWORD *)(a1 + 640);
if ( v14 )
{
LABEL_23:
GJRobotSprite::updateFrame(v14, v12);
goto LABEL_42;
}
v15 = GJRobotSprite::create(v12);
*(_QWORD *)(a1 + 640) = v15;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 464LL))(a1, v15);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 640) + 336LL))(*(_QWORD *)(a1 + 640), 0);
LOBYTE(v16) = 1;
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 640) + 336LL))(*(_QWORD *)(a1 + 640), v16);
LABEL_42:
if ( v41 > 0xF )
{
v37 = Block[0];
if ( v41 + 1 >= 0x1000 )
{
v37 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v37 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v37);
}
}