Prev: 45495 Up: Map Next: 45573
45524: Initialise Game
Used by the routine at GameInitialisation.
Sets up the state of both players ready for a new game, builds the first room and starts the turn of player 1. A one player game gives player 2 no lives.
Before After InitialiseGame
initialise-game-before initialise-game-after
Initialise player 2.
InitialiseGame 45524 CALL InitialisePlayer Initialise the player.
45527 CALL ChangePlayer Swap over to the other player.
Initialise player 1.
45530 CALL InitialisePlayer Initialise the player.
Always start on player 1.
45533 XOR A Set the active player to 1UP in Flag_ActivePlayer.
45534 LD (38558),A
45537 CALL ClearPlayArea_Attributes Clear the attribute buffer of the play area.
45540 CALL ClearPlayArea Clear the play area.
45543 LD A,(38546) Fetch the game options from GameOptions.
45546 AND %00000001 Keep only bit 0.
45548 JR NZ,InitialiseGame_StartTurn Jump to InitialiseGame_StartTurn if this is a two player game.
45550 LD (38624),A Set the number of lives of player 2 in InactivePlayer_Lives to zero.
This entry point is used by the routine at SwitchPlayer.
This is also where the next player joins in after the other player has died.
InitialiseGame_StartTurn 45553 CALL StartTurn Start the turn.
45556 LD IX,38658 Point IX at the player's actor at ImmortalData.
45560 CALL VisitRoom Mark the room as visited.
45563 CALL LoadOrchid Load the orchid for the room.
45566 CALL SetUpRoomObjects Set up the objects in the room.
45569 CALL DrawCurrentRoom Draw the current room.
45572 RET Return.
Prev: 45495 Up: Map Next: 45573