i MAY have overcomplicated it and it's not pretty yet, but here is todays work!
Download dkcRamWatcher.luaLanguage: lua
local front = 0x056F
local frontVal
local xDiddySpeed = 0x0E8D
local xDidSpdVal
local xDiddyPosition = 0x0B1D
local xDidPos
local xDiddySub = 0x0DBE
local xDidSub
local yDiddySpeed = 0x0EF5
local yDidSpd
local yDiddyPosition = 0x0FF9
local yDidPos
local diddySJ = 0x16FC
local didSJ
local donkeySJ = 0x16FA
local donSJ
local status = 0x1B03
local statuss
local xDonkeySpeed = 0x0E8B
local xDonSpd
local xDonkeyPosition = 0x0FC3
local xDonPos
local xDonkeySub = 0x0DBC
local xDonSub
local yDonkeySpeed = 0x0EF3
local yDonSpd
local yDonkeyPosition = 0x0FF7
local yDonPos
memory.usememorydomain("WRAM") -- just in case
while true do
statuss = memory.readbyte(status)
frontVal = memory.readbyte(front)
didSJ = memory.readbyte(diddySJ)
donSJ = memory.readbyte(donkeySJ)
gui.text(120, 35, "X")
gui.text(170, 35, "Y")
if (frontVal == 2) then
xDidSpdVal = memory.read_s16_le(xDiddySpeed)
gui.text(0, 50, "Speed: "..xDidSpdVal)
xDidPos = memory.read_s16_le(xDiddyPosition)
gui.text(0, 65, "Position: "..xDidPos)
xDidSub = memory.read_s16_le(xDiddySub)
gui.text(0, 80, "SubPixels: "..xDidSub)
yDidSpd = memory.read_s16_le(yDiddySpeed)
gui.text(150, 50, yDidSpd)
yDidPos = memory.read_s16_le(yDiddyPosition)
gui.text(160, 65, yDidPos)
elseif (frontVal == 1) then
xDonSpd = memory.read_s16_le(xDonkeySpeed)
gui.text(0, 50, "Speed: "..xDonSpd)
xDonPos = memory.read_s16_le(xDonkeyPosition)
gui.text(0, 65, "Position: "..xDonPos)
xDonSub = memory.read_s16_le(xDonkeySub)
gui.text(0, 80, "SubPixels: "..xDonSub)
yDonSpd = memory.read_s16_le(yDonkeySpeed)
gui.text(150, 50, yDonSpd)
yDonPos = memory.read_s16_le(yDonkeyPosition)
gui.text(160, 65, yDonPos)
end
if (statuss == 1) then
if (didSJ == 0) then
gui.text(0, 95, "SJ Diddy: Stored!")
else
gui.text(0, 95, "SJ Diddy: Not stored!")
end
if (donSJ == 0) then
gui.text(0, 110, "SJ Donkey: Stored!")
else
gui.text(0,110, "SJ Donkey: Not Stored!")
end
else
gui.text(0, 95, "SJ Diddy: Not stored!")
gui.text(0,110, "SJ Donkey: Not Stored!")
end
emu.frameadvance()
end
Also, I blame notepad++ for any formatting errors. it looks good to me!