{"type": "func", "start": 8777804, "end": 8778200, "name": "GJBaseGameLayer::speedForShaderTarget", "pseudocode": "// \n// GJBaseGameLayer::speedForShaderTarget from 0x85f04c to 0x85f1d8 (396 bytes)\n// \n// 3 xrefs:\n// > GJBaseGameLayer::updateShaderLayer @ 0x85f9c4\n// > GJBaseGameLayer::updateShaderLayer @ 0x85f9e0\n// > <???> @ 0xafc20\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\ncocos2d::CCPoint GJBaseGameLayer::speedForShaderTarget(GJBaseGameLayer *a1, int a2)\n{\n  cocos2d::CCPoint *v2; // x8\n  cocos2d::CCPoint *v4; // x20\n  GameObject *MainObject; // x0\n  GameObject *v6; // x21\n  const cocos2d::CCPoint *v7; // x0\n  float v8; // s0\n  float v9; // s1\n  const cocos2d::CCPoint *v12; // x23\n  PlayerObject *m_player2; // x0\n  const cocos2d::CCPoint *LastPosition; // x0\n  float v15; // s0\n  float v16; // s1\n  float v17; // s0\n  float v18; // s1\n  __int64 v20; // [xsp+58h] [xbp+58h] BYREF\n  cocos2d::CCPoint v21; // [xsp+60h] [xbp+60h] BYREF\n  cocos2d::CCPoint result; // 0:s0.4,4:s1.4\n\n  v4 = v2;\n  cocos2d::CCPoint::CCPoint(v2);\n  if ( a2 == -1 )\n    goto LABEL_11;\n  if ( a2 == -2 )\n  {\n    if ( a1->m_gameState.m_isDualMode )\n    {\n      v12 = a1->m_player2->getPosition(a1->m_player2);\n      m_player2 = a1->m_player2;\nLABEL_10:\n      LastPosition = GameObject::getLastPosition(m_player2);\n      cocos2d::CCPoint::operator-(&v21, v12, LastPosition);\n      cocos2d::CCPoint::operator=(v4, v15, v16);\n      return result;\n    }\nLABEL_11:\n    v12 = a1->m_player1->getPosition(a1->m_player1);\n    m_player2 = a1->m_player1;\n    goto LABEL_10;\n  }\n  if ( a2 <= 0 )\n  {\n    cocos2d::CCPoint::operator-(&v21, &a1->m_gameState.m_cameraStepDiff);\n    cocos2d::CCPoint::operator=(v4, v17, v18);\n  }\n  else\n  {\n    MainObject = GJBaseGameLayer::tryGetMainObject(a1, a2);\n    v6 = MainObject;\n    if ( MainObject )\n    {\n      MainObject->getRealPosition((GameObject *)&v20);\n      v7 = GameObject::getLastPosition(v6);\n      cocos2d::CCPoint::operator-(&v21, &v20, v7);\n    }\n    else\n    {\n      cocos2d::CCPoint::CCPoint(&v21, &stru_1242DA8);\n    }\n    cocos2d::CCPoint::operator=(v4, v8, v9);\n  }\n  return result;\n}", "assembly": "; \n; GJBaseGameLayer::speedForShaderTarget from 0x85f04c to 0x85f1d8 (396 bytes)\n; \n; 3 xrefs:\n; > GJBaseGameLayer::updateShaderLayer @ 0x85f9c4\n; > GJBaseGameLayer::updateShaderLayer @ 0x85f9e0\n; > <???> @ 0xafc20\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\nSTP             X29, X30, [SP,#var_70]!                                ; +0x0, 0x85f04c\nMOV             X29, SP                                                ; +0x4, 0x85f050\nSTP             X19, X20, [SP,#0x70+var_60]                            ; +0x8, 0x85f054\nADRP            X19, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x85f058\nSTR             X23, [SP,#0x70+var_40]                                 ; +0x10, 0x85f05c\nSTP             X21, X22, [SP,#0x70+var_50]                            ; +0x14, 0x85f060\nMOV             X21, X0                                                ; +0x18, 0x85f064\nMOV             X0, X8; this                                           ; +0x1c, 0x85f068\nLDR             X2, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x20, 0x85f06c\nMOV             X20, X8                                                ; +0x24, 0x85f070\nSTR             X1, [X29,#0x70+var_28]                                 ; +0x28, 0x85f074\nLDR             X2, [X2]                                               ; +0x2c, 0x85f078\nSTR             X2, [X29,#0x70+var_8]                                  ; +0x30, 0x85f07c\nBL              _ZN7cocos2d7CCPointC1Ev; cocos2d::CCPoint::CCPoint(void) ; +0x34, 0x85f080\nLDR             X1, [X29,#0x70+var_28]; int                            ; +0x38, 0x85f084\nCMN             W1, #1                                                 ; +0x3c, 0x85f088\nB.EQ            loc_85F164                                             ; +0x40, 0x85f08c\nCMN             W1, #2                                                 ; +0x44, 0x85f090\nB.EQ            loc_85F118                                             ; +0x48, 0x85f094\nCMP             W1, WZR                                                ; +0x4c, 0x85f098\nB.LE            loc_85F188                                             ; +0x50, 0x85f09c\nMOV             X0, X21; this                                          ; +0x54, 0x85f0a0\nBL              _ZN15GJBaseGameLayer16tryGetMainObjectEi; GJBaseGameLayer::tryGetMainObject(int) ; +0x58, 0x85f0a4\nMOV             X21, X0                                                ; +0x5c, 0x85f0a8\nCBZ             X0, loc_85F1AC                                         ; +0x60, 0x85f0ac\nLDR             X1, [X0]                                               ; +0x64, 0x85f0b0\nADD             X22, X29, #0x70+var_18                                 ; +0x68, 0x85f0b4\nMOV             X8, X22                                                ; +0x6c, 0x85f0b8\nLDR             X1, [X1,#0x540]                                        ; +0x70, 0x85f0bc\nBLR             X1                                                     ; +0x74, 0x85f0c0\nMOV             X0, X21; this                                          ; +0x78, 0x85f0c4\nBL              _ZN10GameObject15getLastPositionEv; GameObject::getLastPosition(void) ; +0x7c, 0x85f0c8\nADD             X21, X29, #0x70+var_10                                 ; +0x80, 0x85f0cc\nMOV             X1, X0                                                 ; +0x84, 0x85f0d0\nMOV             X8, X21                                                ; +0x88, 0x85f0d4\nMOV             X0, X22                                                ; +0x8c, 0x85f0d8\nBL              _ZNK7cocos2d7CCPointmiERKS0_; cocos2d::CCPoint::operator-(cocos2d::CCPoint const&) ; +0x90, 0x85f0dc\nMOV             X0, X20                                                ; +0x94, 0x85f0e0\nMOV             X1, X21                                                ; +0x98, 0x85f0e4\nBL              _ZN7cocos2d7CCPointaSERKS0_; cocos2d::CCPoint::operator=(cocos2d::CCPoint const&) ; +0x9c, 0x85f0e8\nLDR             X19, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0xa0, 0x85f0ec\nMOV             X0, X20                                                ; +0xa4, 0x85f0f0\nLDR             X2, [X29,#0x70+var_8]                                  ; +0xa8, 0x85f0f4\nLDR             X1, [X19]                                              ; +0xac, 0x85f0f8\nCMP             X2, X1                                                 ; +0xb0, 0x85f0fc\nB.NE            loc_85F1C8                                             ; +0xb4, 0x85f100\nLDP             X19, X20, [SP,#0x70+var_60]                            ; +0xb8, 0x85f104\nLDP             X21, X22, [SP,#0x70+var_50]                            ; +0xbc, 0x85f108\nLDR             X23, [SP,#0x70+var_40]                                 ; +0xc0, 0x85f10c\nLDP             X29, X30, [SP+0x70+var_70],#0x70                       ; +0xc4, 0x85f110\nRET                                                                    ; +0xc8, 0x85f114\nLDRB            W0, [X21,#0x412]                                       ; +0xcc, 0x85f118\nCBZ             W0, loc_85F164                                         ; +0xd0, 0x85f11c\nLDR             X1, [X21,#0xE00]                                       ; +0xd4, 0x85f120\nADD             X22, X29, #0x70+var_10                                 ; +0xd8, 0x85f124\nMOV             X0, X1                                                 ; +0xdc, 0x85f128\nLDR             X1, [X1]                                               ; +0xe0, 0x85f12c\nLDR             X1, [X1,#0xC0]                                         ; +0xe4, 0x85f130\nBLR             X1                                                     ; +0xe8, 0x85f134\nMOV             X23, X0                                                ; +0xec, 0x85f138\nLDR             X0, [X21,#0xE00]; this                                 ; +0xf0, 0x85f13c\nBL              _ZN10GameObject15getLastPositionEv; GameObject::getLastPosition(void) ; +0xf4, 0x85f140\nMOV             X1, X0                                                 ; +0xf8, 0x85f144\nMOV             X8, X22                                                ; +0xfc, 0x85f148\nMOV             X0, X23                                                ; +0x100, 0x85f14c\nBL              _ZNK7cocos2d7CCPointmiERKS0_; cocos2d::CCPoint::operator-(cocos2d::CCPoint const&) ; +0x104, 0x85f150\nMOV             X0, X20                                                ; +0x108, 0x85f154\nMOV             X1, X22                                                ; +0x10c, 0x85f158\nBL              _ZN7cocos2d7CCPointaSERKS0_; cocos2d::CCPoint::operator=(cocos2d::CCPoint const&) ; +0x110, 0x85f15c\nB               loc_85F0EC                                             ; +0x114, 0x85f160\nLDR             X1, [X21,#0xDF8]                                       ; +0x118, 0x85f164\nADD             X22, X29, #0x70+var_10                                 ; +0x11c, 0x85f168\nMOV             X0, X1                                                 ; +0x120, 0x85f16c\nLDR             X1, [X1]                                               ; +0x124, 0x85f170\nLDR             X1, [X1,#0xC0]                                         ; +0x128, 0x85f174\nBLR             X1                                                     ; +0x12c, 0x85f178\nMOV             X23, X0                                                ; +0x130, 0x85f17c\nLDR             X0, [X21,#0xDF8]                                       ; +0x134, 0x85f180\nB               loc_85F140                                             ; +0x138, 0x85f184\nADD             X1, X29, #0x70+var_10                                  ; +0x13c, 0x85f188\nADD             X0, X21, #0x4BC                                        ; +0x140, 0x85f18c\nMOV             X8, X1                                                 ; +0x144, 0x85f190\nSTR             X1, [X29,#0x70+var_28]                                 ; +0x148, 0x85f194\nBL              _ZNK7cocos2d7CCPointngEv; cocos2d::CCPoint::operator-(void) ; +0x14c, 0x85f198\nLDR             X1, [X29,#0x70+var_28]                                 ; +0x150, 0x85f19c\nMOV             X0, X20                                                ; +0x154, 0x85f1a0\nBL              _ZN7cocos2d7CCPointaSERKS0_; cocos2d::CCPoint::operator=(cocos2d::CCPoint const&) ; +0x158, 0x85f1a4\nB               loc_85F0EC                                             ; +0x15c, 0x85f1a8\nADRP            X1, #qword_1242DA0@PAGE                                ; +0x160, 0x85f1ac\nADD             X21, X29, #0x70+var_10                                 ; +0x164, 0x85f1b0\nADD             X1, X1, #qword_1242DA0@PAGEOFF                         ; +0x168, 0x85f1b4\nMOV             X0, X21; this                                          ; +0x16c, 0x85f1b8\nADD             X1, X1, #8; cocos2d::CCPoint *                         ; +0x170, 0x85f1bc\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0x174, 0x85f1c0\nB               loc_85F0E0                                             ; +0x178, 0x85f1c4\nBL              .__stack_chk_fail                                      ; +0x17c, 0x85f1c8\nBL              _Unwind_Resume                                         ; +0x180, 0x85f1cc\nB               loc_85F1CC                                             ; +0x184, 0x85f1d0\nB               loc_85F1CC                                             ; +0x188, 0x85f1d4", "xrefs": ["GJBaseGameLayer::updateShaderLayer @ 0x85f9c4", "GJBaseGameLayer::updateShaderLayer @ 0x85f9e0", "<???> @ 0xafc20"], "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"}