{"type": "func", "start": 4301174384, "end": 4301174756, "name": "GJGroundLayer::updateGroundWidth", "pseudocode": "// \n// GJGroundLayer::updateGroundWidth from 0x1005eb670 to 0x1005eb7e4 (372 bytes)\n// \n// 1 xrefs:\n// > GJGroundLayer::scaleGround @ 0x1005eb5c7\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  GJGroundLayer *v3; // rbx\n  cocos2d::CCDirector *v4; // rsi\n  GJGroundLayer_vtbl *v5; // rax\n  float (__cdecl **p_getScaleX)(cocos2d::CCNode *__hidden); // rax\n  float v7; // xmm0_4\n  __m128 v8; // xmm1\n  int v9; // r15d\n  float *v10; // rdi\n  double v11; // xmm0_8\n  float m_groundWidth; // xmm0_4\n  cocos2d::CCSprite *m_lineSprite; // rbx\n  __int64 v14; // rax\n  float v15[2]; // [rsp+4h] [rbp-2Ch] BYREF\n  float v16; // [rsp+Ch] [rbp-24h] BYREF\n  float v17; // [rsp+14h] [rbp-1Ch]\n  double v18; // 0:xmm0_8.8\n\n  v3 = a1;\n  if ( ((__int64 (__fastcall *)(GJGroundLayer *))a1->getParent)(a1) )\n  {\n    v4 = cocos2d::CCDirector::sharedDirector();\n    *(cocos2d::CCSize *)&v18 = cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v16);\n    v5 = a1->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n    if ( a2 )\n    {\n      p_getScaleX = &v5->getScaleX;\n    }\n    else\n    {\n      a1 = (GJGroundLayer *)((__int64 (__fastcall *)(GJGroundLayer *, cocos2d::CCDirector *, double))v5->getParent)(\n                              a1,\n                              v4,\n                              v18);\n      p_getScaleX = &a1->getScale;\n    }\n    v7 = ((float (__fastcall *)(GJGroundLayer *, cocos2d::CCDirector *, double))*p_getScaleX)(a1, v4, v18);\n    v8 = (__m128)LODWORD(v16);\n    v17 = v7;\n    v8.f32[0] = (float)(v16 / v7) + 10.0;\n    LODWORD(v3->m_groundWidth) = v8.i32[0];\n    v8.f32[0] = v8.f32[0] / v3->m_textureWidth;\n    v9 = (int)(float)(_mm_round_ss((__m128)0LL, v8, 10).f32[0] + 1.0) + v3->m_cameraRotated;\n    GJGroundLayer::loadGroundSprites(v3, v9, 1);\n    GJGroundLayer::loadGroundSprites(v3, v9, 0);\n    if ( v3->m_lineType < 2 )\n    {\n      v8.i64[0] = LODWORD(v17);\n      if ( !a2 )\n      {\nLABEL_10:\n        m_groundWidth = v3->m_groundWidth;\n        m_lineSprite = v3->m_lineSprite;\n        v17 = (float)(m_groundWidth * 0.5) + -5.0;\n        v14 = ((__int64 (__fastcall *)(cocos2d::CCSprite *, float, double))m_lineSprite->getPosition)(\n                m_lineSprite,\n                v17,\n                *(double *)v8.i64);\n        sub_10028CBE0(v15, v17, *(float *)(v14 + 4));\n        ((void (__fastcall *)(cocos2d::CCSprite *, float *))m_lineSprite->setPosition)(m_lineSprite, v15);\n        return;\n      }\n      v10 = (float *)v3->m_lineSprite;\n      HIDWORD(v11) = 0;\n      *(float *)&v11 = 1.0 / v17;\n    }\n    else\n    {\n      v10 = (float *)v3->m_lineSprite;\n      *(_QWORD *)&v11 = LODWORD(v16);\n      *(float *)&v11 = (float)((float)(v16 + 10.0) / v17) / v10[108];\n    }\n    (*(void (__fastcall **)(float *, double))(*(_QWORD *)v10 + 128LL))(v10, v11);\n    goto LABEL_10;\n  }\n}", "assembly": "; \n; GJGroundLayer::updateGroundWidth from 0x1005eb670 to 0x1005eb7e4 (372 bytes)\n; \n; 1 xrefs:\n; > GJGroundLayer::scaleGround @ 0x1005eb5c7\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\npush    rbp                                                            ; +0x0, 0x1005eb670\nmov     rbp, rsp                                                       ; +0x1, 0x1005eb671\npush    r15                                                            ; +0x4, 0x1005eb674\npush    r14                                                            ; +0x6, 0x1005eb676\npush    rbx                                                            ; +0x8, 0x1005eb678\nsub     rsp, 18h                                                       ; +0x9, 0x1005eb679\nmov     r14d, esi                                                      ; +0xd, 0x1005eb67d\nmov     rbx, rdi                                                       ; +0x10, 0x1005eb680\nmov     rax, [rdi]                                                     ; +0x13, 0x1005eb683\ncall    qword ptr [rax+1F0h]                                           ; +0x16, 0x1005eb686\ntest    rax, rax                                                       ; +0x1c, 0x1005eb68c\njz      loc_1005EB7D9                                                  ; +0x1f, 0x1005eb68f\ncall    cocos2d__CCDirector__sharedDirector                            ; +0x25, 0x1005eb695\nlea     rdi, [rbp+var_24]                                              ; +0x2a, 0x1005eb69a\nmov     rsi, rax                                                       ; +0x2e, 0x1005eb69e\ncall    cocos2d__CCDirector__getWinSize                                ; +0x31, 0x1005eb6a1\nmov     rax, [rbx]                                                     ; +0x36, 0x1005eb6a6\ntest    r14b, r14b                                                     ; +0x39, 0x1005eb6a9\njz      short loc_1005EB6B9                                            ; +0x3c, 0x1005eb6ac\nadd     rax, 88h                                                       ; +0x3e, 0x1005eb6ae\nmov     rdi, rbx                                                       ; +0x44, 0x1005eb6b4\njmp     short loc_1005EB6CD                                            ; +0x47, 0x1005eb6b7\nmov     rdi, rbx                                                       ; +0x49, 0x1005eb6b9\ncall    qword ptr [rax+1F0h]                                           ; +0x4c, 0x1005eb6bc\nmov     rdi, rax                                                       ; +0x52, 0x1005eb6c2\nmov     eax, 0A8h                                                      ; +0x55, 0x1005eb6c5\nadd     rax, [rdi]                                                     ; +0x5a, 0x1005eb6ca\ncall    qword ptr [rax]                                                ; +0x5d, 0x1005eb6cd\nmovss   xmm1, [rbp+var_24]                                             ; +0x5f, 0x1005eb6cf\nmovss   [rbp+var_1C], xmm0                                             ; +0x64, 0x1005eb6d4\ndivss   xmm1, xmm0                                                     ; +0x69, 0x1005eb6d9\naddss   xmm1, cs:dword_100814FEC                                       ; +0x6d, 0x1005eb6dd\nmovss   dword ptr [rbx+1C4h], xmm1                                     ; +0x75, 0x1005eb6e5\ndivss   xmm1, dword ptr [rbx+1A8h]                                     ; +0x7d, 0x1005eb6ed\nxorps   xmm0, xmm0                                                     ; +0x85, 0x1005eb6f5\nroundss xmm0, xmm1, 0Ah                                                ; +0x88, 0x1005eb6f8\naddss   xmm0, cs:alpha                                                 ; +0x8e, 0x1005eb6fe\ncvttss2si eax, xmm0                                                    ; +0x96, 0x1005eb706\nmovzx   r15d, byte ptr [rbx+1D0h]                                      ; +0x9a, 0x1005eb70a\nadd     r15d, eax                                                      ; +0xa2, 0x1005eb712\nmov     rdi, rbx                                                       ; +0xa5, 0x1005eb715\nmov     esi, r15d                                                      ; +0xa8, 0x1005eb718\nmov     edx, 1                                                         ; +0xab, 0x1005eb71b\ncall    GJGroundLayer__loadGroundSprites                               ; +0xb0, 0x1005eb720\nmov     rdi, rbx                                                       ; +0xb5, 0x1005eb725\nmov     esi, r15d                                                      ; +0xb8, 0x1005eb728\nxor     edx, edx                                                       ; +0xbb, 0x1005eb72b\ncall    GJGroundLayer__loadGroundSprites                               ; +0xbd, 0x1005eb72d\ncmp     dword ptr [rbx+1C0h], 2                                        ; +0xc2, 0x1005eb732\njl      short loc_1005EB75E                                            ; +0xc9, 0x1005eb739\nmov     rdi, [rbx+1B0h]                                                ; +0xcb, 0x1005eb73b\nmovss   xmm0, [rbp+var_24]                                             ; +0xd2, 0x1005eb742\naddss   xmm0, cs:dword_100814FEC                                       ; +0xd7, 0x1005eb747\ndivss   xmm0, [rbp+var_1C]                                             ; +0xdf, 0x1005eb74f\ndivss   xmm0, dword ptr [rdi+1B0h]                                     ; +0xe4, 0x1005eb754\njmp     short loc_1005EB77B                                            ; +0xec, 0x1005eb75c\nmovss   xmm1, [rbp+var_1C]                                             ; +0xee, 0x1005eb75e\ntest    r14b, r14b                                                     ; +0xf3, 0x1005eb763\njz      short loc_1005EB784                                            ; +0xf6, 0x1005eb766\nmov     rdi, [rbx+1B0h]                                                ; +0xf8, 0x1005eb768\nmovss   xmm0, cs:alpha                                                 ; +0xff, 0x1005eb76f\ndivss   xmm0, xmm1                                                     ; +0x107, 0x1005eb777\nmov     rax, [rdi]                                                     ; +0x10b, 0x1005eb77b\ncall    qword ptr [rax+80h]                                            ; +0x10e, 0x1005eb77e\nmovss   xmm0, dword ptr [rbx+1C4h]                                     ; +0x114, 0x1005eb784\nmulss   xmm0, cs:dword_100814FA8                                       ; +0x11c, 0x1005eb78c\nmov     rbx, [rbx+1B0h]                                                ; +0x124, 0x1005eb794\naddss   xmm0, cs:dword_100815278                                       ; +0x12b, 0x1005eb79b\nmovss   [rbp+var_1C], xmm0                                             ; +0x133, 0x1005eb7a3\nmov     rax, [rbx]                                                     ; +0x138, 0x1005eb7a8\nmov     rdi, rbx                                                       ; +0x13b, 0x1005eb7ab\ncall    qword ptr [rax+0C0h]                                           ; +0x13e, 0x1005eb7ae\nmovss   xmm1, dword ptr [rax+4]                                        ; +0x144, 0x1005eb7b4\nlea     r14, [rbp+var_2C]                                              ; +0x149, 0x1005eb7b9\nmov     rdi, r14                                                       ; +0x14d, 0x1005eb7bd\nmovss   xmm0, [rbp+var_1C]                                             ; +0x150, 0x1005eb7c0\ncall    sub_10028CBE0                                                  ; +0x155, 0x1005eb7c5\nmov     rax, [rbx]                                                     ; +0x15a, 0x1005eb7ca\nmov     rdi, rbx                                                       ; +0x15d, 0x1005eb7cd\nmov     rsi, r14                                                       ; +0x160, 0x1005eb7d0\ncall    qword ptr [rax+0B8h]                                           ; +0x163, 0x1005eb7d3\nadd     rsp, 18h                                                       ; +0x169, 0x1005eb7d9\npop     rbx                                                            ; +0x16d, 0x1005eb7dd\npop     r14                                                            ; +0x16e, 0x1005eb7de\npop     r15                                                            ; +0x170, 0x1005eb7e0\npop     rbp                                                            ; +0x172, 0x1005eb7e2\nretn                                                                   ; +0x173, 0x1005eb7e3", "xrefs": ["GJGroundLayer::scaleGround @ 0x1005eb5c7"], "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"}