Prev: 72F5 Up: Map Next: 737A
7325: Display Lives
Used by the routines at LevelNew and PlayerInit.
Controller for 1UP lives.
DisplayPlayerLives 7325 LD HL,$0040 Call ScreenAddress with 0040 (screen buffer address) for 1UP lives.
7328 CALL ScreenAddress
732B CALL ControllerActiveLives A=1UP lives remaining (by calling ControllerActiveLives).
732E AND A If 1UP lives are zero, jump to Handler1UPNoLives.
732F JR Z,Handler1UPNoLives
7331 CALL HandlerDisplayLives Else, there are lives to display so call HandlerDisplayLives.
Controller for 2UP lives.
Controller2UPLives 7334 LD HL,$00B0 Call ScreenAddress with 00B0 (screen buffer address) for 2UP lives.
7337 CALL ScreenAddress
733A CALL ControllerInactiveLives A=2UP lives remaining (by calling ControllerInactiveLives).
733D AND A If 2UP lives are zero, jump to Handler2UPNoLives.
733E JR Z,Handler2UPNoLives
Handles displaying the lives count and UDG character.
HandlerDisplayLives 7340 ADD A,$30 Add 30 to convert to an ASCII character (starting at "0" character).
7342 CALL PrintScreen Call PrintScreen.
7345 LD DE,$735C DE=UDG_Life.
7348 PUSH BC Stash BC and DE on the stack.
7349 PUSH DE
734A JP PrintScreen_0 Jump to PrintScreen_0.
1UP has no lives.
Handler1UPNoLives 734D CALL Handler2UPNoLives Call Handler2UPNoLives.
7350 JR Controller2UPLives Jump to Controller2UPLives.
2UP has no lives.
Handler2UPNoLives 7352 LD A,$20 A=ASCII " " (SPACE).
7354 CALL PrintScreen Call PrintScreen.
7357 LD A,$20 A=ASCII " " (SPACE).
7359 JP PrintScreen Jump to PrintScreen.
The UDG for the lives icon.
UDG_Life 735C DEFB %00011000
udg29532_7x4
735D DEFB %00100100
735E DEFB %00111100
735F DEFB %01111110
7360 DEFB %01011010
7361 DEFB %00111100
7362 DEFB %00111100
7363 DEFB %01100110
Controller for the currently active player.
ControllerActiveLives 7364 LD A,($5E1E) If Current_Player is not zero then jump to InactivePlayerLives.
7367 AND A
7368 JR NZ,InactivePlayerLives
Return currently active players Lives left.
ActivePlayerLives 736A LD A,($5E38) A=CurrentPlayer_Lives.
736D RET Return.
Return inactive players Lives left.
InactivePlayerLives 736E LD A,($5E3A) A=InactivePlayer_Lives.
7371 RET Return.
Controller for the inactive player.
ControllerInactiveLives 7372 LD A,($5E1E) If Current_Player is zero then jump to InactivePlayerLives.
7375 AND A
7376 JR Z,InactivePlayerLives
7378 JR ActivePlayerLives Jump to ActivePlayerLives.
View the equivalent code in;
Prev: 72F5 Up: Map Next: 737A