SHARE
TWEET

Metroid lua

a guest Nov 20th, 2013 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local cx, cy, cxs, cxy, px, py, pxs, pys
  2. local lpx = 0
  3. local lpy = 0
  4. local lcy = 0
  5. local lcx = 0
  6.  
  7. local function box(x,y,color)
  8.         gui.box(x-4,y-memory.readbyteunsigned(0x301),x+4,y+memory.readbyteunsigned(0x301),color,"#000000f0")
  9. end
  10.  
  11. local function Stuff()
  12.  
  13.         box(memory.readbyteunsigned(0x51), memory.readbyte(0x52), "#ff000050")
  14.        
  15.         cx = memory.readbyteunsigned(0xFD)
  16.         cy = memory.readbyteunsigned(0xFC)
  17.        
  18.         cxs = cx - lcx
  19.         cys = cy - lcy
  20.        
  21.         px = memory.readwordunsigned(0x51,0x50) + cx
  22.         py = memory.readbyteunsigned(0x52) + cy
  23.                
  24.         pxs = px - lpx
  25.         pys = py - lpy
  26.        
  27.         gui.text(10,10,string.format("Room: %3d-%3d",memory.readbyte(0x33),memory.readbyte(0x34)))
  28.         gui.text(160,10,string.format("RNGs: %3d/%3d", memory.readbyte(0x2e), memory.readbyte(0x2f)))
  29.         gui.text(160,20,string.format("X:%3d.%3d (%3d)\nY:%3d.%3d (%3d)", px, memory.readbyteunsigned(0x311), pxs, py, memory.readbyteunsigned(0x312), pys))
  30.         gui.text(160,40,string.format("max s spd: %3d", memory.readbyte(0x316)))
  31.         gui.text(160,50,string.format("camX:%3d (%3d)\ncamY:%3d (%3d)", cx, cxs, cy, cys))
  32.         gui.text(160,70,string.format("ScrllDir %3d\nSamusDir %3d\nDoorScrollStatus %3d\nDmgPushDir %3d\nMissilesCollectables %3d/%3d\nJmpDisplacement %3d\nGravity %3d", memory.readbyte(0x49), memory.readbyte(0x4d), memory.readbyte(0x57), memory.readbyte(0x72), memory.readbyte(0x95), memory.readbyte(0x93), memory.readbyte(0x30f), memory.readbyte(0x314)))
  33.                
  34.         if (memory.readbyte(0x30b) == 0) then gui.text(20,20,"out of bounds =)") end
  35.        
  36.         lpx = px
  37.         lpy = py
  38.         lcx = cx
  39.         lcy = cy
  40.        
  41.         gui.text(160,200,string.format("0HP: %3d\n0Delay: %3d", memory.readbyte(0x40b), memory.readbyte(0x409)))
  42.        
  43. end
  44.  
  45. emu.registerafter(Stuff)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top