![]() |
Routines |
| Prev: 28668 | Up: Map | Next: 28921 |
|
|
||||
|
Controller for 1UP lives.
|
||||
| DisplayPlayerLives | 28836 | LD HL,64 | Call ScreenAddress with 0064 (screen buffer address) for 1UP lives. | |
| 28839 | CALL ScreenAddress | |||
| 28842 | CALL ControllerActiveLives | A=1UP lives remaining (by calling ControllerActiveLives). | ||
| 28845 | AND A | If 1UP lives are zero, jump to Handler1UPNoLives. | ||
| 28846 | JR Z,Handler1UPNoLives | |||
| 28848 | CALL HandlerDisplayLives | Else, there are lives to display so call HandlerDisplayLives. | ||
|
Controller for 2UP lives.
|
||||
| Controller2UPLives | 28851 | LD HL,176 | Call ScreenAddress with 0176 (screen buffer address) for 2UP lives. | |
| 28854 | CALL ScreenAddress | |||
| 28857 | CALL ControllerInactiveLives | A=2UP lives remaining (by calling ControllerInactiveLives). | ||
| 28860 | AND A | If 2UP lives are zero, jump to Handler2UPNoLives. | ||
| 28861 | JR Z,Handler2UPNoLives | |||
|
Handles displaying the lives count and UDG character.
|
||||
| HandlerDisplayLives | 28863 | ADD A,48 | Add 48 to convert to an ASCII character (starting at "0" character). | |
| 28865 | CALL PrintScreen | Call PrintScreen. | ||
| 28868 | LD DE,28891 | DE=UDG_Life. | ||
| 28871 | PUSH BC | Stash BC and DE on the stack. | ||
| 28872 | PUSH DE | |||
| 28873 | JP PrintScreen_0 | Jump to PrintScreen_0. | ||
|
1UP has no lives.
|
||||
| Handler1UPNoLives | 28876 | CALL Handler2UPNoLives | Call Handler2UPNoLives. | |
| 28879 | JR Controller2UPLives | Jump to Controller2UPLives. | ||
|
2UP has no lives.
|
||||
| Handler2UPNoLives | 28881 | LD A,32 | A=ASCII " " (SPACE). | |
| 28883 | CALL PrintScreen | Call PrintScreen. | ||
| 28886 | LD A,32 | A=ASCII " " (SPACE). | ||
| 28888 | JP PrintScreen | Jump to PrintScreen. | ||
|
The UDG for the lives icon.
|
||||
| UDG_Life | 28891 | DEFB %00011000 |
|
|
| 28892 | DEFB %00100100 | |||
| 28893 | DEFB %00111100 | |||
| 28894 | DEFB %01111110 | |||
| 28895 | DEFB %01011010 | |||
| 28896 | DEFB %00111100 | |||
| 28897 | DEFB %00111100 | |||
| 28898 | DEFB %01100110 | |||
|
Controller for the currently active player.
|
||||
| ControllerActiveLives | 28899 | LD A,(24017) | If Flag_ActivePlayer is not zero then jump to InactivePlayerLives. | |
| 28902 | AND A | |||
| 28903 | JR NZ,InactivePlayerLives | |||
|
Return currently active players lives left.
|
||||
| ActivePlayerLives | 28905 | LD A,(24049) | A=ActivePlayer_Lives. | |
| 28908 | RET | Return. | ||
|
Return inactive players lives left.
|
||||
| InactivePlayerLives | 28909 | LD A,(24057) | A=InactivePlayer_Lives. | |
| 28912 | RET | Return. | ||
|
Controller for the inactive player.
|
||||
| ControllerInactiveLives | 28913 | LD A,(24017) | If Flag_ActivePlayer is zero then jump to InactivePlayerLives. | |
| 28916 | AND A | |||
| 28917 | JR Z,InactivePlayerLives | |||
| 28919 | JR ActivePlayerLives | Jump to ActivePlayerLives. | ||
|
View the equivalent code in;
|
||||
| Prev: 28668 | Up: Map | Next: 28921 |