{"type": "func", "start": 5371076912, "end": 5371077400, "name": "GJBaseGameLayer::applySFXEditTrigger", "pseudocode": "// \n// GJBaseGameLayer::applySFXEditTrigger from 0x140242130 to 0x140242318 (488 bytes)\n// \n// 6 xrefs:\n// > GJBaseGameLayer::processQueuedAudioTriggers @ 0x14023bbc8\n// > GJBaseGameLayer::activateSongEditTrigger @ 0x1402419d1\n// > GJBaseGameLayer::activateSFXEditTrigger @ 0x140241feb\n// > GJBaseGameLayer::activateSFXEditTrigger @ 0x14024207f\n// > GJBaseGameLayer::activateSFXEditTrigger @ 0x14024210a\n// > <???> @ 0x1406ce478\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=4\nvoid GJBaseGameLayer::applySFXEditTrigger(GJBaseGameLayer *a1, int a2, int a3, SFXTriggerGameObject *a4)\n{\n  FMODAudioEngine *v7; // rcx\n  float m_pitch; // xmm6_4\n  FMODAudioEngine *v9; // rcx\n  FMODAudioEngine *v10; // [rsp+60h] [rbp+8h]\n  FMODAudioEngine *v11; // [rsp+60h] [rbp+8h]\n  FMODAudioEngine *v12; // [rsp+60h] [rbp+8h]\n  FMODAudioEngine *v13; // [rsp+60h] [rbp+8h]\n\n  if ( a1->m_practiceMusicSync || !a1->m_isPracticeMode || a1->m_isPlatformer )\n  {\n    if ( a4->m_stop || a4->m_stopLoop )\n    {\n      v7 = (FMODAudioEngine *)qword_1406C2E88;\n      if ( !qword_1406C2E88 )\n      {\n        v10 = (FMODAudioEngine *)operator new(0x888u);\n        qword_1406C2E88 = (__int64)FMODAudioEngine::FMODAudioEngine(v10);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2E88 + 72LL))(qword_1406C2E88);\n        v7 = (FMODAudioEngine *)qword_1406C2E88;\n      }\n      FMODAudioEngine::stopChannel(v7, a2, (AudioTargetType)a3, a4->m_stopLoop, 0.0);\n    }\n    if ( a4->m_changeVolume )\n    {\n      m_pitch = a4->m_pitch;\n      if ( m_pitch <= 0.0 )\n      {\n        if ( !qword_1406C2E88 )\n        {\n          v11 = (FMODAudioEngine *)operator new(0x888u);\n          qword_1406C2E88 = (__int64)FMODAudioEngine::FMODAudioEngine(v11);\n          (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2E88 + 72LL))(qword_1406C2E88);\n        }\n        m_pitch = FMODAudioEngine::pitchForIdx(a4->m_speed);\n      }\n      if ( !qword_1406C2E88 )\n      {\n        v12 = (FMODAudioEngine *)operator new(0x888u);\n        qword_1406C2E88 = (__int64)FMODAudioEngine::FMODAudioEngine(v12);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2E88 + 72LL))(qword_1406C2E88);\n      }\n      FMODAudioEngine::updateChannel(\n        (FMODAudioEngine *)qword_1406C2E88,\n        a2,\n        (AudioTargetType)a3,\n        Pitch,\n        a4->m_duration,\n        m_pitch);\n    }\n    if ( a4->m_changeSpeed )\n    {\n      v9 = (FMODAudioEngine *)qword_1406C2E88;\n      if ( !qword_1406C2E88 )\n      {\n        v13 = (FMODAudioEngine *)operator new(0x888u);\n        qword_1406C2E88 = (__int64)FMODAudioEngine::FMODAudioEngine(v13);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2E88 + 72LL))(qword_1406C2E88);\n        v9 = (FMODAudioEngine *)qword_1406C2E88;\n      }\n      FMODAudioEngine::updateChannel(v9, a2, (AudioTargetType)a3, Volume, a4->m_duration, a4->m_volume);\n    }\n  }\n}", "assembly": "; \n; GJBaseGameLayer::applySFXEditTrigger from 0x140242130 to 0x140242318 (488 bytes)\n; \n; 6 xrefs:\n; > GJBaseGameLayer::processQueuedAudioTriggers @ 0x14023bbc8\n; > GJBaseGameLayer::activateSongEditTrigger @ 0x1402419d1\n; > GJBaseGameLayer::activateSFXEditTrigger @ 0x140241feb\n; > GJBaseGameLayer::activateSFXEditTrigger @ 0x14024207f\n; > GJBaseGameLayer::activateSFXEditTrigger @ 0x14024210a\n; > <???> @ 0x1406ce478\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_8], rbx                                               ; +0x0, 0x140242130\nmov     [rsp+arg_10], rsi                                              ; +0x5, 0x140242135\npush    rdi                                                            ; +0xa, 0x14024213a\nsub     rsp, 50h                                                       ; +0xb, 0x14024213b\nmovaps  [rsp+58h+var_18], xmm6                                         ; +0xf, 0x14024213f\nmovaps  [rsp+58h+var_28], xmm7                                         ; +0x14, 0x140242144\nmov     rbx, r9                                                        ; +0x19, 0x140242149\nmov     edi, r8d                                                       ; +0x1c, 0x14024214c\nmov     esi, edx                                                       ; +0x1f, 0x14024214f\ncmp     byte ptr [rcx+31F1h], 0                                        ; +0x21, 0x140242151\njnz     short loc_140242170                                            ; +0x28, 0x140242158\ncmp     byte ptr [rcx+31F0h], 0                                        ; +0x2a, 0x14024215a\njz      short loc_140242170                                            ; +0x31, 0x140242161\ncmp     byte ptr [rcx+309Eh], 0                                        ; +0x33, 0x140242163\njz      loc_1402422FE                                                  ; +0x3a, 0x14024216a\nxorps   xmm7, xmm7                                                     ; +0x40, 0x140242170\ncmp     byte ptr [r9+7B8h], 0                                          ; +0x43, 0x140242173\njnz     short loc_140242187                                            ; +0x4b, 0x14024217b\ncmp     byte ptr [r9+787h], 0                                          ; +0x4d, 0x14024217d\njz      short loc_1402421DA                                            ; +0x55, 0x140242185\nmov     rcx, cs:qword_1406C2E88                                        ; +0x57, 0x140242187\ntest    rcx, rcx                                                       ; +0x5e, 0x14024218e\njnz     short loc_1402421C2                                            ; +0x61, 0x140242191\nmov     ecx, 888h; Size                                                ; +0x63, 0x140242193\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x68, 0x140242198\nmov     [rsp+58h+arg_0], rax                                           ; +0x6d, 0x14024219d\nmov     rcx, rax                                                       ; +0x72, 0x1402421a2\ncall    FMODAudioEngine__FMODAudioEngine                               ; +0x75, 0x1402421a5\nnop                                                                    ; +0x7a, 0x1402421aa\nmov     cs:qword_1406C2E88, rax                                        ; +0x7b, 0x1402421ab\nmov     rdx, [rax]                                                     ; +0x82, 0x1402421b2\nmov     rcx, rax                                                       ; +0x85, 0x1402421b5\ncall    qword ptr [rdx+48h]                                            ; +0x88, 0x1402421b8\nmov     rcx, cs:qword_1406C2E88                                        ; +0x8b, 0x1402421bb\nmovss   [rsp+58h+var_38], xmm7                                         ; +0x92, 0x1402421c2\nmovzx   r9d, byte ptr [rbx+787h]                                       ; +0x98, 0x1402421c8\nmov     r8d, edi                                                       ; +0xa0, 0x1402421d0\nmov     edx, esi                                                       ; +0xa3, 0x1402421d3\ncall    FMODAudioEngine__stopChannel                                   ; +0xa5, 0x1402421d5\ncmp     byte ptr [rbx+7BAh], 0                                         ; +0xaa, 0x1402421da\njz      loc_140242291                                                  ; +0xb1, 0x1402421e1\nmovss   xmm6, dword ptr [rbx+764h]                                     ; +0xb7, 0x1402421e7\ncomiss  xmm6, xmm7                                                     ; +0xbf, 0x1402421ef\nja      short loc_140242234                                            ; +0xc2, 0x1402421f2\ncmp     cs:qword_1406C2E88, 0                                          ; +0xc4, 0x1402421f4\njnz     short loc_140242226                                            ; +0xcc, 0x1402421fc\nmov     ecx, 888h; Size                                                ; +0xce, 0x1402421fe\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0xd3, 0x140242203\nmov     [rsp+58h+arg_0], rax                                           ; +0xd8, 0x140242208\nmov     rcx, rax                                                       ; +0xdd, 0x14024220d\ncall    FMODAudioEngine__FMODAudioEngine                               ; +0xe0, 0x140242210\nnop                                                                    ; +0xe5, 0x140242215\nmov     cs:qword_1406C2E88, rax                                        ; +0xe6, 0x140242216\nmov     rdx, [rax]                                                     ; +0xed, 0x14024221d\nmov     rcx, rax                                                       ; +0xf0, 0x140242220\ncall    qword ptr [rdx+48h]                                            ; +0xf3, 0x140242223\nmov     ecx, [rbx+768h]                                                ; +0xf6, 0x140242226\ncall    FMODAudioEngine__pitchForIdx                                   ; +0xfc, 0x14024222c\nmovaps  xmm6, xmm0                                                     ; +0x101, 0x140242231\ncmp     cs:qword_1406C2E88, 0                                          ; +0x104, 0x140242234\njnz     short loc_140242266                                            ; +0x10c, 0x14024223c\nmov     ecx, 888h; Size                                                ; +0x10e, 0x14024223e\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x113, 0x140242243\nmov     [rsp+58h+arg_0], rax                                           ; +0x118, 0x140242248\nmov     rcx, rax                                                       ; +0x11d, 0x14024224d\ncall    FMODAudioEngine__FMODAudioEngine                               ; +0x120, 0x140242250\nnop                                                                    ; +0x125, 0x140242255\nmov     cs:qword_1406C2E88, rax                                        ; +0x126, 0x140242256\nmov     rdx, [rax]                                                     ; +0x12d, 0x14024225d\nmov     rcx, rax                                                       ; +0x130, 0x140242260\ncall    qword ptr [rdx+48h]                                            ; +0x133, 0x140242263\nmovss   [rsp+58h+var_30], xmm6                                         ; +0x136, 0x140242266\nmovss   xmm0, dword ptr [rbx+5BCh]                                     ; +0x13c, 0x14024226c\nmovss   [rsp+58h+var_38], xmm0                                         ; +0x144, 0x140242274\nmov     r9d, 1                                                         ; +0x14a, 0x14024227a\nmov     r8d, edi                                                       ; +0x150, 0x140242280\nmov     edx, esi                                                       ; +0x153, 0x140242283\nmov     rcx, cs:qword_1406C2E88                                        ; +0x155, 0x140242285\ncall    FMODAudioEngine__updateChannel                                 ; +0x15c, 0x14024228c\ncmp     byte ptr [rbx+7B9h], 0                                         ; +0x161, 0x140242291\njz      short loc_1402422FE                                            ; +0x168, 0x140242298\nmov     rcx, cs:qword_1406C2E88                                        ; +0x16a, 0x14024229a\ntest    rcx, rcx                                                       ; +0x171, 0x1402422a1\njnz     short loc_1402422D5                                            ; +0x174, 0x1402422a4\nmov     ecx, 888h; Size                                                ; +0x176, 0x1402422a6\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x17b, 0x1402422ab\nmov     [rsp+58h+arg_0], rax                                           ; +0x180, 0x1402422b0\nmov     rcx, rax                                                       ; +0x185, 0x1402422b5\ncall    FMODAudioEngine__FMODAudioEngine                               ; +0x188, 0x1402422b8\nnop                                                                    ; +0x18d, 0x1402422bd\nmov     cs:qword_1406C2E88, rax                                        ; +0x18e, 0x1402422be\nmov     rdx, [rax]                                                     ; +0x195, 0x1402422c5\nmov     rcx, rax                                                       ; +0x198, 0x1402422c8\ncall    qword ptr [rdx+48h]                                            ; +0x19b, 0x1402422cb\nmov     rcx, cs:qword_1406C2E88                                        ; +0x19e, 0x1402422ce\nmovss   xmm0, dword ptr [rbx+770h]                                     ; +0x1a5, 0x1402422d5\nmovss   [rsp+58h+var_30], xmm0                                         ; +0x1ad, 0x1402422dd\nmovss   xmm1, dword ptr [rbx+5BCh]                                     ; +0x1b3, 0x1402422e3\nmovss   [rsp+58h+var_38], xmm1                                         ; +0x1bb, 0x1402422eb\nxor     r9d, r9d                                                       ; +0x1c1, 0x1402422f1\nmov     r8d, edi                                                       ; +0x1c4, 0x1402422f4\nmov     edx, esi                                                       ; +0x1c7, 0x1402422f7\ncall    FMODAudioEngine__updateChannel                                 ; +0x1c9, 0x1402422f9\nmov     rbx, [rsp+58h+arg_8]                                           ; +0x1ce, 0x1402422fe\nmov     rsi, [rsp+58h+arg_10]                                          ; +0x1d3, 0x140242303\nmovaps  xmm6, [rsp+58h+var_18]                                         ; +0x1d8, 0x140242308\nmovaps  xmm7, [rsp+58h+var_28]                                         ; +0x1dd, 0x14024230d\nadd     rsp, 50h                                                       ; +0x1e2, 0x140242312\npop     rdi                                                            ; +0x1e6, 0x140242316\nretn                                                                   ; +0x1e7, 0x140242317", "xrefs": ["GJBaseGameLayer::processQueuedAudioTriggers @ 0x14023bbc8", "GJBaseGameLayer::activateSongEditTrigger @ 0x1402419d1", "GJBaseGameLayer::activateSFXEditTrigger @ 0x140241feb", "GJBaseGameLayer::activateSFXEditTrigger @ 0x14024207f", "GJBaseGameLayer::activateSFXEditTrigger @ 0x14024210a", "<???> @ 0x1406ce478"], "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"}