![]() |
Routines |
| Prev: 42567 | Up: Map | Next: 42632 |
|
Used by the routine at StartGame.
Prepares a new game: builds the lookup tables, gives the player five lives, shows the menu, plays the start tune, and places the player and the special objects.
|
||||
|
Build the tables and set the starting state.
|
||||
| InitialiseGame | 42576 | CALL BuildLookupTables | Call BuildLookupTables. | |
| 42579 | XOR A | Write 0 to RoomFlags. | ||
| 42580 | LD (23314),A | |||
| 42583 | LD (51753),A | Write 0 to 51753. | ||
| 42586 | LD A,5 | Set Lives to 5. | ||
| 42588 | LD (23322),A | |||
| 42591 | LD HL,96 | Set LightYearsRemaining to 0096. | ||
| 42594 | LD (23350),HL | |||
| 42597 | LD HL,0 | Write 0000 to 23352. | ||
| 42600 | LD (23352),HL | |||
|
Stir RandomSeed1 with FrameCounter.
|
||||
| 42603 | LD HL,23296 | Point HL at RandomSeed1. | ||
| 42606 | LD A,(23298) | Fetch the low byte of FrameCounter. | ||
| 42609 | ADD A,(HL) | Add it to RandomSeed1. | ||
| 42610 | LD (HL),A | |||
|
Show the menu and wait for the player to start.
|
||||
| 42611 | CALL ClearScreen | Call ClearScreen. | ||
| 42614 | CALL GameMenu | Call GameMenu. | ||
|
|
||||
| 42617 | LD DE,46021 | Point DE at StartGameTune. | ||
| 42620 | CALL PlayMusic | Call PlayMusic. | ||
|
Place the player and set up the rooms.
|
||||
| 42623 | CALL InitialisePlayer | Call InitialisePlayer. | ||
| 42626 | CALL InitialiseSpecialObjects | Call InitialiseSpecialObjects. | ||
| 42629 | CALL SetRoomAttributes | Call SetRoomAttributes. | ||
|
Continue on to StartLife.
|
||||
| Prev: 42567 | Up: Map | Next: 42632 |