// // GJBaseGameLayer::processSongState from 0x869310 to 0x8697ac (1180 bytes) // // 3 xrefs: // > GJBaseGameLayer::processActivatedAudioTriggers @ 0x88d720 // > GJBaseGameLayer::processActivatedAudioTriggers @ 0x88e210 // > @ 0x4a9b8 // // 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 // bool GJBaseGameLayer::processSongState( GJBaseGameLayer *a1, int a2, float a3, float a4, int a5, float a6, float a7, std::vector *a8, SongTriggerGameObject *a9) { SongTriggerState *m_start; // x19 SongTriggerState *m_finish; // x28 float *v18; // x26 SongTriggerGameObject *v19; // x27 float m_duration; // s12 float v21; // s8 float v22; // s0 float v23; // s2 float v24; // s4 float v25; // s8 float v26; // s1 float v27; // s0 float v28; // s2 SongTriggerGameObject *m_songTriggerGameObject; // x24 float m_unkDouble; // s0 float v31; // s11 float v32; // s8 float v33; // s9 float v34; // s0 float v35; // s10 float v36; // s2 float v37; // s8 FMODAudioEngine *v38; // x0 FMODAudioEngine *v39; // x0 int v40; // w19 float v41; // s0 float v42; // s8 float v43; // s9 float v44; // s2 float v45; // s8 FMODAudioEngine *v46; // x0 FMODAudioEngine *v47; // x0 FMODAudioEngine *v48; // x0 FMOD::Channel *ActiveMusicChannel; // x0 FMODAudioEngine *v50; // x0 FMODAudioEngine *v52; // x0 FMODAudioEngine *v53; // x0 float v54; // s0 FMODAudioEngine *v55; // x0 float v56; // [xsp+A0h] [xbp+A0h] unsigned int v58; // [xsp+C0h] [xbp+C0h] BYREF unsigned int v59; // [xsp+C4h] [xbp+C4h] BYREF if ( !a8 ) goto LABEL_47; m_start = a8->m_start; m_finish = a8->m_finish; if ( m_finish == a8->m_start ) goto LABEL_47; v18 = nullptr; v19 = nullptr; do { while ( 1 ) { m_songTriggerGameObject = m_start->m_songTriggerGameObject; m_unkDouble = m_start->m_unkDouble; m_start->m_songTriggerGameObject->m_spawnTriggerDelay = m_unkDouble; if ( m_unkDouble < a3 ) goto LABEL_15; if ( m_songTriggerGameObject->m_stop ) { v52 = FMODAudioEngine::sharedEngine(); FMODAudioEngine::stopMusic(v52, a2); return 0; } if ( m_songTriggerGameObject->m_changeVolume ) { if ( v19 ) { m_duration = v19->m_duration; v21 = m_unkDouble - v19->m_spawnTriggerDelay; FMODAudioEngine::sharedEngine(); v22 = FMODAudioEngine::pitchForIdx(v19->m_speed); v23 = v21 - m_duration; if ( m_duration <= 0.0 ) { a7 = v22; } else { if ( m_duration > v21 ) { v24 = v21 / m_duration; m_duration = v21; v23 = 0.0; v22 = a7 + (float)((float)(v22 - a7) * v24); } v25 = a7 + v22; a7 = v22; a5 = (int)(float)((float)a5 + (float)((float)(m_duration * (float)(v25 * 0.5)) * 1000.0)); } v19 = m_songTriggerGameObject; if ( v23 > 0.0 ) a5 = (int)(float)((float)a5 + (float)((float)(v23 * v22) * 1000.0)); } else { v19 = m_songTriggerGameObject; a5 = (int)(float)((float)a5 + (float)((float)((float)(m_unkDouble - a3) * a7) * 1000.0)); } } if ( !m_songTriggerGameObject->m_changeSpeed ) goto LABEL_15; if ( !v18 ) break; v26 = v18[359]; v27 = m_songTriggerGameObject->m_spawnTriggerDelay - v18[448]; v28 = v18[462]; if ( v26 <= v27 || v26 <= 0.0 ) { a6 = v18[462]; break; } v18 = (float *)m_songTriggerGameObject; a6 = a6 + (float)((float)(v28 - a6) * (float)(v27 / v26)); LABEL_15: if ( m_finish == ++m_start ) goto LABEL_23; } ++m_start; v18 = (float *)m_songTriggerGameObject; } while ( m_finish != m_start ); LABEL_23: v31 = a7; if ( !v19 ) { v40 = 1; if ( !v18 ) goto LABEL_47; goto LABEL_31; } v32 = v19->m_duration; v33 = a4 - v19->m_spawnTriggerDelay; FMODAudioEngine::sharedEngine(); v34 = FMODAudioEngine::pitchForIdx(v19->m_speed); v35 = v34; v36 = v33 - v32; if ( v32 <= 0.0 ) { if ( v36 > 0.0 ) { LABEL_27: a7 = v34; v37 = 0.0; a5 = (int)(float)((float)a5 + (float)((float)(v34 * v36) * 1000.0)); goto LABEL_28; } v55 = FMODAudioEngine::sharedEngine(); a7 = v35; FMODAudioEngine::updateChannel(v55, a2, MusicChannel, Pitch, 0.0, v35); } else { if ( v32 > v33 ) { v54 = v33 / v32; v37 = v32 - v33; a7 = a7 + (float)((float)(v35 - a7) * v54); a5 = (int)(float)((float)a5 + (float)((float)(v33 * (float)((float)(a7 + v31) * 0.5)) * 1000.0)); } else { a5 = (int)(float)((float)a5 + (float)((float)(v32 * (float)((float)(v34 + a7) * 0.5)) * 1000.0)); if ( v36 > 0.0 ) goto LABEL_27; a7 = v34; v37 = 0.0; } LABEL_28: v38 = FMODAudioEngine::sharedEngine(); FMODAudioEngine::updateChannel(v38, a2, MusicChannel, Pitch, 0.0, a7); if ( v37 > 0.0 ) { v39 = FMODAudioEngine::sharedEngine(); FMODAudioEngine::updateChannel(v39, a2, MusicChannel, Pitch, v37, v35); } } v40 = 0; if ( !v18 ) { LABEL_36: if ( !a9 ) goto LABEL_48; goto LABEL_37; } LABEL_31: v41 = v18[359]; v42 = a4 - v18[448]; v43 = v18[462]; if ( v41 <= v42 || v41 <= 0.0 ) { v53 = FMODAudioEngine::sharedEngine(); FMODAudioEngine::updateChannel(v53, a2, MusicChannel, Volume, 0.0, v43); if ( v40 ) goto LABEL_47; goto LABEL_36; } v44 = v42 / v41; v45 = v41 - v42; v56 = a6 + (float)((float)(v43 - a6) * v44); v46 = FMODAudioEngine::sharedEngine(); FMODAudioEngine::updateChannel(v46, a2, MusicChannel, Volume, 0.0, v56); if ( v45 > 0.0 ) { v47 = FMODAudioEngine::sharedEngine(); FMODAudioEngine::updateChannel(v47, a2, MusicChannel, Volume, v45, v43); } if ( !v40 ) goto LABEL_36; LABEL_47: a5 = (int)(float)((float)a5 + (float)((float)((float)(a4 - a3) * a7) * 1000.0)); if ( !a9 ) { LABEL_48: if ( a1->m_levelSettings->m_dontReset ) return 1; goto LABEL_42; } LABEL_37: if ( a9->m_loop && a9->m_end > 0 ) { v48 = FMODAudioEngine::sharedEngine(); ActiveMusicChannel = FMODAudioEngine::getActiveMusicChannel(v48, a2); if ( ActiveMusicChannel ) { FMOD::Channel::getLoopPoints(ActiveMusicChannel, &v58, 1u, &v59, 1u); a5 = (a5 - v58) % (v59 - v58) + v58; } } if ( a9->m_dontReset ) return 1; LABEL_42: v50 = FMODAudioEngine::sharedEngine(); FMODAudioEngine::setMusicTimeMS(v50, a5, 0, a2); return 1; }
GD Web Decomp Icon

GD Web Decomp

Raw Source