Skip to navigation

Elite on the BBC Micro

Version analysis of FLFLLS

This code appears in the following versions (click to see it in the source code):

Code variations between these versions are shown below.

Name: FLFLLS Type: Subroutine Category: Drawing suns Summary: Reset the sun line heap
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

Code variation 1 of 1Specific to an individual platform

Tap on a version to expand it, and tap it again to show to all variations.

Cassette, Flight, Docked, 6502SP

Master

LDY #2*Y-1 \ #Y is the y-coordinate of the centre of the space \ view, so this sets Y as a counter for the number of \ lines in the space view (i.e. 191), which is also the \ number of lines in the LSO block
LDY #2*Y-1+8 \ #Y is the y-coordinate of the centre of the space \ view, so this sets Y as a counter for the number of \ lines in the space view (i.e. 191) - which is also the \ number of lines in the LSO block - plus an extra 8 \ bytes
 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

RSS Feed