Routines
 Prev: 869F Up: Map Next: 873C
86C3: Display the code entry screen
Used by the routine at 869F. Displays the code entry screen and waits for a code to be entered. Returns with the zero flag set if the code entered is correct.
Input
IX Address of the message to print (858B or 85AB)
86C3 LD DE,\$4800 Print the message pointed to by IX at (8,0)
86C6 LD C,\$20
86C8 CALL \$9680
86CB LD HL,\$4842 Print the graphic for the '1' key at (10,2)
86CE LD DE,\$9B00
86D1 LD C,\$00
86D3 CALL \$9456
86D6 LD HL,\$4845 Print the graphic for the '2' key at (10,5)
86D9 CALL \$9456
86DC LD HL,\$4848 Print the graphic for the '3' key at (10,8)
86DF CALL \$9456
86E2 LD HL,\$484B Print the graphic for the '4' key at (10,11)
86E5 CALL \$9456
86E8 LD HL,\$9B80 Copy the 128 attribute bytes from 9B80 to the screen (lines 8, 9, 10 and 11)
86EB LD DE,\$5900
86EE LD BC,\$0080
86F1 LDIR
86F3 LD A,(\$5C78) Collect the LSB of the system variable FRAMES
86F6 ADD A,\$25 Add 0x25 to this value and replace it; this ensures that the value collected on the second pass through this routine is different from the value collected on the first pass
86F8 LD (\$5C78),A
86FB CP \$B3 Is the value between 0x00 and 0xB2?
86FD JR C,\$8701 Jump if so
86FF SUB \$B4 Otherwise subtract 0xB4; note that if the original value of the LSB of the system variable FRAMES was 0x8E, this leaves A holding 0xFF, which is a bug
8701 LD L,A Now L holds either 0xFF or some number between 0x00 and 0xB2
8702 LD H,\$9E Point HL at one of the entries in the table at 9E00 (or at 9EFF if L=0xFF)
8704 LD A,(HL) Pick up the table entry
8706 LD (\$85E4),A Store the code at 85E4
8709 LD C,L Copy the code index to C; this will be used to compute the grid location
870A LD E,\$2F Calculate the ASCII code of the grid location number (0-9) in E
870C INC E
870D LD A,C
870E CP \$12
8710 JR C,\$8717
8712 SUB \$12
8714 LD C,A
8715 JR \$870C
8717 LD A,E Print the grid location number at (8,30)
8718 LD DE,\$481E
871B CALL \$9691
871E LD A,C Calculate the ASCII code of the grid location letter (A-R) in A