Prev: 49809 Up: Map Next: 49870
49818: 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 49818 LD IX,47818 Use the temporary object, TemporaryObject.
49822 LD (IX+0),22 Set the type of the temporary object to 22, which is the sprite of the icon.
49826 LD (IX+7),0 Set the flags of the temporary object to 0.
49830 LD (IX+26),16 Set the screen x co-ordinate of the object to 16.
49834 LD (IX+27),32 Set the screen y co-ordinate of the object to 32.
49838 CALL DrawObject_Sprite Call DrawObject_Sprite to draw the sprite.
Set the attributes of the area that holds the icon and the number.
49841 LD A,71 Set the attribute in A to bright white ink on a black paper.
49843 LD DE,23106 Start at the attribute file, at the top line of the area.
49846 LD B,2 Set a counter in B of two attributes.
49848 CALL ClearBytes_FillBytes Call ClearBytes_FillBytes to set them.
49851 LD DE,23138 Move on to the next line of the attributes.
49854 LD B,4 Set a counter in B of four attributes.
49856 CALL ClearBytes_FillBytes Call ClearBytes_FillBytes to set them.
Print the number of lives.
49859 LD DE,42785 Take the number of lives, Lives.
49862 LD B,1 Set a counter in B of one byte.
49864 LD HL,56691 Find the place for the digits in the buffer.
49867 JP PrintBCDNumber Jump to PrintBCDNumber.
Prev: 49809 Up: Map Next: 49870