Routines |
Prev: 32825 | Up: Map | Next: 32961 |
Used by the routine at 33021.
|
||||
Checks if the player has picked a control option on menu 1 (32825).
|
||||
32929 | LD BC,63486 | Port input address for keyboard keys 1,2,3,4 and 5 | ||
32932 | IN A,(C) | Get input from port | ||
32934 | OR %11100000 | To maintain keyboard consistency, set bits 5-7 ready for the CP in the next instruction | ||
32936 | CP %11111111 | Are any keys currently being pressed? | ||
32938 | JR Z,32952 | If not (value = 255), check if a key press has previously been registered | ||
Key is being pressed - check if it's a valid option (1,2,3 or 4), and if so, jump to 32961.
|
||||
32940 | LD B,4 | 4 port addresses to check | ||
32942 | LD HL,35762 | Address pointer to where the port addresses are held | ||
Loop through port addresses
|
||||
32945 | CP (HL) | Compare with keyboard input | ||
32946 | JR Z,32961 | If a valid key has been pressed, jump to 32961 to play a sound and highlight the choice on screen | ||
32948 | INC HL | Otherwise advance to the next (2 byte) port address | ||
32949 | INC HL | |||
32950 | DJNZ 32945 | ...and keep checking until all 4 are done. | ||
Check if a key press has been registered already
|
||||
32952 | LD A,(35754) | Has a menu option (1-4) been chosen yet? | ||
32955 | CP 0 | |||
32957 | JR Z,32929 | If not, go back to checking keys at 32929 | ||
32959 | JR 33021 | If so, run the routine to see if ENTER is being pressed (to start the game) |
Prev: 32825 | Up: Map | Next: 32961 |