{"type": "func", "start": 4295148564, "end": 4295148924, "name": "GJGroundLayer::updateGroundWidth", "pseudocode": "// \n// GJGroundLayer::updateGroundWidth from 0x10002c414 to 0x10002c57c (360 bytes)\n// \n// 1 xrefs:\n// > GJGroundLayer::scaleGround @ 0x10002c3ec\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 __fastcall GJGroundLayer::updateGroundWidth(GJGroundLayer *a1, bool a2)\n{\n  _BOOL4 v2; // w20\n  cocos2d::CCDirector *v4; // x0\n  GJGroundLayer_vtbl *v5; // x8\n  float (__fastcall **p_getScaleX)(GJGroundLayer *, __n128, __n128); // x8\n  GJGroundLayer *v7; // x0\n  float v8; // s8\n  float v9; // s0\n  int v10; // w21\n  _BOOL4 m_cameraRotated; // w22\n  __n128 v12; // q0\n  cocos2d::CCSprite *v13; // x0\n  cocos2d::CCSprite *m_lineSprite; // x20\n  float v15; // s8\n  __n128 v16; // q1\n  __n128 v17; // q0\n  __n128 v18; // q0\n  __n128 v19; // q1\n  int v20; // [xsp+0h] [xbp-40h] BYREF\n  float v21; // [xsp+8h] [xbp-38h]\n  cocos2d::CCSize WinSize; // 0:kr00_8.8\n\n  v2 = a2;\n  if ( ((__int64 (__fastcall *)(GJGroundLayer *))a1->getParent)(a1) )\n  {\n    v4 = cocos2d::CCDirector::sharedDirector();\n    WinSize = cocos2d::CCDirector::getWinSize(v4);\n    v18.n128_u32[0] = LODWORD(WinSize.width);\n    v19.n128_u32[0] = LODWORD(WinSize.height);\n    v5 = a1->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n    if ( v2 )\n    {\n      p_getScaleX = (float (__fastcall **)(GJGroundLayer *, __n128, __n128))&v5->getScaleX;\n      v7 = a1;\n    }\n    else\n    {\n      v7 = (GJGroundLayer *)((__int64 (__fastcall *)(GJGroundLayer *, float, float))v5->getParent)(\n                              a1,\n                              WinSize.width,\n                              WinSize.height);\n      p_getScaleX = (float (__fastcall **)(GJGroundLayer *, __n128, __n128))&v7->getScale;\n    }\n    v8 = (*p_getScaleX)(v7, v18, v19);\n    v9 = (float)(v21 / v8) + 10.0;\n    a1->m_groundWidth = v9;\n    v10 = (int)(float)(ceilf(v9 / a1->m_textureWidth) + 1.0);\n    m_cameraRotated = a1->m_cameraRotated;\n    GJGroundLayer::loadGroundSprites(a1, v10 + m_cameraRotated, 1);\n    GJGroundLayer::loadGroundSprites(a1, v10 + m_cameraRotated, 0);\n    if ( a1->m_lineType < 2 )\n    {\n      if ( !v2 )\n      {\nLABEL_10:\n        m_lineSprite = a1->m_lineSprite;\n        v15 = (float)(a1->m_groundWidth * 0.5) + -5.0;\n        v16.n128_u32[0] = *(_DWORD *)(((__int64 (__fastcall *)(cocos2d::CCSprite *))m_lineSprite->getPosition)(m_lineSprite)\n                                    + 4);\n        v17.n128_f32[0] = v15;\n        sub_100022980(v17, v16, &v20);\n        ((void (__fastcall *)(cocos2d::CCSprite *, int *))m_lineSprite->setPosition)(m_lineSprite, &v20);\n        return;\n      }\n      v13 = a1->m_lineSprite;\n      v12.n128_f32[0] = 1.0 / v8;\n    }\n    else\n    {\n      v13 = a1->m_lineSprite;\n      v12.n128_f32[0] = (float)((float)(v21 + 10.0) / v8) / v13->m_obRect.size.width;\n    }\n    ((void (__fastcall *)(cocos2d::CCSprite *, __n128))v13->setScaleX)(v13, v12);\n    goto LABEL_10;\n  }\n}", "assembly": "; \n; GJGroundLayer::updateGroundWidth from 0x10002c414 to 0x10002c57c (360 bytes)\n; \n; 1 xrefs:\n; > GJGroundLayer::scaleGround @ 0x10002c3ec\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, #0x50                                          ; +0x0, 0x10002c414\nSTP             D9, D8, [SP,#0x40+var_30]                              ; +0x4, 0x10002c418\nSTP             X22, X21, [SP,#0x40+var_20]                            ; +0x8, 0x10002c41c\nSTP             X20, X19, [SP,#0x40+var_10]                            ; +0xc, 0x10002c420\nSTP             X29, X30, [SP,#0x40+var_s0]                            ; +0x10, 0x10002c424\nADD             X29, SP, #0x40                                         ; +0x14, 0x10002c428\nMOV             X20, X1                                                ; +0x18, 0x10002c42c\nMOV             X19, X0                                                ; +0x1c, 0x10002c430\nLDR             X8, [X0]                                               ; +0x20, 0x10002c434\nLDR             X8, [X8,#0x1F0]                                        ; +0x24, 0x10002c438\nBLR             X8                                                     ; +0x28, 0x10002c43c\nCBZ             X0, loc_10002C564                                      ; +0x2c, 0x10002c440\nBL              cocos2d__CCDirector__sharedDirector                    ; +0x30, 0x10002c444\nADD             X8, SP, #0x40+var_38                                   ; +0x34, 0x10002c448\nBL              cocos2d__CCDirector__getWinSize                        ; +0x38, 0x10002c44c\nLDR             X8, [X19]                                              ; +0x3c, 0x10002c450\nCBZ             W20, loc_10002C464                                     ; +0x40, 0x10002c454\nADD             X8, X8, #0x88                                          ; +0x44, 0x10002c458\nMOV             X0, X19                                                ; +0x48, 0x10002c45c\nB               loc_10002C478                                          ; +0x4c, 0x10002c460\nLDR             X8, [X8,#0x1F0]                                        ; +0x50, 0x10002c464\nMOV             X0, X19                                                ; +0x54, 0x10002c468\nBLR             X8                                                     ; +0x58, 0x10002c46c\nLDR             X8, [X0]                                               ; +0x5c, 0x10002c470\nADD             X8, X8, #0xA8                                          ; +0x60, 0x10002c474\nLDR             X8, [X8]                                               ; +0x64, 0x10002c478\nBLR             X8                                                     ; +0x68, 0x10002c47c\nFMOV            S8, S0                                                 ; +0x6c, 0x10002c480\nLDR             S0, [SP,#0x40+var_38]                                  ; +0x70, 0x10002c484\nFDIV            S0, S0, S8                                             ; +0x74, 0x10002c488\nFMOV            S9, #10.0                                              ; +0x78, 0x10002c48c\nFADD            S0, S0, S9                                             ; +0x7c, 0x10002c490\nSTR             S0, [X19,#0x1C4]                                       ; +0x80, 0x10002c494\nLDR             S1, [X19,#0x1A8]                                       ; +0x84, 0x10002c498\nFDIV            S0, S0, S1                                             ; +0x88, 0x10002c49c\nFRINTP          S0, S0                                                 ; +0x8c, 0x10002c4a0\nFMOV            S1, #1.0                                               ; +0x90, 0x10002c4a4\nFADD            S0, S0, S1                                             ; +0x94, 0x10002c4a8\nFCVTZS          W21, S0                                                ; +0x98, 0x10002c4ac\nLDRB            W22, [X19,#0x1D0]                                      ; +0x9c, 0x10002c4b0\nADD             W1, W21, W22                                           ; +0xa0, 0x10002c4b4\nMOV             X0, X19                                                ; +0xa4, 0x10002c4b8\nMOV             W2, #1                                                 ; +0xa8, 0x10002c4bc\nBL              GJGroundLayer__loadGroundSprites                       ; +0xac, 0x10002c4c0\nADD             W1, W21, W22                                           ; +0xb0, 0x10002c4c4\nMOV             X0, X19                                                ; +0xb4, 0x10002c4c8\nMOV             W2, #0                                                 ; +0xb8, 0x10002c4cc\nBL              GJGroundLayer__loadGroundSprites                       ; +0xbc, 0x10002c4d0\nLDR             W8, [X19,#0x1C0]                                       ; +0xc0, 0x10002c4d4\nCMP             W8, #2                                                 ; +0xc4, 0x10002c4d8\nB.LT            loc_10002C4FC                                          ; +0xc8, 0x10002c4dc\nLDR             X0, [X19,#0x1B0]                                       ; +0xcc, 0x10002c4e0\nLDR             S0, [SP,#0x40+var_38]                                  ; +0xd0, 0x10002c4e4\nFADD            S0, S0, S9                                             ; +0xd4, 0x10002c4e8\nFDIV            S0, S0, S8                                             ; +0xd8, 0x10002c4ec\nLDR             S1, [X0,#0x1B0]                                        ; +0xdc, 0x10002c4f0\nFDIV            S0, S0, S1                                             ; +0xe0, 0x10002c4f4\nB               loc_10002C50C                                          ; +0xe4, 0x10002c4f8\nCBZ             W20, loc_10002C518                                     ; +0xe8, 0x10002c4fc\nLDR             X0, [X19,#0x1B0]                                       ; +0xec, 0x10002c500\nFMOV            S0, #1.0                                               ; +0xf0, 0x10002c504\nFDIV            S0, S0, S8                                             ; +0xf4, 0x10002c508\nLDR             X8, [X0]                                               ; +0xf8, 0x10002c50c\nLDR             X8, [X8,#0x80]                                         ; +0xfc, 0x10002c510\nBLR             X8                                                     ; +0x100, 0x10002c514\nLDR             X20, [X19,#0x1B0]                                      ; +0x104, 0x10002c518\nLDR             S0, [X19,#0x1C4]                                       ; +0x108, 0x10002c51c\nFMOV            S1, #0.5                                               ; +0x10c, 0x10002c520\nFMUL            S0, S0, S1                                             ; +0x110, 0x10002c524\nFMOV            S1, #-5.0                                              ; +0x114, 0x10002c528\nFADD            S8, S0, S1                                             ; +0x118, 0x10002c52c\nLDR             X8, [X20]                                              ; +0x11c, 0x10002c530\nLDR             X8, [X8,#0xC0]                                         ; +0x120, 0x10002c534\nMOV             X0, X20                                                ; +0x124, 0x10002c538\nBLR             X8                                                     ; +0x128, 0x10002c53c\nLDR             S1, [X0,#4]                                            ; +0x12c, 0x10002c540\nMOV             X0, SP                                                 ; +0x130, 0x10002c544\nFMOV            S0, S8                                                 ; +0x134, 0x10002c548\nBL              sub_100022980                                          ; +0x138, 0x10002c54c\nLDR             X8, [X20]                                              ; +0x13c, 0x10002c550\nLDR             X8, [X8,#0xB8]                                         ; +0x140, 0x10002c554\nMOV             X1, SP                                                 ; +0x144, 0x10002c558\nMOV             X0, X20                                                ; +0x148, 0x10002c55c\nBLR             X8                                                     ; +0x14c, 0x10002c560\nLDP             X29, X30, [SP,#0x40+var_s0]                            ; +0x150, 0x10002c564\nLDP             X20, X19, [SP,#0x40+var_10]                            ; +0x154, 0x10002c568\nLDP             X22, X21, [SP,#0x40+var_20]                            ; +0x158, 0x10002c56c\nLDP             D9, D8, [SP,#0x40+var_30]                              ; +0x15c, 0x10002c570\nADD             SP, SP, #0x50 ; 'P'                                    ; +0x160, 0x10002c574\nRET                                                                    ; +0x164, 0x10002c578", "xrefs": ["GJGroundLayer::scaleGround @ 0x10002c3ec"], "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"}