Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- char_checker.lua
- --
- -- Automate the process of checking whether or not a printed
- -- character will crash Majora's Mask (U) on Bizhawk. Can be
- -- swapped over to test japanese characters on (J) by changing
- -- the writes to be 16 bit as well as finding the new addresses
- --
- -- Author: @Faschz
- -- Created: April 6th, 2019
- CHARACTER_ADDR = 0x1D0714
- TEXTBOX_ADDR = 0x3FD355
- TIMER_ADDR = 0x1F9F83
- for c=0, 255 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.writebyte(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.readbyte(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)
- end
- end
- print("DONE!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement