.comp1 LDA #240 ; Hide sprite 13 (the compass dot) by moving it to STA ySprite13 ; y-coordinate 240, off the bottom of the screen RTS ; Return from the subroutine .COMPAS LDA MJ ; If we are in witchspace (i.e. MJ is non-zero), jump up BNE comp1 ; to comp1 to hide the compass dot LDA SSPR ; If we are inside the space station safe zone, jump to BNE SP1 ; SP1 to draw the space station on the compass JSR SPS1 ; Otherwise we need to draw the planet on the compass, ; so first call SPS1 to calculate the vector to the ; planet and store it in XX15 JMP SP2 ; Jump to SP2 to draw XX15 on the compass, returning ; from the subroutine using a tail callName: COMPAS [Show more] Type: Subroutine Category: Dashboard Summary: Update the compass Deep dive: Sprite usage in NES EliteContext: See this subroutine in context in the source code References: This subroutine is called as follows: * DrawSpaceViewInNMI calls COMPAS
[X]
Subroutine SP1 (category: Dashboard)
Draw the space station on the compass
[X]
Subroutine SP2 (category: Dashboard)
Draw a dot on the compass, given the planet/station vector
[X]
Subroutine SPS1 (category: Maths (Geometry))
Calculate the vector to the planet and store it in XX15
[X]
Label comp1 is local to this routine
[X]
Variable ySprite13 in workspace Sprite buffer
Screen y-coordinate for sprite 13