This game for the Gba seems like a good game to TAS. I even made a
run of the first two world. So,what do you think?
Edit: I uploaded to
youtube.
Edit:
Display code
memory.usememorydomain("IWRAM")
local Addresses = {
charge = 0x0008,
speed = 0x1732,
game_state = 0x25C0,
x = 0x372A,
y = 0x372E,
speedx = 0x3732,
speedy = 0x3736,
script_x = 0x3728,
script_y = 0x372C,
npc_base = 0x330B,
npc_x1 = 0x3AAE,--+0x64
npc_y1 = 0x3AB2,--+0x64
cam_x = 0x4B12,
cam_y = 0x4B22,
difficulty = 0x7180,
state = 0x71B0,
l_exit = 0x72AC
}
-- function for checking an input with how many frames to delay
function inputdelay(inputs, delay)
local is = input.get()
local start = false
if inputs ~= nil and (is[tostring(inputs)] ~=nil) then
--console.log(is) --debugging
while (delay > 0) do
emu.frameadvance()
delay = delay -1
end
start = true
return start
end
return start
end
--[[
npc struct
3A77 palatte?
3A8E X sprite size
3A90 Y sprite size
3AAE X
3AB2 Y
]]--
function draw_npc()
local cam_x = memory.read_u16_le(Addresses.cam_x)
local cam_y = memory.read_u16_le(Addresses.cam_y)
local npc_base = 0x330B --may modify later
local offset = 0x64
for i = 0, 50 do
local base_now = npc_base + (offset * i)
local id = memory.readbyte(base_now + 0x1F)
local x = memory.read_u16_le(base_now + 0x37)
local y = memory.read_u16_le(base_now + 0x3B)
gui.drawRectangle(x-cam_x-10, y-cam_y-32, 20, 32,"green")
gui.pixelText(x-cam_x, y-cam_y-32, i)
gui.pixelText(x-cam_x, y-cam_y-32+7, bizstring.hex(base_now))
gui.pixelText(x-cam_x, y-cam_y-32+14, id)
-- gui.pixelText(x-cam_x, y-cam_y-32+14, bizstring.hex(base_now+0x37))
end
end
function draw_position()
local cam_x = memory.read_u16_le(Addresses.cam_x)
local cam_y = memory.read_u16_le(Addresses.cam_y)
local x = memory.read_u16_le(Addresses.x)
local y = memory.read_u16_le(Addresses.y)
local speedx = memory.read_s16_le(Addresses.speedx)
local speedy = memory.read_s16_le(Addresses.speedy)
local charge = memory.read_u16_le(Addresses.charge)
-- memory.write_u16_le(Addresses.cam_x,x)
-- memory.write_u16_le(Addresses.cam_y,y)
-- local npc_x = memory.read_u16_le(Addresses.npc_x1)
-- local npc_y = memory.read_u16_le(Addresses.npc_y1)
-- gui.drawRectangle(x-cam_x-10, y-cam_y-32, 20, 32,"green")
gui.text(0,60, "CX:"..cam_x.." CY:"..cam_y)
gui.text(0,75, "X:"..x.." Y:"..y.." Charge:"..charge)
gui.text(0,90, "SX:"..speedx.." SY:"..speedy)
-- gui.text(0,60, "NX:"..npc_x.." NY:"..npc_y)
end
y1 = memory.read_u32_le(Addresses.script_y)
function hotkey()
local x1 = memory.read_u32_le(Addresses.script_x)
local y = memory.read_u32_le(Addresses.script_y)
local x_speed = 6
local y_speed = 16
if (joypad.getimmediate().R == true) then
if (joypad.getimmediate().Left == true) then
x1 = x1-65536*x_speed
elseif (joypad.getimmediate().Right == true) then
x1 = x1+65536*x_speed
else
x1 = x1
end
if (joypad.getimmediate().Down == true) then
y1 = y1+65536*y_speed
elseif (joypad.getimmediate().Up == true) then
y1 = y1-65536*y_speed
else
y1 = y1
end
end
memory.write_u32_le(Addresses.script_x,x1)
memory.write_u32_le(Addresses.script_y,y1)
end
while true do
draw_npc()
-- if memory.readbyte(Addresses.l_exit) == 1 then client.pause() end
draw_position()
-- hotkey()
game_state = memory.readbyte(Addresses.game_state)
gui.text(0,105, "Gamestate:"..game_state)
-- gui.text(0,40, "X:"..display_x.." Y:"..display_y)
-- gui.text(0,60, "State: "..memory.read_u8(Addresses.game_state))
emu.frameadvance()
end