Prev: 61E5 Up: Map Next: 6260
61EB: Game Initialisation
Blank the 1UP, 2UP and HI scores.
GameInitialisation 61EB LD HL,$5CF0 Write 00 to 0A bytes from High_Score to 5CFA.
61EE LD BC,$0A00
GameInitialisation_Loop 61F1 LD (HL),C
61F2 INC HL
61F3 DJNZ GameInitialisation_Loop
This entry point is used by the routine at PlayerReset.
Game_Restart 61F5 DI Disable interrupts.
61F6 LD SP,$5CF0 Set the stack pointer to High_Score.
61F9 CALL CreateWindow Call CreateWindow.
61FC LD A,$04 Write 04 to JetmanSpeedModifier.
61FE LD ($5DCA),A
GameInitialisation_0 6201 CALL GameMenu
6204 LD A,($5CF3) D=GameOptions.
6207 LD D,A
6208 LD A,$F7 Read from the keyboard;
Port Number Bit
0 1 2 3 4
F7 1 2 3 4 5
620A OUT ($FD),A
620C IN A,($FE)
620E CPL Flip the bits.
Handle 1UP selection.
620F BIT 0,A Has key "1" been pressed? ("1 PLAYER GAME").
6211 JR Z,GameSelect_CheckP2 If not jump to GameSelect_CheckP2.
6213 RES 0,D Set player count = 1.
Handle 2UP selection.
GameSelect_CheckP2 6215 BIT 1,A Has key "2" been pressed? ("2 PLAYER GAME").
6217 JR Z,GameSelect_CheckKeyboard If not jump to GameSelect_CheckKeyboard.
6219 SET 0,D Set player count = 2.
Handle Keyboard selection.
GameSelect_CheckKeyboard 621B BIT 2,A Has key "3" been pressed? ("3 KEYBOARD").
621D JR Z,GameSelect_CheckKempston If not jump to GameSelect_CheckKempston.
621F RES 1,D Set control = "keyboard".
Handle Kempston Joystick selection.
GameSelect_CheckKempston 6221 BIT 3,A Has key "4" been pressed? ("4 KEMPSTON JOYSTICK").
6223 JR Z,GameSelect_CheckStart If not jump to GameSelect_CheckStart.
6225 SET 1,D Set control = "joystick".
Handle starting a new game.
GameSelect_CheckStart 6227 BIT 4,A Has key "5" been pressed? ("5 START GAME").
6229 JP NZ,StartGame If so, jump to StartGame.
Handle flashing each selection.
622C LD A,D
622D LD ($5CF3),A
6230 LD HL,$628E HL=GameSelection_Attributes+01 (i.e. ignoring "Game Selection" as it doesn't flash).
6233 LD A,($5CF3)
6236 LD C,A
6237 BIT 0,C
6239 JR NZ,GameInitialisation_3
623B CALL GameInitialisation_5
GameInitialisation_1 623E BIT 1,C
6240 JR NZ,GameInitialisation_4
6242 CALL GameInitialisation_5
GameInitialisation_2 6245 JP GameInitialisation_0
GameInitialisation_3 6248 CALL GameInitialisation_6
624B JR GameInitialisation_1
GameInitialisation_4 624D CALL GameInitialisation_6
6250 JR GameInitialisation_2
GameInitialisation_5 6252 SET 7,(HL)
6254 INC HL
6255 RES 7,(HL)
6257 INC HL
6258 RET
GameInitialisation_6 6259 RES 7,(HL)
625B INC HL
625C SET 7,(HL)
625E INC HL
625F RET
View the equivalent code in;
Prev: 61E5 Up: Map Next: 6260