![]() |
Routines |
| Prev: 29429 | Up: Map | Next: 29562 |
|
Used by the routines at LevelNew and PlayerInit.
Prints the number of lives each player has left at the top of the screen, each followed by a small life icon. A player with no lives left gets two spaces instead.
|
||||||||
|
Controller for 1UP lives.
|
||||||||
| DisplayPlayerLives | 29477 | LD HL,64 | Call ScreenAddress with 0064 (screen buffer address) for 1UP lives. | |||||
| 29480 | CALL ScreenAddress | |||||||
| 29483 | CALL FetchLives_1UP | A=1UP lives remaining (by calling FetchLives_1UP). | ||||||
| 29486 | AND A | If 1UP lives are zero, jump to Handler1UPNoLives. | ||||||
| 29487 | JR Z,Handler1UPNoLives | |||||||
| 29489 | CALL HandlerDisplayLives | Else, there are lives to display so call HandlerDisplayLives. | ||||||
|
Controller for 2UP lives.
|
||||||||
| Controller2UPLives | 29492 | LD HL,176 | Call ScreenAddress with 0176 (screen buffer address) for 2UP lives. | |||||
| 29495 | CALL ScreenAddress | |||||||
| 29498 | CALL FetchLives_2UP | A=2UP lives remaining (by calling FetchLives_2UP). | ||||||
| 29501 | AND A | If 2UP lives are zero, jump to Handler2UPNoLives. | ||||||
| 29502 | JR Z,Handler2UPNoLives | |||||||
|
Handles displaying the lives count and UDG character.
|
||||||||
| HandlerDisplayLives | 29504 | ADD A,48 | Add 48 to convert to an ASCII character (starting at "0" character). | |||||
| 29506 | CALL PrintScreen | Call PrintScreen. | ||||||
| 29509 | LD DE,29532 | DE=UDG_Life. | ||||||
| 29512 | PUSH BC | Stash BC and DE on the stack. | ||||||
| 29513 | PUSH DE | |||||||
| 29514 | JP PrintScreen_Draw | Jump to PrintScreen_Draw. | ||||||
|
1UP has no lives.
|
||||||||
| Handler1UPNoLives | 29517 | CALL Handler2UPNoLives | Call Handler2UPNoLives. | |||||
| 29520 | JR Controller2UPLives | Jump to Controller2UPLives. | ||||||
|
2UP has no lives.
|
||||||||
| Handler2UPNoLives | 29522 | LD A,32 | A=ASCII " " (SPACE). | |||||
| 29524 | CALL PrintScreen | Call PrintScreen. | ||||||
| 29527 | LD A,32 | A=ASCII " " (SPACE). | ||||||
| 29529 | JP PrintScreen | Jump to PrintScreen. | ||||||
|
The UDG for the lives icon.
|
||||||||
| UDG_Life | 29532 | DEFB %00011000 |
|
|||||
| 29533 | DEFB %00100100 | |||||||
| 29534 | DEFB %00111100 | |||||||
| 29535 | DEFB %01111110 | |||||||
| 29536 | DEFB %01011010 | |||||||
| 29537 | DEFB %00111100 | |||||||
| 29538 | DEFB %00111100 | |||||||
| 29539 | DEFB %01100110 | |||||||
|
Return the 1UP player's lives left.
|
||||||||
| FetchLives_1UP | 29540 | LD A,(24094) | If Current_Player is not zero then jump to InactivePlayerLives. | |||||
| 29543 | AND A | |||||||
| 29544 | JR NZ,InactivePlayerLives | |||||||
|
Return currently active players Lives left.
|
||||||||
| ActivePlayerLives | 29546 | LD A,(24120) | A=CurrentPlayer_Lives. | |||||
| 29549 | RET | Return. | ||||||
|
Return inactive players Lives left.
|
||||||||
| InactivePlayerLives | 29550 | LD A,(24122) | A=InactivePlayer_Lives. | |||||
| 29553 | RET | Return. | ||||||
|
Return the 2UP player's lives left.
|
||||||||
| FetchLives_2UP | 29554 | LD A,(24094) | If Current_Player is zero then jump to InactivePlayerLives. | |||||
| 29557 | AND A | |||||||
| 29558 | JR Z,InactivePlayerLives | |||||||
| 29560 | JR ActivePlayerLives | Jump to ActivePlayerLives. | ||||||
|
View the equivalent code in;
|
||||||||
| Prev: 29429 | Up: Map | Next: 29562 |