Not a very special function per se. I struggled at de-duplicating the
four variables at the top of the function as using just one would give
me some minor reg swaps. I thought adding an enum as a returning value
but I think it is a bit over killing for how small the function is. It
is only called by `EntityAlucard`.
Interestingly, the function in DRA is different between HD and US. But
the HD version is identical to the duplicate found in RIC US. What I
suspect it happened is one of the developers while scrolling the various
functions, found the `- 14407` in an odd spot relative to the rest of
the function and moved it to make it consistent. But as some code from
DRA was copy&pasted to RIC, the same developer did not think to apply
the same change there.
EDIT: Note the `FIX_TO_I`. It is a new macro I added for another
function I failed to decompile.
I noticed that my lints are already pretty slow and hard to maintain so
I moved them to rust and optimized them. All the files are now linted in
parallel, and we can do as many transforms to a single line as we want.
I think this provides a good baseline where we can have a big suite of
lints if we want to.
I added more cases to the FIX linter as well. Rust always puts a newline
at the end of a file so we picked up some changes due to that. I think
git wants you to do that anyway so it seems like an improvement to me.
I'm putting this up as a proof of concept for documenting fixed point
numbers. This does `self->velocityX` in NZ0 to get started. I'm
including a script to do this although it's currently hard-coded just
for velocityX. I think it can be extended for more situations. I chose
`SOTN_FIXED` for the macro because the Saturn SDK already uses `FIXED`.
I'm open to suggestions on the macro name. I chose 4 digits of precision
since that's the highest precision currently seen so far with
`SOTN_FIXED(0.1875);`