Skip to navigation

Elite on the BBC Micro and NES

Drawing planets: PL2

[6502 Second Processor version]

Name: PL2 [Show more] Type: Subroutine Category: Drawing planets Summary: Remove the planet or sun from the screen
Context: See this subroutine in context in the source code Variations: See code variations for this subroutine in the different versions References: This subroutine is called as follows: * PLANET calls PL2 * PROJ calls via PL2-1

Other entry points: PL2-1 Contains an RTS
.PL2 LDA TYPE \ Shift bit 0 of the planet/sun's type into the C flag LSR A BCS PL57 \ If the planet/sun's type has bit 0 clear, then it's \ either 128 or 130, which is a planet; meanwhile, the \ sun has type 129, which has bit 0 set. So if this is \ the sun, jump to PL57 to skip the following \ instructions JSR LS2FL \ Call LS2FL to send the ball line heap to the I/O \ processor for drawing on-screen, which redraws the \ planet and this removes it from the screen STZ LSP \ Reset the ball line heap by setting the ball line heap \ pointer to 0 RTS \ Return from the subroutine .PL57 JMP WPLS \ This is the sun, so jump to WPLS to remove it from \ screen, returning from the subroutine using a tail \ call