User File #638273767007684428

Upload All User Files

#638273767007684428 - Klonoa Empire of Dreams

Klo-GBA.lua
72 downloads
Uploaded 8/11/2023 6:51 PM by inconsistent (see all 30)
The RAM addresses here are the same between the US and JP versions.
local X
local Y 
local Ground
local iFrames
local State

states = {}
states[0] = "Idle"
states[34] = "Idle (Down)" -- looking down
states[35] = "Idle (Up)" -- looking up
states[22] = "Idle (Holding Moo)"

states[29] = "Idle (Anim A)" -- foot tap
states[30] = "Idle (Anim B)" -- hat spin
states[31] = "Idle (Anim C)" -- talking to huepow
states[32] = "Idle (Anim Ea)" -- sleep intermediary
states[33] = "Idle (Anim Eb)" -- sleep

states[1] = "Running"
states[36] = "Running (Down)" 
states[37] = "Running (Up)"
states[23] = "Running (Holding Moo)"
states[28] = "Running (Hoverboard)"

states[2] = "Airborne (Rise)"
states[3] = "Airborne (Stall)"
states[4] = "Airborne (Fall)"
states[7] = "Fluttering"
states[8] = "Wind Bullet"
states[5] = "Landing"
states[27] = "Landing (Holding Moo)"

states[24] = "Airborne (Holding Moo) (Rise)"
states[25] = "Airborne (Holding Moo) (Stall)"
states[26] = "Airborne (Holding Moo) (Fall)"

states[9] = "Throwing Moo"
states[10] = "Throwing Moo (Airborne)"
states[11] = "Double Jumping"
states[12] = "Taking Damage"
states[13] = "Dying!"

states[14] = "Goomis"
states[15] = "Goomis"
states[16] = "Ladder"
states[17] = "Ladder (Up/Down)"
states[18] = "Rope"
states[20] = "Rope (Down)"

klonoaState = states[0]

while true do 
    X = memory.read_s16_le(0x2920, "IWRAM")
    Y = memory.read_s16_le(0x2922, "IWRAM")
    Ground = memory.read_u8(0x5251, "IWRAM")
    iFrames = memory.read_u16_le(0x525E, "IWRAM")
    State = memory.read_u8(0x0830, "IWRAM")
    local klonoaInternalState = memory.read_u8(0x0830, "IWRAM")
    local visionN = memory.read_u8(0x4C2C, "IWRAM")

    gui.text(1,100, "X: " .. X, "white")
    gui.text(1,120, "Y: " .. Y, "white")
    gui.text(1,140, "Ground: " .. Ground, "white")

    if (iFrames ~= 0) then
        gui.text(1, 180, "iFrames: " .. iFrames, "white");
    end

    if states[klonoaInternalState] ~= nil then
	    gui.text(1, 160, "STATE: " .. states[klonoaInternalState], "white")
    else
	    gui.text(1, 160, "UNKNOWN VALUE: " .. klonoaInternalState, "white")
    end
    
    if visionN == 4 then -- only show board speed momentum (bsm) if you're on vision 4, a board level
        local bsmValue = memory.read_u16_le(0x5238, "IWRAM")
        gui.text(1, 200, "BSM: " .. bsmValue, "white")
    end

    emu.frameadvance()
end