Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- char_checker_JP.lua
- --
- -- Automate the process of checking whether or not a printed
- -- character will crash Majora's Mask (J 1.0) on Bizhawk.
- -- US verison: https://pastebin.com/WivTk2gN
- --
- -- Author: @Faschz
- -- Created: April 7th, 2019
- CHARACTER_ADDR = 0x1CAE00
- TEXTBOX_ADDR = 0x3FD51E
- TIMER_ADDR = 0x1FA0F3
- file = io.open('Character Crashes JP 1.0.txt', 'w')
- for c=0, 65535 do
- -- Recover from any crashes by loading a state about to select
- -- the soaring location for Great Bay Coast
- savestate.loadslot(2)
- -- Set the character in the message table
- mainmemory.write_u16_be(CHARACTER_ADDR, c)
- -- Select the soaring location
- joypad.set({["A"] = true}, 1)
- emu.frameadvance()
- joypad.set({["A"] = false}, 1)
- -- Wait until the textbox appears and changes the address
- while c ~= mainmemory.read_u16_be(TEXTBOX_ADDR) do
- emu.frameadvance()
- end
- -- Check if the game is crashed by reading the frame count
- start = mainmemory.readbyte(TIMER_ADDR)
- is_crashed = true
- --3 frames work, but lets be on the safe side
- for frame=0, 5 do
- if start ~= mainmemory.readbyte(TIMER_ADDR) then
- is_crashed = false
- break
- end
- emu.frameadvance()
- end
- if is_crashed then
- print(c)
- file:write(c..'\n')
- end
- end
- file:write("DONE!")
- file:close()
- print("DONE!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement