After our conversation on IRC, give this a whirl. I haven't tested it, but you should be able to massage it into doing exactly what you want.
Language: lua
local function speedtext (addressX, addressY, whereX, whereY)
Pastvalue[0] = Currentvalue[0]
Pastvalue[1] = Currentvalue[1]
Currentvalue[0] = mainmemory.read_u16_le(addressX)
Currentvalue[1] = mainmemory.read_u16_le(addressY)
gui.pixelText(whereX, whereY, "ispX: " .. Currentvalue[0] - Pastvalue[0])
gui.pixelText(whereX, whereY + 8, "ispY: " .. Currentvalue[1] - Pastvalue[1])
end
Pastvalue = {
[0] = 0, -- X coordinate
[1] = 0 -- Y coordinate
}
Currentvalue = {
[0] = 0, -- X coordinate
[1] = 0 -- Y coordinate
}
while true do
mainmemory.writebyte(0x005B, 58) -- Unlimited time
-- mainmemory.writebyte(0x00FD, 74) -- Fixed cam position
speedtext (0x043C, 0x043E, 138, 128)
emu.frameadvance
end