Advertisement
Kaztalek

Untitled

Jul 30th, 2016
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.87 KB | None | 0 0
  1. --"pausebuffer.lua"
  2. --For use in MM (J/U) on BizHawk 1.9.1
  3. --
  4. --Addresses:
  5. --0x1FA0F0 is Visual Frame (J)
  6. --0x3FD8CB is A Button (J)
  7. --
  8. --0x1F9F80 is Visual Frame (U)
  9. --0x3FD71D is A Button (U)
  10.  
  11. local hash = gameinfo.getromhash()
  12. local versions = {
  13.     ['D6133ACE5AFAA0882CF214CF88DABA39E266C078'] = 'US10'
  14. }
  15. local version = versions[hash]
  16. local JP = version ~= 'US10'
  17.  
  18. local frame
  19. local a
  20. if not JP then
  21.     -- US 1.0
  22.     frame = 0x1F9F80
  23.     a = 0x3FD71D
  24. else
  25.     frame = 0x1FA0F0
  26.     a = 0x3FD8CB
  27. end
  28. local buffer = false
  29.  
  30. while true do
  31.     if memory.readbyte(a) ~= lastA and lastA == 21 then
  32.         x = emu.framecount() + 20
  33.         buffer = true
  34.     elseif buffer and emu.framecount() > x and memory.read_u32_be(frame) > lastFrame then
  35.         joypad.set({Start=1},1)
  36.         buffer = false
  37.     end
  38.     lastA = memory.readbyte(a)
  39.     lastFrame = memory.read_u32_be(frame)
  40.     emu.frameadvance()
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement