This is my LuaScript.
I do not know it about the riding stage.
local HEADER = 0x60A90
local pScale = 3000
local vScale = 100000
gui.register(function()
local addr = memory.readdword(HEADER)
if addr ~= 0 then
addr = addr -0x80000000
else
gui.text(8,48,"")
return
end
local X = memory.readdwordsigned( addr + 0x60 ) / pScale
local Y = memory.readdwordsigned( addr + 0x68 ) / pScale
local Z = memory.readdwordsigned( addr + 0x64 ) / pScale
local XV = memory.readdwordsigned( addr + 0x84 ) / vScale
local YV = memory.readdwordsigned( addr + 0x8C ) / vScale
local ZV = memory.readdwordsigned( addr + 0x88 ) / vScale
local V = memory.readdwordsigned( addr + 0x104) / vScale
local XY = math.sqrt(XV*XV+YV*YV)
local D = memory.readwordsigned( addr + 0x94 ) / 4096*360
local J = memory.readword( addr + 0x1B5 )
local BOXi = memory.readword(0x6CC69)
local BOXs = memory.readword(0x6CDC1)
local Level = memory.readword(0x618DC)
gui.text(8,48,
string.format("%8d : Rerecord \n",movie.rerecordcount() )
..string.format("%8x : Header \n",addr )
..string.format("%8d : Level \n", Level )
..string.format("%4d/%3d : Box \n", BOXi , BOXs )
.."\n"
..string.format("%8.2f : Z Pos \n", Z )
..string.format("%8.2f : Z Vel \n", ZV )
..string.format("%8.2f : X Pos \n", X )
..string.format("%8.2f : X Vel \n", XV )
..string.format("%8.2f : Y Pos \n", Y )
..string.format("%8.2f : Y Vel \n", YV )
..string.format("%8.2f : XY Vel \n", XY )
..string.format("%8.2f : Velocity \n", V )
..string.format("%8.2f : Jumps \n", J )
..string.format("%8.2f : Degrees \n", D )
)
end)
function key_input()
local t = joypad.getdown(1)
local a = {xleft=128,yleft=128,xright=128,yright=128}
if t.right == true then
a.xleft = 255
elseif t.left == true then
a.xleft = 0
end
if t.down == true then
a.yleft = 255
elseif t.up == true then
a.yleft = 0
end
joypad.set(1,t)
joypad.setanalog(1,a)
joypad.setanalog(2,{xleft=128,yleft=128,xright=128,yright=128})
-- joypad.setanalog(1,{xleft=132,yleft=0})
end
emu.registerbefore(key_input)