This page documents information about Darkwing Duck
. Many of the tricks demonstrated here are near impossible in real time and documented for the purposes of creating Tool-assisted Speedruns.
$E4-$E7
get RORed every gameplay frame, and sometimes additional small manipulations are done with either $E4-$E5
or $E6-$E7
whenever random even is about to occur (item drops from dying enemies, bosses actions).
$9F6F
+ Y register what he should do: show up or resume swimming.
$9969
+ Y register for whether he should jump up or down.
$AA69
+ Y register for whether he should jump up or stay on the platform. Then shoots from the platform he's on and walks off to cross the screen and jump on the other middle platform, to roll RNG once again.
$049F
decrements from 7 to 0. If Bushroot is jumping when that address is 6, 4, or 2, he will roll RNGs 1 and 2, write the result to Y register, then read from $A83F
for what he should do next.
function getb(i,offset) return memory.readbyte(i+offset) end function getw(i,offset) return memory.readword(i+offset,i+offset+0x10) end function object(slot) a = 0x400 + slot facing = getb(a,0x000) timer1 = getb(a,0x010) state = getb(a,0x020) timer2 = getb(a,0x030) yScr = getb(a,0x040) xScr = getb(a,0x050) ySub = getb(a,0x060) xSub = getb(a,0x070) timer3 = getb(a,0x080) action = getb(a,0x0d0) xPos = getw(a,0x0f0) yPos = getw(a,0x110) xVelSub = getb(a,0x130) xVel = getb(a,0x140) yVelSub = getb(a,0x150)/256 yVel = memory.readbytesigned(a+0x160) id = getb(a,0x170) if yVel >= 0 then ySpd = yVel + yVelSub else ySpd = yVel - yVelSub end if action > 0 then --gui.text(xScr,yScr,string.format("%X",state)) gui.text( 1,1,string.format( "X: %04d.%d\nY: %04d.%03d\nS: %.3f", xPos,xSub/25.6,yPos,ySub,ySpd)) end end function rng() rng1 = memory.readbyte(0xe4) rng2 = memory.readbyte(0xe5) rng3 = memory.readbyte(0xe6) rng4 = memory.readbyte(0xe7) gui.text(10,10,string.format("%02X:%02X:%02X:%02X",rng1,rng2,rng3,rng4)) end function stuff() xCam = memory.readword(0xfc) yCam = memory.readword(0xfa) bossInv = memory.readbyte(0xed) bossHP = memory.readbyte(0xee) bossSlot = memory.readbyte(0xef) bossX = memory.readbyte(0x450+bossSlot) bossY = memory.readbyte(0x440+bossSlot) if bossHP > 0 then gui.text(bossX,bossY,string.format("%d\n%d",16-bossHP,bossInv)) end --rng() object(0) gui.text(xScr,yScr,memory.readbyte(0x50)) end emu.registerafter(stuff)