{"type": "func", "start": 4296995084, "end": 4296995176, "name": "GJBaseGameLayer::convertToClosestDirection", "pseudocode": "// \n// GJBaseGameLayer::convertToClosestDirection from 0x1001ef10c to 0x1001ef168 (92 bytes)\n// \n// 2 xrefs:\n// > PlayerObject::redirectDash @ 0x100225bb0\n// > PlayerObject::redirectPlayerForce @ 0x10022d05c\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 __fastcall 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 ( a1 > a2 )\n    return a1 - (float)(ceilf(floorf(fabsf(a1) / a2) * 0.5) * (float)(a2 + a2));\n  return a1;\n}", "assembly": "; \n; GJBaseGameLayer::convertToClosestDirection from 0x1001ef10c to 0x1001ef168 (92 bytes)\n; \n; 2 xrefs:\n; > PlayerObject::redirectDash @ 0x100225bb0\n; > PlayerObject::redirectPlayerForce @ 0x10022d05c\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, 0x1001ef10c\nFCMP            S2, S0                                                 ; +0x4, 0x1001ef110\nB.LE            loc_1001EF13C                                          ; +0x8, 0x1001ef114\nFABS            S2, S0                                                 ; +0xc, 0x1001ef118\nFDIV            S2, S2, S1                                             ; +0x10, 0x1001ef11c\nFRINTM          S2, S2                                                 ; +0x14, 0x1001ef120\nFMOV            S3, #0.5                                               ; +0x18, 0x1001ef124\nFMUL            S2, S2, S3                                             ; +0x1c, 0x1001ef128\nFRINTP          S2, S2                                                 ; +0x20, 0x1001ef12c\nFADD            S1, S1, S1                                             ; +0x24, 0x1001ef130\nFMADD           S0, S2, S1, S0                                         ; +0x28, 0x1001ef134\nRET                                                                    ; +0x2c, 0x1001ef138\nFCMP            S0, S1                                                 ; +0x30, 0x1001ef13c\nB.LE            locret_1001EF164                                       ; +0x34, 0x1001ef140\nFABS            S2, S0                                                 ; +0x38, 0x1001ef144\nFDIV            S2, S2, S1                                             ; +0x3c, 0x1001ef148\nFRINTM          S2, S2                                                 ; +0x40, 0x1001ef14c\nFMOV            S3, #0.5                                               ; +0x44, 0x1001ef150\nFMUL            S2, S2, S3                                             ; +0x48, 0x1001ef154\nFRINTP          S2, S2                                                 ; +0x4c, 0x1001ef158\nFADD            S1, S1, S1                                             ; +0x50, 0x1001ef15c\nFMSUB           S0, S2, S1, S0                                         ; +0x54, 0x1001ef160\nRET                                                                    ; +0x58, 0x1001ef164", "xrefs": ["PlayerObject::redirectDash @ 0x100225bb0", "PlayerObject::redirectPlayerForce @ 0x10022d05c"], "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"}