{"type": "func", "start": 5372165504, "end": 5372166028, "name": "GJBaseGameLayer::activateSFXTrigger", "pseudocode": "// \n// GJBaseGameLayer::activateSFXTrigger from 0x14034bd80 to 0x14034bf8c (524 bytes)\n// \n// 5 xrefs:\n// > GJBaseGameLayer::processQueuedAudioTriggers @ 0x140345b78\n// > GJBaseGameLayer::processActivatedAudioTriggers @ 0x14034ee03\n// > LevelEditorLayer::activateTriggerEffect @ 0x1403fbfa1\n// > EffectGameObject::triggerObject @ 0x14064949f\n// > <???> @ 0x140920078\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:30:44 +0000\n// \n\n// Hidden C++ exception states: #wind=2\n__int64 __fastcall GJBaseGameLayer::activateSFXTrigger(__int64 a1, __int64 a2)\n{\n  int v4; // eax\n  int v5; // eax\n  int v7; // eax\n  char v8; // bp\n  __int64 v9; // rcx\n  int v10; // esi\n  __int64 v11; // rax\n  __int64 v12; // rcx\n  _BYTE *v13; // rdx\n  _DWORD v14[4]; // [rsp+20h] [rbp-38h] BYREF\n  __int64 v15; // [rsp+30h] [rbp-28h]\n  void *v16; // [rsp+60h] [rbp+8h] BYREF\n  __int64 v17; // [rsp+68h] [rbp+10h] BYREF\n  int v18; // [rsp+70h] [rbp+18h] BYREF\n\n  v17 = a2;\n  if ( !*(_BYTE *)(a1 + 13025) && *(_BYTE *)(a1 + 13024) || *(int *)(a2 + 1888) <= 0 )\n    return 0;\n  v4 = *(_DWORD *)(a1 + 992);\n  if ( *(_DWORD *)(a1 + 13104) != v4 )\n  {\n    *(_DWORD *)(a1 + 13104) = v4;\n    *(_DWORD *)(a1 + 13100) = 0;\n  }\n  v5 = *(_DWORD *)(a1 + 13100);\n  if ( v5 > 100 )\n    return 0;\n  *(_DWORD *)(a1 + 13100) = v5 + 1;\n  if ( *(_BYTE *)(a1 + 14436) )\n  {\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 1368LL))(a1);\n    return 0;\n  }\n  if ( *(_BYTE *)(a1 + 2215) )\n  {\n    sub_1400BD3C0((const void **)(a1 + 2216), &v17);\n    return 0;\n  }\n  else\n  {\n    if ( !*(_BYTE *)(a2 + 1970) )\n    {\n      v7 = *(_DWORD *)(a2 + 1480);\n      if ( v7 > 0 )\n      {\n        v15 = a2;\n        v14[0] = v7;\n        v14[1] = *(_DWORD *)(a2 + 1484);\n        v14[2] = *(_DWORD *)(a2 + 1688);\n        if ( GJBaseGameLayer::volumeForProximityEffect(a1, v14) <= 0.0 )\n          return 0;\n      }\n    }\n    v8 = *(_BYTE *)(a2 + 1969);\n    *(_BYTE *)(a2 + 1969) = 0;\n    if ( *(_BYTE *)(a2 + 1996) )\n    {\n      v9 = qword_14090BF60;\n      if ( !qword_14090BF60 )\n      {\n        v16 = operator new(0x8A8u);\n        qword_14090BF60 = FMODAudioEngine::FMODAudioEngine((__int64)v16);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BF60 + 72LL))(qword_14090BF60);\n        v9 = qword_14090BF60;\n      }\n      FMODAudioEngine::updateReverb(v9, *(_DWORD *)(a2 + 1992), 0);\n    }\n    if ( !qword_14090BFD0 )\n    {\n      v16 = operator new(0x6E8u);\n      qword_14090BFD0 = GameManager::GameManager((__int64)v16);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);\n    }\n    v10 = GameManager::playSFXTrigger(a1, a2);\n    v18 = v10;\n    *(_BYTE *)(a2 + 1969) = v8;\n    if ( v10 > 0 )\n    {\n      LODWORD(v16) = *(_DWORD *)(a2 + 924);\n      v11 = sub_14018CB00((_QWORD *)(a1 + 1896), (__int64)v14, (unsigned __int8 *)&v16);\n      v12 = *(_QWORD *)v11 + 24LL;\n      v13 = *(_BYTE **)(*(_QWORD *)v11 + 32LL);\n      if ( v13 == *(_BYTE **)(*(_QWORD *)v11 + 40LL) )\n      {\n        sub_140069B30((const void **)v12, v13, &v18);\n      }\n      else\n      {\n        *(_DWORD *)v13 = v10;\n        *(_QWORD *)(v12 + 8) += 4LL;\n      }\n      if ( *(int *)(a2 + 1480) > 0 )\n        GJBaseGameLayer::addProximityVolumeEffect(a1, (unsigned int)v10, 0, a2);\n    }\n    return (unsigned int)v10;\n  }\n}", "assembly": "; \n; GJBaseGameLayer::activateSFXTrigger from 0x14034bd80 to 0x14034bf8c (524 bytes)\n; \n; 5 xrefs:\n; > GJBaseGameLayer::processQueuedAudioTriggers @ 0x140345b78\n; > GJBaseGameLayer::processActivatedAudioTriggers @ 0x14034ee03\n; > LevelEditorLayer::activateTriggerEffect @ 0x1403fbfa1\n; > EffectGameObject::triggerObject @ 0x14064949f\n; > <???> @ 0x140920078\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:30:44 +0000\n; \nmov     [rsp+arg_18], rbx                                              ; +0x0, 0x14034bd80\nmov     [rsp+arg_8], rdx                                               ; +0x5, 0x14034bd85\npush    rbp                                                            ; +0xa, 0x14034bd8a\npush    rsi                                                            ; +0xb, 0x14034bd8b\npush    rdi                                                            ; +0xc, 0x14034bd8c\nsub     rsp, 40h                                                       ; +0xd, 0x14034bd8d\nmov     rbx, rdx                                                       ; +0x11, 0x14034bd91\nmov     rdi, rcx                                                       ; +0x14, 0x14034bd94\ncmp     byte ptr [rcx+32E1h], 0                                        ; +0x17, 0x14034bd97\njnz     short loc_14034BDA9                                            ; +0x1e, 0x14034bd9e\ncmp     byte ptr [rcx+32E0h], 0                                        ; +0x20, 0x14034bda0\njnz     short loc_14034BDF5                                            ; +0x27, 0x14034bda7\ncmp     dword ptr [rdx+760h], 0                                        ; +0x29, 0x14034bda9\njle     short loc_14034BDF5                                            ; +0x30, 0x14034bdb0\nmov     eax, [rcx+3E0h]                                                ; +0x32, 0x14034bdb2\ncmp     [rcx+3330h], eax                                               ; +0x38, 0x14034bdb8\njz      short loc_14034BDD0                                            ; +0x3e, 0x14034bdbe\nmov     [rcx+3330h], eax                                               ; +0x40, 0x14034bdc0\nmov     dword ptr [rcx+332Ch], 0                                       ; +0x46, 0x14034bdc6\nmov     eax, [rcx+332Ch]                                               ; +0x50, 0x14034bdd0\ncmp     eax, 64h ; 'd'                                                 ; +0x56, 0x14034bdd6\njg      short loc_14034BDF5                                            ; +0x59, 0x14034bdd9\ninc     eax                                                            ; +0x5b, 0x14034bddb\nmov     [rcx+332Ch], eax                                               ; +0x5d, 0x14034bddd\ncmp     byte ptr [rcx+3864h], 0                                        ; +0x63, 0x14034bde3\njz      short loc_14034BE04                                            ; +0x6a, 0x14034bdea\nmov     rax, [rcx]                                                     ; +0x6c, 0x14034bdec\ncall    qword ptr [rax+558h]                                           ; +0x6f, 0x14034bdef\nxor     eax, eax                                                       ; +0x75, 0x14034bdf5\nmov     rbx, [rsp+58h+arg_18]                                          ; +0x77, 0x14034bdf7\nadd     rsp, 40h                                                       ; +0x7c, 0x14034bdfc\npop     rdi                                                            ; +0x80, 0x14034be00\npop     rsi                                                            ; +0x81, 0x14034be01\npop     rbp                                                            ; +0x82, 0x14034be02\nretn                                                                   ; +0x83, 0x14034be03\ncmp     byte ptr [rcx+8A7h], 0                                         ; +0x84, 0x14034be04\njz      short loc_14034BE2D                                            ; +0x8b, 0x14034be0b\nadd     rcx, 8A8h                                                      ; +0x8d, 0x14034be0d\nlea     rdx, [rsp+58h+arg_8]                                           ; +0x94, 0x14034be14\ncall    sub_1400BD3C0                                                  ; +0x99, 0x14034be19\nxor     eax, eax                                                       ; +0x9e, 0x14034be1e\nmov     rbx, [rsp+58h+arg_18]                                          ; +0xa0, 0x14034be20\nadd     rsp, 40h                                                       ; +0xa5, 0x14034be25\npop     rdi                                                            ; +0xa9, 0x14034be29\npop     rsi                                                            ; +0xaa, 0x14034be2a\npop     rbp                                                            ; +0xab, 0x14034be2b\nretn                                                                   ; +0xac, 0x14034be2c\ncmp     byte ptr [rdx+7B2h], 0                                         ; +0xad, 0x14034be2d\njnz     short loc_14034BE6F                                            ; +0xb4, 0x14034be34\nmov     eax, [rdx+5C8h]                                                ; +0xb6, 0x14034be36\ntest    eax, eax                                                       ; +0xbc, 0x14034be3c\njle     short loc_14034BE6F                                            ; +0xbe, 0x14034be3e\nmov     [rsp+58h+var_28], rbx                                          ; +0xc0, 0x14034be40\nmov     [rsp+58h+var_38], eax                                          ; +0xc5, 0x14034be45\nmov     eax, [rdx+5CCh]                                                ; +0xc9, 0x14034be49\nmov     [rsp+58h+var_34], eax                                          ; +0xcf, 0x14034be4f\nmov     eax, [rdx+698h]                                                ; +0xd3, 0x14034be53\nmov     [rsp+58h+var_30], eax                                          ; +0xd9, 0x14034be59\nlea     rdx, [rsp+58h+var_38]                                          ; +0xdd, 0x14034be5d\ncall    GJBaseGameLayer__volumeForProximityEffect                      ; +0xe2, 0x14034be62\nxorps   xmm1, xmm1                                                     ; +0xe7, 0x14034be67\ncomiss  xmm1, xmm0                                                     ; +0xea, 0x14034be6a\njnb     short loc_14034BDF5                                            ; +0xed, 0x14034be6d\nmovzx   ebp, byte ptr [rbx+7B1h]                                       ; +0xef, 0x14034be6f\nmov     byte ptr [rbx+7B1h], 0                                         ; +0xf6, 0x14034be76\ncmp     byte ptr [rbx+7CCh], 0                                         ; +0xfd, 0x14034be7d\njz      short loc_14034BED2                                            ; +0x104, 0x14034be84\nmov     rcx, cs:qword_14090BF60                                        ; +0x106, 0x14034be86\ntest    rcx, rcx                                                       ; +0x10d, 0x14034be8d\njnz     short loc_14034BEC4                                            ; +0x110, 0x14034be90\nmov     ecx, 8A8h; Size                                                ; +0x112, 0x14034be92\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x117, 0x14034be97\nmov     [rsp+58h+arg_0], rax                                           ; +0x11c, 0x14034be9c\nmov     rcx, rax                                                       ; +0x121, 0x14034bea1\ncall    FMODAudioEngine__FMODAudioEngine                               ; +0x124, 0x14034bea4\nnop                                                                    ; +0x129, 0x14034bea9\nmov     cs:qword_14090BF60, rax                                        ; +0x12a, 0x14034beaa\nmov     rcx, [rax]                                                     ; +0x131, 0x14034beb1\nmov     rdx, [rcx+48h]                                                 ; +0x134, 0x14034beb4\nmov     rcx, rax                                                       ; +0x138, 0x14034beb8\ncall    rdx                                                            ; +0x13b, 0x14034bebb\nmov     rcx, cs:qword_14090BF60                                        ; +0x13d, 0x14034bebd\nxor     r8d, r8d                                                       ; +0x144, 0x14034bec4\nmov     edx, [rbx+7C8h]                                                ; +0x147, 0x14034bec7\ncall    FMODAudioEngine__updateReverb                                  ; +0x14d, 0x14034becd\ncmp     cs:qword_14090BFD0, 0                                          ; +0x152, 0x14034bed2\njnz     short loc_14034BF07                                            ; +0x15a, 0x14034beda\nmov     ecx, 6E8h; Size                                                ; +0x15c, 0x14034bedc\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x161, 0x14034bee1\nmov     [rsp+58h+arg_0], rax                                           ; +0x166, 0x14034bee6\nmov     rcx, rax                                                       ; +0x16b, 0x14034beeb\ncall    GameManager__GameManager                                       ; +0x16e, 0x14034beee\nnop                                                                    ; +0x173, 0x14034bef3\nmov     cs:qword_14090BFD0, rax                                        ; +0x174, 0x14034bef4\nmov     rcx, [rax]                                                     ; +0x17b, 0x14034befb\nmov     rdx, [rcx+48h]                                                 ; +0x17e, 0x14034befe\nmov     rcx, rax                                                       ; +0x182, 0x14034bf02\ncall    rdx                                                            ; +0x185, 0x14034bf05\nmov     rdx, rbx                                                       ; +0x187, 0x14034bf07\ncall    GameManager__playSFXTrigger                                    ; +0x18a, 0x14034bf0a\nmov     esi, eax                                                       ; +0x18f, 0x14034bf0f\nmov     [rsp+58h+arg_10], eax                                          ; +0x191, 0x14034bf11\nmov     [rbx+7B1h], bpl                                                ; +0x195, 0x14034bf15\ntest    eax, eax                                                       ; +0x19c, 0x14034bf1c\njle     short loc_14034BF7D                                            ; +0x19e, 0x14034bf1e\nmov     eax, [rbx+39Ch]                                                ; +0x1a0, 0x14034bf20\nmov     dword ptr [rsp+58h+arg_0], eax                                 ; +0x1a6, 0x14034bf26\nlea     rcx, [rdi+768h]                                                ; +0x1aa, 0x14034bf2a\nlea     r8, [rsp+58h+arg_0]                                            ; +0x1b1, 0x14034bf31\nlea     rdx, [rsp+58h+var_38]                                          ; +0x1b6, 0x14034bf36\ncall    sub_14018CB00                                                  ; +0x1bb, 0x14034bf3b\nmov     rcx, [rax]                                                     ; +0x1c0, 0x14034bf40\nadd     rcx, 18h                                                       ; +0x1c3, 0x14034bf43\nmov     rdx, [rcx+8]                                                   ; +0x1c7, 0x14034bf47\ncmp     rdx, [rcx+10h]                                                 ; +0x1cb, 0x14034bf4b\njz      short loc_14034BF5A                                            ; +0x1cf, 0x14034bf4f\nmov     [rdx], esi                                                     ; +0x1d1, 0x14034bf51\nadd     qword ptr [rcx+8], 4                                           ; +0x1d3, 0x14034bf53\njmp     short loc_14034BF64                                            ; +0x1d8, 0x14034bf58\nlea     r8, [rsp+58h+arg_10]                                           ; +0x1da, 0x14034bf5a\ncall    sub_140069B30                                                  ; +0x1df, 0x14034bf5f\ncmp     dword ptr [rbx+5C8h], 0                                        ; +0x1e4, 0x14034bf64\njle     short loc_14034BF7D                                            ; +0x1eb, 0x14034bf6b\nmov     r9, rbx                                                        ; +0x1ed, 0x14034bf6d\nxor     r8d, r8d                                                       ; +0x1f0, 0x14034bf70\nmov     edx, esi                                                       ; +0x1f3, 0x14034bf73\nmov     rcx, rdi                                                       ; +0x1f5, 0x14034bf75\ncall    GJBaseGameLayer__addProximityVolumeEffect                      ; +0x1f8, 0x14034bf78\nmov     eax, esi                                                       ; +0x1fd, 0x14034bf7d\nmov     rbx, [rsp+58h+arg_18]                                          ; +0x1ff, 0x14034bf7f\nadd     rsp, 40h                                                       ; +0x204, 0x14034bf84\npop     rdi                                                            ; +0x208, 0x14034bf88\npop     rsi                                                            ; +0x209, 0x14034bf89\npop     rbp                                                            ; +0x20a, 0x14034bf8a\nretn                                                                   ; +0x20b, 0x14034bf8b", "xrefs": ["GJBaseGameLayer::processQueuedAudioTriggers @ 0x140345b78", "GJBaseGameLayer::processActivatedAudioTriggers @ 0x14034ee03", "LevelEditorLayer::activateTriggerEffect @ 0x1403fbfa1", "EffectGameObject::triggerObject @ 0x14064949f", "<???> @ 0x140920078"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}