![]() |
Routines |
| Prev: 5FB7 | Up: Map | Next: 6002 |
|
Used by the routine at HandleLevelIntroduction.
Redraws the playing area for the active player, shows the pantry and puts Charlie in his starting position.
|
||||||
StartLife takes a life away, so the life it is about to remove is added back first.
|
||||||
| StartLevel | 5FE1 | LD HL,$5F2E | Add one to the lives of the active player (ActivePlayer_Lives). | |||
| 5FE4 | INC (HL) | |||||
| 5FE5 | CALL StartLife | Take a life away from the active player using StartLife. | ||||
|
This entry point is used by the routine at HandleEndOfLife.
The level is FF when there is no second player in a one player game, so there is nothing to start.
|
||||||
| StartLevel_TestLevel | 5FE8 | LD A,($5F2D) | Fetch the level of the active player. | |||
| 5FEB | INC A | Add one, so that a level of FF becomes zero. | ||||
| 5FEC | RET Z | Return if there is no player to start. | ||||
|
Draw the window, then the pantry, then the remaining lives.
|
||||||
| 5FED | CALL CreateWindow | Draw the window using CreateWindow. | ||||
| 5FF0 | CALL DrawPantry | Draw the pantry using DrawPantry. | ||||
| 5FF3 | CALL DisplayPlayerLives | Show the lives of both players using DisplayPlayerLives. | ||||
|
Self modifying code; this updates the command at 7515 to "CP 1A".
|
||||||
| 5FF6 | LD A,$1A | Write 1A to 7516. | ||||
| 5FF8 | LD ($7516),A | |||||
| 5FFB | LD A,($5C78) | Record the current frame at LastFrame, so that the frame update does not run straight away. | ||||
| 5FFE | LD ($5F22),A | |||||
| 6001 | RET | Return. | ||||
| Prev: 5FB7 | Up: Map | Next: 6002 |