Prev: 33862 Up: Map Next: 34684
34636: KeyboardScanner
Reads the keyboard half-rows used by the game and packs the active directional / fire keys into 33682. Bit 4 = fire/action, bit 3 = right (key 8), bit 2 = left (key 5), bit 1 = up (key 6), bit 0 = down (key 7). Used by the routine at 34684 (HandleInput).
34636 CALL 34640 scan into AlienFlags via the selected device's
34639 RET scanner (the CALL operand at $874D is patched from InputScannerTable by OptionsScreen)
34640 LD HL,33682 HL points to AlienFlags
34643 LD (HL),0
34645 LD BC,63486 port $F7FE: half-row 1-5
34648 IN A,(C)
34650 LD B,239 next read: port $EFFE, half-row 6-0
34652 BIT 4,A key 5 pressed? (active low)
34654 JR NZ,34658
34656 SET 1,(HL) bit 1 = key 5
34658 IN A,(C) read half-row 6-0
34660 BIT 2,A key 8?
34662 JR NZ,34666
34664 SET 0,(HL) bit 0 = key 8
34666 BIT 3,A key 7?
34668 JR NZ,34672
34670 SET 2,(HL) bit 2 = key 7
34672 BIT 4,A key 6?
34674 JR NZ,34678
34676 SET 3,(HL) bit 3 = key 6
34678 BIT 0,A key 0 (action)?
34680 RET NZ
34681 SET 4,(HL) bit 4 = action
34683 RET
Prev: 33862 Up: Map Next: 34684