{"type": "func", "start": 8806160, "end": 8806508, "name": "GJBaseGameLayer::getCameraEdgeValue", "pseudocode": "// \n// GJBaseGameLayer::getCameraEdgeValue from 0x865f10 to 0x86606c (348 bytes)\n// \n// 7 xrefs:\n// > GJBaseGameLayer::updateCamera @ 0x87d930\n// > GJBaseGameLayer::updateCamera @ 0x87d94c\n// > GJBaseGameLayer::updateCamera @ 0x87d968\n// > GJBaseGameLayer::updateCamera @ 0x87d978\n// > GJBaseGameLayer::updateCamera @ 0x87d98c\n// > GJBaseGameLayer::updateCamera @ 0x87df3c\n// > <???> @ 0x6edc0\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\nfloat GJBaseGameLayer::getCameraEdgeValue(GJBaseGameLayer *a1, int a2)\n{\n  int v3; // w21\n  GameObject *MainObject; // x0\n  float v5; // s0\n  float v6; // s1\n  float result; // s0\n  int m_cameraEdgeValue2; // w23\n  int m_cameraEdgeValue0; // w23\n  cocos2d::CCPoint v10; // [xsp+58h] [xbp+58h] BYREF\n  __int64 v11; // [xsp+60h] [xbp+60h] BYREF\n\n  v3 = a2 - 1;\n  switch ( a2 )\n  {\n    case 1:\n      m_cameraEdgeValue0 = a1->m_gameState.m_cameraEdgeValue0;\n      goto LABEL_10;\n    case 2:\n      m_cameraEdgeValue0 = a1->m_gameState.m_cameraEdgeValue1;\nLABEL_10:\n      cocos2d::CCPoint::CCPoint(&v10, &stru_1242DA8);\n      MainObject = GJBaseGameLayer::tryGetMainObject(a1, m_cameraEdgeValue0);\n      if ( MainObject )\n        goto LABEL_3;\n      return v10.x;\n    case 3:\n      m_cameraEdgeValue2 = a1->m_gameState.m_cameraEdgeValue2;\n      goto LABEL_6;\n    case 4:\n      m_cameraEdgeValue2 = a1->m_gameState.m_cameraEdgeValue3;\nLABEL_6:\n      cocos2d::CCPoint::CCPoint(&v10, &stru_1242DA8);\n      MainObject = GJBaseGameLayer::tryGetMainObject(a1, m_cameraEdgeValue2);\n      if ( MainObject )\n        goto LABEL_3;\nLABEL_7:\n      result = v10.y;\n      break;\n    default:\n      cocos2d::CCPoint::CCPoint(&v10, &stru_1242DA8);\n      MainObject = GJBaseGameLayer::tryGetMainObject(a1, 0);\n      if ( MainObject )\n      {\nLABEL_3:\n        MainObject->getRealPosition((GameObject *)&v11);\n        cocos2d::CCPoint::operator=(&v10, v5, v6);\n      }\n      result = 0.0;\n      switch ( v3 )\n      {\n        case 0:\n        case 1:\n          return v10.x;\n        case 2:\n        case 3:\n          goto LABEL_7;\n        default:\n          return result;\n      }\n  }\n  return result;\n}", "assembly": "; \n; GJBaseGameLayer::getCameraEdgeValue from 0x865f10 to 0x86606c (348 bytes)\n; \n; 7 xrefs:\n; > GJBaseGameLayer::updateCamera @ 0x87d930\n; > GJBaseGameLayer::updateCamera @ 0x87d94c\n; > GJBaseGameLayer::updateCamera @ 0x87d968\n; > GJBaseGameLayer::updateCamera @ 0x87d978\n; > GJBaseGameLayer::updateCamera @ 0x87d98c\n; > GJBaseGameLayer::updateCamera @ 0x87df3c\n; > <???> @ 0x6edc0\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, 0x865f10\nMOV             X29, SP                                                ; +0x4, 0x865f14\nSTP             X19, X20, [SP,#0x70+var_60]                            ; +0x8, 0x865f18\nADRP            X19, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x865f1c\nSTR             X23, [SP,#0x70+var_40]                                 ; +0x10, 0x865f20\nSTP             X21, X22, [SP,#0x70+var_50]                            ; +0x14, 0x865f24\nMOV             X22, X0                                                ; +0x18, 0x865f28\nSUB             W21, W1, #1; switch 4 cases                            ; +0x1c, 0x865f2c\nLDR             X0, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x20, 0x865f30\nCMP             W21, #3                                                ; +0x24, 0x865f34\nLDR             X0, [X0]                                               ; +0x28, 0x865f38\nSTR             X0, [X29,#0x70+var_8]                                  ; +0x2c, 0x865f3c\nB.HI            def_865F58; jumptable 0000000000865F58 default case    ; +0x30, 0x865f40\nADRL            X0, jpt_865F58                                         ; +0x34, 0x865f44\nLDRB            W0, [X0,W21,UXTW]                                      ; +0x3c, 0x865f4c\nADR             X1, def_865F58; jumptable 0000000000865F58 default case ; +0x40, 0x865f50\nADD             X0, X1, W0,SXTB#2                                      ; +0x44, 0x865f54\nBR              X0; switch jump                                        ; +0x48, 0x865f58\nADRP            X1, #qword_1242DA0@PAGE; jumptable 0000000000865F58 default case ; +0x4c, 0x865f5c\nADD             X20, X29, #0x70+var_18                                 ; +0x50, 0x865f60\nADD             X1, X1, #qword_1242DA0@PAGEOFF                         ; +0x54, 0x865f64\nMOV             X0, X20; this                                          ; +0x58, 0x865f68\nADD             X1, X1, #8; cocos2d::CCPoint *                         ; +0x5c, 0x865f6c\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0x60, 0x865f70\nMOV             X0, X22; this                                          ; +0x64, 0x865f74\nMOV             W1, #0; int                                            ; +0x68, 0x865f78\nBL              _ZN15GJBaseGameLayer16tryGetMainObjectEi; GJBaseGameLayer::tryGetMainObject(int) ; +0x6c, 0x865f7c\nCBZ             X0, loc_865FA8                                         ; +0x70, 0x865f80\nLDR             X2, [X0]                                               ; +0x74, 0x865f84\nADD             X1, X29, #0x70+var_10                                  ; +0x78, 0x865f88\nMOV             X8, X1                                                 ; +0x7c, 0x865f8c\nSTR             X1, [X29,#0x70+var_28]                                 ; +0x80, 0x865f90\nLDR             X2, [X2,#0x540]                                        ; +0x84, 0x865f94\nBLR             X2                                                     ; +0x88, 0x865f98\nLDR             X1, [X29,#0x70+var_28]                                 ; +0x8c, 0x865f9c\nMOV             X0, X20                                                ; +0x90, 0x865fa0\nBL              _ZN7cocos2d7CCPointaSERKS0_; cocos2d::CCPoint::operator=(cocos2d::CCPoint const&) ; +0x94, 0x865fa4\nCMP             W21, #3; switch 4 cases                                ; +0x98, 0x865fa8\nFMOV            S0, WZR                                                ; +0x9c, 0x865fac\nB.HI            def_865FC8; jumptable 0000000000865FC8 default case    ; +0xa0, 0x865fb0\nADRL            X0, jpt_865FC8                                         ; +0xa4, 0x865fb4\nLDRB            W0, [X0,W21,UXTW]                                      ; +0xac, 0x865fbc\nADR             X1, loc_865FCC; jumptable 0000000000865F58 case 3      ; +0xb0, 0x865fc0\nADD             X0, X1, W0,SXTB#2                                      ; +0xb4, 0x865fc4\nBR              X0; switch jump                                        ; +0xb8, 0x865fc8\nLDR             W23, [X22,#0x458]; jumptable 0000000000865F58 case 3   ; +0xbc, 0x865fcc\nADRP            X1, #qword_1242DA0@PAGE                                ; +0xc0, 0x865fd0\nADD             X20, X29, #0x70+var_18                                 ; +0xc4, 0x865fd4\nADD             X1, X1, #qword_1242DA0@PAGEOFF                         ; +0xc8, 0x865fd8\nMOV             X0, X20; this                                          ; +0xcc, 0x865fdc\nADD             X1, X1, #8; cocos2d::CCPoint *                         ; +0xd0, 0x865fe0\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0xd4, 0x865fe4\nMOV             X0, X22; this                                          ; +0xd8, 0x865fe8\nMOV             W1, W23; int                                           ; +0xdc, 0x865fec\nBL              _ZN15GJBaseGameLayer16tryGetMainObjectEi; GJBaseGameLayer::tryGetMainObject(int) ; +0xe0, 0x865ff0\nCBNZ            X0, loc_865F84                                         ; +0xe4, 0x865ff4\nLDR             S0, [X29,#0x70+var_14]; jumptable 0000000000865FC8 cases 2,3 ; +0xe8, 0x865ff8\nLDR             X19, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; jumptable 0000000000865FC8 default case ; +0xec, 0x865ffc\nLDR             X1, [X29,#0x70+var_8]                                  ; +0xf0, 0x866000\nLDR             X0, [X19]                                              ; +0xf4, 0x866004\nCMP             X1, X0                                                 ; +0xf8, 0x866008\nB.NE            loc_866068                                             ; +0xfc, 0x86600c\nLDP             X19, X20, [SP,#0x70+var_60]                            ; +0x100, 0x866010\nLDP             X21, X22, [SP,#0x70+var_50]                            ; +0x104, 0x866014\nLDR             X23, [SP,#0x70+var_40]                                 ; +0x108, 0x866018\nLDP             X29, X30, [SP+0x70+var_70],#0x70                       ; +0x10c, 0x86601c\nRET                                                                    ; +0x110, 0x866020\nLDR             W23, [X22,#0x454]; jumptable 0000000000865F58 case 2   ; +0x114, 0x866024\nADRP            X1, #qword_1242DA0@PAGE                                ; +0x118, 0x866028\nADD             X20, X29, #0x70+var_18                                 ; +0x11c, 0x86602c\nADD             X1, X1, #qword_1242DA0@PAGEOFF                         ; +0x120, 0x866030\nMOV             X0, X20; this                                          ; +0x124, 0x866034\nADD             X1, X1, #8; cocos2d::CCPoint *                         ; +0x128, 0x866038\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0x12c, 0x86603c\nMOV             X0, X22; this                                          ; +0x130, 0x866040\nMOV             W1, W23; int                                           ; +0x134, 0x866044\nBL              _ZN15GJBaseGameLayer16tryGetMainObjectEi; GJBaseGameLayer::tryGetMainObject(int) ; +0x138, 0x866048\nCBNZ            X0, loc_865F84                                         ; +0x13c, 0x86604c\nLDR             S0, [X29,#0x70+var_18]; jumptable 0000000000865FC8 cases 0,1 ; +0x140, 0x866050\nB               def_865FC8; jumptable 0000000000865FC8 default case    ; +0x144, 0x866054\nLDR             W23, [X22,#0x450]; jumptable 0000000000865F58 case 1   ; +0x148, 0x866058\nB               loc_866028                                             ; +0x14c, 0x86605c\nLDR             W23, [X22,#0x45C]; jumptable 0000000000865F58 case 4   ; +0x150, 0x866060\nB               loc_865FD0                                             ; +0x154, 0x866064\nBL              .__stack_chk_fail                                      ; +0x158, 0x866068", "xrefs": ["GJBaseGameLayer::updateCamera @ 0x87d930", "GJBaseGameLayer::updateCamera @ 0x87d94c", "GJBaseGameLayer::updateCamera @ 0x87d968", "GJBaseGameLayer::updateCamera @ 0x87d978", "GJBaseGameLayer::updateCamera @ 0x87d98c", "GJBaseGameLayer::updateCamera @ 0x87df3c", "<???> @ 0x6edc0"], "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"}