Forums  /  Castlevania II: Simon's Quest  /  Subpixel LUA
  YogidamonkYogidamonk

Putting this here so it doesn't get lost again because it's helpful for learning, and backup floor drops. I think Deceax wrote this for a big 20? Shows the Subpixel value on the screen. (can save the code in a txt file and just run it)

local XAddr=0x336
local X
while true do
X=memory.readbyte(XAddr)
gui.text(0,25,X)
emu.frameadvance();
end

Chambers_NChambers_N likes this. 
  BloodSweatAndCodeBloodSweatAndCode

In the spirit of sharing, I used your snippet to do the same thing with hearts while I get better at the lizardman and Veros night time zombie grinds. Your heart count is stored as literal hex across 2 bytes so it took just a smidge more finessing to get the right values to show up:

local addr1=0x48
local addr2=0x49
while true do
gui.text(230,25,string.format("%x%02x", memory.readbyte(addr2), memory.readbyte(addr1)))
emu.frameadvance();
end