Prev: BB64 Up: Map Next: BBD8
BB74: Game Selection Menu
Used by the routine at RunGame.
Displays the menu and waits for the control method to be chosen and the game to be started. The keys "1" to "4" choose the keyboard, the Kempston joystick, the cursor joystick and Interface II, and "0" starts the game. The menu tune is played once. The choice is held in ControlMethod.
The menu
game-selection-menu
Prepare the menu.
GameMenu BB74 XOR A Write 00 to BorderDrawnFlag, so that the frame will be drawn.
BB75 LD ($A734),A
BB78 LD HL,$BBF1 Start at the colours of the lines of the menu, MenuColours.
BB7B LD B,$08 Set the number of lines to 08.
GameMenu_Steady BB7D RES 7,(HL) Stop the line flashing.
BB7F INC HL Move on to the next line.
BB80 DJNZ GameMenu_Steady Decrease the counter and loop until all the colours are steady.
BB82 CALL ClearScreenBuffer Call ClearScreenBuffer to clear the buffer.
BB85 CALL DisplayMenu Call DisplayMenu to draw the menu.
BB88 CALL FlashMenuOptions Call FlashMenuOptions.
Read the keys that choose the control method.
GameMenu_Loop BB8B CALL DisplayMenu Call DisplayMenu to draw the menu.
BB8E LD DE,$D7CF Take the menu tune, MenuTune.
BB91 CALL PlayMusicOnce Call PlayMusicOnce to play it until a key is pressed.
Read the keys that choose the control method.
BB94 LD A,$F7 Read from the keyboard;
Port Number Bit
0 1 2 3 4
F7 1 2 3 4 5
BB96 CALL ReadKeyboardPort
BB99 LD E,A Stash the keys that are pressed in E.
BB9A LD A,($A709) Fetch the control method from ControlMethod.
BB9D LD ($A70C),A Set PreviousControlMethod.
BBA0 BIT 0,E Jump to GameMenu_TestKempston if key 31 is not pressed.
BBA2 JR Z,GameMenu_TestKempston
BBA4 AND %11111001 Choose the keyboard, by clearing the bits of the control method.
Choose a joystick if one of those keys is pressed.
GameMenu_TestKempston BBA6 BIT 1,E Jump to GameMenu_TestCursor if key 32 is not pressed.
BBA8 JR Z,GameMenu_TestCursor
BBAA AND %11111001 Clear the bits of the control method...
BBAC OR %00000010 Choose the Kempston joystick.
GameMenu_TestCursor BBAE BIT 2,E Jump to GameMenu_TestInterfaceII if key 33 is not pressed.
BBB0 JR Z,GameMenu_TestInterfaceII
BBB2 AND %11111001 Clear the bits of the control method...
BBB4 OR %00000100 Choose the cursor joystick.
GameMenu_TestInterfaceII BBB6 BIT 3,E Jump to GameMenu_SetMethod if key 34 is not pressed.
BBB8 JR Z,GameMenu_SetMethod
BBBA OR %00000110 Choose the Interface II joystick.
GameMenu_SetMethod BBBC LD ($A709),A Write the control method to ControlMethod.
Start the game if "0" is pressed.
BBBF LD HL,$A735 Point HL at UnusedValue.
BBC2 LD HL,$A70C Take the previous control method, PreviousControlMethod.
BBC5 CP (HL) Compare the control method with the previous one, which is not used.
Start the game if key 30 is pressed.
BBC6 LD A,$EF Read from the keyboard;
Port Number Bit
0 1 2 3 4
EF 0 9 8 7 6
BBC8 CALL ReadKeyboardPort
BBCB BIT 0,A Return if key 30 is pressed.
BBCD RET NZ
BBCE LD HL,$A70A Point HL at MenuPassCounter.
BBD1 INC (HL) Increment MenuPassCounter.
BBD2 CALL FlashMenuOptions Call FlashMenuOptions.
BBD5 JP GameMenu_Loop Jump to GameMenu_Loop for another pass.
View the equivalent code in;
Prev: BB64 Up: Map Next: BBD8