//
// SimplePlayer::updateColors from 0x1003a2d64 to 0x1003a2f90 (556 bytes)
//
// 18 xrefs:
// > CommentCell::loadFromComment @ 0x10012b26c
// > GJScoreCell::loadFromScore @ 0x10012ce94
// > GJLevelScoreCell::loadFromScore @ 0x10012e2d4
// > GJThreadCell::loadFromThread @ 0x10012fea8
// > GJCompactUserCell::buildUserRow @ 0x100139314
// > CharacterColorPage::updateIconColors @ 0x1001533dc
// > ProfilePage::loadPageFromUserInfo @ 0x10022be9c
// > GJBaseGameLayer::playExitDualEffect @ 0x100285a6c
// > GJGarageLayer::updatePlayerColors @ 0x1003a010c
// > GJGarageLayer::updatePlayerColors @ 0x1003a0170
// > GJGarageLayer::onSelect @ 0x1003a29a0
// > SimplePlayer::setColor @ 0x1003a4208
// > sub_1003A420C @ 0x1003a4238
// > SimplePlayer::setSecondColor @ 0x1003a4268
// > GJItemIcon::init @ 0x1003a49d4
// > GJItemIcon::darkenStoreItem @ 0x1003a4d9c
// > ThreadViewPopup::mountVirtualRow @ 0x1005003fc
// > sub_1005101EC @ 0x1005102ac
//
// 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 11:03:47 +0000
//
__int64 __fastcall SimplePlayer::updateColors(__int64 a1)
{
unsigned __int8 *v2; // x0
int v3; // w21
unsigned __int8 v4; // w23
unsigned __int8 v5; // w24
unsigned __int8 *v6; // x0
int v7; // w22
unsigned __int8 v8; // w25
unsigned __int8 v9; // w8
unsigned __int8 v10; // w26
unsigned __int8 v11; // w9
__int64 v12; // x0
char v13; // w8
__int64 v14; // x0
__int64 v15; // x0
__int64 v16; // x0
__int64 result; // x0
unsigned __int16 v18; // [xsp+Ch] [xbp-54h] BYREF
unsigned __int8 v19; // [xsp+Eh] [xbp-52h]
v2 = (unsigned __int8 *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 600) + 944LL))(*(_QWORD *)(a1 + 600));
v3 = *v2;
v4 = v2[1];
v5 = v2[2];
v6 = (unsigned __int8 *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 608) + 944LL))(*(_QWORD *)(a1 + 608));
v7 = *v6;
v8 = v6[1];
v9 = v8;
v10 = v6[2];
v11 = v10;
if ( (unsigned __int8)(v3 | v4) | v5 && (unsigned __int8)(v7 | v8) | v10
|| ((unsigned __int8)(v7 | v8) | v10) != 0 && ((unsigned __int8)(v3 | v4) | v5) == 0 )
{
LOBYTE(v18) = *v6;
}
else
{
if ( ((unsigned __int8)(v3 | v4) | v5) == 0 || ((unsigned __int8)(v7 | v8) | v10) != 0 )
{
v19 = -1;
v18 = -1;
goto LABEL_8;
}
v9 = v4;
LOBYTE(v18) = v3;
v11 = v5;
}
HIBYTE(v18) = v9;
v19 = v11;
LABEL_8:
v12 = sub_10004AF1C(v18 | ((unsigned __int64)v19 << 16));
v18 = v12;
v19 = BYTE2(v12);
if ( *(_BYTE *)(a1 + 668) == 1 )
{
v19 = *(_BYTE *)(a1 + 671);
v18 = *(_WORD *)(a1 + 669);
}
(*(void (__fastcall **)(_QWORD, unsigned __int16 *))(**(_QWORD **)(a1 + 624) + 960LL))(*(_QWORD *)(a1 + 624), &v18);
if ( (unsigned __int8)(v3 | v4) | v5 )
v13 = *(_BYTE *)(a1 + 660);
else
v13 = 1;
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 624) + 344LL))(*(_QWORD *)(a1 + 624), v13 & 1);
v14 = *(_QWORD *)(a1 + 640);
if ( v14 )
{
GJRobotSprite::updateColor01(v14, v3 | (v4 << 8) | (v5 << 16));
GJRobotSprite::updateColor02(*(_QWORD *)(a1 + 640), v7 | (v8 << 8) | (v10 << 16));
GJRobotSprite::updateGlowColor(*(_QWORD *)(a1 + 640), v18 | (v19 << 16));
}
v15 = *(_QWORD *)(a1 + 648);
if ( v15 )
{
GJRobotSprite::updateColor01(v15, v3 | (v4 << 8) | (v5 << 16));
GJRobotSprite::updateColor02(*(_QWORD *)(a1 + 648), v7 | (v8 << 8) | (v10 << 16));
GJRobotSprite::updateGlowColor(*(_QWORD *)(a1 + 648), v18 | (v19 << 16));
}
if ( !((unsigned __int8)(v3 | v4) | v5) )
{
v16 = *(_QWORD *)(a1 + 640);
LABEL_20:
if ( v16 )
GJRobotSprite::showGlow(v16);
result = *(_QWORD *)(a1 + 648);
if ( result )
return GJRobotSprite::showGlow(result);
return result;
}
v16 = *(_QWORD *)(a1 + 640);
if ( *(_BYTE *)(a1 + 660) == 1 )
goto LABEL_20;
if ( v16 )
GJRobotSprite::hideGlow(v16);
result = *(_QWORD *)(a1 + 648);
if ( result )
return GJRobotSprite::hideGlow(result);
return result;
}