This code appears in the following versions (click to see it in the source code):
Code variations between these versions are shown below.
Name: PLANET Type: Subroutine Category: Drawing planets
Arguments:
.PLANET
In the Electron version, the PLANET routine only draws planets and will terminate if asked to draw a sun.
This variation is blank in the Cassette, Disc (flight), 6502 Second Processor and Master versions.
LDA TYPE \ If bit 0 of the ship type is set, then this is 129, LSR A \ which is the placeholder used to denote there is no BCS PL2-1 \ space station, so return from the subroutine (as PL2-1 \ contains an RTS)
This variation is blank in the Cassette, Disc (flight) and Electron versions.
Tap on a block to expand it, and tap it again to revert.
In the cassette version, in part 14 of the main flight loop, we didn't remove the planet/sun if it was behind us, so we do it here instead.
Tap on a block to expand it, and tap it again to revert.
LDA K+1 \ If the high byte of the reduced radius is zero, jump BEQ PL82 \ to PL82, as K contains the radius on its own LDA #248 \ Otherwise set K = 248, to round up the radius in STA K \ K(1 0) to the nearest integer (if we consider the low \ byte to be the fractional part) .PL82