Since CasualPokePlayer made a branch of BizHawk that has the dolphin core, I picked up this game again and made a display script for Top Ride:
Download kirby air ride.luaLanguage: lua
memory.usememorydomain("System Bus")
--Top Ride only
local Addresses = {
stage_id = 0x80535D4C,
total_laps = 0x00536952, --total run laps
free_laps = 0x00536954, --free run laps
grass_laps = 0x8053695C,
sand_laps = 0x8053695D,
sky_laps = 0x8053695E,
fire_laps = 0x8053695F,
light_laps = 0x80536960,
water_laps = 0x80536961,
metal_laps = 0x80536962,
pointer1 = 0x805DDAB8,
pointer4 = 0x805DDABC,
--2 layers deep
pointer2 = 0x80D13BD4,
pointer3 = 0x80D13BD8,
cam_x = 0x80D13620,
cam_z = 0x80D13624,
cam_y = 0x80D13628
}
local Kirby1 = {
ptr = Addresses.pointer1,
x = 0x000000,
y = 0x000000,
z = 0x000000,
x_speed = 0x000000,
y_speed = 0x000000,
z_speed = 0x000000,
angle = 0x000000,
charge = 0x000000
}
local Kirby2 = {
ptr = Addresses.pointer2,
base = 0x000000,
x = 0x000000,
y = 0x000000,
z = 0x000000,
x_speed = 0x000000,
y_speed = 0x000000,
z_speed = 0x000000,
angle = 0x000000,
charge = 0x000000
}
local Kirby3 = {
ptr = Addresses.pointer3,
base = 0x000000,
x = 0x000000,
y = 0x000000,
z = 0x000000,
x_speed = 0x000000,
y_speed = 0x000000,
z_speed = 0x000000,
angle = 0x000000,
charge = 0x000000
}
local Kirby4 = {
ptr = Addresses.pointer4,
x = 0x000000,
y = 0x000000,
z = 0x000000,
x_speed = 0x000000,
y_speed = 0x000000,
z_speed = 0x000000,
angle = 0x000000,
charge = 0x000000
}
function update(this, depth, offset)
--[[
]]--
local base = memory.read_u32_be(this.ptr)
if depth > 1 then
-- console.log(bizstring.hex(base + offset))
base = base + offset
this.base = base
end
-- console.log(bizstring.hex(base))
this.x = memory.readfloat(base + 0x88, true)
this.z = memory.readfloat(base + 0x8C, true)
this.y = memory.readfloat(base + 0x90, true)
this.angle = memory.readfloat(base + 0x94, true)
this.x_speed = memory.readfloat(base + 0xA0, true)
this.z_speed = memory.readfloat(base + 0xA4, true)
this.y_speed = memory.readfloat(base + 0xA8, true)
this.charge = memory.readfloat(base + 0xB4, true)
end
--4062CEF63E4CCCCD4166664A
while true do
local pointer = memory.read_s32_be(Kirby1.ptr)
if (pointer ~= 0) then --this will happen if changed rooms or just started script
update(Kirby1,0,0)
update(Kirby4,0,0)
update(Kirby2,2,0xDC8)
update(Kirby3,2,0xDC8)
end
local text_x = 0
-- local line = string.format('Kirby 1 X: %.6f Y: %.6f Z: %.6f', Kirby1.x, Kirby1.y, Kirby1.z)
local line = string.format('Kirby 1 X: %8X 2X: %8X 3X: %8X 4X: %8X', memory.read_u32_be(Kirby1.ptr)+0x88, Kirby2.base+0x88, Kirby3.base+0x88, memory.read_u32_be(Kirby4.ptr)+0x88)
gui.text(0, text_x + 15 * 0 ,line)
local line = string.format('Kirby 1 A: %8X 2A: %8X 3A: %8X 4A: %8X', memory.read_u32_be(Kirby1.ptr)+0x94, Kirby2.base+0x94, Kirby3.base+0x94, memory.read_u32_be(Kirby4.ptr)+0x94)
gui.text(0, text_x + 15 * 1 ,line)
-- line = string.format('Kirby 1 X: %.6f Y: %.6f Z: %.6f', Kirby1.x_speed, Kirby1.y_speed, Kirby1.z_speed)
-- gui.text(0, text_x + 15 * 1 , line)
-- gui.text(0, text_x + 15 * 2 , bizstring.hex(memory.read_u32_be(Kirby1.ptr)) .. " XSpeed: " .. bizstring.hex(memory.read_u32_be(Kirby1.ptr)+0x88))
-- line = string.format('Kirby 4 X: %.6f Y: %.6f Z: %.6f', Kirby4.x, Kirby4.y, Kirby4.z)
-- gui.text(0, text_x + 15 * 3 ,line)
-- line = string.format('Kirby 4 X: %.6f Y: %.6f Z: %.6f', Kirby4.x_speed, Kirby4.y_speed, Kirby4.z_speed)
-- gui.text(0, text_x + 15 * 4 , line)
-- gui.text(0, text_x + 15 * 5 , bizstring.hex(memory.read_u32_be(Kirby4.ptr)) .. " XSpeed: " .. bizstring.hex(memory.read_u32_be(Kirby4.ptr)+0x88))
-- line = string.format('Kirby 2 X: %.6f Y: %.6f Z: %.6f', Kirby2.x, Kirby2.y, Kirby2.z)
-- gui.text(0, text_x + 15 * 3 ,line)
-- line = string.format('Kirby 2 X: %.6f Y: %.6f Z: %.6f', Kirby2.x_speed, Kirby2.y_speed, Kirby2.z_speed)
-- gui.text(0, text_x + 15 * 4 , line)
-- gui.text(0, text_x + 15 * 5 , bizstring.hex(memory.read_u32_be(Kirby2.ptr)) .. " Ptr2: " .. bizstring.hex(memory.read_u32_be(Kirby2.ptr)) .. " XSpeed: " .. bizstring.hex(memory.read_u32_be(Kirby2.base)+0x88))
emu.frameadvance()
end
I found all 4 player addresses and their pointers.