Prev: 29080 Up: Map Next: 29651
29560: Display Lives
Used by the routines at 24545 and 28669.
29560 LD HL,2 Write 0002 to 24363.
29563 LD (24363),HL
Controller for 1UP lives.
DisplayPlayerLives 29566 LD HL,64 Call ScreenAddress with 0064 (screen buffer address) for 1UP lives.
29569 CALL ScreenAddress
29572 CALL ControllerActiveLives A=1UP lives remaining (by calling ControllerActiveLives).
29575 AND A If 1UP lives are zero, jump to Handler1UPNoLives.
29576 JR Z,Handler1UPNoLives
29578 CALL HandlerDisplayLives Else, there are lives to display so call HandlerDisplayLives.
Controller for 2UP lives.
Controller2UPLives 29581 LD HL,176 Call ScreenAddress with 0176 (screen buffer address) for 2UP lives.
29584 CALL ScreenAddress
29587 CALL ControllerInactiveLives A=2UP lives remaining (by calling ControllerInactiveLives).
29590 AND A If 2UP lives are zero, jump to Handler2UPNoLives.
29591 JR Z,Handler2UPNoLives
Handles displaying the lives count and UDG character.
HandlerDisplayLives 29593 ADD A,48 Add 48 to convert to an ASCII character (starting at "0" character).
29595 CALL PrintScreen Call PrintScreen.
29598 LD DE,29621 DE=UDG_Life.
29601 PUSH BC Stash BC and DE on the stack.
29602 PUSH DE
29603 JP PrintScreen_0 Jump to PrintScreen_0.
1UP has no lives.
Handler1UPNoLives 29606 CALL Handler2UPNoLives Call Handler2UPNoLives.
29609 JR Controller2UPLives Jump to Controller2UPLives.
2UP has no lives.
Handler2UPNoLives 29611 LD A,32 A=ASCII " " (SPACE).
29613 CALL PrintScreen Call PrintScreen.
29616 LD A,32 A=ASCII " " (SPACE).
29618 JP PrintScreen Jump to PrintScreen.
The UDG for the lives icon.
UDG_Life 29621 DEFB %00011000
udg29621_7x4
29622 DEFB %00100100
29623 DEFB %00111100
29624 DEFB %01111110
29625 DEFB %01011010
29626 DEFB %00111100
29627 DEFB %00111100
29628 DEFB %01100110
Controller for the currently active player.
ControllerActiveLives 29629 LD A,(24353) If ActivePlayer is not zero then jump to InactivePlayerLives.
29632 AND A
29633 JR NZ,InactivePlayerLives
Return currently active players lives left.
ActivePlayerLives 29635 LD A,(24366) A=1UP_Lives.
29638 RET Return.
Return inactive players lives left.
InactivePlayerLives 29639 LD A,(24370) A=2UP_Lives.
29642 RET Return.
Controller for the inactive player.
ControllerInactiveLives 29643 LD A,(24353) If ActivePlayer is zero then jump to InactivePlayerLives.
29646 AND A
29647 JR Z,InactivePlayerLives
29649 JR ActivePlayerLives Jump to ActivePlayerLives.
View the equivalent code in;
Prev: 29080 Up: Map Next: 29651