Prev: 46957 Up: Map Next: 47124
47053: Display Lives
Used by the routines at GameComplete, 41720, 43559 and 45495.
Controller for 1UP lives.
DisplayPlayerLives 47053 LD HL,16392 HL=16392 (screen buffer address) for 1UP lives.
47056 CALL ControllerActiveLives A=1UP lives remaining (by calling ControllerActiveLives).
47059 AND A If 1UP lives are zero, jump to Handler1UPNoLives.
47060 JR Z,Handler1UPNoLives
47062 CALL HandlerDisplayLives Else, there are lives to display so call HandlerDisplayLives.
Controller for 2UP lives.
Controller2UPLives 47065 LD HL,16406 HL=16406 (screen buffer address) for 2UP lives.
47068 CALL ControllerInactiveLives A=2UP lives remaining (by calling ControllerInactiveLives).
47071 AND A If 2UP lives are zero, jump to Handler2UPNoLives.
47072 JR Z,Handler2UPNoLives
Handles displaying the lives count and UDG character.
HandlerDisplayLives 47074 ADD A,48 Add 48 to convert to an ASCII character (starting at "0" character).
47076 CALL PrintScreen Call PrintScreen.
47079 LD DE,47124 DE=UDG_Life.
47082 PUSH BC Stash BC and DE on the stack.
47083 PUSH DE
47084 JP PrintScreen_0 Jump to PrintScreen_0.
1UP has no lives.
Handler1UPNoLives 47087 CALL Handler2UPNoLives Call Handler2UPNoLives.
47090 JR Controller2UPLives Jump to Controller2UPLives.
2UP has no lives.
Handler2UPNoLives 47092 LD A,32 A=ASCII " " (SPACE).
47094 CALL PrintScreen Call PrintScreen.
47097 LD A,32 A=ASCII " " (SPACE).
47099 JP PrintScreen Jump to PrintScreen.
Controller for the currently active player.
ControllerActiveLives 47102 LD A,(38558) If Flag_ActivePlayer is not zero then jump to InactivePlayerLives.
47105 AND A
47106 JR NZ,InactivePlayerLives
Return currently active players lives left.
ActivePlayerLives 47108 LD A,(38589) A=ActivePlayer_Lives.
47111 RET Return.
Return inactive players lives left.
InactivePlayerLives 47112 LD A,(38624) A=InactivePlayer_Lives.
47115 RET Return.
Controller for the inactive player.
ControllerInactiveLives 47116 LD A,(38558) If Flag_ActivePlayer is zero then jump to InactivePlayerLives.
47119 AND A
47120 JR Z,InactivePlayerLives
47122 JR ActivePlayerLives Jump to ActivePlayerLives.
View the equivalent code in;
Prev: 46957 Up: Map Next: 47124