Skip to navigation


Drawing ships: LL9 (Part 11 of 12)

[NES version, Bank 1]

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 References: No direct references to this subroutine in this source file
.LL78 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, jump to LL81 as we have processed all BCS LL81 ; the edges and don't need to loop back for the next one LDY #0 ; Set Y to point to byte #0 again, ready for the next ; edge LDA V ; Increment V by 4 so V(1 0) points to the data for the ADC #4 ; next edge STA V BCC ll81 ; If the above addition didn't overflow, jump to ll81 to ; 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 .ll81 JMP LL75 ; Loop back to LL75 to process the next edge .LL81 LDA U ; This instruction is left over from the other versions ; of Elite and has no effect ; ; It would fetch the ship line heap pointer from U, but ; the NES version does not have a ship line heap as the ; screen is redrawn for every frame