Prev: A200 Up: Map Next: A61D
A590: Game Entry Point
GameEntryPoint A590 LD A,$00 Write 00 to *CC3D.
A592 LD ($CC3D),A
A595 LD A,$9F I=9F.
A597 LD I,A
A599 IM 2 Set interrupt mode 2.
A59B EI Enable interrupts.
A59C LD A,R A=R.
A59E OR %10000000 Set bit 7.
A5A0 LD ($C1E5),A Write A to C1E5.
This entry point is used by the routines at Handler_Fired and Handler_DebounceSpace.
Game_Loop A5A3 CALL BlankMiddleAttributeBuffer Call BlankMiddleAttributeBuffer.
A5A6 CALL BlankMiddleScreenBuffer Call BlankMiddleScreenBuffer.
A5A9 CALL GameMenu Call GameMenu.
A5AC CALL BlankMiddleAttributeBuffer Call BlankMiddleAttributeBuffer.
A5AF CALL BlankMiddleScreenBuffer Call BlankMiddleScreenBuffer.
A5B2 CALL InitialiseNewGame Call InitialiseNewGame.
A5B5 CALL Player_Name Call Player_Name.
A5B8 CALL BlankMiddleScreenBuffer Call BlankMiddleScreenBuffer.
This entry point is used by the routine at Handler_Fired.
NewLevel A5BB CALL InitialiseStreet Call InitialiseStreet.
A5BE CALL Handler_StreetIntroduction Call Handler_StreetIntroduction.
A5C1 CALL PressAnyKey Call PressAnyKey.
A5C4 CALL StartGame Call StartGame.
The game has ended ... check why.
A5C7 LD A,($B008) A=*B008.
A5CA BIT 2,A Jump to Handler_TimeOut if the bonus/ time counter reached zero.
A5CC JR NZ,Handler_TimeOut
A5CE LD HL,$C272 HL=Time_Remaining.
A5D1 CALL AddPointsToScore Call AddPointsToScore.
Check other reasons why the game ended (see Immunity).
A5D4 LD A,($B008) A=*B008.
A5D7 BIT 0,A Jump to Handler_Fired_0 if bit 0 is set.
A5D9 JP NZ,Handler_Fired_0
A5DC LD HL,($AB7E) HL=*ActivePlayer.
Point to the current players level.
A5DF INC HL Increment HL by one.
Has the player completed the game?
A5E0 LD A,$0C Jump to Game_Complete if *HL equals 0C.
A5E2 CP (HL)
A5E3 JR Z,Game_Complete
A5E5 INC (HL) Increment *HL by two.
A5E6 INC (HL)
A5E7 CALL FinishedStreet Call FinishedStreet.
A5EA CALL PressAnyKey Call PressAnyKey.
This entry point is used by the routine at Handler_TimeOut.
SwitchPlayers A5ED CALL Handler_SwitchPlayers Call Handler_SwitchPlayers.
A5F0 JR C,NewLevel Jump to NewLevel if 2UP is active.
A5F2 CALL Handler_SwitchPlayers Call Handler_SwitchPlayers.
A5F5 JR NewLevel Jump to NewLevel.
Who is in play, is it 1UP or 2UP?
Game_Complete A5F7 LD HL,$AB8A HL=Game_Flags.
A5FA BIT 4,(HL) Jump to NewLevel_2UP_CopyScore if this is player two.
A5FC JR NZ,NewLevel_2UP_CopyScore
A5FE RES 6,(HL) Reset bit 6 of *HL.
A600 JR NewLevel_CopyScore Jump to NewLevel_CopyScore.
NewLevel_2UP_CopyScore A602 RES 7,(HL) Reset bit 7 of *HL.
NewLevel_CopyScore A604 CALL CopyScore_ActiveScore Call CopyScore_ActiveScore.
A607 CALL NewHighScore Call NewHighScore.
A60A CALL Messaging_GameOver Call Messaging_GameOver.
A60D CALL PressAnyKey Call PressAnyKey.
A610 CALL Print_HighScoreTable Call Print_HighScoreTable.
A613 CALL PressAnyKey Call PressAnyKey.
A616 CALL Handler_SwitchPlayers Call Handler_SwitchPlayers.
A619 JR C,NewLevel Jump to NewLevel if 2UP is active.
A61B JR Game_Loop Jump to Game_Loop.
Prev: A200 Up: Map Next: A61D