.LL155 LDY XX14 \ Set Y to the offset in the line heap XX14 .LL27 CPY XX14+1 \ If Y >= XX14+1, jump to LLEX to return from the ship BCS LLEX \ drawing routine, because the index in Y is greater \ than the size of the existing ship line heap, which \ means we have alrady erased all the old ship's lines \ when drawing the new ship \ If we get here then Y < XX14+1, which means Y is \ pointing to an on-screen line from the old ship that \ we need to erase LDA (XX19),Y \ Fetch the X1 line coordinate from the heap and store INY \ it in XX15, incrementing the heap pointer STA XX15 LDA (XX19),Y \ Fetch the Y1 line coordinate from the heap and store INY \ it in XX15+1, incrementing the heap pointer STA XX15+1 LDA (XX19),Y \ Fetch the X2 line coordinate from the heap and store INY \ it in XX15+2, incrementing the heap pointer STA XX15+2 LDA (XX19),Y \ Fetch the Y2 line coordinate from the heap and store INY \ it in XX15+3, incrementing the heap pointer STA XX15+3 JSR LL30 \ Draw a line from (X1, Y1) to (X2, Y2) to erase it from \ the screen JMP LL27 \ Loop back to LL27 to draw (i.e. erase) the next line \ from the heap .LLEX LDA XX14 \ Store XX14 in the first byte of the ship line heap LDY #0 STA (XX19),Y .LL82 RTS \ Return from the subroutineName: LL9 (Part 12 of 12) [Show more] Type: Subroutine Category: Drawing ships Summary: Draw ship: Draw all the visible edges from the ship line heap Deep dive: Drawing shipsContext: See this subroutine in context in the source code Variations: See code variations for this subroutine in the different versions References: No direct references to this subroutine in this source file
This part draws any remaining lines from the old ship that are still in the ship line heap.
Label LL27 is local to this routine
Draw a one-segment line
Label LLEX is local to this routine