Prev: 26662 Up: Map Next: 26749
26664: Get Keyboard Input
KeyboardInput 26664 LD DE,65024 DE=65024.
26667 LD BC,65278 Read from the keyboard;
Port Number Bit
0 1 2 3 4
254 SHIFT Z X C V
KeyboardInput_0 26670 IN A,(C)
26672 CPL Invert the bits in A.
26673 AND %00011111 Keep only bits 0-4.
26675 JR Z,KeyboardInput_1 Jump to KeyboardInput_1 if {} is zero.
26677 SCF Set the carry flag.
KeyboardInput_1 26678 RL E Rotate E left.
26680 RL D Rotate D left.
26682 JR NC,KeyboardInput_2 Jump to KeyboardInput_2 if {} is higher.
26684 RLC B Rotate B left (with carry).
26686 JR KeyboardInput_0 Jump to KeyboardInput_0.
KeyboardInput_2 26688 LD A,E A=E.
26689 RRCA RRCA.
26690 JR NC,KeyboardInput_3 Jump to KeyboardInput_3 if {} is higher.
26692 SET 0,D Set bit 0 of D.
KeyboardInput_3 26694 RRCA RRCA.
26695 JR NC,KeyboardInput_4 Jump to KeyboardInput_4 if {} is higher.
26697 SET 2,D Set bit 2 of D.
KeyboardInput_4 26699 RRCA RRCA.
26700 JR NC,KeyboardInput_5 Jump to KeyboardInput_5 if {} is higher.
26702 SET 3,D Set bit 3 of D.
KeyboardInput_5 26704 RRCA RRCA.
26705 JR NC,KeyboardInput_6 Jump to KeyboardInput_6 if {} is higher.
26707 SET 4,D Set bit 4 of D.
KeyboardInput_6 26709 RRCA RRCA.
26710 JR NC,KeyboardInput_7 Jump to KeyboardInput_7 if {} is higher.
26712 SET 4,D Set bit 4 of D.
KeyboardInput_7 26714 RRCA RRCA.
26715 JR NC,KeyboardInput_8 Jump to KeyboardInput_8 if {} is higher.
26717 SET 3,D Set bit 3 of D.
KeyboardInput_8 26719 RRCA RRCA.
26720 JR NC,KeyboardInput_9 Jump to KeyboardInput_9 if {} is higher.
26722 SET 2,D Set bit 2 of D.
KeyboardInput_9 26724 RRCA RRCA.
26725 JR NC,KeyboardInput_10 Jump to KeyboardInput_10 if {} is higher.
26727 SET 1,D Set bit 1 of D.
KeyboardInput_10 26729 LD A,D A=D.
26730 AND %00000011 Keep only bits 0-1.
26732 CP 3 Compare A with 3.
26734 JR NZ,KeyboardInput_11 Jump to KeyboardInput_11 if {} is not zero.
26736 XOR D Flip the bits according to D.
26737 LD D,A D=A.
KeyboardInput_11 26738 LD A,D A=D.
26739 AND %00001100 Keep only bits 2-3.
26741 CP 12 Compare A with 12.
26743 JR NZ,KeyboardInput_12 Jump to KeyboardInput_12 if {} is not zero.
26745 XOR D Flip the bits according to D.
26746 LD D,A D=A.
KeyboardInput_12 26747 LD A,D A=D.
26748 RET Return.
Prev: 26662 Up: Map Next: 26749