{"type": "func", "start": 6882256, "end": 6882420, "name": "EditorUI::getGridSnappedPos", "pseudocode": "// \n// EditorUI::getGridSnappedPos from 0x6903d0 to 0x690474 (164 bytes)\n// \n// 10 xrefs:\n// > EditorUI::applySpecialOffset @ 0x693f70\n// > EditorUI::findSnapObject @ 0x694178\n// > EditorUI::findSnapObject @ 0x6942b8\n// > EditorUI::onCreateObject @ 0x6bfca8\n// > EditorUI::createPrefab @ 0x6c06c4\n// > EditorUI::ccTouchMoved @ 0x6c1ae8\n// > EditorUI::ccTouchEnded @ 0x6c2df4\n// > EditorUI::doPasteObjects @ 0x6c391c\n// > SetupSmartBlockLayer::onPasteTemplate @ 0x9dc420\n// > <???> @ 0x31e00\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\ncocos2d::CCPoint EditorUI::getGridSnappedPos(EditorUI *a1, cocos2d::CCPoint a2)\n{\n  float *v2; // x1\n  float m_gridSize; // s2\n  cocos2d::CCPoint v7; // [xsp+40h] [xbp+40h] BYREF\n  cocos2d::CCPoint LimitedPosition; // 0:kr00_8.8\n  cocos2d::CCPoint v9; // 0:s0.4,4:s1.4\n  cocos2d::CCPoint result; // 0:s0.4,4:s1.4\n\n  m_gridSize = a1->m_editorLayer->m_drawGridLayer->m_gridSize;\n  cocos2d::CCPoint::CCPoint(\n    &v7,\n    m_gridSize * (float)(floorf(*v2 / m_gridSize) + 0.5),\n    m_gridSize * (float)(floorf(v2[1] / m_gridSize) + 0.5));\n  LimitedPosition = EditorUI::getLimitedPosition(a1, v9);\n  result.x = LimitedPosition.x;\n  result.y = LimitedPosition.y;\n  return result;\n}", "assembly": "; \n; EditorUI::getGridSnappedPos from 0x6903d0 to 0x690474 (164 bytes)\n; \n; 10 xrefs:\n; > EditorUI::applySpecialOffset @ 0x693f70\n; > EditorUI::findSnapObject @ 0x694178\n; > EditorUI::findSnapObject @ 0x6942b8\n; > EditorUI::onCreateObject @ 0x6bfca8\n; > EditorUI::createPrefab @ 0x6c06c4\n; > EditorUI::ccTouchMoved @ 0x6c1ae8\n; > EditorUI::ccTouchEnded @ 0x6c2df4\n; > EditorUI::doPasteObjects @ 0x6c391c\n; > SetupSmartBlockLayer::onPasteTemplate @ 0x9dc420\n; > <???> @ 0x31e00\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\nSTP             X29, X30, [SP,#var_50]!                                ; +0x0, 0x6903d0\nFMOV            S3, #0.5                                               ; +0x4, 0x6903d4\nMOV             X29, SP                                                ; +0x8, 0x6903d8\nSTR             X21, [SP,#0x50+var_30]                                 ; +0xc, 0x6903dc\nMOV             X21, X0                                                ; +0x10, 0x6903e0\nLDR             S0, [X1]                                               ; +0x14, 0x6903e4\nADD             X0, X29, #0x50+var_10; this                            ; +0x18, 0x6903e8\nLDR             S1, [X1,#4]                                            ; +0x1c, 0x6903ec\nSTR             X0, [X29,#0x50+var_18]                                 ; +0x20, 0x6903f0\nLDR             X2, [X21,#0x4F8]                                       ; +0x24, 0x6903f4\nSTP             X19, X20, [SP,#0x50+var_40]                            ; +0x28, 0x6903f8\nADRP            X19, #__stack_chk_guard_ptr@PAGE                       ; +0x2c, 0x6903fc\nMOV             X20, X8                                                ; +0x30, 0x690400\nLDR             X2, [X2,#0x38A8]                                       ; +0x34, 0x690404\nLDR             X19, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x38, 0x690408\nLDR             S2, [X2,#0x25C]                                        ; +0x3c, 0x69040c\nFDIV            S0, S0, S2                                             ; +0x40, 0x690410\nLDR             X3, [X19]                                              ; +0x44, 0x690414\nSTR             X3, [X29,#0x50+var_8]                                  ; +0x48, 0x690418\nFDIV            S1, S1, S2                                             ; +0x4c, 0x69041c\nFRINTM          S0, S0                                                 ; +0x50, 0x690420\nFADD            S0, S0, S3                                             ; +0x54, 0x690424\nFMUL            S0, S2, S0; float                                      ; +0x58, 0x690428\nFRINTM          S1, S1                                                 ; +0x5c, 0x69042c\nFADD            S1, S1, S3                                             ; +0x60, 0x690430\nFMUL            S1, S2, S1; float                                      ; +0x64, 0x690434\nBL              _ZN7cocos2d7CCPointC1Eff; cocos2d::CCPoint::CCPoint(float,float) ; +0x68, 0x690438\nLDR             X1, [X29,#0x50+var_18]                                 ; +0x6c, 0x69043c\nMOV             X0, X21                                                ; +0x70, 0x690440\nMOV             X8, X20                                                ; +0x74, 0x690444\nBL              _ZN8EditorUI18getLimitedPositionEN7cocos2d7CCPointE; EditorUI::getLimitedPosition(cocos2d::CCPoint) ; +0x78, 0x690448\nLDR             X2, [X29,#0x50+var_8]                                  ; +0x7c, 0x69044c\nMOV             X0, X20                                                ; +0x80, 0x690450\nLDR             X1, [X19]                                              ; +0x84, 0x690454\nCMP             X2, X1                                                 ; +0x88, 0x690458\nB.NE            loc_690470                                             ; +0x8c, 0x69045c\nLDP             X19, X20, [SP,#0x50+var_40]                            ; +0x90, 0x690460\nLDR             X21, [SP,#0x50+var_30]                                 ; +0x94, 0x690464\nLDP             X29, X30, [SP+0x50+var_50],#0x50                       ; +0x98, 0x690468\nRET                                                                    ; +0x9c, 0x69046c\nBL              .__stack_chk_fail                                      ; +0xa0, 0x690470", "xrefs": ["EditorUI::applySpecialOffset @ 0x693f70", "EditorUI::findSnapObject @ 0x694178", "EditorUI::findSnapObject @ 0x6942b8", "EditorUI::onCreateObject @ 0x6bfca8", "EditorUI::createPrefab @ 0x6c06c4", "EditorUI::ccTouchMoved @ 0x6c1ae8", "EditorUI::ccTouchEnded @ 0x6c2df4", "EditorUI::doPasteObjects @ 0x6c391c", "SetupSmartBlockLayer::onPasteTemplate @ 0x9dc420", "<???> @ 0x31e00"], "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"}