View Page Source

Revision (current)
Last Updated by admin@tasvideos.org on 1/1/2022 6:13 PM
Back to Page

! Positioning

Every time you press B, 0x80 is subtracted from Y subpixel speed. Otherwise, it either is nullified (on the ground), or just increases by 8 (in midair) each frame. Max Y speed is 3.0.

Every frame you hold direction, X subpixel speed increases by 16. Limit is 2.00.

! Enemies

They spawn with frame step of 46. Spawn slot depends on RNG which is rolled several times per frame while enemies or their eggs, or frag score is on-screen. So by picking eggs at different frames you can manipulate where the next enemy spawns.

However, in the first wave, they always spawn at the same spots: upper, upper and left slots.

Addresses $7C-$80 show which enemy occupies what spawn slot.


! Details

%%TAB RAM

[module:addresses|addrset=57]

%%TAB HUD Script

%%SRC_EMBED lua

-- NES Joust HUD
-- feos, 2014
function Joust()
	local rng    = memory.readbyte(0x2E)
	local x      = memory.readbyte(0x54)
	local xSub   = memory.readbyte(0x56) / 32
	local y      = memory.readbyte(0x58)
	local ySub   = memory.readbyte(0x5A) / 32
	local xSpeedOffset = memory.readbytesigned(0x4E)
	local xSpeed = memory.readbytesigned(0xCF69+xSpeedOffset) + memory.readbyte(0xCFAB+xSpeedOffset)/256
	local ySpeed = memory.readbytesigned(0x52) + memory.readbyte(0x50)/256
	local s1     = memory.readbyte(0x7C+0)
	local s2     = memory.readbyte(0x7C+1)
	local s3     = memory.readbyte(0x7C+2)
	local s4     = memory.readbyte(0x7C+3)
	local s5     = memory.readbyte(0x7C+4)
	local s6     = memory.readbyte(0x7C+5)
	gui.text(  1,224,string.format("\nSlots: %d %d %d %d %d %d",s1,s2,s3,s4,s5,s6))
	gui.text(110,224,string.format("\nRNG: %X",rng))
	gui.text(124,202,string.format("X: %.2f\nY: %.2f",xSpeed,ySpeed))
	gui.text(180,202,string.format("X: %3d.%d\nY: %3d.%d",x,xSub,y,ySub))
	RNGcount = 0
end
emu.registerafter(Joust)

%%END_EMBED


%%TAB RNG Roll

%%SRC_EMBED snescom

$D440 LDY #$03
$D442 ASL rng1
$D444 ROL rng2
$D446 ROL
$D447 ROL
$D448 EOR rng1
$D44A ROL
$D44B EOR rng1
$D44D LSR
$D44E LSR
$D44F EOR #$FF
$D451 AND #$01
$D453 ORA rng1
$D455 STA rng1
$D457 DEY
$D458 BPL $D442
$D45A RTS 

%%END_EMBED


%%TAB Set spawn slot

%%SRC_EMBED snescom

$EB2F JSR RNG Roll
$EB32 LDA rng1
$EB34 AND #$03
$EB36 BNE $EB3C
$EB38 LDY $0032
$EB3A BEQ $EB2F
$EB3C STA spawn slot,X

%%END_EMBED

%%TAB_END