![]() |
Routines |
| Prev: A647 | Up: Map | Next: A688 |
|
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 | A650 | CALL BuildLookupTables | Call BuildLookupTables. | |
| A653 | XOR A | Write 00 to RoomFlags. | ||
| A654 | LD ($5B12),A | |||
| A657 | LD ($CA29),A | Write 00 to CA29. | ||
| A65A | LD A,$05 | Set Lives to 05. | ||
| A65C | LD ($5B1A),A | |||
| A65F | LD HL,$0060 | Set LightYearsRemaining to 0060. | ||
| A662 | LD ($5B36),HL | |||
| A665 | LD HL,$0000 | Write 0000 to 5B38. | ||
| A668 | LD ($5B38),HL | |||
|
Stir RandomSeed1 with FrameCounter.
|
||||
| A66B | LD HL,$5B00 | Point HL at RandomSeed1. | ||
| A66E | LD A,($5B02) | Fetch the low byte of FrameCounter. | ||
| A671 | ADD A,(HL) | Add it to RandomSeed1. | ||
| A672 | LD (HL),A | |||
|
Show the menu and wait for the player to start.
|
||||
| A673 | CALL ClearScreen | Call ClearScreen. | ||
| A676 | CALL GameMenu | Call GameMenu. | ||
|
|
||||
| A679 | LD DE,$B3C5 | Point DE at StartGameTune. | ||
| A67C | CALL PlayMusic | Call PlayMusic. | ||
|
Place the player and set up the rooms.
|
||||
| A67F | CALL InitialisePlayer | Call InitialisePlayer. | ||
| A682 | CALL InitialiseSpecialObjects | Call InitialiseSpecialObjects. | ||
| A685 | CALL SetRoomAttributes | Call SetRoomAttributes. | ||
|
Continue on to StartLife.
|
||||
| Prev: A647 | Up: Map | Next: A688 |