{"type": "func", "start": 5371075664, "end": 5371076173, "name": "GJBaseGameLayer::activateSFXTrigger", "pseudocode": "// \n// GJBaseGameLayer::activateSFXTrigger from 0x140241c50 to 0x140241e4d (509 bytes)\n// \n// 5 xrefs:\n// > GJBaseGameLayer::processQueuedAudioTriggers @ 0x14023bc02\n// > GJBaseGameLayer::processActivatedAudioTriggers @ 0x140244a70\n// > LevelEditorLayer::activateTriggerEffect @ 0x1402dd5b6\n// > EffectGameObject::triggerObject @ 0x1404a79c8\n// > <???> @ 0x1406ce460\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\n// Hidden C++ exception states: #wind=2\nvoid GJBaseGameLayer::activateSFXTrigger(GJBaseGameLayer *a1, SFXTriggerGameObject *a2)\n{\n  std::vector<SFXTriggerGameObject *> *p_m_activeSfxTriggers; // rcx\n  _BYTE *Mylast; // rdx\n  int m_targetGroupID; // edx\n  int m_controlID; // ecx\n  int m_centerGroupID; // eax\n  bool m_preload; // bp\n  FMODAudioEngine *v10; // rcx\n  int v11; // esi\n  __int64 v12; // rax\n  __int64 v13; // rcx\n  _BYTE *v14; // rdx\n  SFXTriggerInstance v15[2]; // [rsp+20h] [rbp-38h] BYREF\n  FMODAudioEngine *v16; // [rsp+60h] [rbp+8h] BYREF\n  SFXTriggerGameObject *v17; // [rsp+68h] [rbp+10h] BYREF\n  int v18; // [rsp+70h] [rbp+18h] BYREF\n\n  v17 = a2;\n  if ( (a1->m_practiceMusicSync || !a1->m_isPracticeMode) && a2->m_soundID > 0 )\n  {\n    if ( a1->m_loadingStartPosition )\n    {\n      ((void (__fastcall *)(GJBaseGameLayer *))a1->activatedAudioTrigger)(a1);\n    }\n    else if ( a1->m_startingFromBeginning )\n    {\n      p_m_activeSfxTriggers = &a1->m_activeSfxTriggers;\n      Mylast = p_m_activeSfxTriggers->_Mypair._Myval2._Mylast;\n      if ( Mylast == (_BYTE *)p_m_activeSfxTriggers->_Mypair._Myval2._Myend )\n      {\n        sub_14012D2A0((const void **)&p_m_activeSfxTriggers->_Mypair._Myval2._Myfirst, Mylast, &v17);\n      }\n      else\n      {\n        *(_QWORD *)Mylast = a2;\n        ++p_m_activeSfxTriggers->_Mypair._Myval2._Mylast;\n      }\n    }\n    else if ( a2->m_ignoreVolumeTest\n           || (m_targetGroupID = a2->m_targetGroupID, m_targetGroupID <= 0)\n           || (m_controlID = a2->m_controlID,\n               m_centerGroupID = a2->m_centerGroupID,\n               v15[0].m_sfxTriggerGameObject = a2,\n               v15[0].m_groupID1 = m_targetGroupID,\n               v15[0].m_groupID2 = m_centerGroupID,\n               v15[0].m_controlID = m_controlID,\n               GJBaseGameLayer::volumeForProximityEffect(a1, v15) > 0.0) )\n    {\n      m_preload = a2->m_preload;\n      a2->m_preload = 0;\n      if ( a2->m_reverbEnabled )\n      {\n        v10 = (FMODAudioEngine *)qword_1406C2E88;\n        if ( !qword_1406C2E88 )\n        {\n          v16 = (FMODAudioEngine *)operator new(0x888u);\n          qword_1406C2E88 = (__int64)FMODAudioEngine::FMODAudioEngine(v16);\n          (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2E88 + 72LL))(qword_1406C2E88);\n          v10 = (FMODAudioEngine *)qword_1406C2E88;\n        }\n        FMODAudioEngine::updateReverb(v10, a2->m_reverbPreset, 0);\n      }\n      if ( !qword_1406C2ED8 )\n      {\n        v16 = (FMODAudioEngine *)operator new(0x668u);\n        qword_1406C2ED8 = sub_14017AB00((__int64)v16);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n      }\n      v11 = GameManager::playSFXTrigger((GameManager *)a1, a2);\n      v18 = v11;\n      a2->m_preload = m_preload;\n      if ( v11 > 0 )\n      {\n        LODWORD(v16) = a2->m_uniqueID;\n        v12 = sub_140250040(&a1->m_gameState.m_unkUMap8, v15, &v16);\n        v13 = *(_QWORD *)v12 + 24LL;\n        v14 = *(_BYTE **)(*(_QWORD *)v12 + 32LL);\n        if ( v14 == *(_BYTE **)(*(_QWORD *)v12 + 40LL) )\n        {\n          sub_140063270((const void **)v13, v14, &v18);\n        }\n        else\n        {\n          *(_DWORD *)v14 = v11;\n          *(_QWORD *)(v13 + 8) += 4LL;\n        }\n        if ( a2->m_targetGroupID > 0 )\n          GJBaseGameLayer::addProximityVolumeEffect(a1, v11, 0, a2);\n      }\n    }\n  }\n}", "assembly": "; \n; GJBaseGameLayer::activateSFXTrigger from 0x140241c50 to 0x140241e4d (509 bytes)\n; \n; 5 xrefs:\n; > GJBaseGameLayer::processQueuedAudioTriggers @ 0x14023bc02\n; > GJBaseGameLayer::processActivatedAudioTriggers @ 0x140244a70\n; > LevelEditorLayer::activateTriggerEffect @ 0x1402dd5b6\n; > EffectGameObject::triggerObject @ 0x1404a79c8\n; > <???> @ 0x1406ce460\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\nmov     [rsp+arg_18], rbx                                              ; +0x0, 0x140241c50\nmov     [rsp+arg_8], rdx                                               ; +0x5, 0x140241c55\npush    rbp                                                            ; +0xa, 0x140241c5a\npush    rsi                                                            ; +0xb, 0x140241c5b\npush    rdi                                                            ; +0xc, 0x140241c5c\nsub     rsp, 40h                                                       ; +0xd, 0x140241c5d\nmov     rbx, rdx                                                       ; +0x11, 0x140241c61\nmov     rdi, rcx                                                       ; +0x14, 0x140241c64\ncmp     byte ptr [rcx+31F1h], 0                                        ; +0x17, 0x140241c67\njnz     short loc_140241C79                                            ; +0x1e, 0x140241c6e\ncmp     byte ptr [rcx+31F0h], 0                                        ; +0x20, 0x140241c70\njnz     short loc_140241C94                                            ; +0x27, 0x140241c77\ncmp     dword ptr [rdx+760h], 0                                        ; +0x29, 0x140241c79\njle     short loc_140241C94                                            ; +0x30, 0x140241c80\ncmp     byte ptr [rcx+3764h], 0                                        ; +0x32, 0x140241c82\njz      short loc_140241CA3                                            ; +0x39, 0x140241c89\nmov     rax, [rcx]                                                     ; +0x3b, 0x140241c8b\ncall    qword ptr [rax+528h]                                           ; +0x3e, 0x140241c8e\nxor     eax, eax                                                       ; +0x44, 0x140241c94\nmov     rbx, [rsp+58h+arg_18]                                          ; +0x46, 0x140241c96\nadd     rsp, 40h                                                       ; +0x4b, 0x140241c9b\npop     rdi                                                            ; +0x4f, 0x140241c9f\npop     rsi                                                            ; +0x50, 0x140241ca0\npop     rbp                                                            ; +0x51, 0x140241ca1\nretn                                                                   ; +0x52, 0x140241ca2\ncmp     byte ptr [rcx+88Ah], 0                                         ; +0x53, 0x140241ca3\njz      short loc_140241CED                                            ; +0x5a, 0x140241caa\nadd     rcx, 890h                                                      ; +0x5c, 0x140241cac\nmov     rdx, [rcx+8]                                                   ; +0x63, 0x140241cb3\ncmp     rdx, [rcx+10h]                                                 ; +0x67, 0x140241cb7\njz      short loc_140241CD4                                            ; +0x6b, 0x140241cbb\nmov     [rdx], rbx                                                     ; +0x6d, 0x140241cbd\nadd     qword ptr [rcx+8], 8                                           ; +0x70, 0x140241cc0\nxor     eax, eax                                                       ; +0x75, 0x140241cc5\nmov     rbx, [rsp+58h+arg_18]                                          ; +0x77, 0x140241cc7\nadd     rsp, 40h                                                       ; +0x7c, 0x140241ccc\npop     rdi                                                            ; +0x80, 0x140241cd0\npop     rsi                                                            ; +0x81, 0x140241cd1\npop     rbp                                                            ; +0x82, 0x140241cd2\nretn                                                                   ; +0x83, 0x140241cd3\nlea     r8, [rsp+58h+arg_8]                                            ; +0x84, 0x140241cd4\ncall    sub_14012D2A0                                                  ; +0x89, 0x140241cd9\nxor     eax, eax                                                       ; +0x8e, 0x140241cde\nmov     rbx, [rsp+58h+arg_18]                                          ; +0x90, 0x140241ce0\nadd     rsp, 40h                                                       ; +0x95, 0x140241ce5\npop     rdi                                                            ; +0x99, 0x140241ce9\npop     rsi                                                            ; +0x9a, 0x140241cea\npop     rbp                                                            ; +0x9b, 0x140241ceb\nretn                                                                   ; +0x9c, 0x140241cec\ncmp     byte ptr [rdx+7AEh], 0                                         ; +0x9d, 0x140241ced\njnz     short loc_140241D36                                            ; +0xa4, 0x140241cf4\nmov     edx, [rdx+5C8h]                                                ; +0xa6, 0x140241cf6\ntest    edx, edx                                                       ; +0xac, 0x140241cfc\njle     short loc_140241D36                                            ; +0xae, 0x140241cfe\nmov     ecx, [rbx+698h]                                                ; +0xb0, 0x140241d00\nmov     eax, [rbx+5CCh]                                                ; +0xb6, 0x140241d06\nmov     [rsp+58h+var_28], rbx                                          ; +0xbc, 0x140241d0c\nmov     [rsp+58h+var_38], edx                                          ; +0xc1, 0x140241d11\nmov     [rsp+58h+var_34], eax                                          ; +0xc5, 0x140241d15\nmov     [rsp+58h+var_30], ecx                                          ; +0xc9, 0x140241d19\nlea     rdx, [rsp+58h+var_38]                                          ; +0xcd, 0x140241d1d\nmov     rcx, rdi                                                       ; +0xd2, 0x140241d22\ncall    GJBaseGameLayer__volumeForProximityEffect                      ; +0xd5, 0x140241d25\nxorps   xmm1, xmm1                                                     ; +0xda, 0x140241d2a\ncomiss  xmm1, xmm0                                                     ; +0xdd, 0x140241d2d\njnb     loc_140241C94                                                  ; +0xe0, 0x140241d30\nmovzx   ebp, byte ptr [rbx+7ADh]                                       ; +0xe6, 0x140241d36\nmov     byte ptr [rbx+7ADh], 0                                         ; +0xed, 0x140241d3d\ncmp     byte ptr [rbx+7C8h], 0                                         ; +0xf4, 0x140241d44\njz      short loc_140241D96                                            ; +0xfb, 0x140241d4b\nmov     rcx, cs:qword_1406C2E88                                        ; +0xfd, 0x140241d4d\ntest    rcx, rcx                                                       ; +0x104, 0x140241d54\njnz     short loc_140241D88                                            ; +0x107, 0x140241d57\nmov     ecx, 888h; Size                                                ; +0x109, 0x140241d59\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x10e, 0x140241d5e\nmov     [rsp+58h+arg_0], rax                                           ; +0x113, 0x140241d63\nmov     rcx, rax                                                       ; +0x118, 0x140241d68\ncall    FMODAudioEngine__FMODAudioEngine                               ; +0x11b, 0x140241d6b\nnop                                                                    ; +0x120, 0x140241d70\nmov     cs:qword_1406C2E88, rax                                        ; +0x121, 0x140241d71\nmov     rdx, [rax]                                                     ; +0x128, 0x140241d78\nmov     rcx, rax                                                       ; +0x12b, 0x140241d7b\ncall    qword ptr [rdx+48h]                                            ; +0x12e, 0x140241d7e\nmov     rcx, cs:qword_1406C2E88                                        ; +0x131, 0x140241d81\nxor     r8d, r8d                                                       ; +0x138, 0x140241d88\nmov     edx, [rbx+7C4h]                                                ; +0x13b, 0x140241d8b\ncall    FMODAudioEngine__updateReverb                                  ; +0x141, 0x140241d91\ncmp     cs:qword_1406C2ED8, 0                                          ; +0x146, 0x140241d96\njnz     short loc_140241DC8                                            ; +0x14e, 0x140241d9e\nmov     ecx, 668h; Size                                                ; +0x150, 0x140241da0\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x155, 0x140241da5\nmov     [rsp+58h+arg_0], rax                                           ; +0x15a, 0x140241daa\nmov     rcx, rax                                                       ; +0x15f, 0x140241daf\ncall    sub_14017AB00                                                  ; +0x162, 0x140241db2\nnop                                                                    ; +0x167, 0x140241db7\nmov     cs:qword_1406C2ED8, rax                                        ; +0x168, 0x140241db8\nmov     rdx, [rax]                                                     ; +0x16f, 0x140241dbf\nmov     rcx, rax                                                       ; +0x172, 0x140241dc2\ncall    qword ptr [rdx+48h]                                            ; +0x175, 0x140241dc5\nmov     rdx, rbx                                                       ; +0x178, 0x140241dc8\ncall    GameManager__playSFXTrigger                                    ; +0x17b, 0x140241dcb\nmov     esi, eax                                                       ; +0x180, 0x140241dd0\nmov     [rsp+58h+arg_10], eax                                          ; +0x182, 0x140241dd2\nmov     [rbx+7ADh], bpl                                                ; +0x186, 0x140241dd6\ntest    eax, eax                                                       ; +0x18d, 0x140241ddd\njle     short loc_140241E3E                                            ; +0x18f, 0x140241ddf\nmov     eax, [rbx+39Ch]                                                ; +0x191, 0x140241de1\nmov     dword ptr [rsp+58h+arg_0], eax                                 ; +0x197, 0x140241de7\nlea     rcx, [rdi+768h]                                                ; +0x19b, 0x140241deb\nlea     r8, [rsp+58h+arg_0]                                            ; +0x1a2, 0x140241df2\nlea     rdx, [rsp+58h+var_38]                                          ; +0x1a7, 0x140241df7\ncall    sub_140250040                                                  ; +0x1ac, 0x140241dfc\nmov     rcx, [rax]                                                     ; +0x1b1, 0x140241e01\nadd     rcx, 18h                                                       ; +0x1b4, 0x140241e04\nmov     rdx, [rcx+8]                                                   ; +0x1b8, 0x140241e08\ncmp     rdx, [rcx+10h]                                                 ; +0x1bc, 0x140241e0c\njz      short loc_140241E1B                                            ; +0x1c0, 0x140241e10\nmov     [rdx], esi                                                     ; +0x1c2, 0x140241e12\nadd     qword ptr [rcx+8], 4                                           ; +0x1c4, 0x140241e14\njmp     short loc_140241E25                                            ; +0x1c9, 0x140241e19\nlea     r8, [rsp+58h+arg_10]                                           ; +0x1cb, 0x140241e1b\ncall    sub_140063270                                                  ; +0x1d0, 0x140241e20\ncmp     dword ptr [rbx+5C8h], 0                                        ; +0x1d5, 0x140241e25\njle     short loc_140241E3E                                            ; +0x1dc, 0x140241e2c\nmov     r9, rbx                                                        ; +0x1de, 0x140241e2e\nxor     r8d, r8d                                                       ; +0x1e1, 0x140241e31\nmov     edx, esi                                                       ; +0x1e4, 0x140241e34\nmov     rcx, rdi                                                       ; +0x1e6, 0x140241e36\ncall    GJBaseGameLayer__addProximityVolumeEffect                      ; +0x1e9, 0x140241e39\nmov     eax, esi                                                       ; +0x1ee, 0x140241e3e\nmov     rbx, [rsp+58h+arg_18]                                          ; +0x1f0, 0x140241e40\nadd     rsp, 40h                                                       ; +0x1f5, 0x140241e45\npop     rdi                                                            ; +0x1f9, 0x140241e49\npop     rsi                                                            ; +0x1fa, 0x140241e4a\npop     rbp                                                            ; +0x1fb, 0x140241e4b\nretn                                                                   ; +0x1fc, 0x140241e4c", "xrefs": ["GJBaseGameLayer::processQueuedAudioTriggers @ 0x14023bc02", "GJBaseGameLayer::processActivatedAudioTriggers @ 0x140244a70", "LevelEditorLayer::activateTriggerEffect @ 0x1402dd5b6", "EffectGameObject::triggerObject @ 0x1404a79c8", "<???> @ 0x1406ce460"], "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"}