Prev: 6C9D Up: Map Next: 6CEE
6CC9: Draw Ship
Used by the routine at 72C9.
ship
DrawShip 6CC9 LD HL,$604E Point HL to the ship graphic: Graphics_Ship.
6CCC LD DE,$50CF Set the screen buffer location 50CF.
6CCF LD B,$02 Set a counter in B for 02 rows.
DrawShip_RowLoop 6CD1 PUSH BC Stash the row counter on the stack.
6CD2 LD B,$02 And a counter in C for 02 columns.
DrawShip_ColumnLoop 6CD4 PUSH BC Stash the column counter and the screen position on the stack.
6CD5 PUSH DE
6CD6 LD B,$08 Set a line counter in B (08 lines in a UDG).
DrawShip_LineLoop 6CD8 LD A,(HL) Copy the UDG data to the screen buffer.
6CD9 LD (DE),A
6CDA INC HL Move to the next UDG graphic data byte.
6CDB INC D Move down one pixel line in the screen buffer.
6CDC DJNZ DrawShip_LineLoop Decrease the line counter by one and loop back to DrawShip_LineLoop until all 08 lines of the UDG character have been drawn.
6CDE POP DE Restore the starting screen position from the stack.
6CDF INC DE Increment DE by one.
6CE0 POP BC Restore the column counter from the stack.
6CE1 DJNZ DrawShip_ColumnLoop Decrease the column counter by one and loop back to DrawShip_ColumnLoop until both columns have been drawn to the screen buffer.
6CE3 LD DE,$50EF Update the screen buffer pointer in DE to 50EF.
6CE6 POP BC Restore the row counter from the stack.
6CE7 DJNZ DrawShip_RowLoop Decrease the row counter by one and loop back to DrawShip_RowLoop until both rows have been drawn to the screen buffer.
6CE9 LD L,$CE L=CE.
6CEB JP $6F93 Jump to 6F93.
Prev: 6C9D Up: Map Next: 6CEE