| jetpac | Routines | 
| Prev: 61c9 | Up: Map | Next: 6234 | 
| 
 | 
||||
| 61d5 | call $6234 | Draw the menu entries | ||
| 61d8 | ld a,($5cf3) | D=Game options | ||
| 61db | ld d,a | |||
| 
 
Read the keyboard and perform menu selection.
 
 | 
||||
| 61dc | ld a,$f7 | Row: 1,2,3,4,5 | ||
| 61de | out ($fd),a | Set port for reading keyboard | ||
| 61e0 | in a,($fe) | ...and read that row of keys | ||
| 61e2 | cpl | Flip bits so a `1` means a key is pressed. | ||
| 61e3 | bit 0,a | Key #1 pressed? ("1 PLAYER GAME") | ||
| 61e5 | jr z,$61e9 | No key pressed? Jump | ||
| 61e7 | res 0,d | else, Player count = 1 | ||
| 61e9 | bit 1,a | Key #2 pressed? ("2 PLAYER GAME") | ||
| 61eb | jr z,$61ef | No key pressed? Jump | ||
| 61ed | set 0,d | else, Player count = 2 | ||
| 61ef | bit 2,a | Key #3 pressed? ("KEYBOARD") | ||
| 61f1 | jr z,$61f5 | No key pressed? Jump | ||
| 61f3 | res 1,d | else, Input type = keyboard | ||
| 61f5 | bit 3,a | Key #4 pressed? ("JOYSTICK") | ||
| 61f7 | jr z,$61fb | No key pressed? Jump | ||
| 61f9 | set 1,d | else, Input type = joystick | ||
| 61fb | bit 4,a | Key #5 pressed? ("START GAME") | ||
| 61fd | jp nz,$62fe | |||
| 6200 | ld a,d | Update the Game options | ||
| 6201 | ld ($5cf3),a | |||
| 
 
Update flashing state of the menu items.
 
 | 
||||
| 6204 | ld hl,$6262 | Point HL to main menu colour attributes list. | ||
| 6207 | ld a,($5cf3) | C=Game options | ||
| 620a | ld c,a | |||
| 620b | bit 0,c | Jump if player count = 2 | ||
| 620d | jr nz,$621c | |||
| 620f | call $6226 | Set flashing state for a one player game | ||
| 6212 | bit 1,c | Jump if input type = joystick | ||
| 6214 | jr nz,$6221 | |||
| 6216 | call $6226 | Set flashing state for keyboard input | ||
| 6219 | jp $61d5 | Loop and process again main menu input | ||
| 621c | call $622d | Set flashing state for a two player game | ||
| 621f | jr $6212 | Check input type | ||
| 6221 | call $622d | Set flashing state for joystick input | ||
| 6224 | jr $6219 | Loop and process again menu selection | ||
| 
 
Set flashing state for "1 PLAYER GAME" and "KEYBOARD" menu items.
 
 | 
||||
| 6226 | set 7,(hl) | |||
| 6228 | inc hl | |||
| 6229 | res 7,(hl) | |||
| 622b | inc hl | |||
| 622c | ret | |||
| 
 
Set "2 PLAYER GAME" and "JOYSTICK" menu items flashing.
 
 | 
||||
| 622d | res 7,(hl) | |||
| 622f | inc hl | |||
| 6230 | set 7,(hl) | |||
| 6232 | inc hl | |||
| 6233 | ret | |||
| Prev: 61c9 | Up: Map | Next: 6234 |