Prev: A826 Up: Map Next: A880
A84C: Initialise New Game
Sets the starting level and lives for both players. The loop runs twice, clearing the level parity and carrying flag, initialising the terrain and then swapping the player states using ChangePlayer. The 2UP starting lives and level are written afterwards.
Write the starting level and lives for both players.
NewGame A84C LD B,$02 Set a player counter in B for 02 loops.
NewGame_Loop A84E PUSH BC Stash the counter in BC on the stack.
Handle setting up 1UP player.
A84F LD A,$FF Write 1UP starting level to ActivePlayer_Level.
A851 LD ($5EA0),A
See 255 Lives.
A854 LD A,$04 Write 1UP starting lives to ActivePlayer_Lives.
A856 LD ($5EA1),A
A859 XOR A Write 00 to;
A85A LD ($5EA2),A
A85D LD ($5EA3),A
A860 CALL Terrain_Initialise Call Terrain_Initialise.
A863 CALL InitialiseObjects Call InitialiseObjects.
A866 CALL ChangePlayer Call ChangePlayer.
A869 POP BC Restore BC from the stack.
A86A DJNZ NewGame_Loop Decrease the counter by one and jump back to NewGame_Loop until it is zero.
Handle setting up 2UP player.
See 255 Lives.
A86C LD A,$05 Write 2UP starting lives to InactivePlayer_Lives.
A86E LD ($5EA5),A
A871 LD A,$FF Write 2UP starting level to InactivePlayer_Level.
A873 LD ($5EA4),A
A876 LD A,($5E00) A=*GameOptions.
A879 AND %00000001 Keep only bit 0.
A87B RET NZ Return if GameOptions indicates this is a 2UP game.
A87C LD ($5EA5),A Write 00 to InactivePlayer_Lives as there is no 2UP player.
A87F RET Return.
View the equivalent code in;
Prev: A826 Up: Map Next: A880