Skip to navigation

Elite on the BBC Micro

Drawing ships: LL9 (Part 11 of 12) (Master version)

Name: LL9 (Part 11 of 12) [View in context] Type: Subroutine [Compare versions] Category: Drawing ships Summary: Draw ship: Loop back for the next edge Deep dive: Drawing ships
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 XX14 \ If XX14 >= CNT, skip to LL81 so we don't loop back for CMP CNT \ the next edge (CNT was set to the maximum heap size BCS LL81 \ 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 ll81 \ If the above addition didn't overflow, jump to ll81 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 .ll81 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 LL155 \ Jump down to part 12 below to draw any remaining lines \ from the old ship that are still in the ship line heap