Prev: C889 Up: Map Next: C8B2
C898: Colour the knight by the hits he has left
Used by the routine at NEW_GAME.
Called every turn by NEW_GAME with the knight's place in the middle of the play area: bright white with three hits left, yellow with two, green with one. Four rows of two cells: the left one of each row bright and the right one not, with the play area's paper this turn mixed into both. Nothing is coloured while his record is empty, between one life and the next.
Input
A the colour (from the list at KNIGHT_COLOURS, by HITS)
HL his place in the attribute buffer
B how many rows (4)
COLOUR_KNIGHT C898 EX AF,AF' nothing while his legs' record is empty
C899 LD A,(KNIGHT)
C89C AND A
C89D RET Z
C89E EX AF,AF'
C89F LD E,A the colour with this turn's paper
C8A0 LD A,(LAST_FLASH)
C8A3 OR E
C8A4 LD DE,$0017
COLOUR_KNIGHT_0 C8A7 OR $40 each row: the left cell bright, the right one not bright and not flashing
C8A9 LD (HL),A
C8AA INC HL
C8AB AND $3F
C8AD LD (HL),A
C8AE ADD HL,DE
C8AF DJNZ COLOUR_KNIGHT_0
C8B1 RET
Prev: C889 Up: Map Next: C8B2