Prev: 7C17 Up: Map Next: 7C90
7C19: Game Entry Point
Used by the routine at SecurityCheck.
GameInitialisation 7C19 LD HL,$5E00 Write 00 to 10 bytes, from GameOptions to 5E10.
7C1C LD B,$10
GameInitialisation_Loop 7C1E LD (HL),$00
7C20 INC HL
7C21 DJNZ GameInitialisation_Loop
7C23 LD HL,$BE4C Write MainFont to FontPointer.
7C26 LD ($5E01),HL
This entry point is used by the routine at GameOver.
Game_Restart 7C29 CALL ClearScreen Call ClearScreen.
7C2C CALL MenuIcons Call MenuIcons.
GameSelect_Loop 7C2F CALL GameMenu Call GameMenu.
7C32 LD A,$F7 Read from the keyboard;
Port Number Bit
0 1 2 3 4
F7 1 2 3 4 5
7C34 OUT ($FD),A
7C36 IN A,($FE)
7C38 CPL Flip the bits.
7C39 LD E,A E=A.
7C3A LD A,($5E00) A=GameOptions.
Handle Keyboard selection.
7C3D BIT 0,E Has key "1" been pressed? ("KEYBOARD").
7C3F JR Z,GameSelect_CheckKempston If not jump to GameSelect_CheckKempston.
7C41 AND %11111001 Keep only bits 0, 3-7.
Handle Kempston Joystick selection.
GameSelect_CheckKempston 7C43 BIT 1,E Has key "2" been pressed? ("KEMPSTON JOYSTICK").
7C45 JR Z,GameSelect_CheckCursor If not jump to GameSelect_CheckCursor.
7C47 AND %11111001 Keep only bits 0, 3-7.
7C49 OR %00000010 Set control method = 02.
Handle Cursor Joystick selection.
GameSelect_CheckCursor 7C4B BIT 2,E Has key "3" been pressed? ("CURSOR JOYSTICK").
7C4D JR Z,GameSelect_CheckKnight If not jump to GameSelect_CheckKnight.
7C4F AND %11111001 Keep only bits 0, 3-7.
7C51 OR %00000100 Set control method = 04.
Handle "Knight" selection.
GameSelect_CheckKnight 7C53 BIT 3,E Has key "4" been pressed? ("KNIGHT").
7C55 JR Z,GameSelect_CheckWizard If not jump to GameSelect_CheckWizard.
7C57 AND %11100111 Keep only bits 0-2, 5-7.
Handle "Wizard" selection.
GameSelect_CheckWizard 7C59 BIT 4,E Has key "5" been pressed? ("WIZARD").
7C5B JR Z,GameInitialisation_0 If not jump to GameInitialisation_0.
7C5D AND %11100111 Keep only bits 0-2, 5-7.
7C5F OR %00001000 Set player = 08.
GameInitialisation_0 7C61 LD D,A
7C62 LD A,$EF Read from the keyboard;
Port Number Bit
0 1 2 3 4
EF 0 9 8 7 6
7C64 OUT ($FD),A
7C66 IN A,($FE)
7C68 CPL Flip the bits.
7C69 LD E,A
7C6A LD A,D
Handle choosing "Serf".
GameSelect_CheckSerf 7C6B BIT 4,E Has key "6" been pressed? ("SERF").
7C6D JR Z,GameInitialisation_1 If not skip to GameInitialisation_1.
7C6F AND %11100111 Keep only bits 0-2, 5-7.
7C71 OR %00010000 Set bit 4.
GameInitialisation_1 7C73 LD ($5E00),A
7C76 LD C,A
Handle starting a new game.
GameSelect_Start 7C77 BIT 0,E Has key "0" been pressed? ("START GAME").
7C79 JP NZ,StartGame If so, jump to StartGame.
7C7C LD HL,$7CEA HL=GameSelection_Attributes.
7C7F LD B,$03 B=03 (counter).
7C81 LD A,C A=C.
7C82 CALL $7C90 Call 7C90.
7C85 LD B,$03 B=03 (counter).
7C87 LD A,C A=C / 04.
7C88 RRCA
7C89 RRCA
7C8A CALL $7C90 Call 7C90.
7C8D JP GameSelect_Loop Jump to GameSelect_Loop.
View the equivalent code in;
Prev: 7C17 Up: Map Next: 7C90