//
// GJBaseGameLayer::updateSavePositionObjects from 0x877c58 to 0x877dac (340 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::update @ 0x89e16c
// > ??> @ 0x9f7b0
//
// 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 GJBaseGameLayer::updateSavePositionObjects(GJBaseGameLayer *a1)
{
cocos2d::CCPoint *p_m_cameraPosition2; // x2
int m_unkUint5; // w0
unsigned int m_unkUint6; // w1
std::__detail::_Hash_node_base *M_nxt; // x20
int m_unkUint11; // w3
GameObject *v7; // x19
const cocos2d::CCPoint *LastPosition; // x0
int m_unk52C; // w19
float *m_start; // x1
int v11; // w0
int v12; // w1
int M_nxt_high; // w25
PlayerObject *m_player2; // x1
int v15; // [xsp+54h] [xbp+54h] BYREF
m_unkUint5 = a1->m_gameState.m_unkUint5;
m_unkUint6 = a1->m_gameState.m_unkUint6;
if ( !m_unkUint5 || m_unkUint5 + 1000 <= m_unkUint6 )
{
M_nxt = a1->m_savePositionValues._M_h._M_before_begin._M_nxt;
m_unkUint11 = a1->m_gameState.m_unkUint11 + 1;
a1->m_gameState.m_unkUint5 = m_unkUint6;
for ( a1->m_gameState.m_unkUint11 = m_unkUint11; M_nxt; m_start[v11 + 1] = p_m_cameraPosition2->y )
{
v12 = (int)M_nxt[1]._M_nxt;
v15 = v12;
M_nxt_high = HIDWORD(M_nxt[1]._M_nxt);
if ( v12 > 0 )
{
v7 = *(GameObject **)std::__detail::_Map_base,std::allocator>,std::__detail::_Select1st,std::equal_to,std::hash,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits,true>::operator[](
(char **)&a1->m_savePositionObjects,
&v15);
LastPosition = GameObject::getLastPosition(v7);
m_unk52C = v7->m_unk52C;
m_unkUint11 = a1->m_gameState.m_unkUint11;
p_m_cameraPosition2 = (cocos2d::CCPoint *)LastPosition;
}
else
{
if ( v12 == -2 )
{
m_player2 = a1->m_player2;
}
else
{
if ( v12 != -1 )
{
m_unk52C = 0;
if ( v12 == -3 )
{
m_unk52C = a1->m_gameState.m_unkUint12;
p_m_cameraPosition2 = &a1->m_gameState.m_cameraPosition2;
}
goto LABEL_6;
}
m_player2 = a1->m_player1;
}
m_unk52C = m_player2->m_unk52C;
p_m_cameraPosition2 = (cocos2d::CCPoint *)GameObject::getLastPosition(m_player2);
m_unkUint11 = a1->m_gameState.m_unkUint11;
}
LABEL_6:
m_start = a1->m_gameState.m_unkVecFloat1.m_start;
M_nxt = M_nxt->_M_nxt;
v11 = 2 * (m_unkUint11 % M_nxt_high + m_unk52C);
m_start[v11] = p_m_cameraPosition2->x;
}
}
}