Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- HUD script originally made by Pasky, MESHUGGAH just transformed them
- local px, cx, py, pxs, pys
- local lpx = 0
- local lpy = 0
- -- for objects
- local dir
- function findbit(p)
- return 2 ^ (p - 1)
- end
- function hasbit(x, p)
- return x % (p + p) >= p
- end
- local function axis(x,y,color)
- --gui.box(x-16,y-16, x+16,y+16,"#FFFFFF10")
- gui.line(x,y-16,x,y+16,color)
- gui.line(x-16,y,x+16,y,color)
- end
- local function objects()
- gui.text(1,220,string.format("Direction, Animation timer, State?, ??? / X pos, Y pos with sub"))
- for i=0, 15 do
- if (memory.readbyte(0x4e0+i) ~= 0) then
- axis(memory.readbyte(0x450+i),memory.readbyte(0x440+i),"#FFFFFF3F")
- dir = memory.readbyte(0x400+i)
- -- up down? 90 d0 d8...
- if hasbit(dir,findbit(7)) == true then dir = '>' else dir = '<' end
- gui.text(memory.readbyte(0x450+i)-16,memory.readbyte(0x440+i)-22,
- string.format("%s %d %3d %3d", dir, memory.readbyte(0x410+i), memory.readbyte(0x420+i), memory.readbyte(0x4b0+i)),"#FFFFFFb0", "#00000030")
- gui.text(memory.readbyte(0x450+i)-16,memory.readbyte(0x440+i)+22,
- string.format("%3d,%3d.%3d", memory.readwordunsigned(0x4F0+i,0x500+i), memory.readbyte(0x440+i), memory.readbyte(0x460+i)),"#FFFFFFb0", "#00000030")
- end
- end
- end
- local function Stuff()
- px = memory.readwordunsigned(0x4F0,0x500)
- py = memory.readbyte(0x440)
- pxs = px - lpx
- pys = py - lpy
- gui.text(100,200,string.format("X:%3d (%3d)\nY:%3d (%3d)", px, pxs, py, pys))
- lpx = px
- lpy = py
- objects()
- end
- emu.registerafter(Stuff)
Advertisement
Add Comment
Please, Sign In to add comment