Basic X-men 2 HUD. Original version by feos, updates by me.
Shows character and screen position, speed, acceleration. Bare-bones lag detector, since the built-in one in Gens doesn't detect lag in this game.
-- HUD for X-Men 2 (Genesis)
-- feos, 2012
-- updated by Truncated 2012-02-29
xvel_prev = 0
yvel_prev = 0
xcam_prev = 0
ycam_prev = 0
x_prev = 0
xsub_prev = 0
y_prev = 0
ysub_prev = 0
gui.register(function()
x = memory.readwordunsigned(0xFFEAB1)
y = memory.readwordunsigned(0xFFEAB5)
xvel = memory.readwordsigned (0xFFEABE)
yvel = memory.readwordsigned (0xFFEAC0)
xsub = memory.readbyteunsigned(0xFFEAB3)
ysub = memory.readbyteunsigned(0xFFEAB7)
xcam = memory.readwordunsigned(0xFFCD72)
xcam_bug = memory.readwordunsigned(0xFFC73E)
ycam = memory.readwordunsigned(0xFFCD70)
xacc = xvel - xvel_prev
yacc = yvel - yvel_prev
xvel_prev = xvel
yvel_prev = yvel
xgui = 120
ygui = 190
xscr = x-xcam
yscr = y-ycam
-- Velocities
if xvel < 0 then
xvel_sign = "-"
else
xvel_sign = ""
end
xvel_sub = math.abs(xvel) % 256
xvel_pix = (math.abs(xvel) - xvel_sub)/256
if yvel < 0 then
yvel_sign = "-"
else
yvel_sign = ""
end
yvel_sub = math.abs(yvel) % 256
yvel_pix = (math.abs(yvel) - yvel_sub)/256
-- Accelerations
if xacc < 0 then
xacc_sign = "-"
else
xacc_sign = ""
end
xacc_sub = math.abs(xacc) % 256
xacc_pix = (math.abs(xacc) - xacc_sub)/256
if yacc < 0 then
yacc_sign = "-"
else
yacc_sign = ""
end
yacc_sub = math.abs(yacc) % 256
yacc_pix = (math.abs(yacc) - yacc_sub)/256
--screen and character locked?
if (xcam_prev == xcam) and (ycam_prev == ycam) then
gui.text(130, 100, "SCREEN LOCK! SCREEN LOCK!", "red", "black")
end
xcam_prev = xcam
ycam_prev = ycam
if (x_prev == x) and (xsub_prev == xsub) and
(y_prev == y) and (ysub_prev == ysub)
then
gui.text(138, 108, "CHAR LOCK! CHAR LOCK!", "white", "red")
end
x_prev = x
xsub_prev = xsub
y_prev = y
ysub_prev = ysub
--print HUD to screen
gui.text(xgui+30, ygui, "X Y", "magenta")
gui.text(xgui, ygui+8, "Pos:", "green")
gui.text(xgui+23, ygui+8, x..":"..xsub, "green")
gui.text(xgui+60, ygui+8, y..":"..ysub, "green")
gui.text(xgui, ygui+16, "Vel:", "yellow")
gui.text(xgui+23, ygui+16, xvel_sign .. xvel_pix .. ":" .. xvel_sub, "yellow")
gui.text(xgui+60, ygui+16, yvel_sign .. yvel_pix .. ":" .. yvel_sub, "yellow")
gui.text(xgui, ygui+24, "Acc:", "red")
gui.text(xgui+23, ygui+24, xacc_sign .. xacc_pix .. ":" .. xacc_sub, "red")
gui.text(xgui+60, ygui+24, yacc_sign .. yacc_pix .. ":" .. yacc_sub, "red")
gui.text(xscr-18, yscr-7, "I'm here!", "green")
gui.text(100, 50, xcam, "green")
gui.text(100, 60, xcam_bug, "green")
end)