//
// MenuGameLayer::update from 0x1004fabd0 to 0x1004faf35 (869 bytes)
//
// 1 xrefs:
// > ??> @ 0x100958700
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall MenuGameLayer::update(MenuGameLayer *a1, float a2)
{
cocos2d::CCDirector *v3; // rsi
float v4; // xmm1_4
GJGroundLayer *m_groundLayer; // r14
unsigned __int16 *v6; // rax
GJGroundLayer *v7; // r14
cocos2d::CCSprite *m_ground2Sprite; // rdi
unsigned __int16 *v9; // rax
PlayerObject *m_playerObject; // r14
double *v11; // rax
PlayerObject *v12; // rax
__m128 m_vehicleSize_low; // xmm2
__m128 v14; // xmm1
cocos2d::CCDirector *v15; // rax
float v16; // xmm0_4
__int64 v17; // rax
PlayerObject *v18; // r14
float *v19; // rax
float *v20; // rax
float m_backgroundWrapPosition; // xmm0_4
float v22; // xmm2_4
GJGroundLayer *v23; // r14
float m_textureWidth; // xmm0_4
float v25; // xmm1_4
cocos2d::CCPoint v26; // xmm0_8
__int64 v27; // [rsp+8h] [rbp-58h] BYREF
__m128 v28; // [rsp+10h] [rbp-50h]
float v29; // [rsp+24h] [rbp-3Ch] BYREF
double v30; // [rsp+2Ch] [rbp-34h] BYREF
__int64 v31; // [rsp+34h] [rbp-2Ch] BYREF
float v32; // [rsp+3Ch] [rbp-24h]
float v33; // [rsp+40h] [rbp-20h]
float m_unkAngle1; // [rsp+44h] [rbp-1Ch]
v32 = a2;
v3 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v29);
v4 = v32;
a1->m_deltaCount = a1->m_deltaCount + v32;
v33 = 60.0 * v4;
m_groundLayer = a1->m_groundLayer;
v6 = (unsigned __int16 *)((__int64 (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCDirector *))m_groundLayer->m_ground1Sprite->getColor)(
m_groundLayer->m_ground1Sprite,
v3);
GJGroundLayer::updateGround01Color(m_groundLayer, (cocos2d::ccColor3B)(*v6 | (*((unsigned __int8 *)v6 + 2) << 16)));
v7 = a1->m_groundLayer;
m_ground2Sprite = v7->m_ground2Sprite;
if ( m_ground2Sprite )
{
v9 = (unsigned __int16 *)((__int64 (__fastcall *)(cocos2d::CCSprite *))m_ground2Sprite->getColor)(m_ground2Sprite);
GJGroundLayer::updateGround02Color(v7, (cocos2d::ccColor3B)(*v9 | (*((unsigned __int8 *)v9 + 2) << 16)));
}
m_playerObject = a1->m_playerObject;
v11 = (double *)((__int64 (__fastcall *)(PlayerObject *))m_playerObject->getPosition)(m_playerObject);
sub_10028CC60(&v31, v11);
sub_10028CC90(&m_playerObject->m_shipRotation, (double *)&v31);
PlayerObject::updateInternalActions(a1->m_playerObject, v32);
((void (__fastcall *)(PlayerObject *, float))a1->m_playerObject->update)(a1->m_playerObject, v33);
v12 = a1->m_playerObject;
v12->m_totalTime = a1->m_deltaCount;
m_vehicleSize_low = (__m128)LODWORD(v12->m_vehicleSize);
m_unkAngle1 = v12->m_unkAngle1;
v14 = (__m128)0x3F800000u;
v14.f32[0] = (float)((float)(1.0 - m_vehicleSize_low.f32[0]) * m_unkAngle1) * 0.5;
v28 = _mm_and_ps(_mm_cmpneq_ss(m_vehicleSize_low, (__m128)0x3F800000u), v14);
v15 = cocos2d::CCDirector::sharedDirector();
v16 = sub_100484D80((__int64)v15);
m_unkAngle1 = (float)((float)(m_unkAngle1 * 0.5) + (float)(v16 + 90.0)) - v28.f32[0];
v17 = ((__int64 (__fastcall *)(PlayerObject *))a1->m_playerObject->getPosition)(a1->m_playerObject);
if ( m_unkAngle1 > *(float *)(v17 + 4) )
{
v18 = a1->m_playerObject;
v19 = (float *)((__int64 (__fastcall *)(PlayerObject *))v18->getPosition)(v18);
sub_10028CBE0((float *)&v31, *v19, m_unkAngle1);
((void (__fastcall *)(PlayerObject *, __int64 *))v18->setPosition)(v18, &v31);
PlayerObject::hitGround(a1->m_playerObject, nullptr, 0);
}
PlayerObject::updateRotation_1(a1->m_playerObject, v33);
v20 = (float *)((__int64 (__fastcall *)(PlayerObject *))a1->m_playerObject->getPosition)(a1->m_playerObject);
if ( *v20 > (float)(v29 + 100.0) )
MenuGameLayer::resetPlayer(a1);
sub_10028CBE0((float *)&v31, (float)((float)(v33 * 5.7700019) * 0.89999998) + a1->m_realBackgroundPosition.x, 0.0);
sub_10028CC90(&a1->m_realBackgroundPosition, (double *)&v31);
sub_10028CBE0((float *)&v31, a1->m_realBackgroundPosition.x * -0.1, -0.1 * a1->m_realBackgroundPosition.y);
m_backgroundWrapPosition = a1->m_backgroundWrapPosition;
v22 = *(float *)&v31;
if ( (float)-m_backgroundWrapPosition > *(float *)&v31 )
{
do
v22 = v22 + m_backgroundWrapPosition;
while ( (float)-m_backgroundWrapPosition > v22 );
*(float *)&v31 = v22;
}
((void (__fastcall *)(cocos2d::CCSprite *, __int64 *))a1->m_backgroundSprite->setPosition)(
a1->m_backgroundSprite,
&v31);
sub_10028CBE0((float *)&v30, -a1->m_realBackgroundPosition.x, 0.0);
v23 = a1->m_groundLayer;
m_textureWidth = v23->m_textureWidth;
v25 = *(float *)&v30;
if ( (float)-m_textureWidth > *(float *)&v30 )
{
do
v25 = v25 + m_textureWidth;
while ( (float)-m_textureWidth > v25 );
*(float *)&v30 = v25;
}
*(double *)&v26 = sub_10028CC60(&v27, &v30);
GJGroundLayer::updateGroundPos(v23, v26);
PlayerObject::updateEffects(a1->m_playerObject, v32);
}