Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- By pigdevil2010 for using in this video:
- -- This script works in VBA-RR
- n = {0x88d0, 0x8b40, 0x8ac0, 0x8a10, 0x8a40, 0x8b10} -- VRAM addresses of "Number" tile
- curr = 0 -- First phone number in the list
- p = true
- -- Converting numbers into VRAM address functions
- function hexU(a)
- i = math.floor(a / 16)
- if i > 9 then return 0x8760 + i * 16
- else return 0x8f60 + i * 16 end
- end
- function hexL(a)
- i = a % 16
- if i > 9 then return 0x8760 + i * 16
- else return 0x8f60 + i * 16 end
- end
- -- Check if we're currently in Pokegear menu by adding every values from address 0x9000 to 0x95ff and compare with the checksum
- function gear()
- chk = 0
- for i = 0x9000, 0x95fc, 4 do chk = chk + memory.readdword(i) end
- return chk == 709077982679
- end
- -- Draw a tile that stored in the given VRAM
- function drawtile(vram, x, y)
- for i = 0, 7, 1 do for j = 0, 7, 1 do
- if bit.band(bit.rshift(memory.readbyte(vram + i * 2), 7 - j), 1) == 1 then
- gui.pixel(x + j, y + i, "white")
- end
- end end
- end
- -- Main function
- for i = 0, 9, 1 do memory.writebyte(0xdc7c + i, i) end -- Make it write phone number 00 - 09 at the first time it run
- function upd()
- ge = gear()
- if memory.readword(0xcf64) == 2 and ge then
- for i = 1, 6, 1 do drawtile(n[i], 64 + i * 8, 8) end
- drawtile(hexU(curr), 96, 16)
- drawtile(hexL(curr), 104, 16)
- drawtile(0x8e30, 112, 16)
- if curr == 250 then
- drawtile(0x8850, 120, 16)
- drawtile(0x8850, 128, 16)
- else
- drawtile(hexU(curr + 9), 120, 16)
- drawtile(hexL(curr + 9), 128, 16)
- end
- end
- if memory.readword(0xcf64) == 3 and ge then
- if p and curr < 250 then
- curr = curr + 10
- p = false
- for i = 0, 9, 1 do
- t = curr + i
- if t > 255 then t = 0 end
- memory.writebyte(0xdc7c + i, t)
- end
- end
- else p = true end
- curr = memory.readbyte(0xdc7c)
- end
- gui.register(upd) -- Make it update every frame
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement