{"type": "func", "start": 4295939904, "end": 4295940271, "name": "GJBaseGameLayer::toggleAudioVisualizer", "pseudocode": "// \n// GJBaseGameLayer::toggleAudioVisualizer from 0x1000ed740 to 0x1000ed8af (367 bytes)\n// \n// 3 xrefs:\n// > GJBaseGameLayer::init @ 0x1000ec894\n// > GameOptionsLayer::didToggle @ 0x10029f1ee\n// > sub_100602EF0 @ 0x10060313d\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 12:21:08 +0000\n// \n\n__int64 __fastcall GJBaseGameLayer::toggleAudioVisualizer(__int64 a1, __int64 a2, double a3)\n{\n  char v3; // r14\n  __int64 result; // rax\n  __int64 v6; // rdi\n  __int64 v7; // rsi\n  __int64 v8; // rax\n  __int64 v9; // r14\n  __int64 v10; // rax\n  __int64 v11; // r14\n  _BYTE v12[8]; // [rsp+0h] [rbp-30h] BYREF\n  _BYTE v13[4]; // [rsp+8h] [rbp-28h] BYREF\n  float v14; // [rsp+Ch] [rbp-24h]\n  float v15[8]; // [rsp+10h] [rbp-20h] BYREF\n\n  v3 = a2;\n  result = FMODAudioEngine::sharedEngine(a3);\n  *(_BYTE *)(result + 1608) = a2;\n  if ( *(_BYTE *)(a1 + 13704) != (_BYTE)a2 )\n  {\n    *(_BYTE *)(a1 + 13704) = a2;\n    v6 = *(_QWORD *)(a1 + 13688);\n    if ( !v6 )\n    {\n      v7 = cocos2d::CCDirector::sharedDirector(0, a2);\n      cocos2d::CCDirector::getWinSize(v13, v7);\n      v8 = FMODLevelVisualizer::create();\n      *(_QWORD *)(a1 + 13688) = v8;\n      (*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 13288) + 464LL))(\n        *(_QWORD *)(a1 + 13288),\n        v8,\n        100);\n      v9 = *(_QWORD *)(a1 + 13688);\n      sub_100278250(v15, 0.0, 0.0);\n      sub_100278250(v12, v15[0] + 20.0, v14 * 0.5);\n      (*(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v9 + 184LL))(v9, v12);\n      v10 = FMODLevelVisualizer::create();\n      *(_QWORD *)(a1 + 13696) = v10;\n      (*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 13288) + 464LL))(\n        *(_QWORD *)(a1 + 13288),\n        v10,\n        100);\n      v11 = *(_QWORD *)(a1 + 13696);\n      sub_100278250(v15, 0.0, 0.0);\n      sub_100278250(v12, v15[0] + 35.0, 0.5 * v14);\n      (*(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v11 + 184LL))(v11, v12);\n      v6 = *(_QWORD *)(a1 + 13688);\n      v3 = *(_BYTE *)(a1 + 13704);\n    }\n    (*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v6 + 344LL))(v6, v3 & 1);\n    return (*(__int64 (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 13696) + 344LL))(\n             *(_QWORD *)(a1 + 13696),\n             *(unsigned __int8 *)(a1 + 13704));\n  }\n  return result;\n}", "assembly": "; \n; GJBaseGameLayer::toggleAudioVisualizer from 0x1000ed740 to 0x1000ed8af (367 bytes)\n; \n; 3 xrefs:\n; > GJBaseGameLayer::init @ 0x1000ec894\n; > GameOptionsLayer::didToggle @ 0x10029f1ee\n; > sub_100602EF0 @ 0x10060313d\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 12:21:08 +0000\n; \npush    rbp                                                            ; +0x0, 0x1000ed740\nmov     rbp, rsp                                                       ; +0x1, 0x1000ed741\npush    r15                                                            ; +0x4, 0x1000ed744\npush    r14                                                            ; +0x6, 0x1000ed746\npush    rbx                                                            ; +0x8, 0x1000ed748\nsub     rsp, 18h                                                       ; +0x9, 0x1000ed749\nmov     r14d, esi                                                      ; +0xd, 0x1000ed74d\nmov     rbx, rdi                                                       ; +0x10, 0x1000ed750\ncall    FMODAudioEngine__sharedEngine                                  ; +0x13, 0x1000ed753\nmov     [rax+648h], r14b                                               ; +0x18, 0x1000ed758\ncmp     [rbx+3588h], r14b                                              ; +0x1f, 0x1000ed75f\njz      loc_1000ED8A4                                                  ; +0x26, 0x1000ed766\nmov     [rbx+3588h], r14b                                              ; +0x2c, 0x1000ed76c\nmov     rdi, [rbx+3578h]                                               ; +0x33, 0x1000ed773\ntest    rdi, rdi                                                       ; +0x3a, 0x1000ed77a\njnz     loc_1000ED87D                                                  ; +0x3d, 0x1000ed77d\ncall    cocos2d__CCDirector__sharedDirector                            ; +0x43, 0x1000ed783\nlea     rdi, [rbp+var_28]                                              ; +0x48, 0x1000ed788\nmov     rsi, rax                                                       ; +0x4c, 0x1000ed78c\ncall    cocos2d__CCDirector__getWinSize                                ; +0x4f, 0x1000ed78f\ncall    FMODLevelVisualizer__create                                    ; +0x54, 0x1000ed794\nmov     [rbx+3578h], rax                                               ; +0x59, 0x1000ed799\nmov     rdi, [rbx+33E8h]                                               ; +0x60, 0x1000ed7a0\nmov     rcx, [rdi]                                                     ; +0x67, 0x1000ed7a7\nmov     rsi, rax                                                       ; +0x6a, 0x1000ed7aa\nmov     edx, 64h ; 'd'                                                 ; +0x6d, 0x1000ed7ad\ncall    qword ptr [rcx+1D0h]                                           ; +0x72, 0x1000ed7b2\nmov     r14, [rbx+3578h]                                               ; +0x78, 0x1000ed7b8\nlea     rdi, [rbp+var_20]                                              ; +0x7f, 0x1000ed7bf\nxorps   xmm0, xmm0                                                     ; +0x83, 0x1000ed7c3\nxorps   xmm1, xmm1                                                     ; +0x86, 0x1000ed7c6\ncall    sub_100278250                                                  ; +0x89, 0x1000ed7c9\nmovss   xmm0, [rbp+var_20]                                             ; +0x8e, 0x1000ed7ce\naddss   xmm0, cs:dword_100A0359C                                       ; +0x93, 0x1000ed7d3\nmovss   xmm1, [rbp+var_24]                                             ; +0x9b, 0x1000ed7db\nmulss   xmm1, cs:dword_100A03578                                       ; +0xa0, 0x1000ed7e0\nlea     r15, [rbp+var_30]                                              ; +0xa8, 0x1000ed7e8\nmov     rdi, r15                                                       ; +0xac, 0x1000ed7ec\ncall    sub_100278250                                                  ; +0xaf, 0x1000ed7ef\nmov     rax, [r14]                                                     ; +0xb4, 0x1000ed7f4\nmov     rdi, r14                                                       ; +0xb7, 0x1000ed7f7\nmov     rsi, r15                                                       ; +0xba, 0x1000ed7fa\ncall    qword ptr [rax+0B8h]                                           ; +0xbd, 0x1000ed7fd\ncall    FMODLevelVisualizer__create                                    ; +0xc3, 0x1000ed803\nmov     [rbx+3580h], rax                                               ; +0xc8, 0x1000ed808\nmov     rdi, [rbx+33E8h]                                               ; +0xcf, 0x1000ed80f\nmov     rcx, [rdi]                                                     ; +0xd6, 0x1000ed816\nmov     rsi, rax                                                       ; +0xd9, 0x1000ed819\nmov     edx, 64h ; 'd'                                                 ; +0xdc, 0x1000ed81c\ncall    qword ptr [rcx+1D0h]                                           ; +0xe1, 0x1000ed821\nmov     r14, [rbx+3580h]                                               ; +0xe7, 0x1000ed827\nlea     rdi, [rbp+var_20]                                              ; +0xee, 0x1000ed82e\nxorps   xmm0, xmm0                                                     ; +0xf2, 0x1000ed832\nxorps   xmm1, xmm1                                                     ; +0xf5, 0x1000ed835\ncall    sub_100278250                                                  ; +0xf8, 0x1000ed838\nmovss   xmm0, [rbp+var_20]                                             ; +0xfd, 0x1000ed83d\naddss   xmm0, cs:dword_100A03A58                                       ; +0x102, 0x1000ed842\nmovss   xmm1, cs:dword_100A03578                                       ; +0x10a, 0x1000ed84a\nmulss   xmm1, [rbp+var_24]                                             ; +0x112, 0x1000ed852\nmov     rdi, r15                                                       ; +0x117, 0x1000ed857\ncall    sub_100278250                                                  ; +0x11a, 0x1000ed85a\nmov     rax, [r14]                                                     ; +0x11f, 0x1000ed85f\nmov     rdi, r14                                                       ; +0x122, 0x1000ed862\nmov     rsi, r15                                                       ; +0x125, 0x1000ed865\ncall    qword ptr [rax+0B8h]                                           ; +0x128, 0x1000ed868\nmov     rdi, [rbx+3578h]                                               ; +0x12e, 0x1000ed86e\nmovzx   r14d, byte ptr [rbx+3588h]                                     ; +0x135, 0x1000ed875\nmov     rax, [rdi]                                                     ; +0x13d, 0x1000ed87d\nmovzx   esi, r14b                                                      ; +0x140, 0x1000ed880\nand     esi, 1                                                         ; +0x144, 0x1000ed884\ncall    qword ptr [rax+158h]                                           ; +0x147, 0x1000ed887\nmov     rdi, [rbx+3580h]                                               ; +0x14d, 0x1000ed88d\nmovzx   esi, byte ptr [rbx+3588h]                                      ; +0x154, 0x1000ed894\nmov     rax, [rdi]                                                     ; +0x15b, 0x1000ed89b\ncall    qword ptr [rax+158h]                                           ; +0x15e, 0x1000ed89e\nadd     rsp, 18h                                                       ; +0x164, 0x1000ed8a4\npop     rbx                                                            ; +0x168, 0x1000ed8a8\npop     r14                                                            ; +0x169, 0x1000ed8a9\npop     r15                                                            ; +0x16b, 0x1000ed8ab\npop     rbp                                                            ; +0x16d, 0x1000ed8ad\nretn                                                                   ; +0x16e, 0x1000ed8ae", "xrefs": ["GJBaseGameLayer::init @ 0x1000ec894", "GameOptionsLayer::didToggle @ 0x10029f1ee", "sub_100602EF0 @ 0x10060313d"], "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"}