Prev: 31874 Up: Map Next: 32327
32217: Start Game
Used by the routine at TitleScreen.
First collect the control method.
StartGame 32217 CALL Print_ControlMenu Call Print_ControlMenu.
This is a game the player started, so disable the demo mode and unset the game-over flag.
32220 XOR A Write 0 to;
32221 LD (26357),A
32224 LD (26355),A
32227 INC A Write 1 to *Flag_ExtraLife.
32228 LD (26351),A
32231 LD A,4 Write 4 to *Phase.
32233 LD (26353),A
Set the players starting life count.
32236 INC A Write 5 to *Player_Lives.
32237 LD (26352),A
32240 CALL InitialiseLevel Call InitialiseLevel.
Game_Loop 32243 CALL Handler_PlayerDeathGameOver Call Handler_PlayerDeathGameOver.
32246 CALL Handler_AliensMovement_Spawning Call Handler_AliensMovement_Spawning.
32249 CALL Handler_Aliens Call Handler_Aliens.
32252 CALL Handler_AlienExplosions Call Handler_AlienExplosions.
32255 CALL Handler_LevelReset Call Handler_LevelReset.
32258 CALL DifficultyDelay Call DifficultyDelay.
32261 LD A,(26357) Jump back to Game_Loop unless *Flag_GameOver is active.
32264 OR A
32265 JR Z,Game_Loop
*Flag_GameOver is active, start the "Game Over" process.
32267 LD D,8 D=8.
StartGame_0 32269 LD BC,0 BC=0000.
StartGame_1 32272 DJNZ StartGame_1 Decrease counter by one and loop back to StartGame_1 until counter is zero.
32274 DEC C Decrease C by one.
32275 JR NZ,StartGame_1 Jump to StartGame_1 until C is zero.
32277 DEC D Decrease D by one.
32278 JR NZ,StartGame_0 Jump to StartGame_0 if D is not equal to A.
32280 LD HL,25876 HL=Messaging_Score.
32283 LD DE,25887 DE=Messaging_HighScore.
32286 LD B,6 B=6.
32288 PUSH HL Stash HL and DE on the stack.
32289 PUSH DE
StartGame_2 32290 LD A,(DE) Jump to StartGame_3 if *DE is equal to *HL.
32291 CP (HL)
32292 JR Z,StartGame_3
32294 JR C,StartGame_5 Jump to StartGame_5 if *DE is less than *HL.
32296 JR StartGame_4 Jump to StartGame_4.
StartGame_3 32298 INC DE Increment DE by one.
32299 INC HL Increment HL by one.
32300 DJNZ StartGame_2 Decrease counter by one and loop back to StartGame_2 until counter is zero.
StartGame_4 32302 POP DE Restore DE from the stack.
32303 JR StartGame_6 Jump to StartGame_6.
StartGame_5 32305 POP DE Restore DE and HL from the stack.
32306 POP HL
32307 PUSH HL Stash HL on the stack.
32308 LD BC,6 BC=0006.
32311 LDIR LDIR.
StartGame_6 32313 POP HL Restore HL from the stack.
32314 LD DE,25877 DE=25877.
32317 LD (HL),48 Write ASCII 48 ("0") to *HL.
32319 LD BC,5 BC=0005.
32322 LDIR LDIR.
32324 JP TitleScreen Jump to TitleScreen.
Prev: 31874 Up: Map Next: 32327