{"type": "func", "start": 3024488, "end": 3024836, "name": "BoomScrollLayer::ccTouchEnded", "pseudocode": "// \n// BoomScrollLayer::ccTouchEnded from 0x2e2668 to 0x2e27c4 (348 bytes)\n// \n// 1 xrefs:\n// > `non-virtual thunk to'BoomScrollLayer::ccTouchEnded @ 0x2e27dc\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 BoomScrollLayer::ccTouchEnded(BoomScrollLayer *a1, cocos2d::CCTouch *a2, cocos2d::CCEvent *a3)\n{\n  cocos2d::CCDirector *v4; // r0\n  int m_page; // r5\n  float v6; // s16\n  double v7; // d7\n  double v8; // d6\n  float v9; // s11\n  float m_minimumTouchLengthToChangePage; // s15\n  const cocos2d::CCPoint *v11; // r0\n  cocos2d::CCPoint v12; // r1\n  cocos2d::CCPoint v13; // [sp+4h] [bp-14h] BYREF\n  cocos2d::CCPoint v14; // [sp+Ch] [bp-Ch] BYREF\n\n  if ( a1->m_touch == a2 )\n  {\n    a1->m_touch = nullptr;\n    cocos2d::CCTouch::getLocationInView(&v13, a2);\n    v4 = cocos2d::CCDirector::sharedDirector();\n    cocos2d::CCDirector::convertToGL(&v14, v4, &v13);\n    cocos2d::CCPoint::operator=(&v13, &v14);\n    m_page = a1->m_page;\n    v6 = v13.x - a1->m_touchX;\n    clock_gettime(0, (struct timespec *)&v14);\n    v7 = (double)SLODWORD(v14.x) + (double)SLODWORD(v14.y) / 1000000000.0;\n    v8 = v7 - a1->m_touchTime;\n    v9 = fabsf(v6);\n    if ( v8 == 0.0 )\n      *(float *)&v7 = a1->m_maxSpeed;\n    else\n      v7 = v9;\n    if ( v8 == 0.0 )\n    {\n      HIDWORD(v7) = 1.0;\n      *(float *)&v7 = *(float *)&v7 + 1.0;\n    }\n    else\n    {\n      v7 = v7 / v8;\n    }\n    if ( v8 != 0.0 )\n      *(float *)&v7 = v7;\n    m_minimumTouchLengthToChangePage = a1->m_minimumTouchLengthToChangePage;\n    a1->m_touchQuotient = *(float *)&v7;\n    if ( v9 >= m_minimumTouchLengthToChangePage\n      || *(float *)&v7 > a1->m_unkFloat1 && v9 >= (float)(m_minimumTouchLengthToChangePage * 0.25) )\n    {\n      v11 = a1->m_extendedLayer->getPosition(a1->m_extendedLayer);\n      cocos2d::CCPoint::CCPoint(&v14, v11);\n      LODWORD(v12.x) = &v14;\n      m_page = BoomScrollLayer::pageNumberForPosition(a1, v12);\n      if ( m_page == a1->m_page )\n      {\n        if ( v6 < 0.0 && (a1->m_looped || m_page < BoomScrollLayer::getTotalPages(a1) - 1) )\n        {\n          ++m_page;\n        }\n        else if ( v6 > 0.0 && (a1->m_looped || m_page > 0) )\n        {\n          --m_page;\n        }\n      }\n    }\n    BoomScrollLayer::moveToPage(a1, m_page);\n  }\n}", "assembly": "; \n; BoomScrollLayer::ccTouchEnded from 0x2e2668 to 0x2e27c4 (348 bytes)\n; \n; 1 xrefs:\n; > `non-virtual thunk to'BoomScrollLayer::ccTouchEnded @ 0x2e27dc\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\nLDR             R3, =(__stack_chk_guard_ptr - 0x2E2672)                ; +0x0, 0x2e2668\nPUSH.W          {R4-R8,LR}                                             ; +0x2, 0x2e266a\nADD             R3, PC; __stack_chk_guard_ptr                          ; +0x6, 0x2e266e\nLDR             R3, [R3]; __stack_chk_guard                            ; +0x8, 0x2e2670\nVPUSH           {D8}                                                   ; +0xa, 0x2e2672\nMOV             R4, R0                                                 ; +0xe, 0x2e2676\nLDR             R2, [R3]                                               ; +0x10, 0x2e2678\nMOV             R7, R3                                                 ; +0x12, 0x2e267a\nSUB             SP, SP, #0x18                                          ; +0x14, 0x2e267c\nSTR             R2, [SP,#0x18+var_4]                                   ; +0x16, 0x2e267e\nLDR.W           R2, [R0,#0x164]                                        ; +0x18, 0x2e2680\nCMP             R2, R1                                                 ; +0x1c, 0x2e2684\nBNE.W           loc_2E27AE                                             ; +0x1e, 0x2e2686\nADD             R5, SP, #0x18+var_14                                   ; +0x22, 0x2e268a\nMOV.W           R8, #0                                                 ; +0x24, 0x2e268c\nSTR.W           R8, [R0,#0x164]                                        ; +0x28, 0x2e2690\nADD             R6, SP, #0x18+var_C                                    ; +0x2c, 0x2e2694\nMOV             R0, R5; this                                           ; +0x2e, 0x2e2696\nBL              _ZNK7cocos2d7CCTouch17getLocationInViewEv; cocos2d::CCTouch::getLocationInView(void) ; +0x30, 0x2e2698\nBL              _ZN7cocos2d10CCDirector14sharedDirectorEv; cocos2d::CCDirector::sharedDirector(void) ; +0x34, 0x2e269c\nMOV             R2, R5                                                 ; +0x38, 0x2e26a0\nMOV             R1, R0; cocos2d::CCPoint *                             ; +0x3a, 0x2e26a2\nMOV             R0, R6; this                                           ; +0x3c, 0x2e26a4\nBL              _ZN7cocos2d10CCDirector11convertToGLERKNS_7CCPointE; cocos2d::CCDirector::convertToGL(cocos2d::CCPoint const&) ; +0x3e, 0x2e26a6\nMOV             R0, R5                                                 ; +0x42, 0x2e26aa\nMOV             R1, R6                                                 ; +0x44, 0x2e26ac\nBL              _ZN7cocos2d7CCPointaSERKS0_; cocos2d::CCPoint::operator=(cocos2d::CCPoint const&) ; +0x46, 0x2e26ae\nVLDR            S15, [R4,#0x144]                                       ; +0x4a, 0x2e26b2\nMOV             R0, R8; clock_id                                       ; +0x4e, 0x2e26b6\nMOV             R1, R6; tp                                             ; +0x50, 0x2e26b8\nLDR.W           R5, [R4,#0x1CC]                                        ; +0x52, 0x2e26ba\nVLDR            S16, [SP,#0x18+var_14]                                 ; +0x56, 0x2e26be\nVSUB.F32        S16, S16, S15                                          ; +0x5a, 0x2e26c2\nBLX             clock_gettime                                          ; +0x5e, 0x2e26c6\nVLDR            S15, [SP,#0x18+var_C]                                  ; +0x62, 0x2e26ca\nVLDR            D5, =1.0e9                                             ; +0x66, 0x2e26ce\nVCVT.F64.S32    D6, S15                                                ; +0x6a, 0x2e26d2\nVLDR            S15, [SP,#0x18+var_8]                                  ; +0x6e, 0x2e26d6\nVCVT.F64.S32    D7, S15                                                ; +0x72, 0x2e26da\nVDIV.F64        D7, D7, D5                                             ; +0x76, 0x2e26de\nVADD.F64        D7, D6, D7                                             ; +0x7a, 0x2e26e2\nVLDR            D6, [R4,#0x170]                                        ; +0x7e, 0x2e26e6\nVSUB.F64        D6, D7, D6                                             ; +0x82, 0x2e26ea\nVABS.F32        S11, S16                                               ; +0x86, 0x2e26ee\nVCMP.F64        D6, #0.0                                               ; +0x8a, 0x2e26f2\nVMRS            APSR_nzcv, FPSCR                                       ; +0x8e, 0x2e26f6\nITETE NE                                                               ; +0x92, 0x2e26fa\nVCVTNE.F64.F32  D7, S11                                                ; +0x94, 0x2e26fc\nVLDREQ          S14, [R4,#0x198]                                       ; +0x98, 0x2e2700\nVDIVNE.F64      D7, D7, D6                                             ; +0x9c, 0x2e2704\nVMOVEQ.F32      S15, #1.0                                              ; +0xa0, 0x2e2708\nITE EQ                                                                 ; +0xa4, 0x2e270c\nVADDEQ.F32      S14, S14, S15                                          ; +0xa6, 0x2e270e\nVCVTNE.F32.F64  S14, D7                                                ; +0xaa, 0x2e2712\nVLDR            S15, [R4,#0x1B0]                                       ; +0xae, 0x2e2716\nVCMPE.F32       S11, S15                                               ; +0xb2, 0x2e271a\nVSTR            S14, [R4,#0x148]                                       ; +0xb6, 0x2e271e\nVMRS            APSR_nzcv, FPSCR                                       ; +0xba, 0x2e2722\nBGE             loc_2E2748                                             ; +0xbe, 0x2e2726\nVLDR            S13, [R4,#0x194]                                       ; +0xc0, 0x2e2728\nVCMPE.F32       S14, S13                                               ; +0xc4, 0x2e272c\nVMRS            APSR_nzcv, FPSCR                                       ; +0xc8, 0x2e2730\nBLE             loc_2E279C                                             ; +0xcc, 0x2e2734\nVMOV.F32        S14, #0.25                                             ; +0xce, 0x2e2736\nVMUL.F32        S15, S15, S14                                          ; +0xd2, 0x2e273a\nVCMPE.F32       S11, S15                                               ; +0xd6, 0x2e273e\nVMRS            APSR_nzcv, FPSCR                                       ; +0xda, 0x2e2742\nBLT             loc_2E279C                                             ; +0xde, 0x2e2746\nLDR.W           R0, [R4,#0x180]                                        ; +0xe0, 0x2e2748\nLDR             R3, [R0]                                               ; +0xe4, 0x2e274c\nLDR             R3, [R3,#0x60]                                         ; +0xe6, 0x2e274e\nBLX             R3                                                     ; +0xe8, 0x2e2750\nMOV             R1, R0; cocos2d::CCPoint *                             ; +0xea, 0x2e2752\nMOV             R0, R6; this                                           ; +0xec, 0x2e2754\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0xee, 0x2e2756\nMOV             R0, R4                                                 ; +0xf2, 0x2e275a\nMOV             R1, R6                                                 ; +0xf4, 0x2e275c\nBL              _ZN15BoomScrollLayer21pageNumberForPositionEN7cocos2d7CCPointE; BoomScrollLayer::pageNumberForPosition(cocos2d::CCPoint) ; +0xf6, 0x2e275e\nLDR.W           R3, [R4,#0x1CC]                                        ; +0xfa, 0x2e2762\nCMP             R0, R3                                                 ; +0xfe, 0x2e2766\nMOV             R5, R0                                                 ; +0x100, 0x2e2768\nBNE             loc_2E279C                                             ; +0x102, 0x2e276a\nVCMPE.F32       S16, #0.0                                              ; +0x104, 0x2e276c\nVMRS            APSR_nzcv, FPSCR                                       ; +0x108, 0x2e2770\nBPL             loc_2E2788                                             ; +0x10c, 0x2e2774\nLDRB.W          R3, [R4,#0x14C]                                        ; +0x10e, 0x2e2776\nCBNZ            R3, loc_2E27A6                                         ; +0x112, 0x2e277a\nMOV             R0, R4; this                                           ; +0x114, 0x2e277c\nBL              _ZN15BoomScrollLayer13getTotalPagesEv; BoomScrollLayer::getTotalPages(void) ; +0x116, 0x2e277e\nSUBS            R0, #1                                                 ; +0x11a, 0x2e2782\nCMP             R5, R0                                                 ; +0x11c, 0x2e2784\nBLT             loc_2E27A6                                             ; +0x11e, 0x2e2786\nVCMPE.F32       S16, #0.0                                              ; +0x120, 0x2e2788\nVMRS            APSR_nzcv, FPSCR                                       ; +0x124, 0x2e278c\nBLE             loc_2E279C                                             ; +0x128, 0x2e2790\nLDRB.W          R3, [R4,#0x14C]                                        ; +0x12a, 0x2e2792\nCBNZ            R3, loc_2E27AA                                         ; +0x12e, 0x2e2796\nCMP             R5, #0                                                 ; +0x130, 0x2e2798\nBGT             loc_2E27AA                                             ; +0x132, 0x2e279a\nMOV             R0, R4; this                                           ; +0x134, 0x2e279c\nMOV             R1, R5; int                                            ; +0x136, 0x2e279e\nBL              _ZN15BoomScrollLayer10moveToPageEi; BoomScrollLayer::moveToPage(int) ; +0x138, 0x2e27a0\nB               loc_2E27AE                                             ; +0x13c, 0x2e27a4\nADDS            R5, #1                                                 ; +0x13e, 0x2e27a6\nB               loc_2E279C                                             ; +0x140, 0x2e27a8\nSUBS            R5, #1                                                 ; +0x142, 0x2e27aa\nB               loc_2E279C                                             ; +0x144, 0x2e27ac\nLDR             R2, [SP,#0x18+var_4]                                   ; +0x146, 0x2e27ae\nLDR             R3, [R7]                                               ; +0x148, 0x2e27b0\nCMP             R2, R3                                                 ; +0x14a, 0x2e27b2\nBEQ             loc_2E27BA                                             ; +0x14c, 0x2e27b4\nBLX             __stack_chk_fail                                       ; +0x14e, 0x2e27b6\nADD             SP, SP, #0x18                                          ; +0x152, 0x2e27ba\nVPOP            {D8}                                                   ; +0x154, 0x2e27bc\nPOP.W           {R4-R8,PC}                                             ; +0x158, 0x2e27c0", "xrefs": ["`non-virtual thunk to'BoomScrollLayer::ccTouchEnded @ 0x2e27dc"], "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"}