Well, I've produced a script to paint hitboxes. That might be worth something.
Download TGL.luaLanguage: lua
R1u= memory.readbyte
local function R2u(a) return R1u(a) + R1u(a+1)*0x100 end
local lastkeys, keys= input.get(), input.get()
--*****************************************************************************
local function UpdateKeys() lastkeys= keys; keys= input.get() end
local function Press(k) return keys[k] and not lastkeys[k] end
--*****************************************************************************
local function Limits(V,l,h) return math.max(math.min(V,h),l) end
--*****************************************************************************
--*****************************************************************************
Draw= {} --Draw[button]( x , y , c )
--*****************************************************************************
--Coordinates is the top-left pixel of the 3x5 digit.
--Used for drawing compact, colored numbers.
local Px,Li= gui.pixel, gui.line
Draw[0]= function(x,y,c) -- ###
Li(x ,y ,x ,y+4,c)-- # #
Li(x+2,y ,x+2,y+4,c)-- # #
Px(x+1,y ,c) -- # #
Px(x+1,y+4,c) -- ###
end
Draw[1]= function(x,y,c) -- #
Li(x ,y+4,x+2,y+4,c)-- ##
Li(x+1,y ,x+1,y+3,c)-- #
Px(x ,y+1,c) -- #
end -- ###
Draw[2]= function(x,y,c) -- ###
Li(x ,y ,x+2,y ,c)-- #
Li(x ,y+3,x+2,y+1,c)-- ###
Li(x ,y+4,x+2,y+4,c)-- #
Px(x ,y+2,c) -- ###
Px(x+2,y+2,c)
end
Draw[3]= function(x,y,c) -- ###
Li(x ,y ,x+1,y ,c)-- #
Li(x ,y+2,x+1,y+2,c)-- ###
Li(x ,y+4,x+1,y+4,c)-- #
Li(x+2,y ,x+2,y+4,c)-- ###
end
Draw[4]= function(x,y,c) -- # #
Li(x ,y ,x ,y+2,c)-- # #
Li(x+2,y ,x+2,y+4,c)-- ###
Px(x+1,y+2,c) -- #
end -- #
Draw[5]= function(x,y,c) -- ###
Li(x ,y ,x+2,y ,c)-- #
Li(x ,y+1,x+2,y+3,c)-- ###
Li(x ,y+4,x+2,y+4,c)-- #
Px(x ,y+2,c) -- ###
Px(x+2,y+2,c)
end
Draw[6]= function(x,y,c) -- ###
Li(x ,y ,x+2,y ,c)-- #
Li(x ,y+1,x ,y+4,c)-- ###
Li(x+2,y+2,x+2,y+4,c)-- # #
Px(x+1,y+2,c) -- ###
Px(x+1,y+4,c)
end
-- ###
Draw[7]= function(x,y,c) -- #
Li(x ,y ,x+1,y ,c)-- ##
Li(x+2,y ,x+1,y+4,c)-- #
end -- #
Draw[8]= function(x,y,c) -- ###
Li(x ,y ,x ,y+4,c)-- # #
Li(x+2,y ,x+2,y+4,c)-- ###
Px(x+1,y ,c) -- # #
Px(x+1,y+2,c) -- ###
Px(x+1,y+4,c)
end
Draw[9]= function(x,y,c) -- ###
Li(x ,y ,x ,y+2,c)-- # #
Li(x+2,y ,x+2,y+3,c)-- ###
Li(x ,y+4,x+2,y+4,c)-- #
Px(x+1,y ,c) -- ###
Px(x+1,y+2,c)
end
Draw[10]=function(x,y,c) -- #
Li(x ,y+1,x ,y+4,c)-- # #
Li(x+2,y+1,x+2,y+4,c)-- # #
Px(x+1,y ,c) -- ###
Px(x+1,y+3,c) -- # #
end
Draw[11]=function(x,y,c) -- ##
Li(x ,y ,x ,y+4,c)-- # #
Li(x+1,y ,x+2,y+1,c)-- ##
Li(x+1,y+4,x+2,y+3,c)-- # #
Px(x+1,y+2,c) -- ##
end
Draw[12]=function(x,y,c) -- #
Li(x ,y+1,x ,y+3,c)-- # #
Li(x+1,y ,x+2,y+1,c)-- #
Li(x+1,y+4,x+2,y+3,c)-- # #
end -- #
Draw[13]=function(x,y,c) -- ##
Li(x ,y ,x ,y+4,c)-- # #
Li(x+2,y+1,x+2,y+3,c)-- # #
Px(x+1,y ,c) -- # #
Px(x+1,y+4,c) -- ##
end
Draw[14]=function(x,y,c) -- ###
Li(x ,y ,x ,y+4,c)-- #
Li(x+1,y ,x+2,y ,c)-- ##
Li(x+1,y+4,x+2,y+4,c)-- #
Px(x+1,y+2,c) -- ###
end
Draw[15]=function(x,y,c) -- ###
Li(x ,y ,x ,y+4,c)-- #
Li(x+1,y ,x+2,y ,c)-- ##
Px(x+1,y+2,c) -- #
end -- #
--*****************************************************************************
local function __DN_AnyBase(right, y, Number, c, bkgnd, div)
--*****************************************************************************
-- Works with any base from 2 to 16. Paints the input number.
-- Returns the x position where it would paint another digit.
-- It only works with integers. Rounds fractions toward zero.
if div < 2 then return end -- Prevents the function from never returning.
local Digit= {}
local Negative= false
if Number < 0 then
Number= -Number
Negative= true
end
Number= math.floor(Number)
c= c or "white"
bkgnd= bkgnd or "clear"
local i= 0
if Number < 1 then
Digit[1]= 0
i= 1
end
while (Number >= 1) do
i= i+1
Digit[i]= Number % div
Number= math.floor(Number/div)
end
if Negative then i= i+1 end
local x= right - i*4
gui.box(x+1, y-1, right+1, y+5,bkgnd,bkgnd)
i= 1
while Draw[Digit[i]] do
Draw[Digit[i]](right-2,y,c)
right= right-4
i=i+1
end
if Negative then
gui.line(right, y+2,right-2,y+2,c)
right= right-4
end
return right
end
--*****************************************************************************
local function DrawNum(right, y, Number, c, bkgnd)
--*****************************************************************************
-- Paints the input number as right-aligned. Decimal version.
return __DN_AnyBase(right, y, Number, c, bkgnd, 10)
end
--*****************************************************************************
local function DrawNumx(right, y, Number, c, bkgnd)
--*****************************************************************************
-- Paints the input number as right-aligned. Hexadecimal version.
return __DN_AnyBase(right, y, Number, c, bkgnd, 16)
end
--#############################################################################
--#############################################################################
-- Finally, to the core of my code!
--*****************************************************************************
local function DumpObjInfo()
--*****************************************************************************
for i=0x00, 0x17 do
local Ypos= 12+8*i
local addr= 0x0500 + i
local color= "white"
if R1u(addr) == 0 then color= "grey" end
for j= 0, 24 do
DrawNumx( 9+10*j,Ypos,R1u(addr + (j+7)*0x18),color,"black")
end
end
end
--*****************************************************************************
local function GetBox(ObjIndex)
--*****************************************************************************
end
--*****************************************************************************
local function PaintHitBox(ObjIndex)
--*****************************************************************************
gui.box(
R1u(ObjIndex + 20*0x18),
math.min(R1u(ObjIndex + 22*0x18),R1u(ObjIndex + 23*0x18)),
R1u(ObjIndex + 21*0x18),
R1u(ObjIndex + 23*0x18),
"clear","white"
)
DrawNumx(R1u(ObjIndex + 21*0x18),R1u(ObjIndex + 23*0x18)+2,
R1u(ObjIndex + 6*0x18),"white","black")
DrawNum(R1u(ObjIndex + 21*0x18),R1u(ObjIndex + 23*0x18)+9,
R1u(ObjIndex + 7*0x18),"yellow","black")
end
--*****************************************************************************
local function SimpleStat()
--*****************************************************************************
local count= 19
for i=0x05, 0x17 do
local x= 12*(i-4)
local color= "white"
if R1u(0x0500+i) == 0 then color= "grey"; count= count-1 end
DrawNumx(x,191,R1u(0x0500+i),color,"black")
end
DrawNum(250,191,count,"yellow","black")
count= 0
for i=0x01, 0x04 do
if R1u(0x0500+i) ~= 0 then count= count+1 end
end
DrawNum(250,200,count)
end
--*****************************************************************************
local function ScanObjs()
--*****************************************************************************
-- local count= 0
for i= 0, 0x17 do
local addr= 0x0500 + i
if R1u(addr) ~= 0 then
-- count= count+1
if R1u(addr) == 0xA9 then -- Spawner object?
else
PaintHitBox(addr)
end -- Spawner or else
end -- Exist?
end -- for
end -- Function
local Dr= {0x00, 0x32, 0x50, 0x64, 0x8C, 0xB4, 0xDC, 0xE6} -- Thresholds
--*****************************************************************************
local function ItemHUD()
--*****************************************************************************
-- For showing item drop information.
DrawNumx(222,216,R1u(0x0043)) --Counter for enemy kills
DrawNumx(214,216,R1u(0x0044),"grey") --Increments when $0043 overflows
for i= 1, #Dr do
local color= "white"
local IMO= (i-2) % #Dr +1 --IMO is Index Minus One
local tVal, tHigh= (R1u(0x0043)-Dr[IMO])%256, (Dr[i]-Dr[IMO])%256
if (tVal < tHigh) then
color= "green" -- Mark next threshold we're hitting.
DrawNum(202,216,tHigh - tVal,"yellow") -- How much until next item
end
DrawNumx(142+10*i,224,Dr[i],color) -- Show threshold list
end
end
--*****************************************************************************
local function BasicHUD()
--*****************************************************************************
-- Odds and ends, mostly. A variety of general information.
-- Position. Address 0x0500, object count 0x18 (24), Offset 0 (player)
DrawNumx(134,224,R1u(0x0518)) -- i01: Y position
DrawNumx(142,224,R1u(0x0500 + 0x19*0x18),"yellow") -- i19: Y sub-pos
DrawNumx(102,224,R1u(0x0530)) -- i02: X position
DrawNumx(110,224,R1u(0x0500 + 0x1A*0x18),"yellow") -- i1A: X sub-pos
-- Player health. Interestingly, at zero HP, our hitbox shrinks a bit.
DrawNum(34,212,R1u(0x0048),"white","black") -- $0048: Immediate HP
local t= R1u(0x0048) - R1u(0x0049) -- $0049: Delayed HP(blue bar)
if t ~= 0 then -- If these don't match, then
DrawNum(34,204,t,"green","black") -- we took damage or healed.
end
t= bit.band(R1u(0x0788),0x3F) -- Inv timer (player obj stats,
if t ~= 0 then -- has other info packed in...)
DrawNum(46,212,t,"grey","black")
end
end
--*****************************************************************************
local function Gui()
--*****************************************************************************
ScanObjs()
SimpleStat()
BasicHUD()
ItemHUD()
-- UpdateKeys()
-- if Press("pageup") then Off= (Off+1)%32 end
-- if Press("pagedown") then Off= (Off-1)%32 end
-- DrawNumx(248,220,Off)
-- DrawNum(248,210,count)
end
gui.register(Gui)
EDIT: Now it shows more stuff! See if you can figure those out!