{"type": "func", "start": 4295151616, "end": 4295151848, "name": "GJMGLayer::updateGroundWidth", "pseudocode": "// \n// GJMGLayer::updateGroundWidth from 0x10002d000 to 0x10002d0e8 (232 bytes)\n// \n// 1 xrefs:\n// > GJMGLayer::scaleGround @ 0x10002cfe4\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\n// local variable allocation has failed, the output may be wrong!\nvoid __fastcall GJMGLayer::updateGroundWidth(GJMGLayer *a1, bool a2)\n{\n  cocos2d::CCDirector *v3; // x0\n  __int64 v4; // x0\n  GJMGLayer_vtbl *v5; // x8\n  void (__fastcall **p_getScaleX)(GJMGLayer *); // x8\n  GJMGLayer *v7; // x0\n  float v8; // s0\n  int v9; // w20\n  _BOOL4 m_cameraRotated; // w21\n  float v11; // [xsp+8h] [xbp-28h]\n  cocos2d::CCSize WinSize; // 0:kr00_8.8\n\n  if ( ((__int64 (__fastcall *)(GJMGLayer *, bool))a1->getParent)(a1, a2) )\n  {\n    v3 = cocos2d::CCDirector::sharedDirector();\n    WinSize = cocos2d::CCDirector::getWinSize(v3);\n    v4 = ((__int64 (__fastcall *)(GJMGLayer *, float, float))a1->getParent)(a1, WinSize.width, WinSize.height);\n    v5 = a1->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n    if ( v4 )\n    {\n      p_getScaleX = (void (__fastcall **)(GJMGLayer *))&v5->getScaleX;\n      v7 = a1;\n    }\n    else\n    {\n      v7 = (GJMGLayer *)((__int64 (__fastcall *)(GJMGLayer *))v5->getParent)(a1);\n      p_getScaleX = (void (__fastcall **)(GJMGLayer *))&v7->getScale;\n    }\n    (*p_getScaleX)(v7);\n    v8 = (float)(v11 / ((float (__fastcall *)(GJMGLayer *))a1->getScaleX)(a1)) + 10.0;\n    a1->m_groundWidth = v8;\n    v9 = (int)(float)(ceilf(v8 / a1->m_textureWidth) + 1.0);\n    m_cameraRotated = a1->m_cameraRotated;\n    GJMGLayer::loadGroundSprites(a1, v9 + m_cameraRotated, 1);\n    GJMGLayer::loadGroundSprites(a1, v9 + m_cameraRotated, 0);\n  }\n}", "assembly": "; \n; GJMGLayer::updateGroundWidth from 0x10002d000 to 0x10002d0e8 (232 bytes)\n; \n; 1 xrefs:\n; > GJMGLayer::scaleGround @ 0x10002cfe4\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\nSUB             SP, SP, #0x40                                          ; +0x0, 0x10002d000\nSTP             X22, X21, [SP,#0x30+var_20]                            ; +0x4, 0x10002d004\nSTP             X20, X19, [SP,#0x30+var_10]                            ; +0x8, 0x10002d008\nSTP             X29, X30, [SP,#0x30+var_s0]                            ; +0xc, 0x10002d00c\nADD             X29, SP, #0x30                                         ; +0x10, 0x10002d010\nMOV             X19, X0                                                ; +0x14, 0x10002d014\nLDR             X8, [X0]                                               ; +0x18, 0x10002d018\nLDR             X8, [X8,#0x1F0]                                        ; +0x1c, 0x10002d01c\nBLR             X8                                                     ; +0x20, 0x10002d020\nCBZ             X0, loc_10002D0D4                                      ; +0x24, 0x10002d024\nBL              cocos2d__CCDirector__sharedDirector                    ; +0x28, 0x10002d028\nADD             X8, SP, #0x30+var_28                                   ; +0x2c, 0x10002d02c\nBL              cocos2d__CCDirector__getWinSize                        ; +0x30, 0x10002d030\nLDR             X8, [X19]                                              ; +0x34, 0x10002d034\nLDR             X8, [X8,#0x1F0]                                        ; +0x38, 0x10002d038\nMOV             X0, X19                                                ; +0x3c, 0x10002d03c\nBLR             X8                                                     ; +0x40, 0x10002d040\nLDR             X8, [X19]                                              ; +0x44, 0x10002d044\nCBZ             X0, loc_10002D058                                      ; +0x48, 0x10002d048\nADD             X8, X8, #0x88                                          ; +0x4c, 0x10002d04c\nMOV             X0, X19                                                ; +0x50, 0x10002d050\nB               loc_10002D06C                                          ; +0x54, 0x10002d054\nLDR             X8, [X8,#0x1F0]                                        ; +0x58, 0x10002d058\nMOV             X0, X19                                                ; +0x5c, 0x10002d05c\nBLR             X8                                                     ; +0x60, 0x10002d060\nLDR             X8, [X0]                                               ; +0x64, 0x10002d064\nADD             X8, X8, #0xA8                                          ; +0x68, 0x10002d068\nLDR             X8, [X8]                                               ; +0x6c, 0x10002d06c\nBLR             X8                                                     ; +0x70, 0x10002d070\nLDR             X8, [X19]                                              ; +0x74, 0x10002d074\nLDR             X8, [X8,#0x88]                                         ; +0x78, 0x10002d078\nMOV             X0, X19                                                ; +0x7c, 0x10002d07c\nBLR             X8                                                     ; +0x80, 0x10002d080\nLDR             S1, [SP,#0x30+var_28]                                  ; +0x84, 0x10002d084\nFDIV            S0, S1, S0                                             ; +0x88, 0x10002d088\nFMOV            S1, #10.0                                              ; +0x8c, 0x10002d08c\nFADD            S0, S0, S1                                             ; +0x90, 0x10002d090\nSTR             S0, [X19,#0x1BC]                                       ; +0x94, 0x10002d094\nLDR             S1, [X19,#0x1A8]                                       ; +0x98, 0x10002d098\nFDIV            S0, S0, S1                                             ; +0x9c, 0x10002d09c\nFRINTP          S0, S0                                                 ; +0xa0, 0x10002d0a0\nFMOV            S1, #1.0                                               ; +0xa4, 0x10002d0a4\nFADD            S0, S0, S1                                             ; +0xa8, 0x10002d0a8\nFCVTZS          W20, S0                                                ; +0xac, 0x10002d0ac\nLDRB            W21, [X19,#0x1C8]                                      ; +0xb0, 0x10002d0b0\nADD             W1, W20, W21                                           ; +0xb4, 0x10002d0b4\nMOV             X0, X19                                                ; +0xb8, 0x10002d0b8\nMOV             W2, #1                                                 ; +0xbc, 0x10002d0bc\nBL              GJMGLayer__loadGroundSprites                           ; +0xc0, 0x10002d0c0\nADD             W1, W20, W21                                           ; +0xc4, 0x10002d0c4\nMOV             X0, X19                                                ; +0xc8, 0x10002d0c8\nMOV             W2, #0                                                 ; +0xcc, 0x10002d0cc\nBL              GJMGLayer__loadGroundSprites                           ; +0xd0, 0x10002d0d0\nLDP             X29, X30, [SP,#0x30+var_s0]                            ; +0xd4, 0x10002d0d4\nLDP             X20, X19, [SP,#0x30+var_10]                            ; +0xd8, 0x10002d0d8\nLDP             X22, X21, [SP,#0x30+var_20]                            ; +0xdc, 0x10002d0dc\nADD             SP, SP, #0x40 ; '@'                                    ; +0xe0, 0x10002d0e0\nRET                                                                    ; +0xe4, 0x10002d0e4", "xrefs": ["GJMGLayer::scaleGround @ 0x10002cfe4"], "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"}