Prev: 25033 Up: Map Next: 25105
25034: Draw lives remaining on top row
The player ship sprites are drawn and buzzed into position. This uses the same code as the regular ship drawing routine, including the ship position variables. So it needs to save the player xpos/ypos values, set them to top row and do the work, then put them back as they were.
Input
Used by the routines at start and check_for_extra_life.
draw_lives_remaining 25034 LD DE,16384 Select 0th row
25037 CALL clear_char_row Clear it
25040 LD A,(_LIVES_REMAINING) Pick up number of lives remaining
25043 DEC A We're going to draw one fewer than that
25044 JR Z,draw_lives_remaining_1 Zero lives to draw, so skip drawing on the top row
25046 JP M,draw_lives_remaining_1
25049 LD (_DRAW_LIVES_REMAINING_COUNTER),A Stash away the counter. There's no obvious reason a PUSH AF wouldn't work here. Shrug.
25052 LD DE,(_PLAYER_XPOS) Current player ship pos, X and Y, stash on the stack
25056 PUSH DE
25057 XOR A Y=0
25058 LD (_PLAYER_YPOS),A
25061 LD A,72 X=72
25063 LD (_PLAYER_XPOS),A
draw_lives_remaining_0 25066 CALL new_player_ship Draw a player ship and move it into position
25069 LD A,(_PLAYER_XPOS) Move X along one ship's width
25072 ADD A,24
25074 LD (_PLAYER_XPOS),A
25077 LD A,(_DRAW_LIVES_REMAINING_COUNTER) Recover the lives to draw counter and decrement it
25080 DEC A
25081 LD (_DRAW_LIVES_REMAINING_COUNTER),A
25084 JR NZ,draw_lives_remaining_0 Back to draw next ship
25086 POP DE Restore the X,Y position which is the player's ship
25087 LD (_PLAYER_XPOS),DE
draw_lives_remaining_1 25091 CALL print_high_score Update high score, drop through to update current score
This entry point is used by the routine at start.
update_onscreen_score 25094 LD HL,(_CURRENT_SCORE) Pick up current score
25097 LD BC,0 Print it at 0,0 5 digits wide
25100 LD A,5
25102 JP print_score
Prev: 25033 Up: Map Next: 25105