Rather late, but I believe I figured out where overworld NPCs addresses are.
Also, it seems for the ones that move, they remain at their own location if offscreen far enough, so that should make manipulating certain Denjuu walk cycles somewhat easier.
Edit:
Language: lua
memory.usememorydomain("IWRAM")
--[[
SystemID GBA
3570 w u 0 IWRAM wtf?
3572 w u 0 IWRAM x cam
3574 w u 0 IWRAM y cam
3576 b h 0 IWRAM sprite related
357C d 3 0 IWRAM x
3580 d 3 0 IWRAM y
3584 d h 0 IWRAM z?
3588 d 3 0 IWRAM movement
358E b h 0 IWRAM nth sprite in area
358F b h 0 IWRAM state
]]--
local NPC = {
x,y,xcam,ycam,state
}
while true do
local num = 0
for i = 0x34D0, 0x3790, 0x20 do
if memory.readbyte(i) ~= 0 then
NPC.xcam = memory.read_u16_le(i+0x2)
NPC.ycam = memory.read_u16_le(i+0x4)
NPC.x = string.format('%.1f',memory.read_u32_le(i+0xC)/65536.0)
NPC.y = string.format('%.1f',memory.read_u32_le(i+0x10)/65536.0)
NPC.state = memory.readbyte(i+0x1F)
num = math.floor((i-0x34D0)/0x20)+1 --So it would be 1 offset
--gui.drawText(xcam,ycam,"X"..x.." Y"..y.."i"..num.."s"..state,null,null,10,null,null)
gui.drawText(NPC.xcam,NPC.ycam,num,null,null,10,null,null)
end
end
gui.text(0,70,num)
emu.frameadvance()
end
Edit: At the very first cave, this already influences the 2 Denjuu to the right of the cave when you go grab the first key; it's possible for them to wander far enough such that they "stop" at different locations, thus changing where they wander once they appear on screen again.
Also, moving diagonally for the "stairs" in certain areas such as the first cave is faster than moving straight through it.