Advertisement
FractalFusion

Memory viewer

Feb 27th, 2012
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.05 KB | None | 0 0
  1. --Lua script by FractalFusion
  2. --http://tasvideos.org/
  3.  
  4. --Starting address
  5. --Recommended to end in 0
  6. local address=0x7E0A00
  7.  
  8. --Number of rows displayed (each row has 16=0x10 bytes)
  9. local rows=20
  10.  
  11. --Keys to move around memory.
  12. --First key = forward by 256=0x100 bytes.
  13. --Second key = backward by 256=0x100 bytes.
  14. local key={"8", "7"}
  15.  
  16. --not very useful
  17. local xfix=0
  18. local yfix=0
  19.  
  20. local c
  21. local i,j
  22.  
  23. prev=input.get()
  24. while true do
  25.  tabl=input.get()
  26.  
  27.  if tabl[key[1]] and not prev[key[1]] then
  28.  address=address+0x100
  29.  end
  30.  
  31.  if tabl[key[2]] and not prev[key[2]] then
  32.  address=address-0x100
  33.  end
  34. --gui.text(0,0,"test","#FFFF00FF")
  35.  
  36.  prev=tabl
  37.  
  38. gui.text(xfix,yfix+12, string.sub(bit.tohex(address),3,5), "#FFFF00FF")
  39.  
  40. for j=0,15,1 do
  41.  gui.text(xfix+15+j*15, yfix+12,string.sub(bit.tohex(j),8,8),"#FFFF00FF")
  42. end
  43.  
  44. for i=0,rows-1,1 do
  45. gui.text(xfix,yfix+20+i*8,string.sub(bit.tohex(address+16*i),6,8),"#FFFF00FF")
  46.  for j=0,15,1 do
  47.   gui.text(xfix+15+j*15,yfix+20+i*8,memory.readbyte(address+16*i+j))
  48.  
  49.  end
  50. end
  51.  
  52. emu.frameadvance()
  53. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement