Prev: 54942 Up: Map Next: 54999
54950: Capture keyboard input
Used by the routine at 54942.
Output
A Stored key-press (bits: 0=LEFT, 1=RIGHT, 2=UP, 3=DOWN, 4=FIRE)
54950 LD C,254 Load C with 254 (as all keyboard half-row "input addresses" have C = 254)
The operand of the instruction at 54952 represents the MSB of the "input address" to use in reading the keyboard for the currently defined LEFT key. This is modified by the routine at 54647.
54952 LD B,127 Load B with MSB of "input address"
54954 IN A,(C) Read keyboard
The operand of the instruction at 54956 represents the index of the bit to use in reading the keyboard. It is modified by the routine at 54647.
54956 BIT 3,A "N" key pressed so...
54958 CALL Z,55100 ...store a LEFT input from control device
54961 LD B,127 Load B with MSB of "input address"
54963 IN A,(C) Read keyboard
54965 BIT 2,A "M" key pressed so...
54967 CALL Z,55103 ...store a RIGHT input from control device
54970 LD B,253 IN 65022 reads the half row A to G...
54972 IN A,(C) Read keyboard
54974 BIT 0,A "A" key pressed so...
54976 CALL Z,55106 ...store an UP input from control device
54979 LD B,254 IN 65278 reads the half row CAPS SHIFT to V
54981 IN A,(C) Read keyboard
54983 BIT 1,A "Z" key pressed so...
54985 CALL Z,55109 ...store a DOWN input from control device
54988 LD B,127 IN 32766 reads the half row SPACE to B
54990 IN A,(C) Read keyboard
54992 BIT 0,A SPACE bar pressed so...
54994 CALL Z,55112 ...store a FIRE input from control device
54997 LD A,(HL) Load stored input into A
54998 RET Return
Prev: 54942 Up: Map Next: 54999