8F9F: Controls: Keyboard
ReadKeyboard |
8F9F |
LD C,$FF |
|
8FA1 |
LD A,$E7 |
|
8FA3 |
OUT ($FD),A |
|
8FA5 |
IN A,($FE) |
|
8FA7 |
CPL |
|
8FA8 |
AND %00011111 |
|
8FAA |
JR Z,ReadKeyboard_0 |
|
8FAC |
RES 2,C |
ReadKeyboard_0 |
8FAE |
LD A,$DB |
|
8FB0 |
OUT ($FD),A |
|
8FB2 |
IN A,($FE) |
|
8FB4 |
CPL |
|
8FB5 |
AND %00011111 |
|
8FB7 |
JR Z,ReadKeyboard_1 |
|
8FB9 |
RES 3,C |
ReadKeyboard_1 |
8FBB |
LD A,$BD |
|
8FBD |
OUT ($FD),A |
|
8FBF |
IN A,($FE) |
|
8FC1 |
CPL |
|
8FC2 |
AND %00011111 |
|
8FC4 |
JR Z,ReadKeyboard_2 |
|
8FC6 |
RES 4,C |
ReadKeyboard_2 |
8FC8 |
LD A,$FE |
|
8FCA |
OUT ($FD),A |
|
8FCC |
IN A,($FE) |
|
8FCE |
CPL |
|
8FCF |
LD B,A |
|
8FD0 |
AND %00010100 |
|
8FD2 |
JR Z,ReadKeyboard_3 |
|
8FD4 |
RES 1,C |
ReadKeyboard_3 |
8FD6 |
LD A,B |
|
8FD7 |
AND %00001000 |
|
8FD9 |
JR Z,ReadKeyboard_4 |
|
8FDB |
RES 0,C |
ReadKeyboard_4 |
8FDD |
LD A,$7F |
|
8FDF |
OUT ($FD),A |
|
8FE1 |
IN A,($FE) |
|
8FE3 |
CPL |
|
8FE4 |
LD B,A |
|
8FE5 |
AND %00001000 |
|
8FE7 |
JR Z,ReadKeyboard_5 |
|
8FE9 |
RES 1,C |
ReadKeyboard_5 |
8FEB |
LD A,B |
|
8FEC |
AND %00010100 |
|
8FEE |
JR Z,ReadKeyboard_6 |
|
8FF0 |
RES 0,C |
ReadKeyboard_6 |
8FF2 |
LD A,C |
|
8FF3 |
RET |