//
// GJBaseGameLayer::processCommands from 0x492f14 to 0x493042 (302 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::update @ 0x497696
//
// 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::processCommands(GJBaseGameLayer *a1, float a2, bool a3, bool a4)
{
_BOOL4 v6; // r7
unsigned int v8; // r0
unsigned int m_commandIndex; // r5
int m_unkUint6; // r1
unsigned int m_currentProgress; // r1
unsigned int v12; // r1
bool v13; // r2
RecordButtonCommand *m_start; // r5
unsigned int v15; // r3
int m_unkUint4; // r1
int m_currentStep; // r0
int v18; // r0
int *i; // r1
int v20; // r2
signed int m_pauseCounter; // r3
signed int v22; // r2
v6 = a3;
a1->m_gameState.m_unkUint4 = a1->m_gameState.m_commandIndex;
if ( a2 > 0.0 )
{
v8 = lroundf();
m_commandIndex = a1->m_gameState.m_commandIndex;
m_unkUint6 = a1->m_gameState.m_unkUint6;
if ( v6 )
{
a1->m_gameState.m_commandIndex = m_commandIndex + 1;
a1->m_gameState.m_unkUint6 = (unsigned int)(float)((float)(unsigned int)m_unkUint6 + vcvts_n_f32_s32(v8, 1u));
}
else
{
a1->m_gameState.m_commandIndex = m_commandIndex + 2;
a1->m_gameState.m_unkUint6 = v8 + m_unkUint6;
}
}
if ( !a1->m_playerDied )
{
if ( a2 > 0.0 )
{
m_currentProgress = a1->m_gameState.m_currentProgress;
if ( v6 )
v12 = m_currentProgress + 1;
else
v12 = m_currentProgress + 2;
a1->m_gameState.m_currentProgress = v12;
}
if ( a1->m_clickBetweenSteps )
v13 = a4;
else
v13 = !a1->m_clickOnSteps || a4;
GJBaseGameLayer::processQueuedButtons(a1, a2, v13);
m_start = a1->m_queuedRecordedButtons.m_start;
v15 = a1->m_queuedRecordedButtons.m_finish - m_start;
if ( a1->m_queuedRecordedButtonsSize < v15 )
{
m_unkUint4 = a1->m_gameState.m_unkUint4;
m_currentStep = a1->m_currentStep;
a1->m_currentStep = m_unkUint4;
v18 = m_unkUint4 - m_currentStep;
for ( i = &a1->m_queuedRecordedButtonsSize; ; *i = v20 + 1 )
{
v20 = *i;
if ( *i >= v15 )
break;
m_start[v20].m_step = v18;
v18 = 0;
}
}
GJBaseGameLayer::updateReplay(a1);
}
m_pauseCounter = a1->m_gameState.m_pauseCounter;
if ( m_pauseCounter > 0 )
{
v22 = a1->m_gameState.m_pauseBufferTimer - 1;
if ( v22 < 0 )
{
a1->m_gameState.m_pauseCounter = m_pauseCounter - 1;
a1->m_gameState.m_pauseBufferTimer = 120;
}
else
{
a1->m_gameState.m_pauseBufferTimer = v22;
}
}
}