Not that specific one. The one I had since before is this:
-- Player
local pbase = 0xFF1CD4
local px = pbase + 0x19
local py = pbase + 0x1D
local camx = 0xFF1BC5
local camy = 0xFF1BC9
--Player projectiles
local projbase = 0xFF1D34
--Enemies
local ebase = 0xFF21B4
--ex = ebase + 0x19 (stupid endianess)
--ey = ebase + 0x3D (stupid endianess)
--enemy hp = +0x0D
-- X radius = +0x13
--Enemy structure size 0x60
local function endian(address)
local result = memory.readbyte(address) + (memory.readbyte(address-1) * 256)
return result
end
local function Toki()
local cx = endian(camx)
local cy = endian(camy)
local x = endian(px) - cx
local y = endian(py) - cy
local xoff = memory.readbytesigned(pbase + 0x11)
local yoff = memory.readbytesigned(pbase + 0x15)
local xrad = memory.readbyte(pbase +0x13)
local yrad = memory.readbyte(pbase +0x17)
local flip
flip = memory.readbyte(pbase +1)
if flip == 1 then
xoff = xoff * -1
end
gui.box(x+xoff-xrad,y+yoff-yrad,x+xoff+xrad,y+yoff+yrad,"#0000FF30","#0000FFFF")
end
local function enemies()
local cx = endian(camx)
local cy = endian(camy)
local x
local y
local xoff
local xrad
local yoff
local yrad
local oend = 44
local base = ebase
local flip
local hp
for i = 0,oend,1 do
if i > 0 then
base = ebase + (i * 0x60)
end
flip = memory.readbyte(base +1)
if memory.readbyte(base) > 0 then
hp = memory.readbyte(base + 0xD)
x = endian(base + 0x19) - cx
xrad = memory.readbyte(base + 0x13)
xoff = memory.readbytesigned(base + 0x11)
yrad = memory.readbyte(base + 0x17)
yoff = memory.readbytesigned(base + 0x15)
if flip == 1 then
xoff = xoff * -1
end
y = endian(base + 0x1D) - cy
if hp > 0 then
gui.text(x,y-10, "HP: " .. hp)
end
gui.box(x+xoff-xrad,y+yoff-yrad,x+xoff+xrad,y+yoff+yrad,"#FF000035","#FF0000FF")
end
end
end
local function projectiles()
local cx = endian(camx)
local cy = endian(camy)
local x
local y
local xoff
local xrad
local yoff
local yrad
local oend = 11
local base = projbase
local flip
for i = 0,oend,1 do
if i > 0 then
base = projbase + (i * 0x60)
end
flip = memory.readbyte(base +1)
if memory.readbyte(base) > 0 then
x = endian(base + 0x19) - cx
y = endian(base + 0x1D) - cy
xoff = memory.readbytesigned(base + 0x11)
yoff = memory.readbytesigned(base + 0x15)
xrad = memory.readbyte(base + 0x13)
yrad = memory.readbyte(base + 0x17)
if flip == 1 then
xoff = xoff * -1
end
gui.box(x+xoff-xrad,y+yoff-yrad,x+xoff+xrad,y+yoff+yrad,"#FFFFFF40","#FFFFFFFF")
end
end
end
while true do
Toki()
enemies()
projectiles()
emu.frameadvance()
end
From what I can tell by looking at the code there are some changes.
-- Player
local pbase = 0xFF1CD4
local px = pbase + 0x19
local py = pbase + 0x1D
local camx = 0xFF1BC5
local camy = 0xFF1BC9
--Player projectiles
local projbase = 0xFF1D34
--Enemies
local ebase = 0xFF21B4
--Bosses
local bbase = 0xFF35F4
local function endian(address)
local result = memory.readbyte(address) + (memory.readbyte(address-1) * 256)
return result
end
local function Toki()
local cx = endian(camx)
local cy = endian(camy)
local x = endian(px) - cx
local y = endian(py) - cy
local xoff = memory.readbytesigned(pbase + 0x11)
local yoff = memory.readbytesigned(pbase + 0x15)
local xrad = memory.readbyte(pbase +0x13)
local yrad = memory.readbyte(pbase +0x17)
local flip = memory.readbyte(pbase +1)
if flip == 1 then
xoff = xoff * -1
end
gui.box(x+xoff-xrad,y+yoff-yrad,x+xoff+xrad,y+yoff+yrad,"#0000FF30","#0000FFFF")
end
local function enemies()
local cx = endian(camx)
local cy = endian(camy)
local x
local y
local xoff
local xrad
local yoff
local yrad
local oend = 44
local base = ebase
local flip
local hp
for i = 0,oend,1 do
if i > 0 then
base = ebase + (i * 0x60)
end
flip = memory.readbyte(base +1)
if memory.readbyte(base) > 0 then
hp = memory.readbyte(base + 0xD)
x = endian(base + 0x19) - cx
xrad = memory.readbyte(base + 0x13)
xoff = memory.readbytesigned(base + 0x11)
yrad = memory.readbyte(base + 0x17)
yoff = memory.readbytesigned(base + 0x15)
if flip == 1 then
xoff = xoff * -1
end
y = endian(base + 0x1D) - cy
if hp > 0 then
gui.text(x,y-10, "HP: " .. hp)
end
gui.box(x+xoff-xrad,y+yoff-yrad,x+xoff+xrad,y+yoff+yrad,"#FF000035","#FF0000FF")
end
end
end
local function boss()
local cx = endian(camx)
local cy = endian(camy)
local x = endian(bbase + 0x19) - cx
local y = endian(bbase + 0x1D) - cy
local xrad = memory.readbyte(bbase + 0x11)
local yrad = memory.readbyte(bbase + 0x15)
local flip = memory.readbyte(bbase +1)
gui.text(x-10,y-10,"HP: " .. memory.readbyte(bbase + 0x0D))
gui.box(x-xrad,y-yrad,x+xrad,y+yrad,"#FF000035","#FF0000FF")
end
local function projectiles()
local cx = endian(camx)
local cy = endian(camy)
local x
local y
local xoff
local xrad
local yoff
local yrad
local oend = 11
local base = projbase
local flip
for i = 0,oend,1 do
if i > 0 then
base = projbase + (i * 0x60)
end
flip = memory.readbyte(base +1)
if memory.readbyte(base) > 0 then
x = endian(base + 0x19) - cx
y = endian(base + 0x1D) - cy
xoff = memory.readbytesigned(base + 0x11)
yoff = memory.readbytesigned(base + 0x15)
xrad = memory.readbyte(base + 0x13)
yrad = memory.readbyte(base + 0x17)
if flip == 1 then
xoff = xoff * -1
end
gui.box(x+xoff-xrad,y+yoff-yrad,x+xoff+xrad,y+yoff+yrad,"#FFFFFF40","#FFFFFFFF")
end
end
end
while true do
Toki()
enemies()
projectiles()
boss()
emu.frameadvance()
end
Can you give a quick description to what has been changed?
Thank you for sharing!