Skip to navigation


Drawing suns: FLFLLS

[Commodore 64 version]

Name: FLFLLS [Show more] Type: Subroutine Category: Drawing suns Summary: Reset the sun line heap
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * KS4 calls FLFLLS * TT23 calls FLFLLS * TTX66 calls FLFLLS

Reset the sun line heap at LSO by zero-filling it and setting the first byte to $FF.
Returns: A A is set to 0
.FLFLLS LDY #199 ; Set Y to the screen height of (which is 200 pixels) so ; we can draw suns on the entire screen (so we can draw ; systems on the Short-range Chart, which uses the ; entire screen height) LDA #0 ; Set A to 0 so we can zero-fill the LSO block .SAL6 STA LSO,Y ; Set the Y-th byte of the LSO block to 0 DEY ; Decrement the counter BNE SAL6 ; Loop back until we have filled all the way to LSO+1 DEY ; Decrement Y to value of $FF (as we exit the above loop ; with Y = 0) STY LSX ; Set the first byte of the LSO block, which has its own ; label LSX, to $FF, to indicate that the sun line heap ; is empty RTS ; Return from the subroutine