{"type": "func", "start": 3660228, "end": 3660672, "name": "EditorUI::onPlayback", "pseudocode": "// \n// EditorUI::onPlayback from 0x37d9c4 to 0x37db80 (444 bytes)\n// \n// 2 xrefs:\n// > EditorUI::onStopPlaytest @ 0x3874c8\n// > EditorUI::keyDown @ 0x3a7738\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\nvoid EditorUI::onPlayback(EditorUI *a1, cocos2d::CCObject *a2)\n{\n  LevelEditorLayer *m_editorLayer; // r0\n  LevelEditorLayer *v4; // r0\n  _BOOL4 m_isPlayingMusic; // r3\n  int v6; // r9\n  LevelEditorLayer *v7; // r1\n  int m_playbackObject; // r5\n  int v9; // r2\n  bool v10; // r3\n  float v11; // r11\n  int SelectedOrderChannel; // r0\n  cocos2d::CCPoint v13; // r1\n  float v14; // r0\n  cocos2d::CCPoint v15; // r1\n  float v16; // r0\n  LevelEditorLayer *v17; // r3\n  float m_playbackStartWarp; // r1\n  FMODAudioEngine *v19; // r0\n  int v20; // [sp+10h] [bp-24h]\n  DrawGridLayer *m_drawGridLayer; // [sp+14h] [bp-20h]\n  DrawGridLayer *v22; // [sp+14h] [bp-20h]\n  cocos2d::CCPoint v23; // [sp+1Ch] [bp-18h] BYREF\n  cocos2d::CCPoint v24; // [sp+24h] [bp-10h] BYREF\n\n  if ( !a1->m_isPaused )\n  {\n    m_editorLayer = a1->m_editorLayer;\n    if ( m_editorLayer->m_playbackMode == Not )\n    {\n      GJBaseGameLayer::preResumeGame(m_editorLayer);\n      v4 = a1->m_editorLayer;\n      m_isPlayingMusic = a1->m_isPlayingMusic;\n      v4->m_gameState.m_unkBool30 = 0;\n      if ( m_isPlayingMusic )\n      {\n        v6 = 0;\n      }\n      else\n      {\n        GJBaseGameLayer::pauseAudio(v4);\n        v6 = 1;\n      }\n      LevelEditorLayer::resetPlayback(a1->m_editorLayer);\n      if ( a1->m_isPlayingMusic )\n      {\n        LevelEditorLayer::stopPlayback(a1->m_editorLayer);\n        a1->m_editorLayer->m_spawnOrderObjectsChanged = 1;\n      }\n      else\n      {\n        DrawGridLayer::updateTimeMarkers(a1->m_editorLayer->m_drawGridLayer);\n        cocos2d::CCNode::convertToNodeSpace(\n          &v23,\n          a1->m_editorLayer->m_objectLayer,\n          (const cocos2d::CCPoint *)&flt_AC5D38);\n        v7 = a1->m_editorLayer;\n        if ( (float)(v23.x + 30.0) < 50.0 )\n          v23.x = 0.0;\n        m_playbackObject = (int)v7->m_playbackObject;\n        if ( m_playbackObject )\n        {\n          LevelEditorLayer::getSelectedEffectPos(&v24, v7);\n          cocos2d::CCPoint::operator=((PlayerObject *)&v23, COERCE_FLOAT(&v24), v9, v10);\n          v11 = COERCE_FLOAT(LevelEditorLayer::getSelectedEditorOrder(a1->m_editorLayer));\n          SelectedOrderChannel = LevelEditorLayer::getSelectedOrderChannel(a1->m_editorLayer);\n          *(float *)&a1->m_editorLayer->m_playbackOrder = v11;\n          m_playbackObject = SelectedOrderChannel;\n        }\n        else\n        {\n          v11 = 0.0;\n        }\n        m_drawGridLayer = a1->m_editorLayer->m_drawGridLayer;\n        cocos2d::CCPoint::CCPoint(&v24, &v23);\n        LODWORD(v13.x) = &v24;\n        v13.y = v11;\n        v14 = DrawGridLayer::timeForPos(m_drawGridLayer, v13, m_playbackObject, 0, 1, 0, 0, (int)&_stack_chk_guard);\n        v22 = a1->m_editorLayer->m_drawGridLayer;\n        a1->m_playbackStartWarp = v14;\n        cocos2d::CCPoint::CCPoint(&v24, &v23);\n        LODWORD(v15.x) = &v24;\n        v15.y = v11;\n        v16 = DrawGridLayer::timeForPos(v22, v15, m_playbackObject, 0, 0, 0, 0, v20);\n        v17 = a1->m_editorLayer;\n        m_playbackStartWarp = a1->m_playbackStartWarp;\n        a1->m_playbackStartTime = v16;\n        DrawGridLayer::updateMusicGuideTime(v17->m_drawGridLayer, m_playbackStartWarp);\n      }\n      a1->m_isPlayingMusic ^= 1u;\n      EditorUI::updatePlaybackBtn(a1);\n      if ( a1->m_isPlayingMusic )\n      {\n        v19 = FMODAudioEngine::sharedEngine();\n        FMODAudioEngine::updateReverb(v19, Generic, 0);\n        LevelEditorLayer::updateGameObjects(a1->m_editorLayer);\n        GJBaseGameLayer::processQueuedAudioTriggers(a1->m_editorLayer);\n      }\n      if ( v6 )\n        a1->m_editorLayer->m_audioPaused = 1;\n    }\n  }\n}", "assembly": "; \n; EditorUI::onPlayback from 0x37d9c4 to 0x37db80 (444 bytes)\n; \n; 2 xrefs:\n; > EditorUI::onStopPlaytest @ 0x3874c8\n; > EditorUI::keyDown @ 0x3a7738\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\nLDR             R3, =(__stack_chk_guard_ptr - 0x37D9CE)                ; +0x0, 0x37d9c4\nPUSH.W          {R4-R11,LR}                                            ; +0x2, 0x37d9c6\nADD             R3, PC; __stack_chk_guard_ptr                          ; +0x6, 0x37d9ca\nLDR             R3, [R3]; __stack_chk_guard                            ; +0x8, 0x37d9cc\nSUB             SP, SP, #0x34                                          ; +0xa, 0x37d9ce\nMOV             R4, R0                                                 ; +0xc, 0x37d9d0\nLDR             R2, [R3]                                               ; +0xe, 0x37d9d2\nSTR             R3, [SP,#0x34+var_24]                                  ; +0x10, 0x37d9d4\nSTR             R2, [SP,#0x34+var_8]                                   ; +0x12, 0x37d9d6\nLDRB.W          R2, [R0,#0x3BC]                                        ; +0x14, 0x37d9d8\nCMP             R2, #0                                                 ; +0x18, 0x37d9dc\nBNE.W           loc_37DB6C                                             ; +0x1a, 0x37d9de\nLDR.W           R0, [R0,#0x340]; this                                  ; +0x1e, 0x37d9e2\nLDR.W           R6, [R0,#0x60C]                                        ; +0x22, 0x37d9e6\nCMP             R6, #0                                                 ; +0x26, 0x37d9ea\nBNE.W           loc_37DB6C                                             ; +0x28, 0x37d9ec\nBL              _ZN15GJBaseGameLayer13preResumeGameEv; GJBaseGameLayer::preResumeGame(void) ; +0x2c, 0x37d9f0\nLDR.W           R0, [R4,#0x340]; this                                  ; +0x30, 0x37d9f4\nLDRB.W          R3, [R4,#0x1BC]                                        ; +0x34, 0x37d9f8\nSTRB.W          R6, [R0,#0x5E0]                                        ; +0x38, 0x37d9fc\nCBNZ            R3, loc_37DA0C                                         ; +0x3c, 0x37da00\nBL              _ZN15GJBaseGameLayer10pauseAudioEv; GJBaseGameLayer::pauseAudio(void) ; +0x3e, 0x37da02\nMOV.W           R9, #1                                                 ; +0x42, 0x37da06\nB               loc_37DA0E                                             ; +0x46, 0x37da0a\nMOV             R9, R6                                                 ; +0x48, 0x37da0c\nLDR.W           R0, [R4,#0x340]; this                                  ; +0x4a, 0x37da0e\nBL              _ZN16LevelEditorLayer13resetPlaybackEv; LevelEditorLayer::resetPlayback(void) ; +0x4e, 0x37da12\nLDRB.W          R3, [R4,#0x1BC]                                        ; +0x52, 0x37da16\nCBZ             R3, loc_37DA32                                         ; +0x56, 0x37da1a\nLDR.W           R0, [R4,#0x340]; this                                  ; +0x58, 0x37da1c\nBL              _ZN16LevelEditorLayer12stopPlaybackEv; LevelEditorLayer::stopPlayback(void) ; +0x5c, 0x37da20\nLDR.W           R2, [R4,#0x340]                                        ; +0x60, 0x37da24\nMOVW            R3, #0x2E68                                            ; +0x64, 0x37da28\nMOVS            R1, #1                                                 ; +0x68, 0x37da2c\nSTRB            R1, [R2,R3]                                            ; +0x6a, 0x37da2e\nB               loc_37DB26                                             ; +0x6c, 0x37da30\nLDR.W           R2, [R4,#0x340]                                        ; +0x6e, 0x37da32\nMOVW            R3, #0x2EAC                                            ; +0x72, 0x37da36\nADD             R6, SP, #0x34+var_18                                   ; +0x76, 0x37da3a\nADD.W           R10, SP, #0x34+var_10                                  ; +0x78, 0x37da3c\nLDR             R0, [R2,R3]; this                                      ; +0x7c, 0x37da40\nBL              _ZN13DrawGridLayer17updateTimeMarkersEv; DrawGridLayer::updateTimeMarkers(void) ; +0x7e, 0x37da42\nLDR.W           R3, [R4,#0x340]                                        ; +0x82, 0x37da46\nLDR             R2, =(flt_AC5D38 - 0x37DA56)                           ; +0x86, 0x37da4a\nMOV             R0, R6; this                                           ; +0x88, 0x37da4c\nLDR.W           R1, [R3,#0x9F0]; cocos2d::CCPoint *                    ; +0x8a, 0x37da4e\nADD             R2, PC; flt_AC5D38                                     ; +0x8e, 0x37da52\nBL              _ZN7cocos2d6CCNode18convertToNodeSpaceERKNS_7CCPointE; cocos2d::CCNode::convertToNodeSpace(cocos2d::CCPoint const&) ; +0x90, 0x37da54\nVMOV.F32        S14, #30.0                                             ; +0x94, 0x37da58\nVLDR            S15, [SP,#0x34+var_18]                                 ; +0x98, 0x37da5c\nLDR.W           R1, [R4,#0x340]                                        ; +0x9c, 0x37da60\nVADD.F32        S15, S15, S14                                          ; +0xa0, 0x37da64\nVLDR            S14, =50.0                                             ; +0xa4, 0x37da68\nVCMPE.F32       S15, S14                                               ; +0xa8, 0x37da6c\nVMRS            APSR_nzcv, FPSCR                                       ; +0xac, 0x37da70\nITT MI                                                                 ; +0xb0, 0x37da74\nMOVMI           R3, #0                                                 ; +0xb2, 0x37da76\nSTRMI           R3, [SP,#0x34+var_18]                                  ; +0xb4, 0x37da78\nMOVW            R3, #0x2FA4                                            ; +0xb6, 0x37da7a\nLDR             R5, [R1,R3]                                            ; +0xba, 0x37da7e\nCBZ             R5, loc_37DAB2                                         ; +0xbc, 0x37da80\nMOV             R0, R10; this                                          ; +0xbe, 0x37da82\nBL              _ZN16LevelEditorLayer20getSelectedEffectPosEv; LevelEditorLayer::getSelectedEffectPos(void) ; +0xc0, 0x37da84\nMOV             R1, R10                                                ; +0xc4, 0x37da88\nMOV             R0, R6                                                 ; +0xc6, 0x37da8a\nBL              _ZN7cocos2d7CCPointaSERKS0_; cocos2d::CCPoint::operator=(cocos2d::CCPoint const&) ; +0xc8, 0x37da8c\nLDR.W           R0, [R4,#0x340]; this                                  ; +0xcc, 0x37da90\nBL              _ZN16LevelEditorLayer22getSelectedEditorOrderEv; LevelEditorLayer::getSelectedEditorOrder(void) ; +0xd0, 0x37da94\nMOV             R11, R0                                                ; +0xd4, 0x37da98\nLDR.W           R0, [R4,#0x340]; this                                  ; +0xd6, 0x37da9a\nBL              _ZN16LevelEditorLayer23getSelectedOrderChannelEv; LevelEditorLayer::getSelectedOrderChannel(void) ; +0xda, 0x37da9e\nLDR.W           R2, [R4,#0x340]                                        ; +0xde, 0x37daa2\nMOVW            R3, #0x2FB0                                            ; +0xe2, 0x37daa6\nSTR.W           R11, [R2,R3]                                           ; +0xe6, 0x37daaa\nMOV             R5, R0                                                 ; +0xea, 0x37daae\nB               loc_37DAB4                                             ; +0xec, 0x37dab0\nMOV             R11, R5                                                ; +0xee, 0x37dab2\nLDR.W           R3, [R4,#0x340]                                        ; +0xf0, 0x37dab4\nMOVW            R8, #0x2EAC                                            ; +0xf4, 0x37dab8\nADD             R7, SP, #0x34+var_18                                   ; +0xf8, 0x37dabc\nMOV             R0, R10; this                                          ; +0xfa, 0x37dabe\nMOVS            R6, #0                                                 ; +0xfc, 0x37dac0\nLDR.W           R3, [R3,R8]                                            ; +0xfe, 0x37dac2\nMOV             R1, R7; cocos2d::CCPoint *                             ; +0x102, 0x37dac6\nSTR             R3, [SP,#0x34+var_20]                                  ; +0x104, 0x37dac8\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0x106, 0x37daca\nLDR             R3, [SP,#0x34+var_20]                                  ; +0x10a, 0x37dace\nMOVS            R2, #1                                                 ; +0x10c, 0x37dad0\nMOV             R1, R10                                                ; +0x10e, 0x37dad2\nSTR             R2, [SP,#0x34+var_30]                                  ; +0x110, 0x37dad4\nSTR             R6, [SP,#0x34+var_34]                                  ; +0x112, 0x37dad6\nMOV             R2, R11                                                ; +0x114, 0x37dad8\nMOV             R0, R3                                                 ; +0x116, 0x37dada\nSTR             R6, [SP,#0x34+var_2C]                                  ; +0x118, 0x37dadc\nMOV             R3, R5                                                 ; +0x11a, 0x37dade\nSTR             R6, [SP,#0x34+var_28]                                  ; +0x11c, 0x37dae0\nBL              _ZN13DrawGridLayer10timeForPosEN7cocos2d7CCPointEiibbbi; DrawGridLayer::timeForPos(cocos2d::CCPoint,int,int,bool,bool,bool,int) ; +0x11e, 0x37dae2\nLDR.W           R3, [R4,#0x340]                                        ; +0x122, 0x37dae6\nMOV             R1, R7; cocos2d::CCPoint *                             ; +0x126, 0x37daea\nLDR.W           R3, [R3,R8]                                            ; +0x128, 0x37daec\nSTR             R3, [SP,#0x34+var_20]                                  ; +0x12c, 0x37daf0\nSTR.W           R0, [R4,#0x1DC]                                        ; +0x12e, 0x37daf2\nMOV             R0, R10; this                                          ; +0x132, 0x37daf6\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0x134, 0x37daf8\nLDR             R3, [SP,#0x34+var_20]                                  ; +0x138, 0x37dafc\nMOV             R1, R10                                                ; +0x13a, 0x37dafe\nSTR             R6, [SP,#0x34+var_34]                                  ; +0x13c, 0x37db00\nSTR             R6, [SP,#0x34+var_30]                                  ; +0x13e, 0x37db02\nMOV             R2, R11                                                ; +0x140, 0x37db04\nMOV             R0, R3                                                 ; +0x142, 0x37db06\nSTR             R6, [SP,#0x34+var_2C]                                  ; +0x144, 0x37db08\nMOV             R3, R5                                                 ; +0x146, 0x37db0a\nSTR             R6, [SP,#0x34+var_28]                                  ; +0x148, 0x37db0c\nBL              _ZN13DrawGridLayer10timeForPosEN7cocos2d7CCPointEiibbbi; DrawGridLayer::timeForPos(cocos2d::CCPoint,int,int,bool,bool,bool,int) ; +0x14a, 0x37db0e\nLDR.W           R3, [R4,#0x340]                                        ; +0x14e, 0x37db12\nLDR.W           R1, [R4,#0x1DC]; float                                 ; +0x152, 0x37db16\nSTR.W           R0, [R4,#0x1E0]                                        ; +0x156, 0x37db1a\nLDR.W           R0, [R3,R8]; this                                      ; +0x15a, 0x37db1e\nBL              _ZN13DrawGridLayer20updateMusicGuideTimeEf; DrawGridLayer::updateMusicGuideTime(float) ; +0x15e, 0x37db22\nLDRB.W          R5, [R4,#0x1BC]                                        ; +0x162, 0x37db26\nMOV             R0, R4; this                                           ; +0x166, 0x37db2a\nEOR.W           R5, R5, #1                                             ; +0x168, 0x37db2c\nSTRB.W          R5, [R4,#0x1BC]                                        ; +0x16c, 0x37db30\nBL              _ZN8EditorUI17updatePlaybackBtnEv; EditorUI::updatePlaybackBtn(void) ; +0x170, 0x37db34\nLDRB.W          R3, [R4,#0x1BC]                                        ; +0x174, 0x37db38\nCBZ             R3, loc_37DB5A                                         ; +0x178, 0x37db3c\nBL              _ZN15FMODAudioEngine12sharedEngineEv; FMODAudioEngine::sharedEngine(void) ; +0x17a, 0x37db3e\nMOVS            R1, #0                                                 ; +0x17e, 0x37db42\nMOV             R2, R1                                                 ; +0x180, 0x37db44\nBL              _ZN15FMODAudioEngine12updateReverbE16FMODReverbPresetb; FMODAudioEngine::updateReverb(FMODReverbPreset,bool) ; +0x182, 0x37db46\nLDR.W           R0, [R4,#0x340]; this                                  ; +0x186, 0x37db4a\nBL              _ZN16LevelEditorLayer17updateGameObjectsEv; LevelEditorLayer::updateGameObjects(void) ; +0x18a, 0x37db4e\nLDR.W           R0, [R4,#0x340]; this                                  ; +0x18e, 0x37db52\nBL              _ZN15GJBaseGameLayer26processQueuedAudioTriggersEv; GJBaseGameLayer::processQueuedAudioTriggers(void) ; +0x192, 0x37db56\nCMP.W           R9, #0                                                 ; +0x196, 0x37db5a\nBEQ             loc_37DB6C                                             ; +0x19a, 0x37db5e\nLDR.W           R2, [R4,#0x340]                                        ; +0x19c, 0x37db60\nMOVW            R3, #0x2DCA                                            ; +0x1a0, 0x37db64\nMOVS            R1, #1                                                 ; +0x1a4, 0x37db68\nSTRB            R1, [R2,R3]                                            ; +0x1a6, 0x37db6a\nLDR             R3, [SP,#0x34+var_24]                                  ; +0x1a8, 0x37db6c\nLDR             R2, [SP,#0x34+var_8]                                   ; +0x1aa, 0x37db6e\nLDR             R3, [R3]                                               ; +0x1ac, 0x37db70\nCMP             R2, R3                                                 ; +0x1ae, 0x37db72\nBEQ             loc_37DB7A                                             ; +0x1b0, 0x37db74\nBLX             __stack_chk_fail                                       ; +0x1b2, 0x37db76\nADD             SP, SP, #0x34 ; '4'                                    ; +0x1b6, 0x37db7a\nPOP.W           {R4-R11,PC}                                            ; +0x1b8, 0x37db7c", "xrefs": ["EditorUI::onStopPlaytest @ 0x3874c8", "EditorUI::keyDown @ 0x3a7738"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}