Prev: C2E8 Up: Map Next: C302
C2EC: Put the player back, a life fewer
Used by the routine at START.
Copies PLAYER_TEMPLATE over both his records -- the player as he came into this room, or as the game starts -- and takes a life. Reached at the start of every game and after every death (START), so the first call takes the five lives the game gives to four; below zero, after the fifth death, the game is over (GAME_OVER, in WON).
LIVES is treated as BCD elsewhere but decremented here as a plain number. It cannot go above 9 (five, and one for each of the four quest items, QUEST_ITEM), so the two agree.
RESTART_PLAYER C2EC LD HL,PLAYER_TEMPLATE both records, legs and body; IX on the legs
C2EF LD DE,OBJECTS
C2F2 PUSH DE
C2F3 POP IX
C2F5 LD BC,$0040
C2F8 LDIR
C2FA LD HL,LIVES a life fewer; below zero: game over
C2FD DEC (HL)
C2FE JP M,GAME_OVER
C301 RET
Prev: C2E8 Up: Map Next: C302