Advertisement
Kaztalek

gimmick.lua

Jul 9th, 2016
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.04 KB | None | 0 0
  1. --"gimmick.lua"
  2. --For use in MM (U) on BizHawk 1.9.1
  3. --Item list: http://bombch.us/BDlV
  4.  
  5. --Addresses:
  6. rupees = 0x1ef6aa
  7. --Addresses for displaying c icons
  8. cleft = 0x3fd773
  9. cright = 0x3fd775
  10. cdown = 0x3fd777
  11. --Addresses for items on c-buttons
  12. leftitem = 0x1ef6bd
  13. rightitem = 0x1ef6be
  14. downitem = 0x1ef6bf
  15. --Addresses for B items of each form
  16. bhuman = 0x1ef6bc
  17. bdeku = 0x1ef6c8
  18. bgoron = 0x1ef6c0
  19. bzora = 0x1ef6c4
  20.  
  21. --Globals:
  22. readByte = memory.readbyte
  23. writeByte = memory.writebyte
  24. readShort = memory.read_s16_be
  25. writeShort = memory.write_s16_be
  26.  
  27. while true do
  28.     local item = readShort(rupees)
  29.     if item > 255 then
  30.         item = 255
  31.     end
  32.     --Set B items to rupee count
  33.     writeByte(bhuman, item)
  34.     writeByte(bdeku, item)
  35.     writeByte(bgoron, item)
  36.     writeByte(bzora, item)
  37.     --Disable using C
  38.     writeByte(leftitem, 255)
  39.     writeByte(rightitem, 255)
  40.     writeByte(downitem, 255)
  41.     --Hide C icons
  42.     writeByte(cleft, 0)
  43.     writeByte(cright, 0)
  44.     writeByte(cdown, 0)
  45.     emu.frameadvance()
  46. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement