.CIRCLE JSR CHKON \ Call CHKON to check whether the circle fits on-screen BCS RTS2 \ If CHKON set the C flag then the circle does not fit \ on-screen, so return from the subroutine (as RTS2 \ contains an RTS) LDX K \ Set X = K = radius LDA #8 \ Set A = 8 CPX #4 \ If the radius < 4, skip to PL89 BCC PL89 LSR A \ Halve A so A = 4 CPX #50 \ If the radius < 50, skip to PL89 BCC PL89 LSR A \ Halve A so A = 2 .PL89 STA STP \ Set STP = A. STP is the step size for the circle, so \ the above sets a smaller step size for bigger circles \ Fall through into CIRCLE3 to draw the circle with the \ correct step sizeName: CIRCLE [Show more] Type: Subroutine Category: Drawing circles Summary: Draw a circle for the planet Deep dive: Drawing circlesContext: 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: * PL9 (Part 1 of 3) calls CIRCLE
Draw a circle with the centre at (K3, K4) and radius K. Used to draw the planet's main outline.
Arguments: K The planet's radius K3(1 0) Pixel x-coordinate of the centre of the planet K4(1 0) Pixel y-coordinate of the centre of the planet
[X]
Subroutine CHKON (category: Drawing circles)
Check whether any part of a circle appears on the extended screen
[X]
Label PL89 is local to this routine
[X]
Entry point RTS2 in subroutine SUN (Part 4 of 4) (category: Drawing suns)
Contains an RTS