Skip to navigation

Drawing ships: LL9 (Part 11 of 12)

[BBC Master version]

Name: LL9 (Part 11 of 12) [Show more] Type: Subroutine Category: Drawing ships Summary: Draw ship: Loop back for the next edge Deep dive: Drawing ships
Context: 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

Other entry points: LL81+2 Draw the contents of the ship line heap, used to draw the ship as a dot from SHPPT
.LL78 LDA LSNUM \ If LSNUM >= CNT, skip to LL81 so we don't loop back CMP CNT \ for the next edge (CNT was set to the maximum heap BCS LL81 \ size for this ship in part 10, so this checks whether \ we have just run out of space in the ship line heap, \ and stops drawing edges if we have) LDA V \ Increment V by 4 so V(1 0) points to the data for the CLC \ next edge ADC #4 STA V BCC P%+4 \ If the above addition didn't overflow, skip the \ following instruction INC V+1 \ Otherwise increment the high byte of V(1 0), as we \ just moved the V(1 0) pointer past a page boundary INC XX17 \ Increment the edge counter to point to the next edge LDY XX17 \ If Y < XX20, which contains the number of edges in CPY XX20 \ the blueprint, loop back to LL75 to process the next BCC LL75 \ edge .LL81 JMP LSCLR \ Jump down to part 12 below to draw any remaining lines \ from the old ship that are still in the ship line heap