Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function checkDirections(thePad)
- if (thePad["Up"] or thePad["Right"] or thePad["Down"] or thePad["Left"]) then return true
- else return false end
- end
- function checkRotations(thePad)
- if (thePad["L"] or thePad["R"] or thePad["B"]) then return true
- else return false end
- end
- function checkPlacement(thePad)
- if (thePad["A"]) then return true
- else return false end
- end
- function checkAll(thePad)
- if (checkDirections(thePad) or checkRotations(thePad) or checkPlacement(thePad)) then return true
- else return false end
- end
- lastBE0 = memory.readbyte(0x000BE0)
- curBE0 = lastBE0
- function update()
- lastBE0 = curBE0
- curBE0 = memory.readbyte(0x000BE0)
- end
- while(true) do
- memory.usememorydomain("IWRAM")
- if(memory.readbyte(0x2B51) == 240 and memory.readbyte(0x2B52) == 250 and
- (movie.getinputasmnemonic(emu.framecount()) ~= "| 0, 0, 0, 100,.......A...|" and movie.getinputasmnemonic(emu.framecount()-1) ~= "| 0, 0, 0, 100,.......A...|")) then
- --THIS GIVES FALSE POSITIVES IN MENUS
- print(emu.framecount() .. " BAD PUZZLE ENTRY?")
- end
- --3318 167, 331A 225, 3320 68, 3322 239
- if(memory.readbyte(0x3318) == 167 and memory.readbyte(0x331A) == 225 and movie.getinputasmnemonic(emu.framecount()) ~= "| 0, 0, 0, 100,.......A...|") then
- --THIS MIGHT NOT BE THOROUGH ENOUGH TO GET POSITIVES
- print(emu.framecount() .. " BAD PUZZLE EXIT?")
- end
- memory.usememorydomain("Combined WRAM")
- update()
- --000BE0 = 0 two frames after we regain control
- --000DED = Fade timer (000BE0 falsely equals 0 during the fadein/out between levels)
- --025EF0 = 176 on the between levels screen
- if(curBE0 == 0 and memory.readbyte(0x000DED) <= 2 and memory.readbyte(0x025EF0) ~= 176 and emu.framecount() > 900) then
- rotation = movie.getinput(emu.framecount()-2)
- movement = movie.getinput(emu.framecount()-1)
- placement = movie.getinput(emu.framecount())
- if (lastBE0 == 6) then
- weRotated = false
- if (rotation["B"] or rotation["R"] or rotation["L"]) then weRotated = true end
- weMoved = false
- if (movement["Up"] or movement["Right"] or movement["Down"] or movement["Left"]) then weMoved = true end
- wePlaced = false
- if (placement["A"]) then wePlaced = true end
- if (not weRotated and not weMoved and not wePlaced) then
- print(emu.framecount() .. " BAD PIECE PLACING?")
- end
- else
- if (not checkAll(rotation) and not checkAll(movement) and not placement["A"]) then
- print(emu.framecount() .. " BAD PIECE PLACING?")
- end
- end
- end
- emu.frameadvance()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement