Closed vabold closed 1 year ago
Thanks to Gaberboo's work, this is done and also is completely functional. It will be displayed with the detailed version of the ".ini" info display, as the team has decided that an external info display program is not necessary for MKW at the moment. Note that users should be advised to avoid @stblr's "Pretty Speedometer" gecko code, as this can cause crashes if these two + other codes are all activated (notably the 200cc code) on the Dolphin build currently being used.
Due to most Gecko codes likely writing to the first part of unused space in the EVA, I propose we write to the last part of unused memory for any purpose we choose. This is a temporary solution to a much larger frame-delay problem. The free space in the last part of unused memory starts at 800017B0, and is 80 bytes long. We will be allocating 8 for this purpose.
XZ/XYZ speeds are the single most referenced value from info display in the MKW TAS community. As such, values delayed by a frame are unacceptable.
Currently, MKW_core.lua's speed calculations look like this:
This relies on using position differences to derive the final velocity vector's components and length. Instead, we can compute the length of the pre-existing vector in PlayerPhysics.
0x9C18F8 + 0x20 + 0x0 + 0x0 + 0x8 + 0x90 + 0x4 + 0xD4
will return the velocity vector's components. We can then use a Gecko code to calculate the XZ and XYZ speed via the sqrt function at 8022F80C, before storing the results at 800017B0 and 800017B4. We will then read those results in RMCP01.ini.