Prev: C291 Up: Map Next: C2CE
C29A: Draw Lives
Used by the routines at RunGame and RunCollectableObject.
Draws the icon for the lives that the player has left, and the number of lives beside it, into the buffer. The attributes of the area are also set, as the buffer is not used for them.
Before After DrawLives and UpdateScreen
draw-lives-before draw-lives-after
DrawLives C29A LD IX,$BACA Use the temporary object, TemporaryObject.
C29E LD (IX+$00),$16 Set the type of the temporary object to 16, which is the sprite of the icon.
C2A2 LD (IX+$07),$00 Set the flags of the temporary object to 00.
C2A6 LD (IX+$1A),$10 Set the screen x co-ordinate of the object to 10.
C2AA LD (IX+$1B),$20 Set the screen y co-ordinate of the object to 20.
C2AE CALL DrawObject_Sprite Call DrawObject_Sprite to draw the sprite.
Set the attributes of the area that holds the icon and the number.
C2B1 LD A,$47 Set the attribute in A to bright white ink on a black paper.
C2B3 LD DE,$5A42 Start at the attribute file, at the top line of the area.
C2B6 LD B,$02 Set a counter in B of two attributes.
C2B8 CALL ClearBytes_FillBytes Call ClearBytes_FillBytes to set them.
C2BB LD DE,$5A62 Move on to the next line of the attributes.
C2BE LD B,$04 Set a counter in B of four attributes.
C2C0 CALL ClearBytes_FillBytes Call ClearBytes_FillBytes to set them.
Print the number of lives.
C2C3 LD DE,$A721 Take the number of lives, Lives.
C2C6 LD B,$01 Set a counter in B of one byte.
C2C8 LD HL,$DD73 Find the place for the digits in the buffer.
C2CB JP PrintBCDNumber Jump to PrintBCDNumber.
Prev: C291 Up: Map Next: C2CE