{"type": "func", "start": 8795336, "end": 8795428, "name": "GJBaseGameLayer::convertToClosestDirection", "pseudocode": "// \n// GJBaseGameLayer::convertToClosestDirection from 0x8634c8 to 0x863524 (92 bytes)\n// \n// 10 xrefs:\n// > PlayLayer::updateScreenRotation @ 0x5cc064\n// > PlayerObject::redirectPlayerForce @ 0x629248\n// > PlayerObject::redirectDash @ 0x62a5b0\n// > getRotateCommandAngleDelta @ 0x8636ac\n// > GJBaseGameLayer::updateScreenRotation @ 0x87d70c\n// > GJBaseGameLayer::updateScreenRotation @ 0x87d71c\n// > GJBaseGameLayer::processAdvancedFollowAction @ 0x883e78\n// > GJBaseGameLayer::processAdvancedFollowAction @ 0x884168\n// > GJBaseGameLayer::processAdvancedFollowAction @ 0x884624\n// > <???> @ 0x56f70\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\nfloat GJBaseGameLayer::convertToClosestDirection(float a1, float a2)\n{\n  if ( (float)-a2 > a1 )\n    return a1 + (float)(ceilf(floorf(fabsf(a1) / a2) * 0.5) * (float)(a2 + a2));\n  if ( a2 < a1 )\n    return a1 - (float)(ceilf(floorf(fabsf(a1) / a2) * 0.5) * (float)(a2 + a2));\n  return a1;\n}", "assembly": "; \n; GJBaseGameLayer::convertToClosestDirection from 0x8634c8 to 0x863524 (92 bytes)\n; \n; 10 xrefs:\n; > PlayLayer::updateScreenRotation @ 0x5cc064\n; > PlayerObject::redirectPlayerForce @ 0x629248\n; > PlayerObject::redirectDash @ 0x62a5b0\n; > getRotateCommandAngleDelta @ 0x8636ac\n; > GJBaseGameLayer::updateScreenRotation @ 0x87d70c\n; > GJBaseGameLayer::updateScreenRotation @ 0x87d71c\n; > GJBaseGameLayer::processAdvancedFollowAction @ 0x883e78\n; > GJBaseGameLayer::processAdvancedFollowAction @ 0x884168\n; > GJBaseGameLayer::processAdvancedFollowAction @ 0x884624\n; > <???> @ 0x56f70\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\nFNEG            S2, S1                                                 ; +0x0, 0x8634c8\nFCMPE           S2, S0                                                 ; +0x4, 0x8634cc\nB.GT            loc_863500                                             ; +0x8, 0x8634d0\nFCMPE           S1, S0                                                 ; +0xc, 0x8634d4\nB.PL            locret_8634FC                                          ; +0x10, 0x8634d8\nFABS            S2, S0                                                 ; +0x14, 0x8634dc\nFADD            S3, S1, S1                                             ; +0x18, 0x8634e0\nFDIV            S1, S2, S1                                             ; +0x1c, 0x8634e4\nFMOV            S2, #0.5                                               ; +0x20, 0x8634e8\nFRINTM          S1, S1                                                 ; +0x24, 0x8634ec\nFMUL            S1, S1, S2                                             ; +0x28, 0x8634f0\nFRINTP          S1, S1                                                 ; +0x2c, 0x8634f4\nFMSUB           S0, S1, S3, S0                                         ; +0x30, 0x8634f8\nRET                                                                    ; +0x34, 0x8634fc\nFABS            S2, S0                                                 ; +0x38, 0x863500\nFADD            S3, S1, S1                                             ; +0x3c, 0x863504\nFDIV            S1, S2, S1                                             ; +0x40, 0x863508\nFMOV            S2, #0.5                                               ; +0x44, 0x86350c\nFRINTM          S1, S1                                                 ; +0x48, 0x863510\nFMUL            S1, S1, S2                                             ; +0x4c, 0x863514\nFRINTP          S1, S1                                                 ; +0x50, 0x863518\nFMADD           S0, S1, S3, S0                                         ; +0x54, 0x86351c\nRET                                                                    ; +0x58, 0x863520", "xrefs": ["PlayLayer::updateScreenRotation @ 0x5cc064", "PlayerObject::redirectPlayerForce @ 0x629248", "PlayerObject::redirectDash @ 0x62a5b0", "getRotateCommandAngleDelta @ 0x8636ac", "GJBaseGameLayer::updateScreenRotation @ 0x87d70c", "GJBaseGameLayer::updateScreenRotation @ 0x87d71c", "GJBaseGameLayer::processAdvancedFollowAction @ 0x883e78", "GJBaseGameLayer::processAdvancedFollowAction @ 0x884168", "GJBaseGameLayer::processAdvancedFollowAction @ 0x884624", "<???> @ 0x56f70"], "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"}