{"type": "func", "start": 4295302016, "end": 4295302270, "name": "GJRotationControl::ccTouchBegan", "pseudocode": "// \n// GJRotationControl::ccTouchBegan from 0x100051b80 to 0x100051c7e (254 bytes)\n// \n// 2 xrefs:\n// > sub_100051C80 @ 0x100051c8c\n// > <???> @ 0x1008b1300\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\nbool __fastcall GJRotationControl::ccTouchBegan(GJRotationControl *a1, cocos2d::CCTouch *a2, cocos2d::CCEvent *a3)\n{\n  bool v3; // r14\n  float v5; // xmm0_4\n  double v6; // xmm0_8\n  GJRotationControlDelegate *m_delegate; // rdi\n  cocos2d::CCSprite *m_controlSprite; // rbx\n  cocos2d::CCSpriteFrameCache *v9; // rax\n  cocos2d::CCSpriteFrame *v10; // rax\n  cocos2d::CCPoint v12; // [rsp+8h] [rbp-38h] BYREF\n  _BYTE v13[48]; // [rsp+10h] [rbp-30h] BYREF\n\n  if ( a1->m_touchID != -1 )\n    return 0;\n  cocos2d::CCTouch::getLocation((cocos2d::CCTouch *)&v12);\n  cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v13, (const cocos2d::CCPoint *)a1);\n  sub_10028CC90();\n  v5 = cocos2d::ccpDistance(&v12, &a1->m_controlPosition);\n  v3 = v5 < 20.0;\n  if ( v5 < 20.0 )\n  {\n    a1->m_startingRotation = a1->m_currentRotation;\n    sub_10028CD00(v13, &v12, &a1->m_controlPosition);\n    v6 = sub_10028CC90();\n    a1->m_touchID = a2->m_nId;\n    m_delegate = a1->m_delegate;\n    if ( m_delegate )\n      ((void (__fastcall *)(GJRotationControlDelegate *, _BYTE *, double))m_delegate->angleChangeBegin)(\n        m_delegate,\n        v13,\n        v6);\n    m_controlSprite = a1->m_controlSprite;\n    v9 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();\n    v10 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v9, \"GJ_rotationControlBtn02_001.png\");\n    ((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSpriteFrame *, double))m_controlSprite->setDisplayFrame)(\n      m_controlSprite,\n      v10,\n      v6);\n  }\n  return v3;\n}", "assembly": "; \n; GJRotationControl::ccTouchBegan from 0x100051b80 to 0x100051c7e (254 bytes)\n; \n; 2 xrefs:\n; > sub_100051C80 @ 0x100051c8c\n; > <???> @ 0x1008b1300\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\npush    rbp                                                            ; +0x0, 0x100051b80\nmov     rbp, rsp                                                       ; +0x1, 0x100051b81\npush    r15                                                            ; +0x4, 0x100051b84\npush    r14                                                            ; +0x6, 0x100051b86\npush    r13                                                            ; +0x8, 0x100051b88\npush    r12                                                            ; +0xa, 0x100051b8a\npush    rbx                                                            ; +0xc, 0x100051b8c\nsub     rsp, 18h                                                       ; +0xd, 0x100051b8d\ncmp     dword ptr [rdi+1B8h], 0FFFFFFFFh                               ; +0x11, 0x100051b91\njz      short loc_100051BA2                                            ; +0x18, 0x100051b98\nxor     r14d, r14d                                                     ; +0x1a, 0x100051b9a\njmp     loc_100051C6C                                                  ; +0x1d, 0x100051b9d\nmov     rbx, rdi                                                       ; +0x22, 0x100051ba2\nlea     r14, [rbp+var_38]                                              ; +0x25, 0x100051ba5\nmov     rdi, r14                                                       ; +0x29, 0x100051ba9\nmov     r13, rsi                                                       ; +0x2c, 0x100051bac\ncall    cocos2d__CCTouch__getLocation                                  ; +0x2f, 0x100051baf\nlea     r15, [rbp+var_30]                                              ; +0x34, 0x100051bb4\nmov     rdi, r15                                                       ; +0x38, 0x100051bb8\nmov     rsi, rbx                                                       ; +0x3b, 0x100051bbb\nmov     rdx, r14                                                       ; +0x3e, 0x100051bbe\ncall    cocos2d__CCNode__convertToNodeSpace                            ; +0x41, 0x100051bc1\nmov     rdi, r14                                                       ; +0x46, 0x100051bc6\nmov     rsi, r15                                                       ; +0x49, 0x100051bc9\ncall    sub_10028CC90                                                  ; +0x4c, 0x100051bcc\nlea     r15, [rbx+19Ch]                                                ; +0x51, 0x100051bd1\nmov     rdi, r14                                                       ; +0x58, 0x100051bd8\nmov     rsi, r15                                                       ; +0x5b, 0x100051bdb\ncall    cocos2d__ccpDistance                                           ; +0x5e, 0x100051bde\nmovss   xmm1, cs:dword_100814FF0                                       ; +0x63, 0x100051be3\nucomiss xmm1, xmm0                                                     ; +0x6b, 0x100051beb\nsetnbe  r14b                                                           ; +0x6e, 0x100051bee\njbe     short loc_100051C6C                                            ; +0x72, 0x100051bf2\nmovss   xmm0, dword ptr [rbx+1B4h]                                     ; +0x74, 0x100051bf4\nmovss   dword ptr [rbx+1B0h], xmm0                                     ; +0x7c, 0x100051bfc\nlea     r12, [rbp+var_30]                                              ; +0x84, 0x100051c04\nlea     rsi, [rbp+var_38]                                              ; +0x88, 0x100051c08\nmov     rdi, r12                                                       ; +0x8c, 0x100051c0c\nmov     rdx, r15                                                       ; +0x8f, 0x100051c0f\ncall    sub_10028CD00                                                  ; +0x92, 0x100051c12\nlea     rdi, [rbx+194h]                                                ; +0x97, 0x100051c17\nmov     rsi, r12                                                       ; +0x9e, 0x100051c1e\ncall    sub_10028CC90                                                  ; +0xa1, 0x100051c21\nmov     eax, [r13+38h]                                                 ; +0xa6, 0x100051c26\nmov     [rbx+1B8h], eax                                                ; +0xaa, 0x100051c2a\nmov     rdi, [rbx+1C0h]                                                ; +0xb0, 0x100051c30\ntest    rdi, rdi                                                       ; +0xb7, 0x100051c37\njz      short loc_100051C42                                            ; +0xba, 0x100051c3a\nmov     rax, [rdi]                                                     ; +0xbc, 0x100051c3c\ncall    qword ptr [rax+8]                                              ; +0xbf, 0x100051c3f\nmov     rbx, [rbx+1A8h]                                                ; +0xc2, 0x100051c42\ncall    cocos2d__CCSpriteFrameCache__sharedSpriteFrameCache            ; +0xc9, 0x100051c49\nlea     rsi, aGjRotationcont_0; \"GJ_rotationControlBtn02_001.png\"      ; +0xce, 0x100051c4e\nmov     rdi, rax                                                       ; +0xd5, 0x100051c55\ncall    cocos2d__CCSpriteFrameCache__spriteFrameByName                 ; +0xd8, 0x100051c58\nmov     rcx, [rbx]                                                     ; +0xdd, 0x100051c5d\nmov     rdi, rbx                                                       ; +0xe0, 0x100051c60\nmov     rsi, rax                                                       ; +0xe3, 0x100051c63\ncall    qword ptr [rcx+478h]                                           ; +0xe6, 0x100051c66\nmov     eax, r14d                                                      ; +0xec, 0x100051c6c\nadd     rsp, 18h                                                       ; +0xef, 0x100051c6f\npop     rbx                                                            ; +0xf3, 0x100051c73\npop     r12                                                            ; +0xf4, 0x100051c74\npop     r13                                                            ; +0xf6, 0x100051c76\npop     r14                                                            ; +0xf8, 0x100051c78\npop     r15                                                            ; +0xfa, 0x100051c7a\npop     rbp                                                            ; +0xfc, 0x100051c7c\nretn                                                                   ; +0xfd, 0x100051c7d", "xrefs": ["sub_100051C80 @ 0x100051c8c", "<???> @ 0x1008b1300"], "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"}