Guest User

kid icarus wall zip finder

a guest
Jul 5th, 2013
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. local function box(xcenter,ycenter,width,height,xoffset,yoffset,color)
  2.  
  3. left = xcenter+xoffset
  4. down = ycenter+height-yoffset
  5. right = xcenter+width+xoffset
  6. up = ycenter-yoffset
  7.  
  8. gui.drawbox(left,down,right,up,color);
  9. --if (left > 0 and left < 255 and right> 0 and right < 255 and down > 0 and down < 224 and up > 0 and up < 224) then
  10. -- gui.drawbox(left,down,right,up,color);
  11.  
  12. --end;
  13. end;
  14.  
  15. local function isblock(x)
  16. z=0
  17. if x==81 then z=1 end --checkered floor
  18. if x==82 then z=1 end
  19. if x==112 then z=1 end
  20. if x==93 then z=1 end
  21. if x==92 then z=1 end
  22. if x==42 then z=1 end --lower part of door
  23. if x==80 then z=1 end --upper part of door
  24. if x==84 then z=1 end --purple block
  25. if x==111 then z=1 end --snake urn
  26. if x==88 then z=1 end --purple stone
  27. return z
  28. end
  29.  
  30. --82 == gray stone
  31. --112 == platform
  32. --93 == red spear block
  33. --92 == gray block
  34.  
  35. while true do
  36.  
  37. local function displayer()
  38.  
  39.  
  40. for i1=0,15,1 do --col
  41. for i2=0,11,1 do --row
  42. zip_ok=0
  43.  
  44. want_ram=0x500 + i1 + 16*i2
  45.  
  46. ram1=memory.readbyte(want_ram)
  47. ram2=memory.readbyte(want_ram+1)
  48. ram3=memory.readbyte(want_ram+16)
  49. ram4=memory.readbyte(want_ram+16+1)
  50. ram5=memory.readbyte(want_ram+32)
  51. ram6=memory.readbyte(want_ram+32+1)
  52.  
  53. z1=isblock(ram1)
  54. z2=isblock(ram2)
  55. z3=isblock(ram3)
  56. z4=isblock(ram4)
  57. z5=isblock(ram5)
  58. z6=isblock(ram6)
  59.  
  60.  
  61. --check if zipping seems possible
  62. if z1==0 and z3==1 and z5==1 and z2==0 and z4==0 then
  63. zip_ok=1
  64. end
  65.  
  66. --zip_ok=1
  67. if zip_ok==1 then
  68. box(16*i1,16*i2,16,16,0,-1-16,"green")
  69. end
  70. --box(16*i1,16*i2,16,16,0,0,"red")
  71. end
  72. end
  73.  
  74. end
  75.  
  76. gui.register(displayer)
  77. FCEU.frameadvance()
  78. end
Advertisement
Add Comment
Please, Sign In to add comment