Prev: 7198 Up: Map Next: 73D3
7378: Display Lives
Used by the routines at 5FE1 and 6FFD.
7378 LD HL,$0002 Write 0002 to 5F2B.
737B LD ($5F2B),HL
Controller for 1UP lives.
DisplayPlayerLives 737E LD HL,$0040 Call ScreenAddress with 0040 (screen buffer address) for 1UP lives.
7381 CALL ScreenAddress
7384 CALL ControllerActiveLives A=1UP lives remaining (by calling ControllerActiveLives).
7387 AND A If 1UP lives are zero, jump to Handler1UPNoLives.
7388 JR Z,Handler1UPNoLives
738A CALL HandlerDisplayLives Else, there are lives to display so call HandlerDisplayLives.
Controller for 2UP lives.
Controller2UPLives 738D LD HL,$00B0 Call ScreenAddress with 00B0 (screen buffer address) for 2UP lives.
7390 CALL ScreenAddress
7393 CALL ControllerInactiveLives A=2UP lives remaining (by calling ControllerInactiveLives).
7396 AND A If 2UP lives are zero, jump to Handler2UPNoLives.
7397 JR Z,Handler2UPNoLives
Handles displaying the lives count and UDG character.
HandlerDisplayLives 7399 ADD A,$30 Add 30 to convert to an ASCII character (starting at "0" character).
739B CALL PrintScreen Call PrintScreen.
739E LD DE,$73B5 DE=UDG_Life.
73A1 PUSH BC Stash BC and DE on the stack.
73A2 PUSH DE
73A3 JP PrintScreen_0 Jump to PrintScreen_0.
1UP has no lives.
Handler1UPNoLives 73A6 CALL Handler2UPNoLives Call Handler2UPNoLives.
73A9 JR Controller2UPLives Jump to Controller2UPLives.
2UP has no lives.
Handler2UPNoLives 73AB LD A,$20 A=ASCII " " (SPACE).
73AD CALL PrintScreen Call PrintScreen.
73B0 LD A,$20 A=ASCII " " (SPACE).
73B2 JP PrintScreen Jump to PrintScreen.
The UDG for the lives icon.
UDG_Life 73B5 DEFB %00011000
udg29621_7x4
73B6 DEFB %00100100
73B7 DEFB %00111100
73B8 DEFB %01111110
73B9 DEFB %01011010
73BA DEFB %00111100
73BB DEFB %00111100
73BC DEFB %01100110
Controller for the currently active player.
ControllerActiveLives 73BD LD A,($5F21) If ActivePlayer is not zero then jump to InactivePlayerLives.
73C0 AND A
73C1 JR NZ,InactivePlayerLives
Return currently active players lives left.
ActivePlayerLives 73C3 LD A,($5F2E) A=1UP_Lives.
73C6 RET Return.
Return inactive players lives left.
InactivePlayerLives 73C7 LD A,($5F32) A=2UP_Lives.
73CA RET Return.
Controller for the inactive player.
ControllerInactiveLives 73CB LD A,($5F21) If ActivePlayer is zero then jump to InactivePlayerLives.
73CE AND A
73CF JR Z,InactivePlayerLives
73D1 JR ActivePlayerLives Jump to ActivePlayerLives.
View the equivalent code in;
Prev: 7198 Up: Map Next: 73D3