{"type": "func", "start": 5373450752, "end": 5373451541, "name": "ShaderLayer::triggerChromaticGlitch", "pseudocode": "// \n// ShaderLayer::triggerChromaticGlitch from 0x140485a00 to 0x140485d15 (789 bytes)\n// \n// 2 xrefs:\n// > GJBaseGameLayer::triggerShaderCommand @ 0x1402215bb\n// > <???> @ 0x1406dbccc\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 ShaderLayer::triggerChromaticGlitch(\n        ShaderLayer *a1,\n        bool a2,\n        float a3,\n        float a4,\n        float a5,\n        float a6,\n        float a7,\n        float a8,\n        float a9,\n        int a10,\n        float a11,\n        bool a12,\n        bool a13)\n{\n  ShaderLayer *v13; // rbx\n  float m_time; // xmm0_4\n  float m_cGStartTime; // xmm0_4\n  double v17; // xmm3_8\n  float m_cGSpeed; // xmm1_4\n  float v19; // xmm9_4\n  float m_cGSegmentHeight; // xmm1_4\n  float m_cGStrength; // xmm1_4\n  float m_cGLineThickness; // xmm1_4\n  float m_cGLineStrength; // xmm1_4\n\n  v13 = a1;\n  if ( !a1->m_state.m_cGEnable )\n  {\n    m_time = a1->m_state.m_time;\n    a1->m_state.m_cGStartTime = m_time;\n    a1->m_state.m_cGTime = m_time;\n  }\n  m_cGStartTime = a1->m_state.m_cGStartTime;\n  v17 = a1->m_state.m_time;\n  a1->m_state.m_cGEnable = a2;\n  a1->m_state.m_cGStartTime = v17;\n  a1->m_state.m_cGTime = (float)((float)(v17 - m_cGStartTime) * a1->m_state.m_cGSpeed) + a1->m_state.m_cGTime;\n  if ( a4 != -909190.0 )\n  {\n    if ( a3 <= 0.0 )\n    {\n      m_cGSpeed = 0.0;\n    }\n    else\n    {\n      if ( a1->m_timesyncShaderActions )\n        GJShaderState::timesyncShaderAction(&a1->m_state, 8);\n      m_cGSpeed = v13->m_state.m_cGSpeed;\n      a1 = v13;\n    }\n    ShaderLayer::tweenValue(a1, m_cGSpeed, a4, 8, a3, a10, a11);\n  }\n  v19 = 1.0 / fmaxf(a9, 0.1);\n  if ( v19 != -909190.0 )\n  {\n    if ( a3 <= 0.0 )\n    {\n      m_cGSegmentHeight = 0.0;\n    }\n    else\n    {\n      if ( v13->m_timesyncShaderActions )\n        GJShaderState::timesyncShaderAction(&v13->m_state, 7);\n      m_cGSegmentHeight = v13->m_state.m_cGSegmentHeight;\n    }\n    ShaderLayer::tweenValue(v13, m_cGSegmentHeight, v19, 7, a3, a10, a11);\n  }\n  if ( a5 != -909190.0 )\n  {\n    if ( a3 <= 0.0 )\n    {\n      m_cGStrength = 0.0;\n    }\n    else\n    {\n      if ( v13->m_timesyncShaderActions )\n        GJShaderState::timesyncShaderAction(&v13->m_state, 4);\n      m_cGStrength = v13->m_state.m_cGStrength;\n    }\n    ShaderLayer::tweenValue(v13, m_cGStrength, a5, 4, a3, a10, a11);\n  }\n  if ( a7 != -909190.0 )\n  {\n    if ( a3 <= 0.0 )\n    {\n      m_cGLineThickness = 0.0;\n    }\n    else\n    {\n      if ( v13->m_timesyncShaderActions )\n        GJShaderState::timesyncShaderAction(&v13->m_state, 5);\n      m_cGLineThickness = v13->m_state.m_cGLineThickness;\n    }\n    ShaderLayer::tweenValue(v13, m_cGLineThickness, a7, 5, a3, a10, a11);\n  }\n  if ( a8 != -909190.0 )\n  {\n    if ( a3 <= 0.0 )\n    {\n      m_cGLineStrength = 0.0;\n    }\n    else\n    {\n      if ( v13->m_timesyncShaderActions )\n        GJShaderState::timesyncShaderAction(&v13->m_state, 6);\n      m_cGLineStrength = v13->m_state.m_cGLineStrength;\n    }\n    ShaderLayer::tweenValue(v13, m_cGLineStrength, a8, 6, a3, a10, a11);\n  }\n  ShaderLayer::tweenValueAuto(v13, a6, 3, a3, a10, a11);\n  v13->m_state.m_cGRelative = a12;\n  v13->m_state.m_cGRelativePos = a13;\n}", "assembly": "; \n; ShaderLayer::triggerChromaticGlitch from 0x140485a00 to 0x140485d15 (789 bytes)\n; \n; 2 xrefs:\n; > GJBaseGameLayer::triggerShaderCommand @ 0x1402215bb\n; > <???> @ 0x1406dbccc\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     rax, rsp                                                       ; +0x0, 0x140485a00\nmov     [rax+8], rbx                                                   ; +0x3, 0x140485a03\npush    rdi                                                            ; +0x7, 0x140485a07\nsub     rsp, 90h                                                       ; +0x8, 0x140485a08\ncmp     byte ptr [rcx+330h], 0                                         ; +0xf, 0x140485a0f\nmov     rbx, rcx                                                       ; +0x16, 0x140485a16\nmovaps  xmmword ptr [rax-18h], xmm6                                    ; +0x19, 0x140485a19\nmovaps  xmm6, xmm2                                                     ; +0x1d, 0x140485a1d\nmovaps  xmmword ptr [rax-28h], xmm7                                    ; +0x20, 0x140485a20\nmovaps  xmmword ptr [rax-38h], xmm8                                    ; +0x24, 0x140485a24\nmovaps  xmmword ptr [rax-48h], xmm9                                    ; +0x29, 0x140485a29\nmovaps  xmm9, xmm3                                                     ; +0x2e, 0x140485a2e\nmovaps  xmmword ptr [rax-58h], xmm10                                   ; +0x32, 0x140485a32\njnz     short loc_140485A55                                            ; +0x37, 0x140485a37\nmovsd   xmm0, qword ptr [rcx+218h]                                     ; +0x39, 0x140485a39\ncvtpd2ps xmm0, xmm0                                                    ; +0x41, 0x140485a41\nmovss   dword ptr [rcx+310h], xmm0                                     ; +0x45, 0x140485a45\nmovss   dword ptr [rcx+314h], xmm0                                     ; +0x4d, 0x140485a4d\nmovss   xmm0, dword ptr [rcx+310h]                                     ; +0x55, 0x140485a55\nxorps   xmm7, xmm7                                                     ; +0x5d, 0x140485a5d\nmovsd   xmm3, qword ptr [rcx+218h]                                     ; +0x60, 0x140485a60\nmovss   xmm10, cs:dword_140623B00                                      ; +0x68, 0x140485a68\nmovaps  xmm1, xmm3                                                     ; +0x71, 0x140485a71\nucomiss xmm9, xmm10                                                    ; +0x74, 0x140485a74\nmov     edi, [rsp+98h+arg_48]                                          ; +0x78, 0x140485a78\nmov     [rcx+330h], dl                                                 ; +0x7f, 0x140485a7f\nmovss   xmm8, [rsp+98h+arg_50]                                         ; +0x85, 0x140485a85\ncvtps2pd xmm0, xmm0                                                    ; +0x8f, 0x140485a8f\nsubsd   xmm1, xmm0                                                     ; +0x92, 0x140485a92\ncvtpd2ps xmm0, xmm3                                                    ; +0x96, 0x140485a96\ncvtpd2ps xmm2, xmm1                                                    ; +0x9a, 0x140485a9a\nmovss   dword ptr [rcx+310h], xmm0                                     ; +0x9e, 0x140485a9e\nmulss   xmm2, dword ptr [rcx+318h]                                     ; +0xa6, 0x140485aa6\naddss   xmm2, dword ptr [rcx+314h]                                     ; +0xae, 0x140485aae\nmovss   dword ptr [rcx+314h], xmm2                                     ; +0xb6, 0x140485ab6\njp      short loc_140485AC2                                            ; +0xbe, 0x140485abe\njz      short loc_140485B11                                            ; +0xc0, 0x140485ac0\ncomiss  xmm6, xmm7                                                     ; +0xc2, 0x140485ac2\njbe     short loc_140485AEE                                            ; +0xc5, 0x140485ac5\ncmp     byte ptr [rcx+460h], 0                                         ; +0xc7, 0x140485ac7\njz      short loc_140485AE1                                            ; +0xce, 0x140485ace\nadd     rcx, 198h                                                      ; +0xd0, 0x140485ad0\nmov     edx, 8                                                         ; +0xd7, 0x140485ad7\ncall    GJShaderState__timesyncShaderAction                            ; +0xdc, 0x140485adc\nmovss   xmm1, dword ptr [rbx+318h]                                     ; +0xe1, 0x140485ae1\nmov     rcx, rbx                                                       ; +0xe9, 0x140485ae9\njmp     short loc_140485AF1                                            ; +0xec, 0x140485aec\nxorps   xmm1, xmm1                                                     ; +0xee, 0x140485aee\nmovss   [rsp+98h+var_68], xmm8                                         ; +0xf1, 0x140485af1\nmov     r9d, 8                                                         ; +0xf8, 0x140485af8\nmov     [rsp+98h+var_70], edi                                          ; +0xfe, 0x140485afe\nmovaps  xmm2, xmm9                                                     ; +0x102, 0x140485b02\nmovss   [rsp+98h+var_78], xmm6                                         ; +0x106, 0x140485b06\ncall    ShaderLayer__tweenValue                                        ; +0x10c, 0x140485b0c\nmovss   xmm0, [rsp+98h+arg_40]                                         ; +0x111, 0x140485b11\nmaxss   xmm0, cs:dword_140622A10                                       ; +0x11a, 0x140485b1a\nmovss   xmm9, cs:flt_140622C24                                         ; +0x122, 0x140485b22\ndivss   xmm9, xmm0                                                     ; +0x12b, 0x140485b2b\nucomiss xmm9, xmm10                                                    ; +0x130, 0x140485b30\njp      short loc_140485B38                                            ; +0x134, 0x140485b34\njz      short loc_140485B87                                            ; +0x136, 0x140485b36\ncomiss  xmm6, xmm7                                                     ; +0x138, 0x140485b38\njbe     short loc_140485B61                                            ; +0x13b, 0x140485b3b\ncmp     byte ptr [rbx+460h], 0                                         ; +0x13d, 0x140485b3d\njz      short loc_140485B57                                            ; +0x144, 0x140485b44\nlea     rcx, [rbx+198h]                                                ; +0x146, 0x140485b46\nmov     edx, 7                                                         ; +0x14d, 0x140485b4d\ncall    GJShaderState__timesyncShaderAction                            ; +0x152, 0x140485b52\nmovss   xmm1, dword ptr [rbx+324h]                                     ; +0x157, 0x140485b57\njmp     short loc_140485B64                                            ; +0x15f, 0x140485b5f\nxorps   xmm1, xmm1                                                     ; +0x161, 0x140485b61\nmovss   [rsp+98h+var_68], xmm8                                         ; +0x164, 0x140485b64\nmov     r9d, 7                                                         ; +0x16b, 0x140485b6b\nmov     [rsp+98h+var_70], edi                                          ; +0x171, 0x140485b71\nmovaps  xmm2, xmm9                                                     ; +0x175, 0x140485b75\nmov     rcx, rbx                                                       ; +0x179, 0x140485b79\nmovss   [rsp+98h+var_78], xmm6                                         ; +0x17c, 0x140485b7c\ncall    ShaderLayer__tweenValue                                        ; +0x182, 0x140485b82\nmovss   xmm9, [rsp+98h+arg_20]                                         ; +0x187, 0x140485b87\nucomiss xmm9, xmm10                                                    ; +0x191, 0x140485b91\njp      short loc_140485B99                                            ; +0x195, 0x140485b95\njz      short loc_140485BE8                                            ; +0x197, 0x140485b97\ncomiss  xmm6, xmm7                                                     ; +0x199, 0x140485b99\njbe     short loc_140485BC2                                            ; +0x19c, 0x140485b9c\ncmp     byte ptr [rbx+460h], 0                                         ; +0x19e, 0x140485b9e\njz      short loc_140485BB8                                            ; +0x1a5, 0x140485ba5\nlea     rcx, [rbx+198h]                                                ; +0x1a7, 0x140485ba7\nmov     edx, 4                                                         ; +0x1ae, 0x140485bae\ncall    GJShaderState__timesyncShaderAction                            ; +0x1b3, 0x140485bb3\nmovss   xmm1, dword ptr [rbx+320h]                                     ; +0x1b8, 0x140485bb8\njmp     short loc_140485BC5                                            ; +0x1c0, 0x140485bc0\nxorps   xmm1, xmm1                                                     ; +0x1c2, 0x140485bc2\nmovss   [rsp+98h+var_68], xmm8                                         ; +0x1c5, 0x140485bc5\nmov     r9d, 4                                                         ; +0x1cc, 0x140485bcc\nmov     [rsp+98h+var_70], edi                                          ; +0x1d2, 0x140485bd2\nmovaps  xmm2, xmm9                                                     ; +0x1d6, 0x140485bd6\nmov     rcx, rbx                                                       ; +0x1da, 0x140485bda\nmovss   [rsp+98h+var_78], xmm6                                         ; +0x1dd, 0x140485bdd\ncall    ShaderLayer__tweenValue                                        ; +0x1e3, 0x140485be3\nmovss   xmm9, [rsp+98h+arg_30]                                         ; +0x1e8, 0x140485be8\nucomiss xmm9, xmm10                                                    ; +0x1f2, 0x140485bf2\njp      short loc_140485BFA                                            ; +0x1f6, 0x140485bf6\njz      short loc_140485C49                                            ; +0x1f8, 0x140485bf8\ncomiss  xmm6, xmm7                                                     ; +0x1fa, 0x140485bfa\njbe     short loc_140485C23                                            ; +0x1fd, 0x140485bfd\ncmp     byte ptr [rbx+460h], 0                                         ; +0x1ff, 0x140485bff\njz      short loc_140485C19                                            ; +0x206, 0x140485c06\nlea     rcx, [rbx+198h]                                                ; +0x208, 0x140485c08\nmov     edx, 5                                                         ; +0x20f, 0x140485c0f\ncall    GJShaderState__timesyncShaderAction                            ; +0x214, 0x140485c14\nmovss   xmm1, dword ptr [rbx+328h]                                     ; +0x219, 0x140485c19\njmp     short loc_140485C26                                            ; +0x221, 0x140485c21\nxorps   xmm1, xmm1                                                     ; +0x223, 0x140485c23\nmovss   [rsp+98h+var_68], xmm8                                         ; +0x226, 0x140485c26\nmov     r9d, 5                                                         ; +0x22d, 0x140485c2d\nmov     [rsp+98h+var_70], edi                                          ; +0x233, 0x140485c33\nmovaps  xmm2, xmm9                                                     ; +0x237, 0x140485c37\nmov     rcx, rbx                                                       ; +0x23b, 0x140485c3b\nmovss   [rsp+98h+var_78], xmm6                                         ; +0x23e, 0x140485c3e\ncall    ShaderLayer__tweenValue                                        ; +0x244, 0x140485c44\nmovss   xmm9, [rsp+98h+arg_38]                                         ; +0x249, 0x140485c49\nucomiss xmm9, xmm10                                                    ; +0x253, 0x140485c53\njp      short loc_140485C5B                                            ; +0x257, 0x140485c57\njz      short loc_140485CAA                                            ; +0x259, 0x140485c59\ncomiss  xmm6, xmm7                                                     ; +0x25b, 0x140485c5b\njbe     short loc_140485C84                                            ; +0x25e, 0x140485c5e\ncmp     byte ptr [rbx+460h], 0                                         ; +0x260, 0x140485c60\njz      short loc_140485C7A                                            ; +0x267, 0x140485c67\nlea     rcx, [rbx+198h]                                                ; +0x269, 0x140485c69\nmov     edx, 6                                                         ; +0x270, 0x140485c70\ncall    GJShaderState__timesyncShaderAction                            ; +0x275, 0x140485c75\nmovss   xmm1, dword ptr [rbx+32Ch]                                     ; +0x27a, 0x140485c7a\njmp     short loc_140485C87                                            ; +0x282, 0x140485c82\nxorps   xmm1, xmm1                                                     ; +0x284, 0x140485c84\nmovss   [rsp+98h+var_68], xmm8                                         ; +0x287, 0x140485c87\nmov     r9d, 6                                                         ; +0x28e, 0x140485c8e\nmov     [rsp+98h+var_70], edi                                          ; +0x294, 0x140485c94\nmovaps  xmm2, xmm9                                                     ; +0x298, 0x140485c98\nmov     rcx, rbx                                                       ; +0x29c, 0x140485c9c\nmovss   [rsp+98h+var_78], xmm6                                         ; +0x29f, 0x140485c9f\ncall    ShaderLayer__tweenValue                                        ; +0x2a5, 0x140485ca5\nmovss   xmm1, [rsp+98h+arg_28]                                         ; +0x2aa, 0x140485caa\nmovaps  xmm3, xmm6                                                     ; +0x2b3, 0x140485cb3\nmovss   [rsp+98h+var_70], xmm8                                         ; +0x2b6, 0x140485cb6\nmov     r8d, 3                                                         ; +0x2bd, 0x140485cbd\nmov     rcx, rbx                                                       ; +0x2c3, 0x140485cc3\nmov     [rsp+98h+var_78], edi                                          ; +0x2c6, 0x140485cc6\ncall    ShaderLayer__tweenValueAuto                                    ; +0x2ca, 0x140485cca\nmovzx   eax, [rsp+98h+arg_58]                                          ; +0x2cf, 0x140485ccf\nlea     r11, [rsp+98h+var_8]                                           ; +0x2d7, 0x140485cd7\nmovaps  xmm6, xmmword ptr [r11-10h]                                    ; +0x2df, 0x140485cdf\nmovaps  xmm7, [rsp+98h+var_28]                                         ; +0x2e4, 0x140485ce4\nmovaps  xmm8, xmmword ptr [r11-30h]                                    ; +0x2e9, 0x140485ce9\nmovaps  xmm9, xmmword ptr [r11-40h]                                    ; +0x2ee, 0x140485cee\nmovaps  xmm10, xmmword ptr [r11-50h]                                   ; +0x2f3, 0x140485cf3\nmov     [rbx+332h], al                                                 ; +0x2f8, 0x140485cf8\nmovzx   eax, [rsp+98h+arg_60]                                          ; +0x2fe, 0x140485cfe\nmov     [rbx+333h], al                                                 ; +0x306, 0x140485d06\nmov     rbx, [r11+10h]                                                 ; +0x30c, 0x140485d0c\nmov     rsp, r11                                                       ; +0x310, 0x140485d10\npop     rdi                                                            ; +0x313, 0x140485d13\nretn                                                                   ; +0x314, 0x140485d14", "xrefs": ["GJBaseGameLayer::triggerShaderCommand @ 0x1402215bb", "<???> @ 0x1406dbccc"], "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"}