You can do something like this. But it will not remember the values from previous frames when you load a state. I did not figure out my item display stuff yet btw.. not that it matters too much.
Language: Lua
function text(x, y, text, color)
gui.pixelText(x, y, text,color,0x00000000)
end
valuetable = {
[0] = "-", -- current frame
[1] = "-", -- previous frame
[2] = "-", -- frame before that
[3] = "-" -- frame before that
}
event.onloadstate(function()
valuetable = {
[0] = "-",
[1] = "-",
[2] = "-",
[3] = "-"
}
end)
while true do
testvalue = memory.read_u16_le(0xc900)
valuetable[3] = valuetable[2]
valuetable[2] = valuetable[1]
valuetable[1] = valuetable[0]
valuetable[0] = testvalue
text(80,38,valuetable[0],0xFF000000)
text(80,48,valuetable[1],0xFF000000)
text(80,58,valuetable[2],0xFF000000)
text(80,68,valuetable[3],0xFF000000)
emu.frameadvance()
end