Advertisement
Blazephlozard

EarthBound spawn line/RNG display

Oct 13th, 2017
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | None | 0 0
  1. while true do
  2.     --Spawn line section
  3.     xLoc = memory.read_s16_le(0x000BBE)
  4.     yLoc = memory.read_s16_le(0x000BFA)
  5.  
  6.     spawnLineX = xLoc % 64
  7.     spawnLineY = (yLoc + 16) % 64
  8.  
  9.     for i=-63,300,64 do
  10.         gui.drawLine(i-spawnLineX, -1, i-spawnLineX, 225, 0xB0FFFFFF)
  11.     end
  12.  
  13.     for i=-65,300,64 do
  14.         gui.drawLine(-1, i-spawnLineY, 257, i-spawnLineY, 0xB0FFFFFF)
  15.     end
  16.    
  17.     --RNG values on screen section
  18.     RNG1 = string.upper(string.format("%02x", memory.readbyte(0x000024)))
  19.     RNG2 = string.upper(string.format("%02x", memory.readbyte(0x000026)))
  20.     RNG3 = string.upper(string.format("%04x", memory.read_s16_le(0x7E4A7A),"System Bus"))
  21.     gui.pixelText(220, 8, RNG1 .. ", " .. RNG2 .. "\n" .. RNG3)
  22.    
  23.     emu.frameadvance()
  24.  
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement