Prev: 26839 Up: Map Next: 26911
26861: 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 26861 LD BC,61438 Read from the keyboard;
Port Number Bit
0 1 2 3 4
239 0 9 8 7 6
26864 IN A,(C)
26866 RRA Rotate bit 0 into carry.
26867 CCF Invert carry.
26868 RET C Return if "0" is pressed.
26869 LD BC,65278 Read from the keyboard;
Port Number Bit
0 1 2 3 4
254 SHIFT Z X C V
26872 IN A,(C)
26874 OR %11100000 Set bits 5-7.
26876 INC A Increment the key bits by one.
26877 SCF Set carry.
26878 RET NZ Return if a key on this row is pressed.
Also test the SPACE row.
Scan_Fire 26879 RRC B Read from the keyboard;
Port Number Bit
0 1 2 3 4
127 SPACE FULL-STOP M N B
26881 IN A,(C)
26883 OR %11100000 Set bits 5-7.
26885 INC A Increment the key bits by one.
26886 SCF Set carry.
26887 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 26888 LD B,0 Set the retry counter to 0 in B.
26890 IN A,(31) Read from Kempston.
26892 LD C,A Store the first reading in C.
Read_Kempston_Retry 26893 IN A,(31) Read from Kempston.
26895 CP C Jump to Read_Kempston_Fail if the readings differ.
26896 JR NZ,Read_Kempston_Fail
26898 DJNZ Read_Kempston_Retry Decrease the retry counter by one and loop back to Read_Kempston_Retry until it is zero.
26900 AND %11100000 Keep only bits 5-7.
26902 RET NZ Return if any of those bits are set.
26903 LD A,C Copy the first reading to A.
26904 BIT 4,A Return if fire is not pressed.
26906 RET Z
26907 SCF Set carry.
26908 RET Return.
The two readings did not match.
Read_Kempston_Fail 26909 AND A Clear carry.
26910 RET Return.
Prev: 26839 Up: Map Next: 26911