Prev: 1155 Up: Map Next: 11C4
1163: select_channel: Channel selection and tuning display.
Used by the routine at handle_keypress.
select_channel 1163 CALL clear_page_number Clear page number display.
1166 CALL display_header_row Decode and display header row data.
1169 LD A,(control_register) Clear bit 2 of control_register and output to control register to disable AFC.
116C AND $FB
116E LD (control_register),A
1171 OUT ($7F),A
select_channel_0 1173 CALL detect_any_key Detect if any key is pressed.
1176 AND A If a key is pressed, jump to select_channel_1.
1177 JR NZ,select_channel_1
1179 PUSH HL Write 'C' to first byte of page display buffer.
117A LD HL,(page_display_buffer_pointer)
117D LD (HL),$43
117F POP HL
1180 CALL data_to_header_row Call data_to_header_row to copy header row from page receive buffer into page display buffer.
1183 CALL display_header_row Decode and display header row data.
1186 JR select_channel_0 Loop until a key is pressed.
select_channel_1 1188 CALL get_dec_digit Call get_dec_digit to get a keypress in the range 0-9.
118B CP $35 Loop until key code is greater than or equal to $31 and less than $35 ('1' to '4').
118D JR NC,select_channel_0
118F CP $31
1191 JR C,select_channel_0
1193 PUSH HL Write key code to second byte of page display buffer.
1194 LD HL,(page_display_buffer_pointer)
1197 INC HL
1198 LD (HL),A
1199 POP HL
119A DEC A Subtract 1 from key code and convert to integer in range 0-3.
119B AND $03
119D LD (control_register),A Store result in control_register and output to control register to set channel.
11A0 OUT ($7F),A
11A2 CALL display_header_row Decode and display header row data.
11A5 LD BC,$FFFF Loop to delay for approximately half a second.
select_channel_2 11A8 DEC BC
11A9 LD A,B
11AA AND A
11AB JR NZ,select_channel_2
11AD LD A,(control_register) Set bit 2 of control_register and output to control register to reenable AFC.
11B0 OR $04
11B2 LD (control_register),A
11B5 OUT ($7F),A
11B7 CALL restore_number Restore page number from number_display_buffer.
11BA CALL clear_receive_rows Clear all rows except header in page receive buffer.
11BD CALL clear_page_buffer Clear page display buffer.
11C0 CALL decode_page Call decode_page and return.
11C3 RET
Prev: 1155 Up: Map Next: 11C4