User File #637784520225621489

Upload All User Files

#637784520225621489 - Rockman 2 Subpixels

rm2xy.lua
Game: Mega Man 2 ( NES, see all files )
92 downloads
Uploaded 1/22/2022 12:40 PM by Shinryuu (see all 11)
Shows X, Y and their subpixels. Dirty lua script to make your day to shine.
-- RM2 Subpixels

local function pixels()
      
      -- X position
      local X  = math.floor((memory.readbyte(0x460)*256+memory.readbyte(0x480))/256.0 * 1000)/1000
      -- Y position
      local Y  = math.floor((memory.readbyte(0x4a0)*256+memory.readbyte(0x4c0))/256.0 * 1000)/1000

      local xadj, yadj = -3, 5
      gui.text(5+xadj,5+yadj, "X:"..X.."", "magenta", "black")
      gui.text(5+xadj,15+yadj,"Y:"..Y.."", "cyan", "black")

end

gui.register(pixels)