Prev: B76D Up: Map Next: B814
B7CD: Display Lives
Used by the routines at GameComplete, A2F8, AA27 and B1B7.
Controller for 1UP lives.
DisplayPlayerLives B7CD LD HL,$4008 HL=4008 (screen buffer address) for 1UP lives.
B7D0 CALL ControllerActiveLives A=1UP lives remaining (by calling ControllerActiveLives).
B7D3 AND A If 1UP lives are zero, jump to Handler1UPNoLives.
B7D4 JR Z,Handler1UPNoLives
B7D6 CALL HandlerDisplayLives Else, there are lives to display so call HandlerDisplayLives.
Controller for 2UP lives.
Controller2UPLives B7D9 LD HL,$4016 HL=4016 (screen buffer address) for 2UP lives.
B7DC CALL ControllerInactiveLives A=2UP lives remaining (by calling ControllerInactiveLives).
B7DF AND A If 2UP lives are zero, jump to Handler2UPNoLives.
B7E0 JR Z,Handler2UPNoLives
Handles displaying the lives count and UDG character.
HandlerDisplayLives B7E2 ADD A,$30 Add 30 to convert to an ASCII character (starting at "0" character).
B7E4 CALL PrintScreen Call PrintScreen.
B7E7 LD DE,$B814 DE=UDG_Life.
B7EA PUSH BC Stash BC and DE on the stack.
B7EB PUSH DE
B7EC JP PrintScreen_0 Jump to PrintScreen_0.
1UP has no lives.
Handler1UPNoLives B7EF CALL Handler2UPNoLives Call Handler2UPNoLives.
B7F2 JR Controller2UPLives Jump to Controller2UPLives.
2UP has no lives.
Handler2UPNoLives B7F4 LD A,$20 A=ASCII " " (SPACE).
B7F6 CALL PrintScreen Call PrintScreen.
B7F9 LD A,$20 A=ASCII " " (SPACE).
B7FB JP PrintScreen Jump to PrintScreen.
Controller for the currently active player.
ControllerActiveLives B7FE LD A,($969E) If Flag_ActivePlayer is not zero then jump to InactivePlayerLives.
B801 AND A
B802 JR NZ,InactivePlayerLives
Return currently active players lives left.
ActivePlayerLives B804 LD A,($96BD) A=ActivePlayer_Lives.
B807 RET Return.
Return inactive players lives left.
InactivePlayerLives B808 LD A,($96E0) A=InactivePlayer_Lives.
B80B RET Return.
Controller for the inactive player.
ControllerInactiveLives B80C LD A,($969E) If Flag_ActivePlayer is zero then jump to InactivePlayerLives.
B80F AND A
B810 JR Z,InactivePlayerLives
B812 JR ActivePlayerLives Jump to ActivePlayerLives.
View the equivalent code in;
Prev: B76D Up: Map Next: B814