{"type": "func", "start": 4295302304, "end": 4295302621, "name": "GJRotationControl::ccTouchMoved", "pseudocode": "// \n// GJRotationControl::ccTouchMoved from 0x100051ca0 to 0x100051ddd (317 bytes)\n// \n// 2 xrefs:\n// > sub_100051DE0 @ 0x100051dec\n// > <???> @ 0x1008b1308\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 __fastcall GJRotationControl::ccTouchMoved(GJRotationControl *a1, cocos2d::CCTouch *a2, cocos2d::CCEvent *a3)\n{\n  __m128 v4; // xmm0\n  __m128 v5; // xmm2\n  __m128 v6; // xmm0\n  float v7; // xmm0_4\n  float m_currentRotation; // xmm1_4\n  GJRotationControlDelegate *m_delegate; // rdi\n  __int64 v10; // [rsp-50h] [rbp-50h] BYREF\n  __m128 v11; // [rsp-48h] [rbp-48h]\n  __int64 v12; // [rsp-30h] [rbp-30h] BYREF\n  float v13; // [rsp-28h] [rbp-28h] BYREF\n  unsigned int v14; // [rsp-24h] [rbp-24h]\n\n  if ( a1->m_touchID == a2->m_nId )\n  {\n    cocos2d::CCTouch::getLocation((cocos2d::CCTouch *)&v10);\n    cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)&v12, (const cocos2d::CCPoint *)a1);\n    sub_10028CC90();\n    sub_10028CC60(&v13);\n    v4 = (__m128)v14;\n    v4.f32[0] = atan2f(*(float *)&v14 - a1->m_cursorDifference.y, v13 - a1->m_cursorDifference.x);\n    v11 = v4;\n    *(__float2 *)v4.f32 = __sincosf_stret(v4.f32[0]);\n    sub_10028CBE0(&v12, (float)(_mm_movehdup_ps(v4).f32[0] * 60.0) + 0.0, (float)(60.0 * v4.f32[0]) + 0.0);\n    *(double *)v4.i64 = sub_10028CC90();\n    ((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCPoint *, double))a1->m_controlSprite->setPosition)(\n      a1->m_controlSprite,\n      &a1->m_controlPosition,\n      *(double *)v4.i64);\n    v5 = v11;\n    v5.f32[0] = (float)(v11.f32[0] * -57.29578) * 1000.0;\n    v6 = _mm_or_ps(_mm_and_ps((__m128)xmmword_1008150B0, v5), (__m128)xmmword_1008150C0);\n    v6.f32[0] = v6.f32[0] + v5.f32[0];\n    v7 = _mm_round_ss(v6, v6, 11).f32[0] / 1000.0;\n    m_currentRotation = a1->m_currentRotation;\n    if ( v7 != m_currentRotation )\n    {\n      a1->m_currentRotation = v7;\n      m_delegate = a1->m_delegate;\n      if ( m_delegate )\n        ((void (__fastcall *)(GJRotationControlDelegate *, float))m_delegate->angleChanged)(\n          m_delegate,\n          v7 - m_currentRotation);\n    }\n  }\n}", "assembly": "; \n; GJRotationControl::ccTouchMoved from 0x100051ca0 to 0x100051ddd (317 bytes)\n; \n; 2 xrefs:\n; > sub_100051DE0 @ 0x100051dec\n; > <???> @ 0x1008b1308\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     eax, [rdi+1B8h]                                                ; +0x0, 0x100051ca0\ncmp     eax, [rsi+38h]                                                 ; +0x6, 0x100051ca6\njnz     locret_100051DDC                                               ; +0x9, 0x100051ca9\npush    rbp                                                            ; +0xf, 0x100051caf\nmov     rbp, rsp                                                       ; +0x10, 0x100051cb0\npush    r15                                                            ; +0x13, 0x100051cb3\npush    r14                                                            ; +0x15, 0x100051cb5\npush    rbx                                                            ; +0x17, 0x100051cb7\nsub     rsp, 38h                                                       ; +0x18, 0x100051cb8\nmov     rbx, rdi                                                       ; +0x1c, 0x100051cbc\nlea     r14, [rbp-48h]                                                 ; +0x1f, 0x100051cbf\nmov     rdi, r14                                                       ; +0x23, 0x100051cc3\ncall    cocos2d__CCTouch__getLocation                                  ; +0x26, 0x100051cc6\nlea     r15, [rbp-28h]                                                 ; +0x2b, 0x100051ccb\nmov     rdi, r15                                                       ; +0x2f, 0x100051ccf\nmov     rsi, rbx                                                       ; +0x32, 0x100051cd2\nmov     rdx, r14                                                       ; +0x35, 0x100051cd5\ncall    cocos2d__CCNode__convertToNodeSpace                            ; +0x38, 0x100051cd8\nmov     rdi, r14                                                       ; +0x3d, 0x100051cdd\nmov     rsi, r15                                                       ; +0x40, 0x100051ce0\ncall    sub_10028CC90                                                  ; +0x43, 0x100051ce3\nlea     rdi, [rbp-20h]                                                 ; +0x48, 0x100051ce8\nmov     rsi, r14                                                       ; +0x4c, 0x100051cec\ncall    sub_10028CC60                                                  ; +0x4f, 0x100051cef\nmovss   xmm1, dword ptr [rbp-20h]                                      ; +0x54, 0x100051cf4\nmovss   xmm0, dword ptr [rbp-1Ch]                                      ; +0x59, 0x100051cf9\nsubss   xmm1, dword ptr [rbx+194h]; float                              ; +0x5e, 0x100051cfe\nsubss   xmm0, dword ptr [rbx+198h]; float                              ; +0x66, 0x100051d06\ncall    _atan2f                                                        ; +0x6e, 0x100051d0e\nmovaps  xmmword ptr [rbp-40h], xmm0                                    ; +0x73, 0x100051d13\ncall    ___sincosf_stret                                               ; +0x77, 0x100051d17\nmovshdup xmm2, xmm0                                                    ; +0x7c, 0x100051d1c\nmovss   xmm1, cs:dword_100815028                                       ; +0x80, 0x100051d20\nmulss   xmm2, xmm1                                                     ; +0x88, 0x100051d28\nxorps   xmm3, xmm3                                                     ; +0x8c, 0x100051d2c\naddss   xmm2, xmm3                                                     ; +0x8f, 0x100051d2f\nmulss   xmm1, xmm0                                                     ; +0x93, 0x100051d33\naddss   xmm1, xmm3                                                     ; +0x97, 0x100051d37\nlea     r14, [rbp-28h]                                                 ; +0x9b, 0x100051d3b\nmov     rdi, r14                                                       ; +0x9f, 0x100051d3f\nmovaps  xmm0, xmm2                                                     ; +0xa2, 0x100051d42\ncall    sub_10028CBE0                                                  ; +0xa5, 0x100051d45\nlea     r15, [rbx+19Ch]                                                ; +0xaa, 0x100051d4a\nmov     rdi, r15                                                       ; +0xb1, 0x100051d51\nmov     rsi, r14                                                       ; +0xb4, 0x100051d54\ncall    sub_10028CC90                                                  ; +0xb7, 0x100051d57\nmov     rdi, [rbx+1A8h]                                                ; +0xbc, 0x100051d5c\nmov     rax, [rdi]                                                     ; +0xc3, 0x100051d63\nmov     rsi, r15                                                       ; +0xc6, 0x100051d66\ncall    qword ptr [rax+0B8h]                                           ; +0xc9, 0x100051d69\nmovaps  xmm2, xmmword ptr [rbp-40h]                                    ; +0xcf, 0x100051d6f\nmulss   xmm2, cs:dword_100815404                                       ; +0xd3, 0x100051d73\nmovss   xmm1, cs:dword_1008152B8                                       ; +0xdb, 0x100051d7b\nmulss   xmm2, xmm1                                                     ; +0xe3, 0x100051d83\nmovaps  xmm0, cs:xmmword_1008150B0                                     ; +0xe7, 0x100051d87\nandps   xmm0, xmm2                                                     ; +0xee, 0x100051d8e\norps    xmm0, cs:xmmword_1008150C0                                     ; +0xf1, 0x100051d91\naddss   xmm0, xmm2                                                     ; +0xf8, 0x100051d98\nroundss xmm0, xmm0, 0Bh                                                ; +0xfc, 0x100051d9c\ndivss   xmm0, xmm1                                                     ; +0x102, 0x100051da2\nmovss   xmm1, dword ptr [rbx+1B4h]                                     ; +0x106, 0x100051da6\nucomiss xmm0, xmm1                                                     ; +0x10e, 0x100051dae\njnz     short loc_100051DB5                                            ; +0x111, 0x100051db1\njnp     short loc_100051DD2                                            ; +0x113, 0x100051db3\nmovss   dword ptr [rbx+1B4h], xmm0                                     ; +0x115, 0x100051db5\nmov     rdi, [rbx+1C0h]                                                ; +0x11d, 0x100051dbd\ntest    rdi, rdi                                                       ; +0x124, 0x100051dc4\njz      short loc_100051DD2                                            ; +0x127, 0x100051dc7\nsubss   xmm0, xmm1                                                     ; +0x129, 0x100051dc9\nmov     rax, [rdi]                                                     ; +0x12d, 0x100051dcd\ncall    qword ptr [rax]                                                ; +0x130, 0x100051dd0\nadd     rsp, 38h                                                       ; +0x132, 0x100051dd2\npop     rbx                                                            ; +0x136, 0x100051dd6\npop     r14                                                            ; +0x137, 0x100051dd7\npop     r15                                                            ; +0x139, 0x100051dd9\npop     rbp                                                            ; +0x13b, 0x100051ddb\nretn                                                                   ; +0x13c, 0x100051ddc", "xrefs": ["sub_100051DE0 @ 0x100051dec", "<???> @ 0x1008b1308"], "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"}