{"type": "func", "start": 4679744, "end": 4679892, "name": "GJBaseGameLayer::getCameraEdgeValue", "pseudocode": "// \n// GJBaseGameLayer::getCameraEdgeValue from 0x476840 to 0x4768d4 (148 bytes)\n// \n// 5 xrefs:\n// > GJBaseGameLayer::updateCamera @ 0x486102\n// > GJBaseGameLayer::updateCamera @ 0x486120\n// > GJBaseGameLayer::updateCamera @ 0x48613a\n// > GJBaseGameLayer::updateCamera @ 0x486160\n// > GJBaseGameLayer::updateCamera @ 0x48617a\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 v2; // r6\n  int m_cameraEdgeValue0; // r4\n  GameObject *MainObject; // r0\n  int v6; // r2\n  bool v7; // r3\n  float result; // r0\n  cocos2d::CCPoint v9; // [sp+4h] [bp-14h] BYREF\n  cocos2d::CCPoint v10; // [sp+Ch] [bp-Ch] BYREF\n\n  v2 = a2 - 1;\n  switch ( a2 )\n  {\n    case 1:\n      m_cameraEdgeValue0 = a1->m_gameState.m_cameraEdgeValue0;\n      break;\n    case 2:\n      m_cameraEdgeValue0 = a1->m_gameState.m_cameraEdgeValue1;\n      break;\n    case 3:\n      m_cameraEdgeValue0 = a1->m_gameState.m_cameraEdgeValue2;\n      break;\n    case 4:\n      m_cameraEdgeValue0 = a1->m_gameState.m_cameraEdgeValue3;\n      break;\n    default:\n      m_cameraEdgeValue0 = 0;\n      break;\n  }\n  cocos2d::CCPoint::CCPoint(&v9, &stru_AC68C0);\n  MainObject = GJBaseGameLayer::tryGetMainObject(a1, m_cameraEdgeValue0);\n  if ( MainObject )\n  {\n    MainObject->getRealPosition(&v10, MainObject);\n    cocos2d::CCPoint::operator=((PlayerObject *)&v9, COERCE_FLOAT(&v10), v6, v7);\n  }\n  switch ( v2 )\n  {\n    case 0:\n    case 1:\n      result = v9.x;\n      break;\n    case 2:\n    case 3:\n      result = v9.y;\n      break;\n    default:\n      result = 0.0;\n      break;\n  }\n  return result;\n}", "assembly": "; \n; GJBaseGameLayer::getCameraEdgeValue from 0x476840 to 0x4768d4 (148 bytes)\n; \n; 5 xrefs:\n; > GJBaseGameLayer::updateCamera @ 0x486102\n; > GJBaseGameLayer::updateCamera @ 0x486120\n; > GJBaseGameLayer::updateCamera @ 0x48613a\n; > GJBaseGameLayer::updateCamera @ 0x486160\n; > GJBaseGameLayer::updateCamera @ 0x48617a\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 - 0x47684A)                ; +0x0, 0x476840\nPUSH.W          {R4-R8,LR}                                             ; +0x2, 0x476842\nADD             R3, PC; __stack_chk_guard_ptr                          ; +0x6, 0x476846\nLDR             R3, [R3]; __stack_chk_guard                            ; +0x8, 0x476848\nSUB             SP, SP, #0x18                                          ; +0xa, 0x47684a\nSUBS            R6, R1, #1; switch 4 cases                             ; +0xc, 0x47684c\nLDR             R2, [R3]                                               ; +0xe, 0x47684e\nMOV             R5, R0                                                 ; +0x10, 0x476850\nMOV             R7, R3                                                 ; +0x12, 0x476852\nSTR             R2, [SP,#0x18+var_4]                                   ; +0x14, 0x476854\nCMP             R6, #3                                                 ; +0x16, 0x476856\nBHI             def_47685A; jumptable 0047685A default case            ; +0x18, 0x476858\nTBB.W           [PC,R6]; switch jump                                   ; +0x1a, 0x47685a\nDCB 2; jump table for switch statement                                 ; +0x1e, 0x47685e\nDCB 5                                                                  ; +0x1f, 0x47685f\nDCB 8                                                                  ; +0x20, 0x476860\nDCB 0xB                                                                ; +0x21, 0x476861\nLDR.W           R4, [R0,#0x394]; jumptable 0047685A case 1             ; +0x22, 0x476862\nB               loc_47687C                                             ; +0x26, 0x476866\nLDR.W           R4, [R0,#0x398]; jumptable 0047685A case 2             ; +0x28, 0x476868\nB               loc_47687C                                             ; +0x2c, 0x47686c\nLDR.W           R4, [R0,#0x39C]; jumptable 0047685A case 3             ; +0x2e, 0x47686e\nB               loc_47687C                                             ; +0x32, 0x476872\nLDR.W           R4, [R0,#0x3A0]; jumptable 0047685A case 4             ; +0x34, 0x476874\nB               loc_47687C                                             ; +0x38, 0x476878\nMOVS            R4, #0; jumptable 0047685A default case                ; +0x3a, 0x47687a\nLDR             R1, =(qword_AC68B8 - 0x476886)                         ; +0x3c, 0x47687c\nADD.W           R8, SP, #0x18+var_14                                   ; +0x3e, 0x47687e\nADD             R1, PC; qword_AC68B8                                   ; +0x42, 0x476882\nMOV             R0, R8; this                                           ; +0x44, 0x476884\nADDS            R1, #(stru_AC68C0 - 0xAC68B8); cocos2d::CCPoint *      ; +0x46, 0x476886\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0x48, 0x476888\nMOV             R1, R4; int                                            ; +0x4c, 0x47688c\nMOV             R0, R5; this                                           ; +0x4e, 0x47688e\nBL              _ZN15GJBaseGameLayer16tryGetMainObjectEi; GJBaseGameLayer::tryGetMainObject(int) ; +0x50, 0x476890\nMOV             R1, R0                                                 ; +0x54, 0x476894\nCBZ             R0, loc_4768AC                                         ; +0x56, 0x476896\nLDR             R3, [R0]                                               ; +0x58, 0x476898\nADD             R4, SP, #0x18+var_C                                    ; +0x5a, 0x47689a\nMOV             R0, R4                                                 ; +0x5c, 0x47689c\nLDR.W           R3, [R3,#0x2A0]                                        ; +0x5e, 0x47689e\nBLX             R3                                                     ; +0x62, 0x4768a2\nMOV             R0, R8                                                 ; +0x64, 0x4768a4\nMOV             R1, R4                                                 ; +0x66, 0x4768a6\nBL              _ZN7cocos2d7CCPointaSERKS0_; cocos2d::CCPoint::operator=(cocos2d::CCPoint const&) ; +0x68, 0x4768a8\nCMP             R6, #3; switch 4 cases                                 ; +0x6c, 0x4768ac\nBHI             def_4768B0; jumptable 004768B0 default case            ; +0x6e, 0x4768ae\nTBB.W           [PC,R6]; switch jump                                   ; +0x70, 0x4768b0\nDCB 2; jump table for switch statement                                 ; +0x74, 0x4768b4\nDCB 2                                                                  ; +0x75, 0x4768b5\nDCB 4                                                                  ; +0x76, 0x4768b6\nDCB 4                                                                  ; +0x77, 0x4768b7\nLDR             R0, [SP,#0x18+var_14]; jumptable 004768B0 cases 0,1    ; +0x78, 0x4768b8\nB               loc_4768C2                                             ; +0x7a, 0x4768ba\nLDR             R0, [SP,#0x18+var_10]; jumptable 004768B0 cases 2,3    ; +0x7c, 0x4768bc\nB               loc_4768C2                                             ; +0x7e, 0x4768be\nMOVS            R0, #0; jumptable 004768B0 default case                ; +0x80, 0x4768c0\nLDR             R2, [SP,#0x18+var_4]                                   ; +0x82, 0x4768c2\nLDR             R3, [R7]                                               ; +0x84, 0x4768c4\nCMP             R2, R3                                                 ; +0x86, 0x4768c6\nBEQ             loc_4768CE                                             ; +0x88, 0x4768c8\nBLX             __stack_chk_fail                                       ; +0x8a, 0x4768ca\nADD             SP, SP, #0x18                                          ; +0x8e, 0x4768ce\nPOP.W           {R4-R8,PC}                                             ; +0x90, 0x4768d0", "xrefs": ["GJBaseGameLayer::updateCamera @ 0x486102", "GJBaseGameLayer::updateCamera @ 0x486120", "GJBaseGameLayer::updateCamera @ 0x48613a", "GJBaseGameLayer::updateCamera @ 0x486160", "GJBaseGameLayer::updateCamera @ 0x48617a"], "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"}