Guest User

banktest.lua

a guest
Oct 15th, 2011
51
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local hexprint = function(str, val)
  2.     print(string.format("%s: %04X", str, val))
  3. end
  4.  
  5. local bank, poke = 0x2FFFC0, memory.readword(0x011A44)
  6. hexprint("poke address", bank)
  7. hexprint("poke value", poke)
  8.  
  9. hexprint("before write, byte 1", memory.readbyte(bank + 0))
  10. hexprint("before write, byte 2", memory.readbyte(bank + 1))
  11. hexprint("before write, word", memory.readword(bank))
  12. memory.writeword(bank, poke)
  13. hexprint("after write, word", memory.readword(bank))
  14.  
  15.  
RAW Paste Data