Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function box(xcenter,ycenter,width,height,xoffset,yoffset,color)
- left = xcenter+xoffset
- down = ycenter+height-yoffset
- right = xcenter+width+xoffset
- up = ycenter-yoffset
- gui.drawbox(left,down,right,up,color);
- --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
- -- gui.drawbox(left,down,right,up,color);
- --end;
- end;
- local function isblock(x)
- z=0
- if x==81 then z=1 end --checkered floor
- if x==82 then z=1 end
- if x==112 then z=1 end
- if x==93 then z=1 end
- if x==92 then z=1 end
- if x==42 then z=1 end --lower part of door
- if x==80 then z=1 end --upper part of door
- if x==84 then z=1 end --purple block
- if x==111 then z=1 end --snake urn
- if x==88 then z=1 end --purple stone
- return z
- end
- --82 == gray stone
- --112 == platform
- --93 == red spear block
- --92 == gray block
- while true do
- local function displayer()
- for i1=0,15,1 do --col
- for i2=0,11,1 do --row
- zip_ok=0
- want_ram=0x500 + i1 + 16*i2
- ram1=memory.readbyte(want_ram)
- ram2=memory.readbyte(want_ram+1)
- ram3=memory.readbyte(want_ram+16)
- ram4=memory.readbyte(want_ram+16+1)
- ram5=memory.readbyte(want_ram+32)
- ram6=memory.readbyte(want_ram+32+1)
- z1=isblock(ram1)
- z2=isblock(ram2)
- z3=isblock(ram3)
- z4=isblock(ram4)
- z5=isblock(ram5)
- z6=isblock(ram6)
- --check if zipping seems possible
- if z1==0 and z3==1 and z5==1 and z2==0 and z4==0 then
- zip_ok=1
- end
- --zip_ok=1
- if zip_ok==1 then
- box(16*i1,16*i2,16,16,0,-1-16,"green")
- end
- --box(16*i1,16*i2,16,16,0,0,"red")
- end
- end
- end
- gui.register(displayer)
- FCEU.frameadvance()
- end
Advertisement
Add Comment
Please, Sign In to add comment