Advertisement
Guest User

Untitled

a guest
Dec 18th, 2016
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.76 KB | None | 0 0
  1. --movement lag counter by ThunderAxe31 for GBC E Mo Dao (Devil Island)
  2. --does automatically clear the count when you load a state.
  3.  
  4. levelx_addr = 0xC122
  5. last_levelx = -1
  6. levelx_lagcount = 0
  7. framecount = -1
  8.  
  9. while true do
  10.    
  11.     if framecount ~= (emu.framecount()-1) then --if a state has been loaded, reset values
  12.         levelx_lagcount = 0
  13.         last_levelx = -1
  14.     end
  15.        
  16.     if (last_levelx > -1) and (last_levelx == memory.read_u8(levelx_addr)) then --checks if the x value is unchanged
  17.         levelx_lagcount = levelx_lagcount + 1 --updates the movement lag count
  18.     end
  19.    
  20.     gui.pixelText(88, 0, levelx_lagcount, "red")
  21.    
  22.     last_levelx = memory.read_u8(levelx_addr) --updates the x value
  23.     framecount = emu.framecount() --updates the frame count
  24.    
  25.     emu.frameadvance()
  26.    
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement