Prev: 27805 Up: Map Next: 27886
27849: Draw Ship
Used by the routine at 29385.
ship
DrawShip 27849 LD HL,24654 Point HL to the ship graphic: Graphics_Ship.
27852 LD DE,20687 Set the screen buffer location 20687.
27855 LD B,2 Set a counter in B for 2 rows.
DrawShip_RowLoop 27857 PUSH BC Stash the row counter on the stack.
27858 LD B,2 And a counter in C for 2 columns.
DrawShip_ColumnLoop 27860 PUSH BC Stash the column counter and the screen position on the stack.
27861 PUSH DE
27862 LD B,8 Set a line counter in B (8 lines in a UDG).
DrawShip_LineLoop 27864 LD A,(HL) Copy the UDG data to the screen buffer.
27865 LD (DE),A
27866 INC HL Move to the next UDG graphic data byte.
27867 INC D Move down one pixel line in the screen buffer.
27868 DJNZ DrawShip_LineLoop Decrease the line counter by one and loop back to DrawShip_LineLoop until all 8 lines of the UDG character have been drawn.
27870 POP DE Restore the starting screen position from the stack.
27871 INC DE Increment DE by one.
27872 POP BC Restore the column counter from the stack.
27873 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.
27875 LD DE,20719 Update the screen buffer pointer in DE to 20719.
27878 POP BC Restore the row counter from the stack.
27879 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.
27881 LD L,206 L=206.
27883 JP 28563 Jump to 28563.
Prev: 27805 Up: Map Next: 27886