Prev: 68D7 Up: Map Next: 691F
68ED: Scan Abort
Used by the routines at Display_Status and Play_Briefing_Set.
Returns with carry set if an abort key is pressed.
Scan_Abort 68ED LD BC,$EFFE Read from the keyboard;
Port Number Bit
0 1 2 3 4
EF 0 9 8 7 6
68F0 IN A,(C)
68F2 RRA Rotate bit 0 into carry.
68F3 CCF Invert carry.
68F4 RET C Return if "0" is pressed.
68F5 LD BC,$FEFE Read from the keyboard;
Port Number Bit
0 1 2 3 4
FE SHIFT Z X C V
68F8 IN A,(C)
68FA OR %11100000 Set bits 5-7.
68FC INC A Increment the key bits by one.
68FD SCF Set carry.
68FE RET NZ Return if a key on this row is pressed.
Also test the SPACE row.
Scan_Fire 68FF RRC B Read from the keyboard;
Port Number Bit
0 1 2 3 4
7F SPACE FULL-STOP M N B
6901 IN A,(C)
6903 OR %11100000 Set bits 5-7.
6905 INC A Increment the key bits by one.
6906 SCF Set carry.
6907 RET NZ Return if a key on this row is pressed.
This entry point is used by the routine at Scan_Menu_Keys.
Return with carry set if Kempston fire is held.
Read_Kempston 6908 LD B,$00 Set the retry counter to 00 in B.
690A IN A,($1F) Read from Kempston.
690C LD C,A Store the first reading in C.
Read_Kempston_Retry 690D IN A,($1F) Read from Kempston.
690F CP C Jump to Read_Kempston_Fail if the readings differ.
6910 JR NZ,Read_Kempston_Fail
6912 DJNZ Read_Kempston_Retry Decrease the retry counter by one and loop back to Read_Kempston_Retry until it is zero.
6914 AND %11100000 Keep only bits 5-7.
6916 RET NZ Return if any of those bits are set.
6917 LD A,C Copy the first reading to A.
6918 BIT 4,A Return if fire is not pressed.
691A RET Z
691B SCF Set carry.
691C RET Return.
The two readings did not match.
Read_Kempston_Fail 691D AND A Clear carry.
691E RET Return.
Prev: 68D7 Up: Map Next: 691F