speed display lua
while true do
local x = memory.read_u16_le(0x3428, "IWRAM")
local y = memory.read_u16_le(0x342A, "IWRAM")
emu.frameadvance();
local x_speed = memory.read_u16_le(0x3428, "IWRAM") - x
local y_speed = memory.read_u16_le(0x342A, "IWRAM") - y
gui.text(5, 5, string.format("X Speed: %d", x_speed), nil, "topright")
gui.text(5, 25, string.format("Y Speed: %d", y_speed), nil, "topright")
end