Skip to navigation


Dashboard: COMPAS

[NES version, Bank 0]

Name: COMPAS [Show more] Type: Subroutine Category: Dashboard Summary: Update the compass Deep dive: Sprite usage in NES Elite
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * DrawSpaceViewInNMI calls COMPAS
.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 call