{"type": "func", "start": 4674636, "end": 4675184, "name": "GJBaseGameLayer::processFollowActions", "pseudocode": "// \n// GJBaseGameLayer::processFollowActions from 0x47544c to 0x475670 (548 bytes)\n// \n// 1 xrefs:\n// > GJBaseGameLayer::processMoveActionsStep @ 0x496d06\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 GJBaseGameLayer::processFollowActions(GJBaseGameLayer *a1)\n{\n  GJEffectManager *m_effectManager; // r3\n  int **m_start; // r9\n  int *p_m_followedCount; // r8\n  int *v5; // r11\n  int *v6; // t1\n  int v7; // r0\n  cocos2d::CCArray *Group; // r7\n  GameObject *MainObject; // r0\n  GameObject *v10; // r5\n  unsigned int m_commandIndex; // r3\n  float *p_x; // r10\n  float *p_y; // r6\n  float m_positionX; // s14\n  float m_positionY; // s14\n  double v16; // d6\n  double v17; // d7\n  double v18; // d5\n  double v19; // d7\n  _BOOL4 v20; // r10\n  GJEffectManager *v21; // r5\n  int v22; // r0\n  int v23; // r3\n  double v24; // d6\n  GJEffectManager *v25; // r5\n  int v26; // r0\n  char v27; // r3\n  cocos2d::ccArray *data; // r3\n  cocos2d::CCObject **arr; // r6\n  GameObject *v30; // r5\n  GameObject *v31; // t1\n  unsigned int v32; // r3\n  float v33; // s14\n  float v34; // s14\n  _BOOL4 v35; // [sp+4h] [bp-10h]\n  int **m_finish; // [sp+8h] [bp-Ch]\n  cocos2d::CCObject **v37; // [sp+Ch] [bp-8h]\n\n  m_effectManager = a1->m_effectManager;\n  m_start = (int **)m_effectManager->m_unkVector6d8.m_start;\n  p_m_followedCount = &a1->m_followedCount;\n  m_finish = (int **)m_effectManager->m_unkVector6d8.m_finish;\n  while ( m_start != m_finish )\n  {\n    v6 = *m_start++;\n    v5 = v6;\n    v7 = (*(int (__fastcall **)(int *))(*v6 + 32))(v6);\n    Group = GJBaseGameLayer::getGroup(a1, v7);\n    MainObject = GJBaseGameLayer::tryGetMainObject(a1, v6[29]);\n    v10 = MainObject;\n    if ( MainObject )\n    {\n      m_commandIndex = a1->m_gameState.m_commandIndex;\n      p_x = &MainObject->m_lastPosition.x;\n      p_y = &MainObject->m_lastPosition.y;\n      if ( MainObject->m_unk4C4 != m_commandIndex )\n      {\n        m_positionX = MainObject->m_positionX;\n        *p_x = m_positionX;\n        m_positionY = MainObject->m_positionY;\n        *p_y = m_positionY;\n        MainObject->m_unk4C4 = m_commandIndex;\n        GameObject::dirtifyObjectRect(MainObject);\n      }\n      v16 = (v10->m_positionX - *p_x) * *((double *)v5 + 16);\n      v17 = v10->m_positionY - *p_y;\n      v18 = *((double *)v5 + 17);\n      *((double *)v5 + 7) = v16;\n      v19 = v17 * v18;\n      *((double *)v5 + 8) = v19;\n      v20 = v16 != 0.0;\n      v35 = v19 != 0.0;\n      if ( v16 != 0.0\n        || v19 != 0.0\n        || *((_BYTE *)v5 + 120)\n        || v10->m_unk4fb\n        && (v21 = a1->m_effectManager,\n            v22 = (*(int (__fastcall **)(int *))(*v5 + 32))(v5),\n            GJEffectManager::wasFollowing(v21, v22, v5[29])) )\n      {\n        v23 = v5[50];\n        if ( v23 )\n        {\n          v24 = *((double *)v5 + 8);\n          *(double *)(v23 + 48) = *(double *)(v23 + 48) + *((double *)v5 + 7);\n          *(double *)(v23 + 56) = *(double *)(v23 + 56) + v24;\n        }\n        v25 = a1->m_effectManager;\n        v26 = (*(int (__fastcall **)(int *))(*v5 + 32))(v5);\n        v27 = v19 != 0.0;\n        if ( v20 )\n          v27 = 1;\n        GJEffectManager::setFollowing(v25, v26, v5[29], v27);\n        *p_m_followedCount += cocos2d::CCArray::count(Group);\n        if ( Group )\n        {\n          data = Group->data;\n          if ( data->num )\n          {\n            arr = data->arr;\n            v37 = &arr[data->num] + 0x3FFFFFFF;\n            while ( arr <= v37 )\n            {\n              v31 = (GameObject *)*arr++;\n              v30 = v31;\n              if ( !v31 )\n                break;\n              if ( !v30->m_isDecoration2 )\n              {\n                v32 = a1->m_gameState.m_commandIndex;\n                if ( v30->m_unk4C4 != v32 )\n                {\n                  v33 = v30->m_positionX;\n                  v30->m_lastPosition.x = v33;\n                  v34 = v30->m_positionY;\n                  v30->m_lastPosition.y = v34;\n                  v30->m_unk4C4 = v32;\n                  GameObject::dirtifyObjectRect(v30);\n                }\n              }\n              if ( v35 )\n                v30->m_positionY = v30->m_positionY + *((double *)v5 + 8);\n              GameObject::dirtifyObjectPos(v30);\n              if ( v20 && !v30->m_tempOffsetXRelated )\n                v30->m_positionX = v30->m_positionX + *((double *)v5 + 7);\n              a1->updateObjectSection(a1, v30);\n            }\n          }\n        }\n        a1->updateDisabledObjectsLastPos(a1, Group);\n      }\n    }\n  }\n}", "assembly": "; \n; GJBaseGameLayer::processFollowActions from 0x47544c to 0x475670 (548 bytes)\n; \n; 1 xrefs:\n; > GJBaseGameLayer::processMoveActionsStep @ 0x496d06\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.W           R3, [R0,#0x690]                                        ; +0x0, 0x47544c\nPUSH.W          {R4-R11,LR}                                            ; +0x4, 0x475450\nADD.W           R8, R0, #0x2D80                                        ; +0x8, 0x475454\nLDR.W           R2, [R3,#0x410]                                        ; +0xc, 0x475458\nSUB             SP, SP, #0x14                                          ; +0x10, 0x47545c\nLDR.W           R9, [R3,#0x40C]                                        ; +0x12, 0x47545e\nADD.W           R8, R8, #0x14                                          ; +0x16, 0x475462\nMOV             R4, R0                                                 ; +0x1a, 0x475466\nSTR             R2, [SP,#0x14+var_C]                                   ; +0x1c, 0x475468\nLDR             R3, [SP,#0x14+var_C]                                   ; +0x1e, 0x47546a\nCMP             R9, R3                                                 ; +0x20, 0x47546c\nBEQ.W           loc_47566A                                             ; +0x22, 0x47546e\nLDR.W           R11, [R9],#4                                           ; +0x26, 0x475472\nLDR.W           R3, [R11]                                              ; +0x2a, 0x475476\nMOV             R0, R11                                                ; +0x2e, 0x47547a\nLDR             R3, [R3,#0x20]                                         ; +0x30, 0x47547c\nBLX             R3                                                     ; +0x32, 0x47547e\nMOV             R1, R0; int                                            ; +0x34, 0x475480\nMOV             R0, R4; this                                           ; +0x36, 0x475482\nBL              _ZN15GJBaseGameLayer8getGroupEi; GJBaseGameLayer::getGroup(int) ; +0x38, 0x475484\nLDR.W           R1, [R11,#0x74]; int                                   ; +0x3c, 0x475488\nMOV             R7, R0                                                 ; +0x40, 0x47548c\nMOV             R0, R4; this                                           ; +0x42, 0x47548e\nBL              _ZN15GJBaseGameLayer16tryGetMainObjectEi; GJBaseGameLayer::tryGetMainObject(int) ; +0x44, 0x475490\nMOV             R5, R0                                                 ; +0x48, 0x475494\nCMP             R0, #0                                                 ; +0x4a, 0x475496\nBEQ             loc_47546A                                             ; +0x4c, 0x475498\nLDR.W           R3, [R4,#0x338]                                        ; +0x4e, 0x47549a\nADDW            R10, R0, #0x41C                                        ; +0x52, 0x47549e\nLDR.W           R2, [R0,#0x428]                                        ; +0x56, 0x4754a2\nADD.W           R6, R0, #0x420                                         ; +0x5a, 0x4754a6\nCMP             R2, R3                                                 ; +0x5e, 0x4754aa\nBEQ             loc_4754CE                                             ; +0x60, 0x4754ac\nVLDR            D7, [R0,#0x320]                                        ; +0x62, 0x4754ae\nVCVT.F32.F64    S14, D7                                                ; +0x66, 0x4754b2\nVSTR            S14, [R10]                                             ; +0x6a, 0x4754b6\nVLDR            D7, [R0,#0x328]                                        ; +0x6e, 0x4754ba\nVCVT.F32.F64    S14, D7                                                ; +0x72, 0x4754be\nVSTR            S14, [R6]                                              ; +0x76, 0x4754c2\nSTR.W           R3, [R0,#0x428]                                        ; +0x7a, 0x4754c6\nBL              _ZN10GameObject17dirtifyObjectRectEv; GameObject::dirtifyObjectRect(void) ; +0x7e, 0x4754ca\nVLDR            S12, [R10]                                             ; +0x82, 0x4754ce\nVLDR            D7, [R5,#0x320]                                        ; +0x86, 0x4754d2\nVCVT.F64.F32    D6, S12                                                ; +0x8a, 0x4754d6\nVLDR            S10, [R6]                                              ; +0x8e, 0x4754da\nVSUB.F64        D7, D7, D6                                             ; +0x92, 0x4754de\nVLDR            D6, [R11,#0x80]                                        ; +0x96, 0x4754e2\nVCVT.F64.F32    D5, S10                                                ; +0x9a, 0x4754e6\nVMUL.F64        D6, D7, D6                                             ; +0x9e, 0x4754ea\nVLDR            D7, [R5,#0x328]                                        ; +0xa2, 0x4754ee\nVSUB.F64        D7, D7, D5                                             ; +0xa6, 0x4754f2\nVLDR            D5, [R11,#0x88]                                        ; +0xaa, 0x4754f6\nVSTR            D6, [R11,#0x38]                                        ; +0xae, 0x4754fa\nVMUL.F64        D7, D7, D5                                             ; +0xb2, 0x4754fe\nVCMP.F64        D6, #0.0                                               ; +0xb6, 0x475502\nVSTR            D7, [R11,#0x40]                                        ; +0xba, 0x475506\nVMRS            APSR_nzcv, FPSCR                                       ; +0xbe, 0x47550a\nVCMP.F64        D7, #0.0                                               ; +0xc2, 0x47550e\nITE NE                                                                 ; +0xc6, 0x475512\nMOVNE.W         R10, #1                                                ; +0xc8, 0x475514\nMOVEQ.W         R10, #0                                                ; +0xcc, 0x475518\nVMRS            APSR_nzcv, FPSCR                                       ; +0xd0, 0x47551c\nITE NE                                                                 ; +0xd4, 0x475520\nMOVNE           R3, #1                                                 ; +0xd6, 0x475522\nMOVEQ           R3, #0                                                 ; +0xd8, 0x475524\nSTR             R3, [SP,#0x14+var_10]                                  ; +0xda, 0x475526\nCMP.W           R10, #0                                                ; +0xdc, 0x475528\nBNE             loc_47555C                                             ; +0xe0, 0x47552c\nCBNZ            R3, loc_47555C                                         ; +0xe2, 0x47552e\nLDRB.W          R3, [R11,#0x78]                                        ; +0xe4, 0x475530\nCBNZ            R3, loc_47555C                                         ; +0xe8, 0x475534\nLDRB.W          R3, [R5,#0x44F]                                        ; +0xea, 0x475536\nCMP             R3, #0                                                 ; +0xee, 0x47553a\nBEQ             loc_47546A                                             ; +0xf0, 0x47553c\nLDR.W           R3, [R11]                                              ; +0xf2, 0x47553e\nMOV             R0, R11                                                ; +0xf6, 0x475542\nLDR.W           R5, [R4,#0x690]                                        ; +0xf8, 0x475544\nLDR             R3, [R3,#0x20]                                         ; +0xfc, 0x475548\nBLX             R3                                                     ; +0xfe, 0x47554a\nLDR.W           R2, [R11,#0x74]; int                                   ; +0x100, 0x47554c\nMOV             R1, R0; int                                            ; +0x104, 0x475550\nMOV             R0, R5; this                                           ; +0x106, 0x475552\nBL              _ZN15GJEffectManager12wasFollowingEii; GJEffectManager::wasFollowing(int,int) ; +0x108, 0x475554\nCMP             R0, #0                                                 ; +0x10c, 0x475558\nBEQ             loc_47546A                                             ; +0x10e, 0x47555a\nLDR.W           R3, [R11,#0xC8]                                        ; +0x110, 0x47555c\nCBZ             R3, loc_475582                                         ; +0x114, 0x475560\nVLDR            D6, [R11,#0x38]                                        ; +0x116, 0x475562\nVLDR            D7, [R3,#0x30]                                         ; +0x11a, 0x475566\nVADD.F64        D7, D7, D6                                             ; +0x11e, 0x47556a\nVLDR            D6, [R11,#0x40]                                        ; +0x122, 0x47556e\nVSTR            D7, [R3,#0x30]                                         ; +0x126, 0x475572\nVLDR            D7, [R3,#0x38]                                         ; +0x12a, 0x475576\nVADD.F64        D7, D7, D6                                             ; +0x12e, 0x47557a\nVSTR            D7, [R3,#0x38]                                         ; +0x132, 0x47557e\nLDR.W           R3, [R11]                                              ; +0x136, 0x475582\nMOV             R0, R11                                                ; +0x13a, 0x475586\nLDR.W           R5, [R4,#0x690]                                        ; +0x13c, 0x475588\nLDR             R3, [R3,#0x20]                                         ; +0x140, 0x47558c\nBLX             R3                                                     ; +0x142, 0x47558e\nCMP.W           R10, #0                                                ; +0x144, 0x475590\nLDR             R3, [SP,#0x14+var_10]                                  ; +0x148, 0x475594\nLDR.W           R2, [R11,#0x74]; int                                   ; +0x14a, 0x475596\nIT NE                                                                  ; +0x14e, 0x47559a\nMOVNE           R3, #1; bool                                           ; +0x150, 0x47559c\nMOV             R1, R0; int                                            ; +0x152, 0x47559e\nMOV             R0, R5; this                                           ; +0x154, 0x4755a0\nBL              _ZN15GJEffectManager12setFollowingEiib; GJEffectManager::setFollowing(int,int,bool) ; +0x156, 0x4755a2\nMOV             R0, R7; this                                           ; +0x15a, 0x4755a6\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x15c, 0x4755a8\nLDR.W           R3, [R8]                                               ; +0x160, 0x4755ac\nADD             R0, R3                                                 ; +0x164, 0x4755b0\nSTR.W           R0, [R8]                                               ; +0x166, 0x4755b2\nCBNZ            R7, loc_4755C6                                         ; +0x16a, 0x4755b6\nLDR             R3, [R4]                                               ; +0x16c, 0x4755b8\nMOV             R0, R4                                                 ; +0x16e, 0x4755ba\nMOV             R1, R7                                                 ; +0x170, 0x4755bc\nLDR.W           R3, [R3,#0x298]                                        ; +0x172, 0x4755be\nBLX             R3                                                     ; +0x176, 0x4755c2\nB               loc_47546A                                             ; +0x178, 0x4755c4\nLDR             R3, [R7,#0x34]                                         ; +0x17a, 0x4755c6\nLDR             R5, [R3]                                               ; +0x17c, 0x4755c8\nCMP             R5, #0                                                 ; +0x17e, 0x4755ca\nBEQ             loc_4755B8                                             ; +0x180, 0x4755cc\nADD.W           R5, R5, #0x40000000                                    ; +0x182, 0x4755ce\nLDR             R6, [R3,#0xC]                                          ; +0x186, 0x4755d2\nSUBS            R5, #1                                                 ; +0x188, 0x4755d4\nADD.W           R3, R6, R5,LSL#2                                       ; +0x18a, 0x4755d6\nSTR             R3, [SP,#0x14+var_8]                                   ; +0x18e, 0x4755da\nLDR             R3, [SP,#0x14+var_8]                                   ; +0x190, 0x4755dc\nCMP             R6, R3                                                 ; +0x192, 0x4755de\nBHI             loc_4755B8                                             ; +0x194, 0x4755e0\nLDR.W           R5, [R6],#4                                            ; +0x196, 0x4755e2\nCMP             R5, #0                                                 ; +0x19a, 0x4755e6\nBEQ             loc_4755B8                                             ; +0x19c, 0x4755e8\nLDRB.W          R3, [R5,#0x44E]                                        ; +0x19e, 0x4755ea\nCBNZ            R3, loc_475626                                         ; +0x1a2, 0x4755ee\nLDR.W           R3, [R4,#0x338]                                        ; +0x1a4, 0x4755f0\nLDR.W           R2, [R5,#0x428]                                        ; +0x1a8, 0x4755f4\nCMP             R2, R3                                                 ; +0x1ac, 0x4755f8\nBEQ             loc_475626                                             ; +0x1ae, 0x4755fa\nVLDR            D7, [R5,#0x320]                                        ; +0x1b0, 0x4755fc\nADDW            R2, R5, #0x41C                                         ; +0x1b4, 0x475600\nMOV             R0, R5; this                                           ; +0x1b8, 0x475604\nVCVT.F32.F64    S14, D7                                                ; +0x1ba, 0x475606\nVSTR            S14, [R2]                                              ; +0x1be, 0x47560a\nADD.W           R2, R5, #0x420                                         ; +0x1c2, 0x47560e\nVLDR            D7, [R5,#0x328]                                        ; +0x1c6, 0x475612\nVCVT.F32.F64    S14, D7                                                ; +0x1ca, 0x475616\nVSTR            S14, [R2]                                              ; +0x1ce, 0x47561a\nSTR.W           R3, [R5,#0x428]                                        ; +0x1d2, 0x47561e\nBL              _ZN10GameObject17dirtifyObjectRectEv; GameObject::dirtifyObjectRect(void) ; +0x1d6, 0x475622\nLDR             R3, [SP,#0x14+var_10]                                  ; +0x1da, 0x475626\nCBZ             R3, loc_47563A                                         ; +0x1dc, 0x475628\nVLDR            D7, [R5,#0x328]                                        ; +0x1de, 0x47562a\nVLDR            D6, [R11,#0x40]                                        ; +0x1e2, 0x47562e\nVADD.F64        D7, D7, D6                                             ; +0x1e6, 0x475632\nVSTR            D7, [R5,#0x328]                                        ; +0x1ea, 0x475636\nMOV             R0, R5; this                                           ; +0x1ee, 0x47563a\nBL              _ZN10GameObject16dirtifyObjectPosEv; GameObject::dirtifyObjectPos(void) ; +0x1f0, 0x47563c\nCMP.W           R10, #0                                                ; +0x1f4, 0x475640\nBEQ             loc_47565C                                             ; +0x1f8, 0x475644\nLDRB.W          R3, [R5,#0x260]                                        ; +0x1fa, 0x475646\nCBNZ            R3, loc_47565C                                         ; +0x1fe, 0x47564a\nVLDR            D7, [R5,#0x320]                                        ; +0x200, 0x47564c\nVLDR            D6, [R11,#0x38]                                        ; +0x204, 0x475650\nVADD.F64        D7, D7, D6                                             ; +0x208, 0x475654\nVSTR            D7, [R5,#0x320]                                        ; +0x20c, 0x475658\nLDR             R3, [R4]                                               ; +0x210, 0x47565c\nMOV             R0, R4                                                 ; +0x212, 0x47565e\nMOV             R1, R5                                                 ; +0x214, 0x475660\nLDR.W           R3, [R3,#0x294]                                        ; +0x216, 0x475662\nBLX             R3                                                     ; +0x21a, 0x475666\nB               loc_4755DC                                             ; +0x21c, 0x475668\nADD             SP, SP, #0x14                                          ; +0x21e, 0x47566a\nPOP.W           {R4-R11,PC}                                            ; +0x220, 0x47566c", "xrefs": ["GJBaseGameLayer::processMoveActionsStep @ 0x496d06"], "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"}