L. Spyro's Memory Hacking Software (or MHS for short) is a rather nifty program that allows you to look into a program and do all kinds of fun stuff with it.

One rather neat thing you can do with it is read memory values and perform calculations based off those values.

Since I'm terrible at starting threads, here's a script that calculates the distance traveled during during the last frame. It's not 100% accurate because the time value isn't always updated when Link can move I think (when just entering a scene I think).

VOID Lock(MHS_ADDRESS aAddress, INT iItemSize){

extern int off = { "project64.exe", 0xD6A1C }; //Grabs pointer value to the start of the 64's RAM for PJ64

extern short t = { "", (0x1EF6AC + off)}; //Grabs the current time frame

extern short tO = { "", (0x3FFF50 + off)}; //Grabs the previous time frame

//grab the current x,y,z coordinates

extern float xN = { "", (0x3FFDD4 + off) };

extern float yN = { "", (0x3FFDD8 + off) };

extern float zN = { "", (0x3FFDDC + off) };

//grab the previous frame's x,y,z coordinates

extern float xO = { "", (0x3FFF44 + off) };

extern float yO = { "", (0x3FFF48 + off) };

extern float zO = { "", (0x3FFF4C + off) };

//result is where we'll return our final value

extern float result = { "", aAddress };

//stores delta x, y, z

float x;

float y;

float z;

//temp values for calculating the speed

float u;

float v;

int i;

//if we're on the next frame

if (t != tO)

{

//get delta x, y, z

x = xN-xO;

y = yN-yO;

z = zN-zO;

//update our previous position/frame number

xO = xN;

yO = yN;

zO = zN;

tO = t;

//Begin calculating sqrt(x^2+y^2+z^2)

//u = x^2+y^2+z^2

u = ((x*x)+(y*y)+(z*z));

//some square root magic I don't quite understand.

i = * (int *) &u;

i = 0x1FBC5524 + i/2;

v = * (float *) &i;

//The more times this is repeated, the more accurate the result is

v = (v + u/v)*0.5f;

v = (v + u/v)*0.5f;

result = v;

}

}