{"type": "func", "start": 4189788, "end": 4190312, "name": "EndPortalObject::updateEndPos", "pseudocode": "// \n// EndPortalObject::updateEndPos from 0x3fee5c to 0x3ff068 (524 bytes)\n// \n// 2 xrefs:\n// > PlayLayer::checkForEnd @ 0x30eede\n// > EndPortalObject::setVisible @ 0x3ff094\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 EndPortalObject::updateEndPos(EndPortalObject *a1, bool a2)\n{\n  _BOOL4 v3; // r7\n  cocos2d::CCDirector *v4; // r0\n  float y; // s16\n  GameManager *v6; // r0\n  float v7; // s16\n  float v8; // s17\n  float v9; // s15\n  GameManager *v10; // r0\n  float v11; // s18\n  float v12; // s17\n  void (__fastcall *setStartPos)(GameObject *__hidden, cocos2d::CCPoint); // r8\n  const cocos2d::CCPoint *v14; // r0\n  cocos2d::CCParticleSystemQuad *m_particle; // r0\n  cocos2d::CCParticleSystemQuad *v16; // r6\n  void (__fastcall *setScale)(cocos2d::CCParticleSystem *__hidden, float); // r7\n  float v18; // s16\n  GameManager *v19; // r0\n  void (__fastcall *setScaleX)(GameObject *__hidden, float); // r6\n  float v21; // s16\n  GameManager *v22; // r0\n  void (__fastcall *setScaleY)(GameObject *__hidden, float); // r6\n  GameManager *v24; // r0\n  cocos2d::CCSprite *m_gradientBar; // r3\n  float height; // s16\n  void (__fastcall *v27)(cocos2d::CCSprite *__hidden, float); // r6\n  GameManager *v28; // r0\n  float v29; // r1\n  void (__fastcall *setPosition)(EndPortalObject *__hidden, const cocos2d::CCPoint *); // r6\n  const cocos2d::CCPoint *v31; // r0\n  cocos2d::CCSize v32; // [sp+4h] [bp-1Ch] BYREF\n  _BYTE v33[4]; // [sp+Ch] [bp-14h] BYREF\n  float v34; // [sp+10h] [bp-10h]\n  cocos2d::CCPoint v35; // [sp+14h] [bp-Ch] BYREF\n\n  v3 = a2;\n  v4 = cocos2d::CCDirector::sharedDirector();\n  cocos2d::CCDirector::getWinSize(&v32, v4);\n  if ( a1->m_startPosHeightRelated )\n  {\n    y = 225.0;\n    a1->getStartPos((cocos2d::CCPoint *)v33, a1);\n    if ( v34 > 225.0 )\n    {\n      a1->getStartPos(&v35, a1);\n      y = v35.y;\n    }\n  }\n  else if ( GameManager::sharedState()->m_playLayer->m_player1->m_isShip\n         || (v6 = GameManager::sharedState(),\n             v7 = v32.height * 0.5,\n             v8 = v6->m_playLayer->m_gameState.m_cameraPosition2.y,\n             v9 = v7 / GameManager::sharedState()->m_playLayer->m_gameState.m_cameraZoom,\n             y = 225.0,\n             (float)(v8 + v9) > 225.0) )\n  {\n    v10 = GameManager::sharedState();\n    v11 = v32.height * 0.5;\n    v12 = v10->m_playLayer->m_gameState.m_cameraPosition2.y;\n    y = v12 + (float)(v11 / GameManager::sharedState()->m_playLayer->m_gameState.m_cameraZoom);\n  }\n  setStartPos = a1->setStartPos;\n  v14 = a1->getPosition(a1);\n  cocos2d::CCPoint::CCPoint(&v35, v14->x, y);\n  ((void (__fastcall *)(EndPortalObject *, cocos2d::CCPoint *))setStartPos)(a1, &v35);\n  m_particle = a1->m_particle;\n  if ( m_particle )\n  {\n    if ( v3 )\n      m_particle->update(m_particle, 1.0);\n    v16 = a1->m_particle;\n    setScale = v16->setScale;\n    v18 = 1.0;\n    if ( a1->m_flippedX )\n      v18 = -1.0;\n    v19 = GameManager::sharedState();\n    ((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, _DWORD))setScale)(\n      v16,\n      v18 / v19->m_playLayer->m_gameState.m_targetCameraZoom);\n  }\n  setScaleX = a1->setScaleX;\n  if ( a1->m_flippedX )\n    v21 = -1.0;\n  else\n    v21 = 1.0;\n  v22 = GameManager::sharedState();\n  ((void (__fastcall *)(EndPortalObject *, _DWORD))setScaleX)(\n    a1,\n    v21 / v22->m_playLayer->m_gameState.m_targetCameraZoom);\n  setScaleY = a1->setScaleY;\n  v24 = GameManager::sharedState();\n  ((void (__fastcall *)(EndPortalObject *, _DWORD))setScaleY)(\n    a1,\n    1.0 / v24->m_playLayer->m_gameState.m_targetCameraZoom);\n  m_gradientBar = a1->m_gradientBar;\n  if ( m_gradientBar )\n  {\n    height = v32.height;\n    v27 = m_gradientBar->setScaleY;\n    v28 = GameManager::sharedState();\n    ((void (__fastcall *)(cocos2d::CCSprite *, _DWORD))v27)(\n      a1->m_gradientBar,\n      (float)((float)(height / v28->m_playLayer->m_gameState.m_targetCameraZoom) * 1.5)\n    / a1->m_gradientBar->m_obRect.size.height);\n    if ( a1->m_flippedX )\n      v29 = -1.0;\n    else\n      v29 = 1.0;\n    ((void (__fastcall *)(cocos2d::CCSprite *, _DWORD))a1->m_gradientBar->setScaleX)(a1->m_gradientBar, LODWORD(v29));\n  }\n  setPosition = a1->setPosition;\n  v31 = a1->getPosition(a1);\n  setPosition(a1, v31);\n}", "assembly": "; \n; EndPortalObject::updateEndPos from 0x3fee5c to 0x3ff068 (524 bytes)\n; \n; 2 xrefs:\n; > PlayLayer::checkForEnd @ 0x30eede\n; > EndPortalObject::setVisible @ 0x3ff094\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.W          {R4-R8,LR}                                             ; +0x0, 0x3fee5c\nMOV             R4, R0                                                 ; +0x4, 0x3fee60\nLDR             R5, =(__stack_chk_guard_ptr - 0x3FEE6E)                ; +0x6, 0x3fee62\nMOV             R7, R1                                                 ; +0x8, 0x3fee64\nVPUSH           {D8-D9}                                                ; +0xa, 0x3fee66\nADD             R5, PC; __stack_chk_guard_ptr                          ; +0xe, 0x3fee6a\nLDR             R5, [R5]; __stack_chk_guard                            ; +0x10, 0x3fee6c\nLDR             R3, [R5]                                               ; +0x12, 0x3fee6e\nSUB             SP, SP, #0x20                                          ; +0x14, 0x3fee70\nADD             R6, SP, #0x20+var_C                                    ; +0x16, 0x3fee72\nSTR             R3, [SP,#0x20+var_4]                                   ; +0x18, 0x3fee74\nBL              _ZN7cocos2d10CCDirector14sharedDirectorEv; cocos2d::CCDirector::sharedDirector(void) ; +0x1a, 0x3fee76\nMOV             R1, R0                                                 ; +0x1e, 0x3fee7a\nADD             R0, SP, #0x20+var_1C; this                             ; +0x20, 0x3fee7c\nBL              _ZN7cocos2d10CCDirector10getWinSizeEv; cocos2d::CCDirector::getWinSize(void) ; +0x22, 0x3fee7e\nLDRB.W          R3, [R4,#0x48D]                                        ; +0x26, 0x3fee82\nCBZ             R3, loc_3FEEB8                                         ; +0x2a, 0x3fee86\nLDR             R3, [R4]                                               ; +0x2c, 0x3fee88\nADD             R0, SP, #0x20+var_14                                   ; +0x2e, 0x3fee8a\nMOV             R1, R4                                                 ; +0x30, 0x3fee8c\nVLDR            S16, =225.0                                            ; +0x32, 0x3fee8e\nLDR.W           R3, [R3,#0x384]                                        ; +0x36, 0x3fee92\nBLX             R3                                                     ; +0x3a, 0x3fee96\nVLDR            S15, [SP,#0x20+var_10]                                 ; +0x3c, 0x3fee98\nVCMPE.F32       S15, S16                                               ; +0x40, 0x3fee9c\nVMRS            APSR_nzcv, FPSCR                                       ; +0x44, 0x3feea0\nBLE             loc_3FEF34                                             ; +0x48, 0x3feea4\nLDR             R3, [R4]                                               ; +0x4a, 0x3feea6\nMOV             R0, R6                                                 ; +0x4c, 0x3feea8\nMOV             R1, R4                                                 ; +0x4e, 0x3feeaa\nLDR.W           R3, [R3,#0x384]                                        ; +0x50, 0x3feeac\nBLX             R3                                                     ; +0x54, 0x3feeb0\nVLDR            S16, [SP,#0x20+var_8]                                  ; +0x56, 0x3feeb2\nB               loc_3FEF34                                             ; +0x5a, 0x3feeb6\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x5c, 0x3feeb8\nVMOV.F32        S18, #0.5                                              ; +0x60, 0x3feebc\nLDR.W           R3, [R0,#0x16C]                                        ; +0x64, 0x3feec0\nLDR.W           R3, [R3,#0x8B8]                                        ; +0x68, 0x3feec4\nLDRB.W          R3, [R3,#0x7B1]                                        ; +0x6c, 0x3feec8\nCBNZ            R3, loc_3FEF08                                         ; +0x70, 0x3feecc\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x72, 0x3feece\nVLDR            S16, [SP,#0x20+var_18]                                 ; +0x76, 0x3feed2\nVMUL.F32        S16, S16, S18                                          ; +0x7a, 0x3feed6\nLDR.W           R3, [R0,#0x16C]                                        ; +0x7e, 0x3feeda\nADDW            R3, R3, #0x414                                         ; +0x82, 0x3feede\nVLDR            S17, [R3]                                              ; +0x86, 0x3feee2\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x8a, 0x3feee6\nLDR.W           R3, [R0,#0x16C]                                        ; +0x8e, 0x3feeea\nVLDR            S15, [R3,#0x148]                                       ; +0x92, 0x3feeee\nVDIV.F32        S15, S16, S15                                          ; +0x96, 0x3feef2\nVLDR            S16, =225.0                                            ; +0x9a, 0x3feef6\nVADD.F32        S15, S17, S15                                          ; +0x9e, 0x3feefa\nVCMPE.F32       S15, S16                                               ; +0xa2, 0x3feefe\nVMRS            APSR_nzcv, FPSCR                                       ; +0xa6, 0x3fef02\nBLE             loc_3FEF34                                             ; +0xaa, 0x3fef06\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0xac, 0x3fef08\nVLDR            S15, [SP,#0x20+var_18]                                 ; +0xb0, 0x3fef0c\nVMUL.F32        S18, S15, S18                                          ; +0xb4, 0x3fef10\nLDR.W           R3, [R0,#0x16C]                                        ; +0xb8, 0x3fef14\nADDW            R3, R3, #0x414                                         ; +0xbc, 0x3fef18\nVLDR            S17, [R3]                                              ; +0xc0, 0x3fef1c\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0xc4, 0x3fef20\nLDR.W           R3, [R0,#0x16C]                                        ; +0xc8, 0x3fef24\nVLDR            S15, [R3,#0x148]                                       ; +0xcc, 0x3fef28\nVDIV.F32        S18, S18, S15                                          ; +0xd0, 0x3fef2c\nVADD.F32        S16, S17, S18                                          ; +0xd4, 0x3fef30\nLDR             R3, [R4]                                               ; +0xd8, 0x3fef34\nMOV             R0, R4                                                 ; +0xda, 0x3fef36\nLDR.W           R8, [R3,#0x2A4]                                        ; +0xdc, 0x3fef38\nLDR             R3, [R3,#0x60]                                         ; +0xe0, 0x3fef3c\nBLX             R3                                                     ; +0xe2, 0x3fef3e\nVMOV            R2, S16; float                                         ; +0xe4, 0x3fef40\nVMOV.F32        S19, #1.0                                              ; +0xe8, 0x3fef44\nMOV             R3, R0                                                 ; +0xec, 0x3fef48\nMOV             R0, R6; this                                           ; +0xee, 0x3fef4a\nLDR             R1, [R3]; float                                        ; +0xf0, 0x3fef4c\nBL              _ZN7cocos2d7CCPointC1Eff; cocos2d::CCPoint::CCPoint(float,float) ; +0xf2, 0x3fef4e\nMOV             R0, R4                                                 ; +0xf6, 0x3fef52\nMOV             R1, R6                                                 ; +0xf8, 0x3fef54\nBLX             R8                                                     ; +0xfa, 0x3fef56\nLDR.W           R0, [R4,#0x294]                                        ; +0xfc, 0x3fef58\nCBZ             R0, loc_3FEF9E                                         ; +0x100, 0x3fef5c\nCBZ             R7, loc_3FEF6A                                         ; +0x102, 0x3fef5e\nLDR             R3, [R0]                                               ; +0x104, 0x3fef60\nVMOV            R1, S19                                                ; +0x106, 0x3fef62\nLDR             R3, [R3,#0x14]                                         ; +0x10a, 0x3fef66\nBLX             R3                                                     ; +0x10c, 0x3fef68\nLDR.W           R6, [R4,#0x294]                                        ; +0x10e, 0x3fef6a\nVMOV.F32        S15, #-1.0                                             ; +0x112, 0x3fef6e\nLDR             R3, [R6]                                               ; +0x116, 0x3fef72\nLDR             R7, [R3,#0x50]                                         ; +0x118, 0x3fef74\nLDRB.W          R3, [R4,#0x48C]                                        ; +0x11a, 0x3fef76\nCMP             R3, #0                                                 ; +0x11e, 0x3fef7a\nVMOV.F32        S16, #1.0                                              ; +0x120, 0x3fef7c\nIT NE                                                                  ; +0x124, 0x3fef80\nVMOVNE.F32      S16, S15                                               ; +0x126, 0x3fef82\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x12a, 0x3fef86\nLDR.W           R3, [R0,#0x16C]                                        ; +0x12e, 0x3fef8a\nMOV             R0, R6                                                 ; +0x132, 0x3fef8e\nVLDR            S15, [R3,#0x14C]                                       ; +0x134, 0x3fef90\nVDIV.F32        S15, S16, S15                                          ; +0x138, 0x3fef94\nVMOV            R1, S15                                                ; +0x13c, 0x3fef98\nBLX             R7                                                     ; +0x140, 0x3fef9c\nVMOV.F32        S18, #-1.0                                             ; +0x142, 0x3fef9e\nLDR             R3, [R4]                                               ; +0x146, 0x3fefa2\nLDR             R6, [R3,#0x40]                                         ; +0x148, 0x3fefa4\nLDRB.W          R3, [R4,#0x48C]                                        ; +0x14a, 0x3fefa6\nCMP             R3, #0                                                 ; +0x14e, 0x3fefaa\nVMOV.F32        S17, #1.0                                              ; +0x150, 0x3fefac\nITE EQ                                                                 ; +0x154, 0x3fefb0\nVMOVEQ.F32      S16, S17                                               ; +0x156, 0x3fefb2\nVMOVNE.F32      S16, S18                                               ; +0x15a, 0x3fefb6\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x15e, 0x3fefba\nLDR.W           R3, [R0,#0x16C]                                        ; +0x162, 0x3fefbe\nMOV             R0, R4                                                 ; +0x166, 0x3fefc2\nVLDR            S15, [R3,#0x14C]                                       ; +0x168, 0x3fefc4\nVDIV.F32        S15, S16, S15                                          ; +0x16c, 0x3fefc8\nVMOV            R1, S15                                                ; +0x170, 0x3fefcc\nBLX             R6                                                     ; +0x174, 0x3fefd0\nLDR             R3, [R4]                                               ; +0x176, 0x3fefd2\nLDR             R6, [R3,#0x48]                                         ; +0x178, 0x3fefd4\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x17a, 0x3fefd6\nLDR.W           R3, [R0,#0x16C]                                        ; +0x17e, 0x3fefda\nMOV             R0, R4                                                 ; +0x182, 0x3fefde\nVLDR            S15, [R3,#0x14C]                                       ; +0x184, 0x3fefe0\nVDIV.F32        S15, S19, S15                                          ; +0x188, 0x3fefe4\nVMOV            R1, S15                                                ; +0x18c, 0x3fefe8\nBLX             R6                                                     ; +0x190, 0x3fefec\nLDR.W           R3, [R4,#0x488]                                        ; +0x192, 0x3fefee\nCBZ             R3, loc_3FF042                                         ; +0x196, 0x3feff2\nLDR             R3, [R3]                                               ; +0x198, 0x3feff4\nVLDR            S16, [SP,#0x20+var_18]                                 ; +0x19a, 0x3feff6\nLDR             R6, [R3,#0x48]                                         ; +0x19e, 0x3feffa\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x1a0, 0x3feffc\nLDR.W           R3, [R4,#0x488]                                        ; +0x1a4, 0x3ff000\nLDR.W           R2, [R0,#0x16C]                                        ; +0x1a8, 0x3ff004\nMOV             R0, R3                                                 ; +0x1ac, 0x3ff008\nVLDR            S15, [R2,#0x14C]                                       ; +0x1ae, 0x3ff00a\nVDIV.F32        S16, S16, S15                                          ; +0x1b2, 0x3ff00e\nVMOV.F32        S15, #1.5                                              ; +0x1b6, 0x3ff012\nVMUL.F32        S16, S16, S15                                          ; +0x1ba, 0x3ff016\nVLDR            S15, [R3,#0x15C]                                       ; +0x1be, 0x3ff01a\nVDIV.F32        S15, S16, S15                                          ; +0x1c2, 0x3ff01e\nVMOV            R1, S15                                                ; +0x1c6, 0x3ff022\nBLX             R6                                                     ; +0x1ca, 0x3ff026\nLDR.W           R0, [R4,#0x488]                                        ; +0x1cc, 0x3ff028\nLDRB.W          R2, [R4,#0x48C]                                        ; +0x1d0, 0x3ff02c\nLDR             R3, [R0]                                               ; +0x1d4, 0x3ff030\nCMP             R2, #0                                                 ; +0x1d6, 0x3ff032\nITE EQ                                                                 ; +0x1d8, 0x3ff034\nVMOVEQ          R1, S17                                                ; +0x1da, 0x3ff036\nVMOVNE          R1, S18                                                ; +0x1de, 0x3ff03a\nLDR             R3, [R3,#0x40]                                         ; +0x1e2, 0x3ff03e\nBLX             R3                                                     ; +0x1e4, 0x3ff040\nLDR             R3, [R4]                                               ; +0x1e6, 0x3ff042\nMOV             R0, R4                                                 ; +0x1e8, 0x3ff044\nLDR             R6, [R3,#0x5C]                                         ; +0x1ea, 0x3ff046\nLDR             R3, [R3,#0x60]                                         ; +0x1ec, 0x3ff048\nBLX             R3                                                     ; +0x1ee, 0x3ff04a\nMOV             R1, R0                                                 ; +0x1f0, 0x3ff04c\nMOV             R0, R4                                                 ; +0x1f2, 0x3ff04e\nBLX             R6                                                     ; +0x1f4, 0x3ff050\nLDR             R2, [SP,#0x20+var_4]                                   ; +0x1f6, 0x3ff052\nLDR             R3, [R5]                                               ; +0x1f8, 0x3ff054\nCMP             R2, R3                                                 ; +0x1fa, 0x3ff056\nBEQ             loc_3FF05E                                             ; +0x1fc, 0x3ff058\nBLX             __stack_chk_fail                                       ; +0x1fe, 0x3ff05a\nADD             SP, SP, #0x20 ; ' '                                    ; +0x202, 0x3ff05e\nVPOP            {D8-D9}                                                ; +0x204, 0x3ff060\nPOP.W           {R4-R8,PC}                                             ; +0x208, 0x3ff064", "xrefs": ["PlayLayer::checkForEnd @ 0x30eede", "EndPortalObject::setVisible @ 0x3ff094"], "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"}