Advertisement
Blazephlozard

Headdy lua script

Dec 24th, 2017
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.14 KB | None | 0 0
  1. memory.usememorydomain("68K RAM")
  2.  
  3. function update()
  4.     xcam = memory.read_u16_be(0xE814)
  5.     ycam = memory.read_u16_be(0xE818)
  6.    
  7.     xscreen = memory.read_u8(0xD401)
  8.     yscreen = memory.read_u8(0xC009)
  9.    
  10.     xspeed = memory.read_s8(0xB6A5)
  11.     xsubspeed = memory.read_u8(0xB6A6)
  12.     yspeed = memory.read_s8(0xB6AD)
  13.     ysubspeed = memory.read_u8(0xB6AE)
  14.     xheadspeed = memory.read_s8(0xD605)
  15.     xheadsubspeed = memory.read_u8(0xD606)
  16.     yheadspeed = memory.read_s8(0xD705)
  17.     yheadsubspeed = memory.read_u8(0xD706)
  18. end
  19.  
  20. update()
  21.  
  22. gui.defaultPixelFont("fceux")
  23.  
  24. while true do
  25.   update()
  26.  
  27.     local xwithsub = xspeed + (xsubspeed / 256)
  28.     local ywithsub = yspeed + (ysubspeed / 256)
  29.     local text = tostring(string.format("% .2f  % .2f",xwithsub,ywithsub))
  30.     local xwithsub = xheadspeed + (xheadsubspeed / 256)
  31.     local ywithsub = yheadspeed + (yheadsubspeed / 256)
  32.     text = text .. "\n" .. tostring(string.format("% .2f  % .2f",xwithsub,ywithsub))
  33.     text = text .. "\n" .. tostring(string.format(" %4d   %4d ",xcam,ycam))
  34.     text = text .. "\n" .. tostring(string.format(" %4d   %4d ",xscreen,yscreen))
  35.     gui.pixelText(60, 6, tostring(text))
  36.  
  37.   emu.frameadvance()
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement