Prev: 43046 Up: Map Next: 43136
43084: 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 43084 LD B,2 Set a player counter in B for 2 loops.
NewGame_Loop 43086 PUSH BC Stash the counter in BC on the stack.
Handle setting up 1UP player.
43087 LD A,255 Write 1UP starting level to ActivePlayer_Level.
43089 LD (24224),A
See 255 Lives.
43092 LD A,4 Write 1UP starting lives to ActivePlayer_Lives.
43094 LD (24225),A
43097 XOR A Write 0 to;
43098 LD (24226),A
43101 LD (24227),A
43104 CALL Terrain_Initialise Call Terrain_Initialise.
43107 CALL InitialiseObjects Call InitialiseObjects.
43110 CALL ChangePlayer Call ChangePlayer.
43113 POP BC Restore BC from the stack.
43114 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.
43116 LD A,5 Write 2UP starting lives to InactivePlayer_Lives.
43118 LD (24229),A
43121 LD A,255 Write 2UP starting level to InactivePlayer_Level.
43123 LD (24228),A
43126 LD A,(24064) A=*GameOptions.
43129 AND %00000001 Keep only bit 0.
43131 RET NZ Return if GameOptions indicates this is a 2UP game.
43132 LD (24229),A Write 0 to InactivePlayer_Lives as there is no 2UP player.
43135 RET Return.
View the equivalent code in;
Prev: 43046 Up: Map Next: 43136