include vers.z80 ; version and date A 000F A vers equ 15 000A A vmonth equ 10 ; Version date 001D A vday equ 29 0013 A vcent equ 19 005E A vyear equ 94 .comment ~ ============================================================================ WA1LMV Repeater Control Software Copyright 1990,1995 by Rick Swenton 106 Melinda Lane Bristol, CT 06010-7176 All Rights Reserved This is a full-featured repeater control system for an 8085 CPU. This program is a proprietary work and has not been released. ============================================================================ This program supports the following features: (at this time) - Two Main Receiver Inputs for COS and PL - Two Auxiliary Receiver Inputs for COS - Audio Gate Control signals for Audio Mixer - Two Main Transmitter Outputs - Two Auxlilary Transmitter Outputs - MCW Messages and ID with programmable pitch and speed - ID Timer with Polite ID and Broadcast ID - Separate Main Receiver Time-Out Timers with PL inhibit - Separate Main and Auxiliary Receiver Timers: Input Access Delay Input Release Delay - Auxiliary Transmitters inactivity dump timer - Autopatch with inactivity dump timer - DTMF regeneration and speed-dialing with speech readout of 10 Programmable Dialer slots and last number recall - DTMF Mute of Audio Gates - Reverse Autopatch with announce - Dial-in Landline Control System - Courtesy tones with programmable MCW character and programmable pitch for each main receiver - Auxiliary RX/TX Indicator Tones on Main RX usage - CRT Console Terminal with Command Menu and Status Display - Ability to enable/disable any input/output signal - Interrupt driven background timing system updates timers every ten milliseconds and I/O every millisecond - Two Interrupt driven DTMF Decoders with buffered type-ahead One decoder for radio input, the other for phone line control - Interrupt driven Console input with buffered type-ahead and X-ON/X-OFF protocol - Simultaneous input from CRT keyboard and both DTMF decoders - Emulation of existing WA1LMV/R Repeater Control Codes - Enahncement of Control System functionality and security (User Operator/Control Operator) - Watchdog timer in hardware and other software error traps to recover from noise, power surges or software bugs. - Speech Synthesis using SSI263 chip -- controls speech inflection, rate and articulation. - Time of Day Clock/Calendar/Alarm (MM58167) with speech readout, hourly chime announce and ten scheduled events - Software detects presence of speech and clock chips and disables speech if chip not there. Program emulates clock chip in software if chip not there. - 10 Programmable Macro keys for control speed-commands - Capability to read/write to/from memory in HEX through Console or DTMF (0-9, A-F) with MCW or Speech readout of memory locations - Two Meter Synthesizer control with 10 preset user programmable frequencies, mode and power control At this time, the program is about 17K large with up to 32K of EPROM available for program storage. The target CPU is an INTEL 8085. The program is written in Z80 Assembly Language. The SLR Systems SLR180+ Assembler was used to create the EPROM file using the /Z switch so as to reject Z80-specific instructions. ~ include codes.z80 A .comment ~ A A Currently Implemented Control and User Functions: A A ============================================================================== A User Functions Series *2500 Codes: A ============================================================================== A A ------------------------------------------------------------------------------ A General User Functions A ------------------------------------------------------------------------------ A A *2501 - Autopatch ON *2500 - Autopatch OFF A A *2502 - Autopatch Speed Dialer where ten phone numbers are stored A in Slots 0 -> 9 A Usage: *25020 through *25029 A A *2503 - Speak the last dialed number A A (Last manually dialed number is saved in Speed Dialer slot 0) A A *2505 - Curly (see *2539 which adds time and ID to Curly) A *2506 - Voice Time A *2507 - Super Beep (no special purpose, just for test) A *2508 - MCW ID Start A *2509 - Voice ID Start A A ------------------------------------------------------------------------------ A Link Transceiver #1 Functions (Two Meters) A ------------------------------------------------------------------------------ A A *2511 - 2M RX ON *2510 - 2M RX/TX OFF A *2512 - 2M TX ON A A *2514c - Set 2M Active channel A *2515c - Speak Preset Channel Frequency where 'c' is the channel number A *2516ffffmp - Set 2m Chan 0 Freq where 'ffff' is the freq A (6880 = 146.880) A This function also selects 'm' is the mode A Channel 0 as the Active Channel 0 = Simplex A 1 = Auto-Repeat A 2 = Auto-Inverse A A 'p' is the power A 0 = Low A 1 = High A A ------------------------------------------------------------------------------ A Link Transceiver #2 Functions A ------------------------------------------------------------------------------ A A *2521 - Aux RX2 ON *2520 - Aux RX2/TX2 OFF A *2522 - Aux TX2 ON A A ------------------------------------------------------------------------------ A Time, Date and Hourly Chime Functions A ------------------------------------------------------------------------------ A A *2505 - Speak Time *2536 - Speak Date A *2535 - Enable Hourly Chime *2534 - Disable Hourly Chime A *2539 - Curly Routine (scheduled during chime disabled) A A ------------------------------------------------------------------------------ A MCW and Speech Functions A ------------------------------------------------------------------------------ A A *2581 - Speech/CW Mode A A Usage: *2581n where n = the desired mode: A A 0 = Speech/CW Disabled 1 = CW Only Mode 2 = Speech/CW Mode A A The MCW ID is always enabled. Speech/MCW Disable only disables feedback A functions such as ON/OFF announcements and other non-essential readouts. A A A ------------------------------------------------------------------------------ A Courtesy Tone Functions A ------------------------------------------------------------------------------ A A *2583 - 6M Courtesy Tone Mode A *2584 - 450 Courtesy Tone Mode A A Usage: *2583n where n = the desired mode A A 0 = Disabled 1 = First Key-Up Mode 2 = Each Key-Up Mode A A ------------------------------------------------------------------------------ A 450 Transmit Time Limiter A ------------------------------------------------------------------------------ A A *2531 - Enable 450 TX Time Limit *2530 - Disable 450 TX Time Limit A A ------------------------------------------------------------------------------ A Antenna Relay A ------------------------------------------------------------------------------ A A *2541 - Antenna #1 *2542 - Antenna #2 A A ------------------------------------------------------------------------------ A Landline Control A ------------------------------------------------------------------------------ A A Unlock: Call 582-8024. Press 0 when the phone answers. A A *2591 - Full Patch ON *2590 - Full Patch OFF A *2597 - Monitor Mode ON *2596 - Monitor Mode OFF A A *2598 - Reset Landline Control A A ------------------------------------------------------------------------------ A A *2599 - Master Reset User Functions (all *2500 codes) to ROM defaults A A ============================================================================== A Control Functions Series *6900 Codes: A ============================================================================== A A ------------------------------------------------------------------------------ A Autopatch Control Functions A ------------------------------------------------------------------------------ A A *6901 - Autopatch Enable *6900 - Autopatch Disable A A *6902 - Program Speed Dialer A Usage: *6902snnnnnnnnnn where S = slot # (0 to 9) to program A and nnnnnnnnnn = up to 10 digits A to save in that slot A A *6903 - Speak Speed Dialer Numbers A Usage: *6903S where S = slot # (0 to 9) to read A A *6963 - Ring Detector Enable *6962 - Ring Detector Disable A A ------------------------------------------------------------------------------ A DTMF Decoder Control Functions A ------------------------------------------------------------------------------ A A *6921 - 450 DTMF PL Enable *6920 - 450 DTMF PL Disable A *6923 - 6M DTMF PL Enable *6922 - 6M DTMF PL Disable A *6925 - DTMF Mute Enable *6924 - DTMF Mute Disable A A ------------------------------------------------------------------------------ A Clock/Calendar Control Functions A ------------------------------------------------------------------------------ A A *6911 - Set Time A Usage: *6911hhmmss where hh = hours in 24 hour format A mm = minutes A ss = seconds (optional) A A If the seconds are omitted, then the seconds are set to sero A A A *6912 - Set Date A Usage: *6912mmddyyyy where mm is the month (1 to 12) A dd is the day of the month (1 to 31) A yyyy is the full year (1991) A A other valid date sequences are: A A *6912mmdd A *6912mmddyy (where yy is the last two digits of the year) A A *6913 - Events A Usage: *6913ephhmmccccc where e is the event (0 to 9) A p is the priority (0=low, 1=hi) A hh is the hours (24 hour format) A mm is the minutes A cccccc is the control code A (i.e. *2511 or silent command **2511) A A *6913e with no parameters toggles active/inactive status A A A *6914 - Subtract one hour from current time to return to Standard Time A A *6915 - Add one hour to current time to return to Daylight Savings Time A A A A ------------------------------------------------------------------------------ A Main Receivers Control Functions A ------------------------------------------------------------------------------ A ------------------------------------------------------------------------------ A Six Meter Receiver Functions A ------------------------------------------------------------------------------ A A *6971 - 6M RX Enable (PL Enabled) *6970 - 6M RX Disable A *6972 - 6M RX Enable (PL Disabled) A A *6974 - 6M PL Time-Out Inhibit ON *6973 - 6M Time-out Inhibit OFF A A *6976 - 6M Temp PL Override Enabled *6975 - 6M Temp PL Override Disabled A A A ------------------------------------------------------------------------------ A UHF Receiver Functions A ------------------------------------------------------------------------------ A A *6981 - 450 RX Enable (PL Enabled) *6980 - 450 RX Disable A *6982 - 450 RX Enable (PL Disabled) A A *6984 - 450 PL Time-Out Inhibit ON *6983 - 450 Time-out Inhibit OFF A A *6986 - 450 Temp PL Override Enabled *6985 - 450 Temp PL Override Disabled A A ------------------------------------------------------------------------------ A Two Meter Link System Functions A ------------------------------------------------------------------------------ A *6904cffffmp - Program 2M Preset Frequencies A where: 'c' is the channel A 'ffff' is the freq A (6880 = 146.880) A This function also selects 'm' is the mode A Channel 'c' as the Active Channel 0 = Simplex A 1 = Auto-Repeat A 2 = Auto-Inverse A A ------------------------------------------------------------------------------ A Main Transmitters Control Functions A ------------------------------------------------------------------------------ A A *6991 - 450 TX Enable *6990 - 450 TX Disable A *6993 - 6M TX Enable *6992 - 6M TX Disable A A *6961 - Preset Transmit Time to 5 Minutes for testing A (The next receiver input will preset back to 5 seconds) A A *6933 - Test Tone Deviation ON *6932 - Test Tone Deviation OFF A *6935 - Test Speech Deviation ON *6934 - Test Speech Deviation ON A A ------------------------------------------------------------------------------ A Macro Control Speed Commands A ------------------------------------------------------------------------------ A A #0 to #9 - Programmed Macro Functions A A *6952 - Program Macro Functions A Usage: *6952n*xxxx where n = macro key 0 to 9 A *xxxx = the Control Code to save (i.e. *2501) A A *6951 - Macro Functions Enable *6950 - Macro Functions Disable A A ------------------------------------------------------------------------------ A Miscellaneous Control Functions A ------------------------------------------------------------------------------ A A A *6954 - User Codes Enable *6953 - User Codes Disable A A A A *6930aaaa - Memory Read *6931aaaa#0dd - Memory Write A where: aaaa = address in hex A dd = data in hex A to enter hex alpha characters, use the two-digit A DTMF sequence - #1=A, #2=B, #3=C, #4=D, #5=E, #6=F A and #0 is the space char separating aaaa and dd. A A *2599 - User Functions Reset A *6999 - Controller Master Reset and default system parameters from ROM A A A Placing a "*" in front of any 4-digit command sequence (i.e. **2501 instead A of *2501) will disable speech or MCW transpond of the results of the command. A A ------------------------------------------------------------------------------- A ~ A .comment ~ ============================================================================== Modifications: (sub-versions are diferentiated only by sign-on date) Version 1.0 Program started on 09/22/1990 Version 1.3 11/02/1991 Version 1.5 03/12/1992 Version 1.5 09/23/1994 Fixed bug in TISR which caused time-out timers to start running if a main receiver was disabled by control. Version 1.5 10/29/1994 Fixed bug in the Daylight/Standard +1/-1 hour function which did not properly add one hour at 9 am or 7 pm and did not properly subtract one hour at 10 am or 8 pm. ============================================================================== This is a surplus single-board 8085 based computer which was removed from Kodak Ektachem Blood Analyzers during a modification. The board can accept an 8K, 16K or 32K EPROM and has 4K of Static Ram, a Programmable Interval Timer (PIT), a Programmable Peripheral Interface (PPI), a Programmable Interrupt Controller (PIC), a Universal Synchronous/Asynchronous Receiver-Transmitter (USART), four 8-bit output ports and three 8-bit input ports (not including the I/O ports on the PPI). This SBC uses memory-mapped I/O conforming to the following chart: Program ROM 00000H to 01FFFH - 8K EPROM 2764 A15 or 00000H to 03FFFH - 16K EPROM 27128 A15 or 00000H to 07FFFH - 32K EPROM 27256 A15 requires one wire and one cut land for each increase in ROM size Static RAM 08000H to 087FFH - 2K RAM 6116 CS0 Static RAM 08800H to 08FFFH - 2K RAM 6116 CS1 I/O Device 09000H to 09003H - PPI 8255 CS2 I/O Device 09800H to 09801H - PIC 8259 CS3 I/O Device 0A000H to 0A001H - USART 8251 CS4 I/O Device 0A800H to 0A803H - PIT 8253 CS5 I/O Device 0B000H to 0B007H - Ports 0 to 7 CS6 The following I/O assignments are decoded on the auxiliary board and not part of the computer main board: Output Port 0C000H to 0CFFFH - SSI-263 Speech IC (uses 0C000H to 0C007H) Output Port 0D000H to 0D005H - MM58177 Clock IC (uses 0D000H to 0D01FH) Output Port 0E000H to 0EFFFH - SSI-75T2089 DTMF Encoder/Decoder (uses 0E000H bits 0-1-2-3 for Encoder) Input Port 0D000H to 0DFFFH - MM58167 Clock IC (uses 0D000H to 0D01FH) Input Port 0E000H to 0EFFFH - SSI-202 DTMF Decoder IC (uses 0E000H bits 0-1-2-3) SSI-75T2089 DTMF Encoder/Decoder IC (uses 0E000H bits 4-5-6-7 for Decoder) A modification to the circuit is required at U4. The wire on U4 pin 4 is removed and pin 4 is connected to address line A14. This will make U4 unambiguously decode device selects which will not contend with device selects made by the 74LS138 on the Auxiliary Board. ---------------------- End of Comment Text ------------------------------------ ~ ;============================================================================= 00FF true equ 0ffh 00FF yes equ 0ffh 0000 false equ 0 0000 no equ 0 ;============================================================================= ;.printx Enter the Processor Clock Crystal Frequency in KHz. ;.printx ;.accept 'Valid choices are 5185 or 8000 --> ', clock ;.printx 1441 clock equ 5185 ; CPU Clock ;clock equ 8000 ; (wishful thinking) ;============================================================================= ; SSI-263 Speech Synthesizer Port Equates C000 sbase equ 0c000h ; Base Port C000 durphon equ sbase ; Duration/Phoneme Register 0 C001 inflect equ sbase+1 ; Inflection Pitch Register 1 C002 rateinf equ sbase+2 ; Rate/Inflection Register 2 C003 cttramp equ sbase+3 ; Control/Articulation/Amplitude Register 3 C004 filfreq equ sbase+4 ; Filter Frequency Register 4 ;============================================================================= ; SSI-202P Radio DTMF Decoder Port Equates E000 dbase equ 0e000h ; Base Port (lower nibble) 000F rdmsk equ 00001111b 0080 rdvmsk equ 10000000b ; Radio DTMF Data Valid Mask (Port 0) ;============================================================================= ; SSI-75T2089 Telephone DTMF Decoder/Encoder Port Equates ; dbase equ 0e000h ; Base Port (upper nibble) 00F0 tdmsk equ 11110000b ; Port 8 is the data port for the 2089 DTMF Encoder ;============================================================================= ; MM58167 Clock/Calendar IC Port Equates ; Not all ports are used D000 cbase equ 0d000h ; Base Port D002 sec equ cbase+2 ; Seconds D003 min equ cbase+3 ; Minutes D004 hrs equ cbase+4 ; Hours ;day equ cbase+5 ; Day of the Week D006 date equ cbase+6 ; Day of the Month D007 month equ cbase+7 ; Month D009 year equ cbase+9 ; Year (in hundreths/tenths of seconds latch) ;lsec equ cbase+10 ; Seconds Latch ;lmin equ cbase+11 ; Minutes Latch D00C lhrs equ cbase+12 ; Hours Latch ;lday equ cbase+13 ; Day of the Week Latch ;ldate equ cbase+14 ; Day of the Month Latch ;lmonth equ cbase+15 ; Month Latch ;cints equ cbase+16 ; Interrupt Status Latch (read only) ;cintc equ cbase+17 ; Interrupt Control Latch (write only) ;ccrst equ cbase+18 ; Counter Reset ;clrst equ cbase+19 ; Latch Reset D014 cstat equ cbase+20 ; Status Bit ; Interrupt Mask for Status (read) and Control (write) registers ; D7 D6 D5 D4 D3 D2 D1 D0 ; Month Week Day Hour Minute Second 1/10 Comparator ; ** Note ** Version 1.3 changes clock operation from interrupt ; driven to polled operation in order to implement the event ; scheduler. ;============================================================================= ; 8255 Programmable Peripheral Interface Equates 9003 ppictl equ 09003H ; 8255 PPI control port 00A6 ppimod equ 10100110b ; 8255 Mode ; |||||||| ; |||||||+-- Group B Port C (Lower) 1=Input 0=Output ; ||||||+--- Group B Port B 1=Input 0=Output ; |||||+---- Group B Mode Selection 1=Mode 1 0=Mode 0 ; ||||+----- Group A Port C (Upper) 1=Input 0=Output ; |||+------ Group A Port A 1=Input 0=Output ; ||+-----+- Group A Mode Selection 01=Mode 1 00=Mode 0 ; |+------+ 1X=Mode 2 ; +--------- Mode Set Flag 1=Active ; We need to set the PC5 bit because it controls ALE to ; enable the dedicated output ports on the board 000A ppipc5 equ 00001010b ; |||||||| ; |||||||+-- Bit Set/Reset 1=Set 0=Reset ; ||||||+--- B0 ; |||||+---- B1 Bit Select ; ||||+----- B2 ; |||+------ x ; ||+------- x x = don't care ; |+-------- x ; +--------- Bit Set/Reset Flag 0=Active ;============================================================================= ; 8253 Programmable Interval Timer equates A800 pitc0 equ 0A800H ; 8253 PIT Counter 0 A801 pitc1 equ 0A801H ; 8253 PIT Counter 1 A802 pitc2 equ 0A802H ; 8253 PIT Counter 2 A803 pitctl equ 0A803H ; 8253 PIT contorl port 00B6 pitcw equ 10110110b ; counter 2, mode 3 ; |||||||| ; |||||||+--- 0 = Binary 16 bits, 1 = BCD 4 decades ; ||||||+---- M0 -+ 000 = Mode 0, 001 = Mode 1 ; |||||+----- M1 -+ X10 = Mode 2, X11 = Mode 3 ; ||||+------ M2 -+ 100 = Mode 4, 101 = Mode 5 ; |||+------- RL0 -+ 00 = Counter Latching Operation ; ||+-------- RL1 -+ 01 = Read/Load MS byte only ; || 10 = Read/Load LS byte only ; || 11 = Read/Load LS byte first, then MS byte ; |+--------- SC0 -+ 00 = Select Counter 0, 01 = Select Counter 1 ; +---------- SC1 -+ 10 = Select Counter 2, 11 = Illegal ; Timing Constants to generate varouus audio frequencies FFFF 1 if clock eq 5185 1 0510 1 b2000 equ 1296 ; 2000 Hz. tone clock*(500/2000) 0870 1 b1200 equ 2160 ; 1200 Hz. tone clock*(500/1200) 0A20 1 b1000 equ 2592 ; 1000 Hz. tone clock*(500/1000) 0B3D 1 b900 equ 2877 ; 900 Hz. tone clock*(500/900) 0CA8 1 b800 equ 3240 ; 800 Hz. tone clock*(500/800) 0F58 1 b660 equ 3928 ; 660 Hz. tone clock*(500/660) 1269 1 b550 equ 4713 ; 550 Hz. tone clock*(500/550) 1441 1 b500 equ 5185 ; 500 Hz. tone clock*(500/500) 1519 1 b480 equ 5401 ; 480 Hz. tone clock*(500/480) 1704 1 b440 equ 5892 ; 440 Hz. tone clock*(500/440) 1 endif ; clock eq 5185 0000 1 if clock eq 8000 1 1 b2000 equ 2000 ; 2000 Hz. tone clock*(500/2000) 1 b1200 equ 3333 ; 1200 Hz. tone clock*(500/1200) 1 b1000 equ 4000 ; 1000 Hz. tone clock*(500/1000) 1 b900 equ 4439 ; 900 Hz. tone clock*(500/900) 1 b800 equ 5000 ; 800 Hz. tone clock*(500/800) 1 b660 equ 6060 ; 660 Hz. tone clock*(500/660) 1 b550 equ 7272 ; 550 Hz. tone clock*(500/550) 1 b500 equ 8000 ; 500 Hz. tone clock*(500/500) 1 b480 equ 8333 ; 480 Hz. tone clock*(500/480) 1 b440 equ 9090 ; 440 Hz. tone clock*(500/440) 1 endif ; clock eq 8000 ; Timing Constants to generate musical notes (not currently used) FFFF 1 if clock eq 5185 1 1045 1 mds5 equ 4165 ; 622.3 Hz. 0F58 1 me5 equ 3928 ; 659.3 Hz. 0E7F 1 mf5 equ 3711 ; 698.5 Hz. 0DAF 1 mfs5 equ 3503 ; 740.0 Hz. 0CEA 1 mg5 equ 3306 ; 784.0 Hz. 0C31 1 mgs5 equ 3121 ; 830.6 Hz. 0B82 1 ma5 equ 2946 ; 880.0 Hz. 0ADC 1 mas5 equ 2780 ; 932.3 Hz. 0A40 1 mb5 equ 2624 ; 987.8 Hz. 09AD 1 mc6 equ 2477 ; 1046.5 Hz. 0922 1 mcs6 equ 2338 ; 1108.7 Hz. 089E 1 md6 equ 2206 ; 1174.7 Hz. 0823 1 mds6 equ 2083 ; 1244.5 Hz. 07AE 1 me6 equ 1966 ; 1318.5 Hz. 073F 1 mf6 equ 1855 ; 1396.9 Hz. 06D7 1 mfs6 equ 1751 ; 1480.0 Hz. 0675 1 mg6 equ 1653 ; 1568.0 Hz. 0618 1 mgs6 equ 1560 ; 1661.2 Hz. 05C1 1 ma6 equ 1473 ; 1760.0 Hz. 056E 1 mas6 equ 1390 ; 1864.7 Hz. 0520 1 mb6 equ 1312 ; 1975.5 Hz. 04D6 1 mc7 equ 1238 ; 2093.5 Hz. 0491 1 mcs7 equ 1169 ; 2217.5 Hz. 044F 1 bd7 equ 1103 ; 2349.3 Hz. 0411 1 mds7 equ 1041 ; 2489.0 Hz. 1 endif ; clock eq 5185 0000 1 if clock eq 8000 1 1 mds5 equ 6428 ; 622.3 Hz. 1 me5 equ 6067 ; 659.3 Hz. 1 mf5 equ 5727 ; 698.5 Hz. 1 mfs5 equ 5405 ; 740.0 Hz. 1 mg5 equ 5102 ; 784.0 Hz. 1 mgs5 equ 4816 ; 830.6 Hz. 1 ma5 equ 4545 ; 880.0 Hz. 1 mas5 equ 4290 ; 932.3 Hz. 1 mb5 equ 4049 ; 987.8 Hz. 1 mc6 equ 3822 ; 1046.5 Hz. 1 mcs6 equ 3608 ; 1108.7 Hz. 1 md6 equ 3405 ; 1174.7 Hz. 1 mds6 equ 3214 ; 1244.5 Hz. 1 me6 equ 3033 ; 1318.5 Hz. 1 mf6 equ 2863 ; 1396.9 Hz. 1 mfs6 equ 2703 ; 1480.0 Hz. 1 mg6 equ 2551 ; 1568.0 Hz. 1 mgs6 equ 2408 ; 1661.2 Hz. 1 ma6 equ 2272 ; 1760.0 Hz. 1 mas6 equ 2145 ; 1864.7 Hz. 1 mb6 equ 2025 ; 1975.5 Hz. 1 mc7 equ 1911 ; 2093.5 Hz. 1 mcs7 equ 1804 ; 2217.5 Hz. 1 bd7 equ 1703 ; 2349.3 Hz. 1 mds7 equ 1697 ; 2489.0 Hz. 1 endif ; clock eq 8000 ;============================================================================= ; 8259 Programmable Interrupt Controller Equates 9800 pic0 equ 09800H ; 8259 port with A0=0 9801 pic1 equ 09801H ; 8259 port with A0=1 ; Initialization Command Words 0012 icw1 equ 00010010b ; 8259 ICW1 with A0=0 and D4=1 ; |||||||| ; |||||||+-- always zero ; ||||||+--- 1=Single, 0=Not Single ; |||||+---- Address Interval 1=4, 0=8 ; ||||+----- always zero ; |||+------ always one ; ||+------- A5 -+ ; |+-------- A6 -+---- A7 to A5 of Lower Routine Address ; +--------- A7 -+ 0000 icw2 equ 00000000b ; 8259 ICW2 ; |||||||| ; |||||||+-- A8 --+ ; ||||||+--- A9 --+ ; |||||+---- A10 -+ ; ||||+----- A11 -+---- Upper Routine Address ; |||+------ A12 -+ ; ||+------- A13 -+ ; |+-------- A14 -+ ; +--------- A15 -+ ; Operation Command Words 00D1 ocw1 equ 11010001b ; 8259 OCW1 witn A0=1 ; |||||||| ; |||||||+-- IR0 (enable IR1,IR2,IR3 and IR5) ; ||||||+--- IR1 ; |||||+---- IR2 ; ||||+----- IR3 0 = Mask Reset (Interrupt Enabled) ; |||+------ IR4 1 = Mask Set (Interrupt Disabled) ; ||+------- IR5 ; |+-------- IR6 ; +--------- IR7 0000 ocw2 equ 00000000b ; 8259 OCW2 with A0=0 ; |||||||| ; |||||||+-- A -+ ; ||||||+--- B -+--- BCD Value of the INT Level to be reset ; |||||+---- C -+ or put into lowest priority ; ||||+----- always zero ; |||+------ always zero ; ||+------- Non-Specific EOI 1=Reset Highest Priority bit of IS ; || 0=No Action ; |+-------- Specfic EOI 1=L2,L1,L0 Bits used, 0=No Action ; +--------- Rotate Priority 1=Rotate, 0=Not Rotate ;============================================================================= ; 8251 Universal Synchronous Receiver-Transmitter Equates A000 ttyd equ 0A000H ; 8251 data port A001 ttyc equ 0A001H ; 8251 control port ; 8251 Mode Instruction 004E mode equ 01001110B ; 8251 mode instruction (Asynchronous) ; |||||||| ; |||||||+-- B1 Baud Rate Factor 00=Sync Mode ; ||||||+--- B2 01=1X 10=16X 11=64X ; |||||+---- L1 Character Length 00=5 Bits ; ||||+----- L2 01=6 Bits 10=7 Bits 11=8 Bits ; |||+------ Parity 1=Enable 0=Disable ; ||+------- Parity Generation/Check 1=Even 0=Odd ; |+-------- S1 Stop Bits 00=invalid 01=1 Bit ; +--------- 10=1.5 Bits 11=2 Bits ; 8251 Command Instruction 0037 cmd equ 00110111B ; 8251 command word ; |||||||| ; |||||||+-- TxEN 1=enable 0=disable ; ||||||+--- DTR 1=Force DTR output low ; |||||+---- RxE 1=enable 0=disable ; ||||+----- SBRK 1=force TxD low 0=normal operation ; |||+------ ER Error Reset 1=reset error flags PE OE FE ; ||+------- RTS 1=Force RTS output low ; |+-------- IR Internal Reset 1=force 8251 into Mode Format ; +--------- EH Enter Hunt Mode 1=enable search for sync ; 8251 Status Read Byte Format ; bbbbbbbb ; 76543210 ; |||||||| ; |||||||+-- TxREADY ; ||||||+--- RxREADY ; |||||+---- TxEMPTY ; ||||+----- PE ; |||+------ OE ; ||+------- FE ; |+-------- SYNDET ; +--------- DSR 0080 dsrmsk equ 10000000b ; DSR Mask 0002 rxrdy equ 00000010b ; RxREADY Mask ; 8251 Command Instruction to return to Mode Instruction Format 0040 cmdrst equ 01000000b ; 8251 reset command word ; 8251 RxRDY and TxEMPTY Bit Masks 0002 inmask equ 00000010B ; Rx Ready Mask 0004 outmask equ 00000100B ; Tx Ready Mask ;============================================================================= ; Various Signal Definitions ; Input Port 0 B000 port0 equ 0B000H 0001 spreq equ 00000001b ; SSI-263 Request Data 0002 lmic equ 00000010b ; Local Mic PTT 0020 pdint equ 00100000b ; SSI-75T2089 Phone DTMF Interrupt IR1 ;ckint equ 01000000b ; MM58167 Clock Interrupt IR2 0080 rdint equ 10000000b ; SSI-263 Radio DTMF Interrupt IR3 ; Input Port 1 B001 port1 equ 0B001H ; Receivers 0001 vrcos equ 00000001b ; 6M COS Mask 0002 vrtos equ 00000010b ; 6M TOS Mask 0004 urcos equ 00000100b ; 450 COS Mask 0008 urtos equ 00001000b ; 450 TOS Mask 0010 a1cos equ 00010000b ; Aux RX #1 COS Mask 0020 a2cos equ 00100000b ; Aux RX #2 COS Mask 0040 ring equ 01000000b ; phone ring detector ; Input Port 2 B002 port2 equ 0B002H ; Spare ; Output Port 4 B004 port4 equ 0B004H 0001 mcwt equ 00000001b ; MCW Tone Mask 0002 iclr equ 00000010b ; landline relay 0004 ptmon equ 00000100b ; Patch Monitor 0080 wdog equ 10000000b ; Watchdog Timer Mask ; Output Port 5 B005 port5 equ 0B005H ; Spare ; Output Port 6 B006 port6 equ 0B006H ; Audio Gates 0001 vag equ 00000001b ; 6M A Gate Mask 0002 vbg equ 00000010b ; 6M B Gate Mask 0004 vdg equ 00000100b ; 6M D gate Mask 0008 uag equ 00001000b ; 450 A Gate Mask 0010 ubg equ 00010000b ; 450 B Gate Mask 0020 udg equ 00100000b ; 450 D Gate Mask 0040 a1ag equ 01000000b ; Aux RX #1 A Gate Mask 0080 a2ag equ 10000000b ; Aux RX #2 A Gate Mask ; Output Port 7 B007 port7 equ 0B007H ; Transmitters, Autopatch 0001 vtx equ 00000001b ; 6M TX Mask 0002 utx equ 00000010b ; 450 TX Mask 0004 ptchr equ 00000100b ; Patch Relay 0008 a1tx equ 00001000b ; Aux TX #1 Mask 0010 a2tx equ 00010000b ; Aux TX #2 Mask 0020 idptt equ 00100000b ; ID/Speech PTT Mask 0040 ptchg equ 01000000b ; Patch Gate 0080 antt equ 10000000b ; Antenna Relay ; Output Port 8 E000 port8 equ 0E000H ; DTMF Decoder/Dialer on Aux Board 000F dgend equ 00001111b ; DTMF Generator Data Mask 0010 dgenc equ 00010000b ; DTMF Generator Clock Mask ; Input Port 8 ;dbase equ 0E000H ; DTMF Decoders on Aux Board ;rdmsk equ 00001111b ; these are already defined and ;tdmsk equ 11110000b ; are here for info only ;============================================================================= ; Memory equates 0000 rombase equ 00000H ; 32K ROM between 0000-7FFFH 7FFF romtop equ 07FFFH 8000 rambase equ 08000H ; 4K RAM between 8000-8FFFH 8FFF ramtop equ 08FFFH ;============================================================================= ; ASCII Equates 0007 bell equ 7 ; CRTL G (bell) 0008 ctrh equ 8 ; CTRL H (BACKSPACE) 0003 ctrc equ 3 ; CTRL C 0013 ctrs equ 19 ; CTRL S 0011 ctrq equ 17 ; CTRL Q 0008 backup equ ctrh ; BACKUP CHAR 007F del equ 127 ; RUBOUT 001B esc equ 27 ; ESCAPE 00F7 apos equ (39-'0') and 0ffh 000D cr equ 13 ; CARRIAGE RETURN 000A lf equ 10 ; LINE FEED ;============================================================================= ; MACRO to resolve 8085 SIM instruction sim macro defb 30h endm ;============================================================================= 0000 org rombase 0000 F3 di 0001 C3 0249 jp start 0008 org 00008h ; RST 1 0008 C3 0356 jp tdisr ; Telephone DTMF Interrupt 0010 org 00010h ; RST 2 0010 C9 ret 0018 org 00018h ; RST 3 0018 C3 0330 jp rdisr ; Radio DTMF Interrupt 0020 org 00020H ; RST 4 0020 C9 ret 0024 org 00024h ; TRAP interrupt 0024 C9 ret 0028 org 0028h ; RST 5 0028 C3 0306 jp kisr ; Console Interrupt Service Routine 002C org 0002ch ; RST 5.5 002C C9 ret 0030 org 00030h ; RST 6 0030 C9 ret 0034 org 00034h ; RST 6.5 0034 C9 ret 0038 org 0038h ; RST 7 0038 C3 2363 jp erst ; error trap, run-away system attempting ; to execute non-existent memory locations, ; the floating bus appears as an RST 7 003C org 003ch ; RST 7.5 003C C3 04CC jp tisr ; Timer Interrupt Service Routine ; Install copyright notice in the EPROM 003F 43 6F 70 79 defb 'Copyright 1990,1993 by Rick Swenton, WA1LMV' include sysdef.z80 A A ;============================================================================= A ; File SYSDEF.Z80 -- System Default Configuration Parameters A ;============================================================================= A A ; The WA1LMV Repeater Controller Software has established A ; system start-up default parameters saved in EPROM and A ; copied to RAM during the first cold start. A A ; The master reset command (*6998) also completely refreshes A ; the contents of RAM with the default startup values in EPROM. A A A ;============================================================================= A ; System Data Table -- copied to RAM during cold start A ;============================================================================= A A ; Select CRT Terminal Type A 0000 A ADDS equ no ; ADDS A2 00FF A A2020 equ yes ; ADDS 2020 0000 A HEATH equ no ; Heath H19/H29 A A A ; WARNING! This table must be in the same order and contain A ; the same number of bytes that are defined in the RAM Data Table A ; which is the final destination of this table A 006A A systbl: A A ; Default System Start-Up Conditions A A ; Initialize I/O Port Control Bytes A ; (some bits read/written direct and can not be disabled) A A ; Input Ports: A 006A FF A defb 11111111b ; port0c Input Port 0 A ; |||||||| A ; |||||||+-- SSI-263 Request Data (read direct) A ; ||||||+--- lmic Local Mic PTT A ; |||||+---- not used A ; ||||+----- not used A ; |||+------ IR0 A ; ||+------- IR1 SSI-75T2089 Data Valid (read direct) A ; |+-------- IR2 MM58167 INT (read direct) A ; +--------- IR3 SSI-202P Data Valid (read direct) A A 006B CA A defb 11001010b ; port1c Receivers P1 A ; |||||||| A ; |||||||+-- vrcos 6M COS A ; ||||||+--- vrtos 6M TOS A ; |||||+---- urcos 450 COS A ; ||||+----- urtos 450 TOS A ; |||+------ a1cos AUX RX #1 COS A ; ||+------- a2cos AUX RX #2 COS A ; |+-------- ring Landline Ring Detector A ; +--------- not used A A 006C FF A defb 11111111b ; port2c Input Port 2 A ; |||||||| A ; |||||||+-- not used A ; ||||||+--- not used A ; |||||+---- not used A ; ||||+----- not used A ; |||+------ not used A ; ||+------- not used A ; |+-------- not used A ; +--------- not used A A A ; Output Ports: A 006D FF A defb 11111111b ; port4c Output Port 4 A ; |||||||| A ; |||||||+-- mcwt Audio Tone Gate (write direct) A ; ||||||+--- iclr Landline Relay A ; |||||+---- ptmon Monitor Mode A ; ||||+----- not used A ; |||+------ not used A ; ||+------- not used A ; |+-------- not used A ; +--------- wdog Watchdog Timer (write direct) A A 006E FF A defb 11111111b ; port5c Output Port 5 A ; |||||||| A ; |||||||+-- not used A ; ||||||+--- not used A ; |||||+---- not used A ; ||||+----- not used A ; |||+------ not used A ; ||+------- not used A ; |+-------- not used A ; +--------- not used A A 006F FF A defb 11111111b ; port6c Audio Gates P5 A ; |||||||| A ; |||||||+-- vag 6M A Gate A ; ||||||+--- vbg 6M B Gate A ; |||||+---- vdg 6M D Gate A ; ||||+----- uag 450 A Gate A ; |||+------ ubg 450 B Gate A ; ||+------- udg 450 D Gate A ; |+-------- a1ag AUX RX #1 A Gate A ; +--------- a2ag AUX RX #2 A Gate A A 0070 E7 A defb 11100111b ; port7c Transmitters P6 A ; |||||||| A ; |||||||+-- vtx 6M Transmitter A ; ||||||+--- utx 450 Transmitter A ; |||||+---- ptchr Patch Relay A ; ||||+----- a1tx Aux TX #1 A ; |||+------ a2tx Aux TX #2 A ; ||+------- idptt ID PTT A ; |+-------- ptcgh Patch Gate A ; +--------- not used A A 0071 00 A defb no ; CRT update enable uflag 0072 00 A defb 0 ; CRT update mode umode 0073 FF A defb yes ; Macro Functions enable mflag 0074 FF A defb yes ; UAD Functions enable uadflg A 0075 02 A defb 2 ; MCW Mode control cwena A ; 0 = Disabled, 1=MCW only, 2=Speech A 0076 01 A defb 1 ; default 6M courtesy tone mode vctmod 0077 01 A defb 1 ; default 450 courtesy tone mode uctmod A ; 0 = Disabled, 1 = First Key-Up A ; 2 = Each Key-Up A 0078 FF A defb yes ; DTMF Mute enable dmutc 0079 FF A defb yes ; Autopatch enable ptchc 007A 00 A defb no ; 6M DTMF PL enable dtplv 007B 00 A defb no ; 450 DTMF PL enable dtplu 007C 00 A defb no ; 6M PL Time-out Inhibit vpltf 007D 00 A defb no ; 450 PL Time-out Inhibit upltf 007E FF A defb yes ; 6M Temp PL override enable vplom 007F FF A defb yes ; 450 Temp PL override enable uplom 0080 00 A defb no ; hourly chime enable chena 0081 FF A defb yes ; 450 TX activity limit limuhf A 0082 A systbc equ $ A A ; Control System Unlock Codes A A ; User Functions (*2500 Series) A A ; First two digits to unlock the user functions A 0082 32 A defb '2' ; first unlock digit 0083 35 A defb '5' ; second unlock digit A A ; Control Functions (*6900 Series) A A ; First two digits to unlock the control functions A 0084 36 A defb '6' ; first unlock digit 0085 39 A defb '9' ; second unlock digit A A A ; Time constants -- ** are in 10 ms. increments A ; * are in 1 ms. increments A 0086 01F6 A defw 5*100+2 ; default main tx hang time (5 sec) ** 0088 55 A defb 850/10 ; default aux tx hang time (850 ms) ** 0089 14 A defb 2*10 ; default IDPTT delay time (2 sec) ** 008A 0510 A defw b2000 ; default MCW tone pitch 008C A412 A defw 7*60*100+2 ; default ID timer time (7 mins.) ** 008E 4652 A defw 3*60*100+2 ; default Time Out timer (3 Mins.) ** 0090 19 A defb 250/10 ; default 6M access delay (250 ms) ** 0091 4B A defb 750/10 ; default 6M release delay (750 ms) ** 0092 04 A defb 40/10 ; default 6M audio access delay (40 ms) ** 0093 19 A defb 250/10 ; default 450 access delay (250 ms) ** 0094 4B A defb 750/10 ; default 450 release delay (750 ms) ** 0095 04 A defb 40/10 ; default 450 audio access delay (40 ms) ** 0096 19 A defb 250/10 ; default Aux R1 access delay (250 ms) ** 0097 4B A defb 750/10 ; default Aux R1 release delay (750 ms) ** 0098 19 A defb 250/10 ; default Aux R2 access delay (250 ms) ** 0099 4B A defb 750/10 ; default Aux R2 release delay (750 ms) ** 009A EA62 A defw 10*60*100+2 ; default Aux TX On Time (10 Mins) ** 009C 1770 A defw 1*60*100 ; default Temp PL Override Time (1 Min) ** 009E EA68 A defw 10*60*100+8 ; default 450 TX activity limit (10 Mins) ** 00A0 7538 A defw 5*60*100+8 ; default 450 TX activity reset (5 Mins) ** A 00A2 2D A defb 45 ; default MCW dot length (MCW Speed) ** A 00A3 2EE2 A defw 2*60*100+2 ; default patch timer (2 Mins) ** 00A5 C8 A defb 2*100 ; default control time-out (2 sec) ** 00A6 C8 A defb 2*100 ; default radio DTMF Mute delay (2 sec) ** 00A7 C8 A defb 2*100 ; default telephone DTMF Mute delay (2 sec) ** 00A8 0A A defb 100/10 ; default Radio DTMF Data Valid Delay (100 ms)** 00A9 07D0 A defw 20*100 ; default DTMF pass-through time (20 sec) ** 00AB 04 A defb 4 ; default max rings to answer (4) 00AC 0320 A defw 8*100 ; default ring-to-ring delay (8 sec) ** 00AE 01F4 A defw 5*100 ; default answer control time (5 sec) ** 00B0 1194 A defw 45*100 ; default answer hold time (45 sec) ** 00B2 EA62 A defw 10*60*100+2 ; default maximum landline time (10 mins) ** 00B4 0FA0 A defw 40*100 ; default landline courtesy time (40 sec) ** 00B6 19 A defb 250/10 ; CRT refresh time (250 ms) ** 00B7 52 A defb 'R' ; Aux RX #1 Indicator Char 00B8 52 A defb 'R' ; Aux RX #2 Indicator Char 00B9 54 A defb 'T' ; Aux TX #1 Indicator Char 00BA 54 A defb 'T' ; Aux TX #2 Indicator Char 00BB 90 A defb 090h ; Speech Rate 00BC 01 A defb 1 ; Inflection Rate (0 to 7) 00BD 07 A defb 7 ; Articulation rate (0 to 7) 00BE 32 A defb 500/10 ; default ring detect delay (500 ms) ** 00BF 19 A defb 19h ; default century A A ; Speed Dialer Table of 10 Default Numbers. A ; 12 bytes per entry including trailing 0ffh end of entry marker. A ; The first entry #0 is empty because that slot is used to store A ; the last manually dialed number for redialing. If the first byte A ; of the table is 0FFH, the entry is considered empty and no A ; action will be taken, i.e. dialing or speaking. An MCW "no" A ; message will be generated. A 00C0 FF FF FF FF A defb 0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh ;#0 00CC 05 08 09 07 A defb 5,8,9,7,2,9,7,0ffh,0ffh,0ffh,0ffh,0ffh ; LMV ;#1 00D8 05 08 03 07 A defb 5,8,3,7,9,6,6,0ffh,0ffh,0ffh,0ffh,0ffh ; SZU ;#2 00E4 04 08 05 01 A defb 4,8,5,1,4,0,6,0ffh,0ffh,0ffh,0ffh,0ffh ; ZSG ;#3 00F0 05 08 02 09 A defb 5,8,2,9,8,8,2,0ffh,0ffh,0ffh,0ffh,0ffh ; ZDF ;#4 00FC 05 08 02 05 A defb 5,8,2,5,9,4,4,0ffh,0ffh,0ffh,0ffh,0ffh ; YHM ;#5 0108 05 08 05 09 A defb 5,8,5,9,4,4,7,0ffh,0ffh,0ffh,0ffh,0ffh ; LMV ;#6 0114 05 08 09 00 A defb 5,8,9,0,9,6,0,0ffh,0ffh,0ffh,0ffh,0ffh ; Telco Test ;#7 0120 05 08 04 02 A defb 5,8,4,2,8,1,1,0ffh,0ffh,0ffh,0ffh,0ffh ; SHC ;#8 012C 05 08 02 08 A defb 5,8,2,8,1,4,3,0ffh,0ffh,0ffh,0ffh,0ffh ; State Police ;#9 A A ; Programmed Macro Functions A ; This is a table of ten ASCII entries of five characters A 0138 41 32 35 30 A defb 'A2500' ; #0 Autopatch Off 013D 41 32 35 30 A defb 'A2501' ; #1 Autopatch On 0142 41 32 35 30 A defb 'A2502' ; #2 Speed Dial 0147 41 32 35 30 A defb 'A2503' ; #3 Speak Last Number 014C 41 32 35 34 A defb 'A2541' ; #4 Antenna #1 0151 41 32 35 30 A defb 'A2505' ; #5 Curly 0156 41 32 35 30 A defb 'A2506' ; #6 Time 015B 41 32 35 34 A defb 'A2542' ; #7 Antenna #2 0160 41 32 35 30 A defb 'A2508' ; #8 MCW ID 0165 41 32 35 30 A defb 'A2509' ; #9 Voice ID A A ; Programmed Scheduled Events A ; This is a table of ten ASCII entries 9 bytes each A ; in the format: A A ; (Control FLag) (Priority Flag) HH MM C1 C2 C3 C4 C5 C6 A A ; Control Flag: 00H = Not Active A ; 80H = Active, Not Pending A ; FFH = Active, Pending A A ; Priority Byte: 00H = Low Priority A ; FFH = High Priority A ; A ; Low Priority will cause event to be A ; skipped if repeater is in use A ; A ; High Priority will cause event to A ; be executed even if repeater is in use A A ; Time: HH MM Hours and Minutes in Packed BCD A A ; Six chars per command (C1 C2 C3 C4 C5 C6) allows the A ; silent command prefix if desired, i.e. A06972 A A ; 1 2 3 4 5 6 7 8 9 A 016A 00 00 00 00 A defb 0,0,0,0,0,0,0,0,0,0 ; Event #0 0174 00 00 00 00 A defb 0,0,0,0,0,0,0,0,0,0 ; Event #1 017E 00 00 00 00 A defb 0,0,0,0,0,0,0,0,0,0 ; Event #2 0188 00 00 00 00 A defb 0,0,0,0,0,0,0,0,0,0 ; Event #3 0192 00 00 00 00 A defb 0,0,0,0,0,0,0,0,0,0 ; Event #4 019C 00 00 00 00 A defb 0,0,0,0,0,0,0,0,0,0 ; Event #5 01A6 00 00 00 00 A defb 0,0,0,0,0,0,0,0,0,0 ; Event #6 01B0 00 00 00 00 A defb 0,0,0,0,0,0,0,0,0,0 ; Event #7 01BA FF 00 00 00 A defb 0ffh,00h,00h,00h,'A2539 ' ; Event #8 01C4 FF 00 12 00 A defb 0ffh,00h,12h,00h,'A2539 ' ; Event #9 A A ; Programmed Two Meter Remote Base Frequencies A A ; Enter the whole frequency in ASCII including the decimal point A A ; Define values for modes and power levels A 0030 A sx equ '0' ; simplex mode 0031 A rpt equ '1' ; auto-repeat mode 0032 A inv equ '2' ; auto-inverse mode A 0030 A lp equ '0' ; low power 0031 A hp equ '1' ; high power A A ; 1234567 01CE 31 34 36 2E A defb '146.520',rpt,hp ; CH 0 - 146.520 Repeat High Power 01D7 31 34 36 2E A defb '146.880',rpt,lp ; CH 1 - 146.880 Repeat Low Power 01E0 31 34 37 2E A defb '147.150',rpt,lp ; CH 2 - 147.150 Repeat Low Power 01E9 31 34 36 2E A defb '146.685',rpt,lp ; CH 3 - 146.685 Repeat Low Power 01F2 31 34 36 2E A defb '146.445',sx,hp ; CH 4 - 146.445 Simplex High Power 01FB 31 34 37 2E A defb '147.510',sx,hp ; CH 5 - 147.510 Simplex High Power 0204 31 34 36 2E A defb '146.520',sx,hp ; CH 6 - 146.520 Simplex High Power 020D 31 34 36 2E A defb '146.520',sx,hp ; CH 7 - 146.520 Simplex High Power 0216 31 34 36 2E A defb '146.520',sx,hp ; CH 8 - 146.520 Simplex High Power 021F 31 34 36 2E A defb '146.520',sx,hp ; CH 9 - 146.520 Simplex High Power A 0228 09 A defb 9 ; Two Meter Active Channel A A ; CRT Definitions - always one trailing zero A 0000 A1 if ADDS A1 defb esc,'0','A',esc,'6',0 ; initialization string - 6 bytes A1 defb 0 A1 defb 14,0,0,0 ; dim string - 4 bytes A1 defb 0 A1 defb 15,0,0,0 ; bright string - 4 bytes A1 defb 0 A1 defb 0ch,0,0,0 ; clear screen - 4 bytes A1 defb 0 A1 defb 24,esc,'6',0 ; cursor on string - 4 bytes A1 defb 0 A1 defb 23,0,0,0 ; cursor off string - 4 bytes A1 defb 0 A endif ; ADDS A 00FF A1 if A2020 0229 1B 30 50 1B A1 defb esc,'0','P',esc,'6',0 ; initialization string - 6 bytes 022F 00 A1 defb 0 0230 0E 00 00 00 A1 defb 14,0,0,0 ; dim string - 4 bytes 0234 00 A1 defb 0 0235 0F 00 00 00 A1 defb 15,0,0,0 ; bright string - 4 bytes 0239 00 A1 defb 0 023A 0C 00 00 00 A1 defb 0ch,0,0,0 ; clear screen - 4 bytes 023E 00 A1 defb 0 023F 18 1B 36 00 A1 defb 24,esc,'6',0 ; cursor on string - 4 bytes 0243 00 A1 defb 0 0244 17 00 00 00 A1 defb 23,0,0,0 ; cursor off string - 4 bytes 0248 00 A1 defb 0 A endif ; A2020 A 0000 A1 if HEATH A1 defb 0,0,0,0,0,0 ; initialization string - 6 bytes A1 defb 0 A1 defb esc,'p',0,0 ; reverse video string - 4 bytes A1 defb 0 A1 defb esc,'q',0,0 ; normal video string - 4 bytes A1 defb 0 A1 defb esc,'E',0,0 ; clear screen - 4 bytes A1 defb 0 A1 defb esc,'y','5',0 ; cursor on string - 4 bytes A1 defb 0 A1 defb esc,'x','5',0 ; cursor off string - 4 bytes A1 defb 0 A endif ; HEATH A 0249 A sysend equ $ ; end of table marker A A A ; Calculate the size of this table to later compare with the size of A ; its destination table in RAM A 01DF A syslen equ sysend-systbl A A ;--------------------- End of System Data Table ---------------------------- A A ;--------------------- end of file SYSDEF.Z80 ------------------------------ A ; Power-up start 0249 3E 03 start: ld a,3 024B 32 8FFF ld (merr),a ; preset controller error byte 024E F3 startr: di ; Disable interrupts 024F 3E 1B ld a,00011011b ; Interrupt Mask for INT 7.5 0251 sim 0251 30 A defb 30h 0252 31 8FFE ld sp,stack ; Set the stack pointer ; Initialize the Hardware ; Set-up the 8259 PIC 0255 3E 12 ld a,icw1 ; Set 8259 ICW1 0257 32 9800 ld (pic0),a 025A 3E 00 ld a,icw2 ; Set 8259 ICW2 025C 32 9801 ld (pic1),a 025F 3E D1 ld a,ocw1 ; Set 8259 OCW1 0261 32 9801 ld (pic1),a 0264 3E 00 ld a,ocw2 ; Set 8259 OCW2 0266 32 9800 ld (pic0),a ; Set-up the 8255 PPI 0269 3E A6 ld a,ppimod ; Set PPI mode 026B 32 9003 ld (ppictl),a 026E 3E 0A ld a,ppipc5 ; Set PC5 bit 0270 32 9003 ld (ppictl),a ;============================================================================= ; Set-up the 8253 PIT to generate 1ms. ticks ; (RST 7.5 is used because it is edge triggered) ;============================================================================= 0273 3E B6 ld a,pitcw ; PIT Control Word (counter 2, mode 3) 0275 32 A803 ld (pitctl),a 0278 3E 20 ld a,low((clock/2)*1) ; Initial counter value LSB 027A 32 A802 ld (pitc2),a 027D 3E 0A ld a,high((clock/2)*1) ; Initial counter value MSB 027F 32 A802 ld (pitc2),a ; ---------------------------------------------------------------------------- ; Set-up the 8251 USART for Console I/O 0282 3E 4E ld a,mode 0284 32 A001 ld (ttyc),a ; Set USART mode 0287 3E 37 ld a,cmd 0289 32 A001 ld (ttyc),a ; Set command ; ---------------------------------------------------------------------------- 028C 21 8000 cold: ld hl,rambase ; Initialize all RAM 028F 01 0FFE ld bc,(ramtop-1)-rambase ; (merr) is saved at RAMTOP 0292 36 00 zloop: ld (hl),0 ; To zero 0294 23 inc hl 0295 0B dec bc ; no flags affected here! 0296 78 ld a,b ; test for zero in A 0297 B1 or a,c 0298 C2 0292 jp nz,zloop ; Copy the System Data Table from its current location ; in ROM to an area in RAM 029B 21 006A ld hl,systbl ; source = system data table 029E 11 820D ld de,ramdat ; dest = location in RAM 02A1 01 01DF ld bc,sysend-systbl; # table entries 02A4 CD 4687 call moveit ; block move ROM to RAM ; Hardware initialization complete 02A7 F3 cold1: di 02A8 31 8FFE ld sp,stack 02AB AF xor a 02AC 32 8020 ld (iptr),a ; set-up input buffer pointer 02AF 32 8021 ld (optr),a ; set-up output buffer pointer 02B2 32 C000 ld (sbase),a ; mute speech chip just in case 02B5 32 E000 ld (port8),a ; reset port 8 separately 02B8 3E FF ld a,0ffh ; block DTMF interrupts from 02BA 32 807C ld (bdtmft),a ; telephone line decoder 02BD FB ei ; start letting those interrupts in ; Initialize SSI-263 Speech Synthesizer 02BE 3E 80 ld a,80h ; set to transitioned inflection 02C0 32 C003 ld (cttramp),a ; first set control bit 02C3 3E C0 ld a,11000000b ; set DR1 and DR0 02C5 32 C000 ld (durphon),a 02C8 3E 70 ld a,70h ; now reset the control bit 02CA 32 C003 ld (cttramp),a ; The following stablizes the SSI-263 so that its first ; sounds after initial power up sound acceptable 02CD 3E 78 ld a,78h ; default amplitude 02CF 32 C003 ld (cttramp),a 02D2 3E 11 ld a,17 ; default inflection 02D4 32 C001 ld (inflect),a 02D7 3E E6 ld a,0e6h ; default filter freq 02D9 32 C004 ld (filfreq),a 02DC AF xor a 02DD 32 C000 ld (durphon),a ; turn off just in case ; Test for existance of the SSI-263 Speech Synthesizer chip ; after we tried to initialize it. 02E0 CD 4791 call chksp ;----------------------------------------------------------------------------- ; Check for the existance of the MM58167 Clock/Calendar ;----------------------------------------------------------------------------- 02E3 3A D00C chkck: ld a,(lhrs) ; get the current value of hours latch 02E6 47 ld b,a ; save 02E7 3E 55 ld a,55h ; load a value 02E9 32 D00C ld (lhrs),a ; into the latch 02EC 3A D00C ld a,(lhrs) ; get it back 02EF FE 55 cp 55h ; same value? 02F1 CA 02FC jp z,clkc1 02F4 3E FF ld a,0ffh ; flag clock inhibit 02F6 32 809D ld (clkp),a 02F9 C3 0300 jp clkc2 02FC 78 clkc1: ld a,b ; get the saved hours latch value 02FD 32 D00C ld (lhrs),a ; restore it 0300 CD 21F6 clkc2: call cmenu 0303 C3 22D0 jp warm ;============================================================================= ; Include the Interrupt Service Routines ;============================================================================= include kisr.z80 A A ;============================================================================= A ; Console Keyboard Interrupt Service Routine A ;============================================================================= A A ; Careful! So far, this routine only uses register A. A ; The subroutine PUTBUF saves its own registers. A 0306 F5 A kisr: push af ; Pending character - Interrupt (IR5) A 0307 3A A000 A ld a,(ttyd) ; get the character 030A E6 7F A and 01111111b ; strip parity A 030C FE 13 A cp ctrs ; Control-S? 030E C2 0319 A jp nz,kisr1 A 0311 3E FF A ld a,0ffh ; set the XON flag to WAIT status 0313 32 8086 A ld (xon),a 0316 C3 0328 A jp kisrd ; don't save in buffer A 0319 FE 11 A kisr1: cp ctrq ; Control-Q? 031B C2 0325 A jp nz,kisr2 A 031E AF A xor a ; set the XON flag to RUN status 031F 32 8086 A ld (xon),a 0322 C3 0328 A jp kisrd ; don't save in buffer A 0325 CD 1EE1 A kisr2: call putbuf ; put character into buffer A 0328 3E 65 A kisrd: ld a,01100101b ; SET 8259 OCW2 (reset IR5 IS bit) 032A 32 9800 A ld (pic0),a ; to indicate specific EOI A 032D F1 A pop af 032E FB A ei 032F C9 A ret A A ;----------------------- end of file KISR.Z80 -------------------------------- include disr.z80 A A ;============================================================================= A ; DTMF Interrupt Service Routine A ;============================================================================= A A ; Radio DTMF Interrupt Dispatcher A 0330 FB A rdisr: ei 0331 E5 A push hl 0332 D5 A push de 0333 C5 A push bc 0334 F5 A push af A 0335 3A 807B A ld a,(bdtmfr) ; see if Radio DTMF interrupts are blocked 0338 B7 A or a 0339 C2 034C A jp nz,risre ; NZ = Blocked, do nothing A 033C AF A xor a ; flag Decoder 0 - the SSI-202 033D 32 807A A ld (dtmfn),a A 0340 2A 8231 A ld hl,(mdfto) ; get the default RX time out value 0343 22 8054 A ld (vrtim),hl ; preset time-out timers 0346 22 8056 A ld (urtim),hl A 0349 CD 0374 A call disr A A ; Process end of specific interrupt for Decoder 0 (radio) A 034C 3E 63 A risre: ld a,01100011b ; SET 8259 OCW2 (reset IR3 IS bit) 034E 32 9800 A ld (pic0),a ; to indicate specific EOI A 0351 F1 A pop af 0352 C1 A pop bc 0353 D1 A pop de 0354 E1 A pop hl 0355 C9 A ret A A A ;----------------------------------------------------------------------------- A A ; Phone DTMF Interrupt Dispatcher A 0356 FB A tdisr: ei 0357 E5 A push hl 0358 D5 A push de 0359 C5 A push bc 035A F5 A push af A 035B 3A 807C A ld a,(bdtmft) ; see if phone DTMF interrupts are blocked 035E B7 A or a 035F C2 036A A jp nz,tdsre ; NZ = Blocked, do nothing A 0362 3E 01 A ld a,1 ; flag Decoder 1 - the SSI-75T2089 0364 32 807A A ld (dtmfn),a A 0367 CD 0374 A call disr A A ; Process end of specific interrupt for Decoder 1 (phone) A 036A 3E 61 A tdsre: ld a,01100001b ; SET 8259 OCW2 (reset IR1 IS bit) 036C 32 9800 A ld (pic0),a ; to indicate specific EOI A 036F F1 A pop af 0370 C1 A pop bc 0371 D1 A pop de 0372 E1 A pop hl 0373 C9 A ret A A ;----------------------------------------------------------------------------- A A ; Main DTMF Service Routine A 0374 AF A disr: xor a 0375 32 8086 A ld (xon),a ; release X-ON just in case it is locked-up A A ; Max Landline Control Time and 450 RX inactivity limit A ; are preset during each Data Valid interrupt A ; from the either DTMF decoder. A A 0378 3A 809A A ld a,(llful) ; see if landline control unlocked 037B B7 A or a ; 0ffh = Unlocked 037C CA 0385 A jp z,disr1 ; skip if not unlocked A 037F 2A 8255 A ld hl,(mdfmxl) ; get the default max landline time 0382 22 8096 A ld (maxll),hl ; preset counter to default time WA1LMV 8085 Repeater Control Software SLR180+ 1.12 Page 21 DTMF Interrupt Service Routine A 0385 2A 8241 A disr1: ld hl,(mdfulm) ; get the default 450 RX inactivity time 0388 22 80B1 A ld (utxlim),hl ; preset counter to default time A 038B 3A 807A A ld a,(dtmfn) ; which decoder? (0 = Radio, 1 = Phone) 038E B7 A or a 038F CA 039F A jp z,disr2 A A ; Process Decoder 1 (Telephone) A 0392 3A E000 A ld a,(dbase) 0395 E6 F0 A and tdmsk ; look only at upper 4-bits from DTMF 0397 1F A rra ; rotate into lower position 0398 1F A rra 0399 1F A rra 039A 1F A rra 039B 47 A ld b,a ; save the char 039C C3 03BF A jp disr4 A A ; Process Decoder 0 (Radio) A 039F 3A E000 A disr2: ld a,(dbase) ; read the input port 03A2 E6 0F A and rdmsk ; look only at lower 4-bits from DTMF 03A4 47 A ld b,a ; save the char A 03A5 3A 8081 A ld a,(crflag) ; get the CR flag 03A8 B7 A or a 03A9 C2 03C4 A jp nz,disr5 ; skip delay if it's not the first character A 03AC 3A 824B A ld a,(mdfrdv) ; get the default radio DTMF delay 03AF 32 807D A ld (rdvdly),a ; preset the delay A 03B2 3A B000 A disr3: ld a,(port0) ; read port 0 direct 03B5 E6 80 A and rdvmsk ; look at radio DTMF Data Valid 03B7 C8 A ret z ; bail out if it is not still there A 03B8 3A 807D A ld a,(rdvdly) ; get the remaining delay time 03BB B7 A or a 03BC C2 03B2 A jp nz,disr3 ; loop until delay done, only for first char A 03BF 3E FF A disr4: ld a,0ffh 03C1 32 8081 A ld (crflag),a ; set the CR Flag A 03C4 3A 8248 A disr5: ld a,(mdfctl) 03C7 32 8080 A ld (atime),a ; preset control time-out A 03CA 78 A ld a,b ; get the char back A 03CB FE 0B A cp 00001011b ; is it a *? 03CD C2 03DA A jp nz,disr6 A 03D0 3E FF A ld a,0ffh ; set the sflag 03D2 32 8089 A ld (sflag),a A 03D5 3E 41 A ld a,'A' 03D7 C3 0435 A jp disr11 A 03DA FE 0C A disr6: cp 00001100b ; is it a #? 03DC C2 03F0 A jp nz,disr7 A 03DF 3A 8089 A ld a,(sflag) ; see if control sequence pending 03E2 B7 A or a 03E3 C2 048C A jp nz,disrx A 03E6 3E FF A ld a,0ffh ; set the pflag 03E8 32 808A A ld (pflag),a A 03EB 3E 42 A ld a,'B' 03ED C3 0435 A jp disr11 A 03F0 FE 0A A disr7: cp 00001010b ; is it a DTMF 0? 03F2 C2 03FA A jp nz,disr8 A 03F5 3E 30 A ld a,'0' 03F7 C3 0410 A jp disr9 A 03FA FE 0D A disr8: cp 00001101b ; is it a DTMF A? 03FC CA 0487 A jp z,disry A 03FF FE 0E A cp 00001110b ; is it a DTMF B? 0401 CA 0487 A jp z,disry A 0404 FE 0F A cp 00001111b ; is it a DTMF C? 0406 CA 0487 A jp z,disry A 0409 FE 00 A cp 00000000b ; is it a DTMF D? 040B CA 0487 A jp z,disry A A ; Must be a valid digit from 0 to 9 A 040E C6 30 A add a,30h ; make into ASCII A 0410 47 A disr9: ld b,a ; save the char A 0411 3A 8084 A ld a,(alpha) ; alpha flag set? 0414 B7 A or a 0415 C2 0496 A jp nz,disr15 A 0418 3A 8089 A ld a,(sflag) ; control sequence pending? 041B B7 A or a 041C C2 0434 A jp nz,disr10 A 041F 3A 808A A ld a,(pflag) ; macro sequence pending? 0422 B7 A or a 0423 C2 0434 A jp nz,disr10 A A A ; Only A (*) or B (#) are processed if Patch is ON or A ; Landline Control is UNLOCKED. Everything else is discarded. A 0426 3A 8073 A ld a,(ptchm) ; see if the autopatch is on 0429 B7 A or a ; 0ffh = on 042A C2 043D A jp nz,disrd ; don't save anything if patch is on A 042D 3A 809A A ld a,(llful) ; see if landline control is unlocked 0430 B7 A or a ; 0ffh = unlocked 0431 C2 043D A jp nz,disrd ; don't save anything if landline control unlocked A 0434 78 A disr10: ld a,b ; get the char back A 0435 CD 1EE1 A disr11: call putbuf ; save the character in the buffer A 0438 47 A ld b,a ; save the char A 0439 AF A xor a 043A 32 8084 A ld (alpha),a ; reset the alpha flag A 043D 3A 807A A disrd: ld a,(dtmfn) ; which decoder? (0 = Radio, 1 = Phone) 0440 B7 A or a 0441 CA 0462 A jp z,disr13 A A ; Process DTMF Mute for Decoder 1 (Telephone) A 0444 3A 8089 A ld a,(sflag) ; control sequence pending? 0447 B7 A or a 0448 C2 0459 A jp nz,disr12 ; force phone DTMF mute A 044B 3A 808A A ld a,(pflag) ; macro sequence pending? 044E B7 A or a 044F C2 0459 A jp nz,disr12 ; force phone DTMF mute A 0452 3A 821B A ld a,(dmutc) ; get mute control flag 0455 B7 A or a 0456 CA 0482 A jp z,disrd1 ; skip phone DTMF mute A 0459 3A 824A A disr12: ld a,(mdftut) ; preset Telephone DTMF mute 045C 32 8077 A ld (tmute),a 045F C3 0482 A jp disrd1 A A A ; Process DTMF Mute for Decoder 0 (Radio) A 0462 3A 8089 A disr13: ld a,(sflag) ; control sequence pending? 0465 B7 A or a 0466 C2 0477 A jp nz,disr14 ; force radio DTMF mute A 0469 3A 808A A ld a,(pflag) ; macro sequence pending? 046C B7 A or a 046D C2 0477 A jp nz,disr14 ; force radio DTMF mute A 0470 3A 821B A ld a,(dmutc) ; get mute control flag 0473 B7 A or a 0474 CA 047D A jp z,disrd0 ; skip phone DTMF mute A 0477 3A 8249 A disr14: ld a,(mdfrut) ; preset Radio DTMF mute 047A 32 8076 A ld (rmute),a A ; jp disrd0 A A ;----------------------------------------------------------------------------- A A ; Done with Decoder Zero (radio) A 047D 78 A disrd0: ld a,b ; get the char back 047E 32 8078 A ld (digitr),a ; save 0481 C9 A ret A A ;----------------------------------------------------------------------------- A A ; Done with Decoder One (phone) A 0482 78 A disrd1: ld a,b ; get the char back 0483 32 8079 A ld (digitp),a ; save 0486 C9 A ret A A ;----------------------------------------------------------------------------- A 0487 3E 25 A disry: ld a,'%' ; invalid char symbol 0489 C3 0434 A jp disr10 A A ;----------------------------------------------------------------------------- A A ; A "#" came in during a control or macro sequence A 048C 3E FF A disrx: ld a,0ffh ; set alpha flag 048E 32 8084 A ld (alpha),a A 0491 06 20 A ld b,' ' ; default char 0493 C3 043D A jp disrd A A ;----------------------------------------------------------------------------- A A ; Alpha Flag is set. Next Character is translated. A ; 1=A 2=B 3=C 4=D 5=E 6=F all others are a space " " A 0496 78 A disr15: ld a,b ; get the character back A 0497 FE 30 A cp '0' ; zero? 0499 CA 04A6 A jp z,disr16 A 049C FE 37 A cp '7' ; greater than 6? 049E D2 04A6 A jp nc,disr16 A 04A1 C6 10 A add 10h ; make '1' through '6' into alpha A through F 04A3 C3 0435 A jp disr11 A 04A6 3E 20 A disr16: ld a,' ' ; make everything else into a space 04A8 C3 0435 A jp disr11 A A A A ;--------------- end of DTMF Interrupt Service Routine ----------------------- A A ; DNUL - DTMF Pass-Through Routine A 04AB 3E FF A dnul: ld a,0ffh ; block further DTMF interrupts 04AD 32 807B A ld (bdtmfr),a ; from radio decoder A 04B0 CD 2289 A call stat 04B3 44 54 4D 46 A defb 'DTMF Pass-Thru',0 A 04C2 CD 24E4 A call sndok A 04C5 2A 824C A ld hl,(mdfnul) ; get the default pass through delay 04C8 22 807E A ld (dnulm),hl ; preset the time A 04CB C9 A ret ; interrupts re-enabled in the background A A ;--------------------- end of file DISR.Z80 ---------------------------------- include tisr.z80 A A A A ;============================================================================= A ; Timer Interrupt Service Routine A ; (Highest Priority Interrupt) A ;============================================================================= A A 04CC E5 A tisr: push hl 04CD D5 A push de 04CE C5 A push bc 04CF F5 A push af A A ; Error Trap - See if the stack is messed-up A 04D0 21 0000 A ld hl,0 04D3 39 A add hl,sp ; get the stack pointer 04D4 7C A ld a,h ; get high nibble 04D5 FE 8F A cp high(stack) ; is it in range? 04D7 C2 235B A jp nz,irst ; reset if not A A A ; The Refresh I/O Ports and Audio Gate routines are processed A ; during each 1ms tick A A ;---------------------------------------------------------------------------- A ; Refresh the I/O Ports A ;---------------------------------------------------------------------------- A A ; Remember that the ports are memory-mapped and the A ; cpu thinks they are memory. A A ; First do input ports 1 -> 2 A A ; The control byte is AND-ed with the inverted input port and A ; saved in the status byte A 04DA 3A 820D A tisr1: ld a,(port0c) ; port 0 04DD 47 A ld b,a 04DE 3A B000 A ld a,(port0) 04E1 2F A cpl 04E2 A0 A and a,b 04E3 32 8045 A ld (port0s),a A A 04E6 3A 820E A ld a,(port1c) ; port 1 04E9 47 A ld b,a 04EA 3A B001 A ld a,(port1) 04ED 2F A cpl 04EE A0 A and a,b 04EF 32 8046 A ld (port1s),a A 04F2 3A 820F A ld a,(port2c) ; port 2 04F5 47 A ld b,a 04F6 3A B002 A ld a,(port2) 04F9 2F A cpl 04FA 32 8047 A ld (port2s),a A A ; Now do output ports 4 -> 7 A A ; The control byte is ANDed with the status byte, then A ; inverted, and sent to the respective output port. A 04FD 3A 8210 A ld a,(port4c) ; port 4 0500 47 A ld b,a 0501 3A 8048 A ld a,(port4s) 0504 A0 A and a,b A ; cpl 0505 32 B004 A ld (port4),a A 0508 3A 8211 A ld a,(port5c) ; port 5 050B 47 A ld b,a 050C 3A 8049 A ld a,(port5s) 050F A0 A and a,b 0510 2F A cpl 0511 32 B005 A ld (port5),a A 0514 3A 8212 A ld a,(port6c) ; port 6 0517 47 A ld b,a 0518 3A 804A A ld a,(port6s) 051B A0 A and a,b 051C 2F A cpl 051D 32 B006 A ld (port6),a A 0520 3A 8213 A ld a,(port7c) ; port 7 0523 47 A ld b,a 0524 3A 804B A ld a,(port7s) 0527 A0 A and a,b A ; cpl ; don't invert port 7 0528 32 B007 A ld (port7),a A A ;============================================================================= A ; Process Audio Gates for 6M Receiver A ;============================================================================= A 052B A tiva1: A A ; The MICOR Squelch closes faster than the TOS without reverse A ; burst. Always force the audio gate closed when COS goes away. A 052B 3A B001 A ld a,(port1) ; read receivers direct 052E 2F A cpl 052F E6 01 A and vrcos ; look at 6M COS 0531 CA 055E A jp z,tiva2 ; Z = COS inactive A A ; Receiver coming on A 0534 3A 805F A ld a,(vgdly) ; get the 6M audio gate access delay 0537 B7 A or a 0538 C2 0577 A jp nz,tivd1 ; NZ = access delay not finished A A ; Receiver is on A 053B 3A 8046 A ld a,(port1s) ; read receivers 053E E6 03 A and vrcos+vrtos ; lool at 6M COS and TOS 0540 47 A ld b,a ; save 0541 3A 806B A ld a,(pltv) ; get 6M temp PL override flag 0544 E6 02 A and vrtos ; simulate TOS? 0546 B0 A or a,b 0547 CA 055E A jp z,tiva2 ; Z = COS, TOS and PL override inactive A 054A 3A 8076 A ld a,(rmute) ; get radio DTMF mute time 054D B7 A or a 054E CA 056F A jp z,tiva3 A 0551 3A 804A A ld a,(port6s) 0554 E6 FE A and not vag ; mute 6M A gate 0556 F6 02 A or vbg ; keep the 6M B gate on 0558 32 804A A ld (port6s),a A 055B C3 0577 A jp tivd1 A 055E 3A 804A A tiva2: ld a,(port6s) ; COS or TOS inactive 0561 E6 FC A and not(vag+vbg) ; turn off 6M A B gates 0563 32 804A A ld (port6s),a A 0566 3A 8235 A ld a,(mdfvgd) ; preset the 6M audio gate access delay 0569 32 805F A ld (vgdly),a A 056C C3 0577 A jp tivd1 A 056F 3A 804A A tiva3: ld a,(port6s) 0572 F6 03 A or vag+vbg ; turn on 6M A and B gates 0574 32 804A A ld (port6s),a ; update audio gates A 0577 3A B001 A tivd1: ld a,(port1) ; read receivers DIRECT 057A 2F A cpl ; invert 057B 47 A ld b,a ; save 057C E6 01 A and vrcos ; COS on 057E CA 05A2 A jp z,tivd3 ; Z = no, turn off D gate A 0581 78 A ld a,b ; restore 0582 E6 02 A and vrtos ; look at 6M TOS 0584 C2 058E A jp nz,tivd2 ; NZ = TOS on A A ; The COS is on all alone, see if ok to enable D gate A 0587 3A 821D A ld a,(dtplv) ; 6M DTMF gate on PL? 058A B7 A or a 058B C2 05A2 A jp nz,tivd3 ; NZ = D Gate on PL, turn off D Gate A 058E 3A B001 A tivd2: ld a,(port1) ; read receivers DIRECT 0591 2F A cpl ; invert 0592 E6 08 A and urtos ; 450 PL signal has priority 0594 C2 05A2 A jp nz,tivd3 ; mute 6M D gate if 450 PL signal present A 0597 3A 804A A ld a,(port6s) 059A F6 04 A or vdg ; turn on 6M D gate 059C 32 804A A ld (port6s),a 059F C3 05AA A jp tiua1 A 05A2 3A 804A A tivd3: ld a,(port6s) 05A5 E6 FB A and not vdg ; turn off 6M D gate 05A7 32 804A A ld (port6s),a A A ;============================================================================= A ; Process Audio Gates for 450 Receiver A ;============================================================================= A 05AA A tiua1: A A ; The MICOR Squelch closes faster than the TOS without reverse A ; burst. Always force the audio gate closed when COS goes away. A 05AA 3A B001 A ld a,(port1) ; read receivers direct 05AD 2F A cpl 05AE E6 04 A and urcos ; look at 450 COS 05B0 CA 05DD A jp z,tiua2 ; Z = COS inactive A A ; Receiver coming on A 05B3 3A 8062 A ld a,(ugdly) ; get the 450 audio gate access delay 05B6 B7 A or a 05B7 C2 05F6 A jp nz,tiud1 ; NZ = access delay not finished A A ; Receiver is on A 05BA 3A 8046 A ld a,(port1s) ; read receivers 05BD E6 0C A and urcos+urtos ; look at 450 COS and TOS 05BF 47 A ld b,a ; save 05C0 3A 806C A ld a,(pltu) ; get 450 temp PL override flag 05C3 E6 08 A and urtos ; simulate 450 TOS? 05C5 B0 A or a,b 05C6 CA 05DD A jp z,tiua2 ; Z = COS, TOS and PL override inactive A 05C9 3A 8076 A ld a,(rmute) ; get radio DTMF mute time 05CC B7 A or a 05CD CA 05EE A jp z,tiua3 A 05D0 3A 804A A ld a,(port6s) 05D3 E6 F7 A and not uag ; mute 450 A gate 05D5 F6 10 A or ubg ; keep the 450 B gate on 05D7 32 804A A ld (port6s),a A 05DA C3 05F6 A jp tiud1 A 05DD 3A 804A A tiua2: ld a,(port6s) ; COS or TOS inactive 05E0 E6 E7 A and not(uag+ubg) ; turn off 450 A B gates 05E2 32 804A A ld (port6s),a A 05E5 3A 8238 A ld a,(mdfugd) ; preset the 450 audio gate access delay 05E8 32 8062 A ld (ugdly),a A 05EB C3 05F6 A jp tiud1 A 05EE 3A 804A A tiua3: ld a,(port6s) 05F1 F6 18 A or uag+ubg ; turn on 450 A and B gates 05F3 32 804A A ld (port6s),a ; update audio gates A 05F6 3A B001 A tiud1: ld a,(port1) ; read receivers DIRECT 05F9 2F A cpl ; invert 05FA 47 A ld b,a ; save 05FB E6 04 A and urcos ; look at 450 COS 05FD CA 0618 A jp z,tiud3 ; Z = COS off, turn off D gate A 0600 78 A ld a,b ; restore 0601 E6 08 A and urtos ; look at 450 TOS 0603 C2 060D A jp nz,tiud2 ; NZ = TOS on A A ; The COS is on all alone, see if ok to enable D gate A 0606 3A 821E A ld a,(dtplu) ; 450 DTMF gate on PL? 0609 B7 A or a 060A C2 0618 A jp nz,tiud3 ; NZ = D Gate on PL, turn off D Gate A 060D 3A 804A A tiud2: ld a,(port6s) 0610 F6 20 A or udg ; turn on 450 D gate 0612 32 804A A ld (port6s),a 0615 C3 0620 A jp tiaa1 A 0618 3A 804A A tiud3: ld a,(port6s) 061B E6 DF A and not udg ; turn off 450 D gate 061D 32 804A A ld (port6s),a A A ;----------------------------------------------------------------------------- A ; Process Audio Gates for Auxiliary Receivers A ;----------------------------------------------------------------------------- A 0620 3A 8073 A tiaa1: ld a,(ptchm) ; see if autopatch is on 0623 B7 A or a ; 0ffh = on 0624 C2 0647 A jp nz,tiaa2 ; close gate if on A 0627 3A 808C A ld a,(idptim) ; see if ID PTT is on 062A B7 A or a ; NZ = on 062B C2 0647 A jp nz,tiaa2 ; close gate if on A 062E CD 0BD4 A call grsd ; get main RX delayed COS status 0631 C2 0647 A jp nz,tiaa2 ; close gate if active A 0634 3A 8046 A ld a,(port1s) ; read receivers 0637 E6 10 A and a1cos ; look at aux receiver #1 0639 CA 0647 A jp z,tiaa2 A 063C 3A 804A A ld a,(port6s) 063F F6 40 A or a1ag 0641 32 804A A ld (port6s),a ; set aux R1 A gate 0644 C3 064F A jp tiaa3 A 0647 3A 804A A tiaa2: ld a,(port6s) 064A E6 BF A and not a1ag ; reset aux R1 A gate 064C 32 804A A ld (port6s),a A 064F 3A 8073 A tiaa3: ld a,(ptchm) ; see if autopatch is on 0652 B7 A or a ; 0ffh = on 0653 C2 0676 A jp nz,tiaa4 ; close gate if on A 0656 3A 808C A ld a,(idptim) ; see if ID PTT is on 0659 B7 A or a ; NZ = on 065A C2 0676 A jp nz,tiaa4 ; close gate if on A 065D CD 0BD4 A call grsd ; get main RX delayed COS status 0660 C2 0676 A jp nz,tiaa4 ; close gate if active A 0663 3A 8046 A ld a,(port1s) ; read receivers 0666 E6 20 A and a2cos ; look at aux receiver #2 0668 CA 0676 A jp z,tiaa4 A 066B 3A 804A A ld a,(port6s) 066E F6 80 A or a2ag ; set aux R2 A gate 0670 32 804A A ld (port6s),a 0673 C3 067E A jp tisrp A 0676 3A 804A A tiaa4: ld a,(port6s) 0679 E6 7F A and not a2ag ; reset aux R2 A gate 067B 32 804A A ld (port6s),a A A ;---------------------------------------------------------------------------- A ; Interrupt Cycle Process Dispatcher A ;---------------------------------------------------------------------------- A 067E 21 804F A tisrp: ld hl,idspd ; ID speed timer 0681 CD 0B9C A call bump ; service every 1ms interrupt A 0684 3A 804C A ld a,(intcnt) ; get the current interrupt cycle count 0687 B7 A or a 0688 CA 0A53 A jp z,tiapt ; service autopatch A 068B FE 01 A cp 1 068D CA 06D4 A jp z,tistx ; service transmitters A 0690 FE 02 A cp 2 0692 CA 0751 A jp z,tisst ; service timers A 0695 FE 03 A cp 3 0697 CA 07FE A jp z,tissu ; service timers A 069A FE 04 A cp 4 069C CA 08AE A jp z,tirxv ; service 6M receiver A 069F FE 05 A cp 5 06A1 CA 092F A jp z,tirxu ; service 450 receiver A 06A4 FE 06 A cp 6 06A6 CA 09B6 A jp z,tirxa ; service aux receiver #1 A 06A9 FE 07 A cp 7 06AB CA 09F0 A jp z,tirxb ; service aux receiver #2 A 06AE FE 08 A cp 8 06B0 CA 0A2A A jp z,tiidt ; service identifier A 06B3 FE 09 A cp 9 06B5 CA 0A87 A jp z,tirng ; service ring detector A A A ;----------------------------------------------------------------------------- A ; The "untick" bit reset is called here in the background. "Ticks" bit A ; set are called from the foreground so that a crash of either foreground A ; or background routines will cause a loss of watchdog heartbeat A ; and eventual hardware-generated master reset. A ;----------------------------------------------------------------------------- A 06B8 3A 804C A tisrd: ld a,(intcnt) ; get the current interrupt cycle count 06BB B7 A or a 06BC CA 06C6 A jp z,tisrd1 ; is it zero? A 06BF 3D A dec a ; nope, bump down 06C0 32 804C A ld (intcnt),a ; save back 06C3 C3 06CB A jp tisrd2 A 06C6 3E 09 A tisrd1: ld a,9 ; it's zero, preset the cycle count 06C8 32 804C A ld (intcnt),a A 06CB CD 1E9F A tisrd2: call untick ; process watchdog timer 06CE F1 A pop af 06CF C1 A pop bc 06D0 D1 A pop de 06D1 E1 A pop hl A 06D2 FB A ei 06D3 C9 A ret A A A ;============================================================================ A ; Service the Transmitters A ;============================================================================ A 06D4 2A 8074 A tistx: ld hl,(hang) ; transmitter hang timer 06D7 7C A ld a,h 06D8 B5 A or a,l 06D9 CA 070F A jp z,tist1 ; if zero, dump the transmitters A 06DC 2B A dec hl 06DD 22 8074 A ld (hang),hl ; bump down counter if not zero A 06E0 3A 804B A tistm: ld a,(port7s) ; get the port 7 status 06E3 F6 03 A or utx+vtx ; turn on 6 and 450 TX bits 06E5 47 A ld b,a ; save A 06E6 3A 808C A ld a,(idptim) ; get the ID PTT time 06E9 B7 A or a 06EA C2 0702 A jp nz,tistb A 06ED 3A 8224 A tista: ld a,(limuhf) ; get the 450 TX inactivity control flag 06F0 B7 A or a 06F1 CA 0702 A jp z,tistb A 06F4 2A 80B1 A ld hl,(utxlim) ; get the 450 TX inactivity timer 06F7 7C A ld a,h 06F8 B5 A or a,l 06F9 C2 0702 A jp nz,tistb ; keep 450 TX on if timer not zero A 06FC 78 A ld a,b ; restore 06FD E6 FD A and not utx ; dump 450 TX 06FF C3 0703 A jp tistc A 0702 78 A tistb: ld a,b ; restore 0703 32 804B A tistc: ld (port7s),a ; output the contents A 0706 2A 8243 A ld hl,(mdfina) ; preset the repeater inactivity timer 0709 22 80B3 A ld (unact),hl A 070C C3 0729 A jp tist2 A A ; Hang Timer count is zero. Test for local Mic PTT A 070F 3A 8045 A tist1: ld a,(port0s) ; get port 0 status byte 0712 E6 02 A and lmic ; only look at Local Mic bit 0714 C2 06E0 A jp nz,tistm ; Mic is pressed, key transmitters A 0717 3A 804B A ld a,(port7s) ; get port 7 status 071A E6 FC A and not (utx+vtx) ; hang timed-out 071C 32 804B A ld (port7s),a A 071F AF A xor a ; reset courtesy tone control flags 0720 32 80B6 A ld (cttflg),a 0723 32 80B7 A ld (cttflv),a 0726 32 80B8 A ld (cttflu),a A 0729 3A 8085 A tist2: ld a,(lhang) ; get the link TX hang timer 072C B7 A or a 072D CA 0746 A jp z,tist3 A 0730 3D A dec a 0731 32 8085 A ld (lhang),a A 0734 3A 8076 A ld a,(rmute) ; get radio DTMF mute status 0737 B7 A or a ; dump link transmitters if 0738 C2 0746 A jp nz,tist3 ; radio DTMF mute in progress A 073B 3A 804B A ld a,(port7s) ; get the port 7 status 073E F6 18 A or a1tx+a2tx ; turn on both link transmitters 0740 32 804B A ld (port7s),a 0743 C3 06B8 A jp tisrd A 0746 3A 804B A tist3: ld a,(port7s) ; get port7 status 0749 E6 E7 A and not (a1tx+a2tx) ; turn off both link transmitters 074B 32 804B A ld (port7s),a A 074E C3 06B8 A jp tisrd A A ; -------------------- end routine TISTX --------------------------------- A A A ;============================================================================ A ; Service Timers (Routine #1) A ;============================================================================ A A ; Service the varoius Timers by counting them down A ; until they reach zero, then stop counting! A 0751 21 804D A tisst: ld hl,idtim ; ID timer 0754 CD 0BA2 A call bump2 0757 D2 075D A jp nc,tiss1 A 075A 32 8203 A ld (fidtm),a ; ID timer timed out A 075D 21 8054 A tiss1: ld hl,vrtim ; 6M RX time out 0760 CD 0BA2 A call bump2 0763 D2 076C A jp nc,tiss2 A 0766 32 8200 A ld (fberm),a ; request Beer message 0769 32 8201 A ld (fvtom),a ; 6M RX timed out A 076C 21 8056 A tiss2: ld hl,urtim ; 450 RX time out 076F CD 0BA2 A call bump2 0772 D2 077B A jp nc,tiss3 A 0775 32 8200 A ld (fberm),a ; request Beer message 0778 32 8202 A ld (futom),a ; 450 RX timed out A 077B 21 806D A tiss3: ld hl,tmppl ; temp PL override time out 077E CD 0BA2 A call bump2 0781 D2 0787 A jp nc,tiss4 A 0784 32 8208 A ld (ftplm),a ; temp PL timed out A 0787 21 806F A tiss4: ld hl,gpt ; general purpose timer 078A CD 0B9C A call bump A 078D 21 8052 A ld hl,crt ; CRT refresh refresh timer 0790 CD 0B9C A call bump 0793 C2 079B A jp nz,tiss5 A 0796 3E FF A ld a,0ffh ; set the foreground task flag 0798 32 820C A ld (fucrm),a ; ready for CRT refresh A 079B 21 805D A tiss5: ld hl,vadly ; 6M access delay 079E CD 0B9C A call bump A 07A1 21 805E A ld hl,vrdly ; 6M release delay 07A4 CD 0B9C A call bump A 07A7 21 8060 A ld hl,uadly ; 450 access delay 07AA CD 0B9C A call bump A 07AD 21 8061 A ld hl,urdly ; 450 release delay 07B0 CD 0B9C A call bump A 07B3 21 8063 A ld hl,aadly ; R1 access delay 07B6 CD 0B9C A call bump A 07B9 21 8064 A ld hl,ardly ; R1 release delay 07BC CD 0B9C A call bump A 07BF 21 8065 A ld hl,badly ; R2 access delay 07C2 CD 0B9C A call bump A 07C5 21 8066 A ld hl,brdly ; R2 delay 07C8 CD 0B9C A call bump A 07CB 21 8076 A ld hl,rmute ; radio DTMF mute timer 07CE CD 0B9C A call bump A 07D1 21 8077 A ld hl,tmute ; telephone DTMF mute timer 07D4 CD 0B9C A call bump A 07D7 21 8080 A ld hl,atime ; control time-out 07DA CD 0B9C A call bump A 07DD 21 8087 A ld hl,tickt ; watchdog tick time-out 07E0 CD 0B9C A call bump A 07E3 21 808C A ld hl,idptim ; ID PTT timer 07E6 CD 0B9C A call bump A 07E9 21 807D A ld hl,rdvdly ; Radio DTMF Data Valid Delay 07EC CD 0B9C A call bump A 07EF 21 805F A ld hl,vgdly ; 6M audio gate access delay 07F2 CD 0B9C A call bump A 07F5 21 8062 A ld hl,ugdly ; 450 audio gate access delay 07F8 CD 0B9C A call bump A 07FB C3 06B8 A jp tisrd A A ; --------------------- end routine TISST ------------------------------ A A ;============================================================================ A ; Service Timers (Routine #2) A ;============================================================================ A A ; Service the varoius Timers by counting them down A ; until they reach zero, then stop counting! A A 07FE 21 808D A tissu: ld hl,rgdlya ; phone ring detector access delay 0801 CD 0B9C A call bump A 0804 21 808E A ld hl,rgdlyr ; phone ring detector release delay 0807 CD 0B9C A call bump A 080A 21 8090 A ld hl,rgird ; inter-ring delay 080D CD 0BA2 A call bump2 0810 D2 0816 A jp nc,tisu1 A 0813 32 809C A ld (llfrt),a ; update ring time out flag A 0816 21 8092 A tisu1: ld hl,ansacc ; get answer control access time 0819 CD 0BA2 A call bump2 081C D2 0822 A jp nc,tisu2 A 081F 32 8099 A ld (llfan),a ; update ANS time out A 0822 21 8094 A tisu2: ld hl,anshld ; get the answer hold time 0825 CD 0BA2 A call bump2 0828 D2 082E A jp nc,tisu3 A 082B 32 809B A ld (llfhl),a ; update hold time-out A 082E 21 8096 A tisu3: ld hl,maxll ; get the max landline time 0831 CD 0BA2 A call bump2 0834 D2 083A A jp nc,tisu4 A 0837 32 820B A ld (fltom),a ; update landline time-out A 083A 2A 8257 A tisu4: ld hl,(mdfpct) ; get the default courtesy tone time 083D EB A ex de,hl 083E 2A 8096 A ld hl,(maxll) ; get current max landline time 0841 CD 46B5 A call subhd ; see if time, result in HL A 0844 7C A ld a,h ; HL = 0 if time to send courtesy tone 0845 B5 A or a,l ; to alert landline user that 0846 C2 084E A jp nz,tisu5 ; it's about to time-out A 0849 3E FF A ld a,0ffh 084B 32 8206 A ld (fpctm),a ; update landline courtesy tone flag A 084E A tisu5: A ; Don't operate patch timer if patch is off A ; or Landline Control is unlocked A 084E 3A 8073 A ld a,(ptchm) ; see if patch is on 0851 B7 A or a ; 0ffh = on 0852 CA 0868 A jp z,tisu6 A 0855 3A 809A A ld a,(llful) ; or if landline control is unlocked 0858 B7 A or a ; 0ffh = unlocked 0859 C2 0868 A jp nz,tisu6 A 085C 21 8071 A ld hl,teltim ; update patch time out 085F CD 0BA2 A call bump2 0862 D2 0868 A jp nc,tisu6 A 0865 32 8207 A ld (fpatm),a ; Patch Timer timed out A A A ; See if any Aux TX enabled A 0868 3A 8213 A tisu6: ld a,(port7c) ; read control byte 086B E6 18 A and a1tx+a2tx ; only look at Aux TX's 086D CA 087C A jp z,tisu7 ; Z = both are disabled A 0870 21 80AA A ld hl,attim ; get Aux TX time limit 0873 CD 0BA2 A call bump2 ; count it down 0876 D2 087C A jp nc,tisu7 A 0879 32 820A A ld (fltxm),a ; reset both Aux Transmitters A 087C 21 807E A tisu7: ld hl,dnulm ; check DTMF Pass-Through timer 087F CD 0BA2 A call bump2 0882 D2 0888 A jp nc,tisu8 A 0885 32 8209 A ld (fdnlm),a ; restore normal DTMF Processing A 0888 3A 8224 A tisu8: ld a,(limuhf) ; see if 450 TX activity limit active 088B B7 A or a 088C CA 0895 A jp z,tisu9 ; Z = disabled A 088F 21 80B1 A ld hl,utxlim ; check 450 TX activity limit 0892 CD 0BA2 A call bump2 A 0895 21 80B3 A tisu9: ld hl,unact ; check repeater inactivity timer 0898 CD 0BA2 A call bump2 089B C2 08A4 A jp nz,tisu10 A 089E 2A 8241 A ld hl,(mdfulm) ; preset the 450 TX activity limit timer 08A1 22 80B1 A ld (utxlim),hl A 08A4 3A 809D A tisu10: ld a,(clkp) ; get the hardware clock flag 08A7 B7 A or a ; Z = clock present 08A8 C4 0AF0 A call nz,softc ; do the software clock update 08AB C3 06B8 A jp tisrd A A ; ------------------- end routine TISSU ---------------------------------- A A ;============================================================================= A ; Process 6M Receiver A ;============================================================================= A 08AE 3A 820E A tirxv: ld a,(port1c) ; get 6M control status 08B1 E6 03 A and vrcos+vrtos 08B3 CA 08D5 A jp z,tirvo ; Z = 6M RX Disabled A 08B6 3A B001 A ld a,(port1) ; get receiver status direct 08B9 2F A cpl 08BA E6 01 A and vrcos ; look at 6M COS only 08BC CA 08CE A jp z,tirvb ; Z = COS inactive A 08BF 3A 806B A ld a,(pltv) ; get 6M temp PL override flag 08C2 B7 A or a 08C3 C2 08E8 A jp nz,tirv1 ; NZ = fake PL A 08C6 3A 8046 A tirva: ld a,(port1s) ; get receiver status 08C9 E6 03 A and vrcos+vrtos ; look at 6M only 08CB C2 08E8 A jp nz,tirv1 ; NZ = receiver coming on A A ; Receiver going off A 08CE 3A 805E A tirvb: ld a,(vrdly) ; get 6M release delay 08D1 B7 A or a 08D2 C2 0916 A jp nz,tirv3 A A ; Receiver is off A 08D5 2A 8231 A tirvo: ld hl,(mdfto) ; preset 6M RX time out 08D8 22 8054 A ld (vrtim),hl A 08DB 3A 8233 A ld a,(mdfvad) ; preset 6M Access Delay 08DE 32 805D A ld (vadly),a A 08E1 AF A xor a ; reset 6M delayed COS 08E2 32 8067 A ld (vdcos),a A 08E5 C3 06B8 A jp tisrd A A ; Receiver coming on A 08E8 3A 805D A tirv1: ld a,(vadly) ; get 6M access delay 08EB B7 A or a 08EC C2 06B8 A jp nz,tisrd ; NZ = access delay not finished A A ; Receiver is on A 08EF 3A 8234 A tirv2: ld a,(mdfvrd) ; preset the release delay 08F2 32 805E A ld (vrdly),a A 08F5 2A 8246 A ld hl,(mdftel) ; preset patch timer 08F8 22 8071 A ld (teltim),hl A 08FB 2A 823D A ld hl,(mdfatt) ; preset Aux TX time limit 08FE 22 80AA A ld (attim),hl A 0901 3A 821F A ld a,(vpltf) ; see if 6M PL time-out inhibit enabled 0904 B7 A or a 0905 CA 0916 A jp z,tirv3 ; zero is disabled A 0908 3A 8046 A ld a,(port1s) ; get receiver status 090B E6 02 A and vrtos ; look only at 6M tos 090D CA 0916 A jp z,tirv3 A 0910 2A 8231 A ld hl,(mdfto) ; preset 6M RX time out 0913 22 8054 A ld (vrtim),hl A 0916 2A 8054 A tirv3: ld hl,(vrtim) ; get 6M RX timer 0919 7C A ld a,h 091A B5 A or a,l 091B C4 40F2 A call nz,lhtim ; key main and aux transmitters A 091E CD 0BC4 A call preid ; set early ID if required A 0921 3E FF A ld a,0ffh 0923 32 8067 A ld (vdcos),a ; set the 6M delayed COS 0926 32 8082 A ld (bidflg),a ; and the Broadcast ID flag 0929 32 8204 A ld (fvctm),a ; and the 6M courtesy tone foreground flag A 092C C3 06B8 A jp tisrd A A ; -------------------------- end routine TIRXV --------------------------- A A ;============================================================================ A ; 450 Receiver Processing A ;============================================================================ A 092F 3A 820E A tirxu: ld a,(port1c) ; get 6M control status 0932 E6 0C A and urcos+urtos 0934 CA 0956 A jp z,tiruo ; Z = 450 RX Disabled A 0937 3A B001 A ld a,(port1) ; get receiver status direct 093A 2F A cpl 093B E6 04 A and urcos ; look at 450 COS only 093D CA 094F A jp z,tirub ; Z = COS inactive A 0940 3A 806C A ld a,(pltu) ; get 450 temp PL override flag 0943 B7 A or a 0944 C2 0969 A jp nz,tiru1 ; NZ = fake PL A 0947 3A 8046 A tirua: ld a,(port1s) ; get receiver status 094A E6 0C A and urcos+urtos ; look at 450 only 094C C2 0969 A jp nz,tiru1 ; NZ = receiver coming on A A ; Receiver going off A 094F 3A 8061 A tirub: ld a,(urdly) ; get 450 release delay 0952 B7 A or a 0953 C2 099D A jp nz,tiru3 A A ; Receiver is off A 0956 2A 8231 A tiruo: ld hl,(mdfto) ; preset 450 RX time out 0959 22 8056 A ld (urtim),hl A 095C 3A 8236 A ld a,(mdfuad) ; preset 450 Access Delay 095F 32 8060 A ld (uadly),a A 0962 AF A xor a ; reset 450 delayed COS 0963 32 8068 A ld (udcos),a A 0966 C3 06B8 A jp tisrd A A ; Receiver coming on A 0969 3A 8060 A tiru1: ld a,(uadly) ; get 450 access delay 096C B7 A or a 096D C2 06B8 A jp nz,tisrd ; NZ = access delay not finished A A ; Receiver is on A 0970 3A 8237 A tiru2: ld a,(mdfurd) ; preset the release delay 0973 32 8061 A ld (urdly),a A 0976 2A 8246 A ld hl,(mdftel) ; preset patch timer 0979 22 8071 A ld (teltim),hl A 097C 2A 823D A ld hl,(mdfatt) ; preset Aux TX time limit 097F 22 80AA A ld (attim),hl A 0982 2A 8241 A ld hl,(mdfulm) ; preset 450 TX inactivity timer 0985 22 80B1 A ld (utxlim),hl A 0988 3A 8220 A ld a,(upltf) ; see if 450 PL time-out inhibit enabled 098B B7 A or a 098C CA 099D A jp z,tiru3 ; zero is disabled A 098F 3A 8046 A ld a,(port1s) ; get receiver status 0992 E6 08 A and urtos ; look only at 450 tos 0994 CA 099D A jp z,tiru3 A 0997 2A 8231 A ld hl,(mdfto) ; preset 450 RX time out 099A 22 8056 A ld (urtim),hl A 099D 2A 8056 A tiru3: ld hl,(urtim) ; get 450 RX timer 09A0 7C A ld a,h 09A1 B5 A or a,l 09A2 C4 40F2 A call nz,lhtim ; key main and aux transmitters A 09A5 CD 0BC4 A call preid ; set early ID if required A 09A8 3E FF A ld a,0ffh 09AA 32 8068 A ld (udcos),a ; set the 450 delayed COS 09AD 32 8082 A ld (bidflg),a ; and the Broadcast ID flag 09B0 32 8205 A ld (fuctm),a ; and the 450 courtesy tone foreground flag A 09B3 C3 06B8 A jp tisrd A A ; --------------------- end routine TIRXU -------------------------------- A A A ;============================================================================= A ; Process Auxiliary Receiver #1 A ;============================================================================= A A 09B6 3A 8046 A tirxa: ld a,(port1s) ; get receiver status 09B9 E6 10 A and a1cos ; look at Aux #1 only 09BB C2 09D2 A jp nz,tira1 ; NZ = receiver coming on A A ; Receiver going off A 09BE 3A 8064 A ld a,(ardly) ; get R1 release delay 09C1 B7 A or a 09C2 C2 09DF A jp nz,tira2 A A ; Receiver is off A 09C5 3A 8239 A ld a,(mdfaad) ; preset R1 Access Delay 09C8 32 8063 A ld (aadly),a 09CB AF A xor a 09CC 32 8069 A ld (adcos),a ; reset R1 delayed COS 09CF C3 06B8 A jp tisrd A A ; Receiver coming on A 09D2 3A 8063 A tira1: ld a,(aadly) ; get R1 access delay 09D5 B7 A or a 09D6 C2 06B8 A jp nz,tisrd ; NZ = access delay not finished A A ; Receiver is on A 09D9 3A 823A A ld a,(mdfard) ; preset the release delay 09DC 32 8064 A ld (ardly),a A 09DF 3E FF A tira2: ld a,0ffh 09E1 32 8058 A ld (acf),a ; set the R1 cos flag 09E4 32 8069 A ld (adcos),a ; and the R1 delayed COS 09E7 32 8082 A ld (bidflg),a ; and the Broadcast ID flag 09EA CD 40F8 A call htime ; transmit A 09ED C3 06B8 A jp tisrd A A ; --------------------- end routine TIRXA --------------------------------- A A ;============================================================================ A ; Process Auxiliary Receiver #2 A ;============================================================================ A 09F0 3A 8046 A tirxb: ld a,(port1s) ; get receiver status 09F3 E6 20 A and a2cos ; look at R2 only 09F5 C2 0A0C A jp nz,tirb1 ; NZ = receiver coming on A A ; Receiver going off A 09F8 3A 8066 A ld a,(brdly) ; get R2 release delay 09FB B7 A or a 09FC C2 0A19 A jp nz,tirb2 A A ; Receiver is off A 09FF 3A 823B A ld a,(mdfbad) ; preset R2 Access Delay 0A02 32 8065 A ld (badly),a 0A05 AF A xor a 0A06 32 806A A ld (bdcos),a ; reset R2 delayed COS 0A09 C3 06B8 A jp tisrd A A ; Receiver coming on A 0A0C 3A 8065 A tirb1: ld a,(badly) ; get R2 access delay 0A0F B7 A or a 0A10 C2 06B8 A jp nz,tisrd ; NZ = access delay not finished A A ; Receiver is on A 0A13 3A 823C A ld a,(mdfbrd) ; preset the release delay 0A16 32 8066 A ld (brdly),a A 0A19 3E FF A tirb2: ld a,0ffh 0A1B 32 8059 A ld (bcf),a ; set the R1 cos flag 0A1E 32 806A A ld (bdcos),a ; and the R1 delayed COS 0A21 32 8082 A ld (bidflg),a ; and the Broadcast ID flag 0A24 CD 40F8 A call htime ; transmit A 0A27 C3 06B8 A jp tisrd A A ; --------------------- end routine TIRXB --------------------------------- A A A ;============================================================================= A ; Process ID PTT A ;============================================================================= A 0A2A 3A 8070 A tiidt: ld a,(cwptt) ; get CW PTT flag 0A2D B7 A or a 0A2E CA 0A36 A jp z,tiid2 ; Z = no ID PTT A 0A31 F5 A push af 0A32 CD 40E9 A call ihtim ; set CW PTT Hang Time and TX Hang Time 0A35 F1 A pop af A 0A36 3A 808C A tiid2: ld a,(idptim) ; check ID PTT Time 0A39 B7 A or a 0A3A CA 0A48 A jp z,tiid3 A 0A3D 3A 804B A ld a,(port7s) ; set the ID PTT bit 0A40 F6 20 A or idptt 0A42 32 804B A ld (port7s),a A 0A45 C3 06B8 A jp tisrd A 0A48 3A 804B A tiid3: ld a,(port7s) ; reset the ID PTT bit 0A4B E6 DF A and not idptt 0A4D 32 804B A ld (port7s),a A 0A50 C3 06B8 A jp tisrd A A ; --------------------- end routine TIIDT ------------------------------- A A A ;============================================================================= A ; Process Autopatch A ;============================================================================= A 0A53 3A 8073 A tiapt: ld a,(ptchm) ; see if patch is on 0A56 B7 A or a ; 0ffh = on 0A57 CA 0A7E A jp z,tiap3 A 0A5A 3A 8076 A ld a,(rmute) ; process possible patch gate DTMF mute 0A5D 47 A ld b,a ; from either radio or telephone 0A5E 3A 8077 A ld a,(tmute) ; DTMF decoders 0A61 B0 A or a,b 0A62 C2 0A70 A jp nz,tiap1 A 0A65 3A 804B A ld a,(port7s) 0A68 F6 40 A or ptchg ; turn on the patch gate 0A6A 32 804B A ld (port7s),a 0A6D C3 0A78 A jp tiap2 A 0A70 3A 804B A tiap1: ld a,(port7s) 0A73 E6 BF A and not ptchg ; mute the patch gate 0A75 32 804B A ld (port7s),a A 0A78 CD 40F8 A tiap2: call htime ; keep transmitters on 0A7B C3 06B8 A jp tisrd A 0A7E 2A 8246 A tiap3: ld hl,(mdftel) ; preset patch timer 0A81 22 8071 A ld (teltim),hl A 0A84 C3 06B8 A jp tisrd A A ; -------------------- end routine TIAPT ---------------------------------- A A ;============================================================================= A ; Process Ring Detector A ;============================================================================= A 0A87 3A 8046 A tirng: ld a,(port1s) 0A8A A0 A and a,b 0A8B E6 40 A and ring ; see if the phone is ringing 0A8D C2 0AA0 A jp nz,tirg1 ; NZ = ring starting or ringing A A ; Ring Stopping A 0A90 3A 808E A ld a,(rgdlyr) ; get release delay 0A93 B7 A or a 0A94 C2 0AB9 A jp nz,titot A A ; Ring Stopped A 0A97 3A 8261 A ld a,(mdfrd) ; get the default ring delay 0A9A 32 808D A ld (rgdlya),a ; preset the access delay A 0A9D C3 0AB9 A jp titot A A ; Ring Starting A 0AA0 3A 808D A tirg1: ld a,(rgdlya) ; get the ring access delay 0AA3 FE 01 A cp 1 ; last count before zero? 0AA5 C2 0AB9 A jp nz,titot ; NZ = ring not long enough A A A ; Ringing A 0AA8 3A 8261 A ld a,(mdfrd) ; get the default ring delay 0AAB 32 808E A ld (rgdlyr),a ; preset the release delay A 0AAE 3E FF A ld a,0ffh ; set the ring flag 0AB0 32 8098 A ld (llfrg),a A 0AB3 2A 824F A ld hl,(mdfird) ; get the default inter-ring time 0AB6 22 8090 A ld (rgird),hl ; preset it A A ; jp titot ; fall through A A ; -------------------- end routine TIRNG ---------------------------------- A A ;============================================================================ A ; Process Control System Time-Out of Command Input Data A ;============================================================================ A 0AB9 3A 8080 A titot: ld a,(atime) ; get the control time-out 0ABC B7 A or a 0ABD C2 06B8 A jp nz,tisrd A 0AC0 3A 8081 A ld a,(crflag) ; test the CR Flag 0AC3 B7 A or a 0AC4 CA 06B8 A jp z,tisrd A 0AC7 3A 8020 A ld a,(iptr) ; get the input buffer pointer 0ACA 3C A inc a ; bump up the input buffer pointer 0ACB 32 8020 A ld (iptr),a A 0ACE FE 20 A cp iblen ; check that it wasn't advanced past end 0AD0 C2 0AD7 A jp nz,tito1 A 0AD3 AF A xor a ; reset the pointer back to start 0AD4 32 8020 A ld (iptr),a A 0AD7 21 8000 A tito1: ld hl,ibuf ; point to next char slot 0ADA 6F A ld l,a A 0ADB 3E 0D A ld a,cr 0ADD 77 A ld (hl),a ; save char to force a CR A 0ADE 3E FF A ld a,0ffh ; set the EOL flag 0AE0 32 8053 A ld (eol),a A 0AE3 AF A xor a 0AE4 32 8081 A ld (crflag),a ; reset the CR Flag 0AE7 32 8089 A ld (sflag),a ; and the star flag 0AEA 32 808A A ld (pflag),a ; and the pflag 0AED C3 06B8 A jp tisrd A A ;--------------------- end routine TITOT ------------------------------------ A A ;============================================================================ A ; Software Time Clock Update Routine A ;============================================================================ A A ; This is a software functional emulation of the MM58167 IC A ; which keeps track of hours, minutes and seconds in a A ; format identical to the hardware registers in the IC. A A ; The value of the registers is actually in Packed BCD, so the A ; count of 9 is followed by 10H (16 decimal). A 0AF0 21 80A4 A softc: ld hl,st10 ; 10 ms event counter 0AF3 CD 0B9C A call bump A 0AF6 3A 80A4 A ld a,(st10) ; get the value 0AF9 B7 A or a 0AFA C0 A ret nz A 0AFB 3E 64 A ld a,100 ; preset to 100 ten ms. intervals 0AFD 32 80A4 A ld (st10),a A 0B00 3A 80A3 A ld a,(msec) ; get the seconds 0B03 FE 59 A cp 59h ; 59? 0B05 D2 0B0F A jp nc,softc1 ; time to bump the minutes A 0B08 CD 0B83 A call cvth A 0B0B 32 80A3 A ld (msec),a ; save back 0B0E C9 A ret A 0B0F AF A softc1: xor a ; reset the seconds 0B10 32 80A3 A ld (msec),a A 0B13 3A 80A2 A ld a,(mmin) ; get the minutes 0B16 FE 59 A cp 59h ; 59? 0B18 D2 0B22 A jp nc,softc2 ; time to bump the hours A 0B1B CD 0B83 A call cvth A 0B1E 32 80A2 A ld (mmin),a ; save back 0B21 C9 A ret A 0B22 AF A softc2: xor a ; reset the minutes 0B23 32 80A2 A ld (mmin),a A 0B26 3A 80A1 A ld a,(mhrs) ; get the hours 0B29 FE 23 A cp 23h ; 23? 0B2B D2 0B35 A jp nc,softc3 ; time to reset to 00:00 and bump the date A 0B2E CD 0B83 A call cvth A 0B31 32 80A1 A ld (mhrs),a ; save back 0B34 C9 A ret A 0B35 AF A softc3: xor a ; reset the hours 0B36 32 80A1 A ld (mhrs),a A 0B39 21 0B90 A softc5: ld hl,dpermh ; point to the table of number of days/month 0B3C 3A 809F A ld a,(mmo) ; get the month 0B3F 3D A dec a ; make it start at zero 0B40 16 00 A ld d,0 0B42 5F A ld e,a ; put in DE 0B43 19 A add hl,de ; offset into table A 0B44 3A 80A0 A ld a,(mdt) ; get the date 0B47 BE A cp (hl) 0B48 D2 0B52 A jp nc,softc6 ; time to reset to 1 A 0B4B CD 0B83 A call cvth A 0B4E 32 80A0 A ld (mdt),a ; save back 0B51 C9 A ret A 0B52 3E 01 A softc6: ld a,1 0B54 32 80A0 A ld (mdt),a ; reset the date to 1 A 0B57 3A 809F A ld a,(mmo) ; get the month 0B5A FE 12 A cp 12h ; 12? 0B5C D2 0B66 A jp nc,softc7 ; time to reset back to 1 A 0B5F CD 0B83 A call cvth A 0B62 32 809F A ld (mmo),a ; save back 0B65 C9 A ret A 0B66 3E 01 A softc7: ld a,1 ; reset back to january 0B68 32 809F A ld (mmo),a A 0B6B 3A 809E A ld a,(myr) ; get the year 0B6E FE 99 A cp 99h ; 99? 0B70 D2 0B7A A jp nc,softc8 A 0B73 CD 0B83 A call cvth A 0B76 32 809E A ld (myr),a ; save back 0B79 C9 A ret A 0B7A AF A softc8: xor a ; reset the units years 0B7B 32 809E A ld (myr),a A 0B7E 21 8262 A ld hl,mdfcty ; get the tens years 0B81 34 A inc (hl) ; bump up 0B82 C9 A ret A A A ; This routine makes the register count up in Packed BCD A ; instead of binary to emulate the hardware registers A ; in the MM58167 IC A 0B83 3C A cvth: inc a ; bump the register 0B84 47 A ld b,a ; save 0B85 E6 0F A and 00001111b ; look at lower nibble 0B87 FE 0A A cp 0ah ; greater than 9? 0B89 78 A ld a,b ; restore 0B8A C0 A ret nz ; return if not A 0B8B E6 F0 A cvth1: and 11110000b ; zero out lower nibble 0B8D C6 10 A add a,10h ; bump up upper nibble 0B8F C9 A ret A 0B90 31 A DPERMH: db 31h ; jan 0B91 28 A db 28h ; feb 0B92 31 A db 31h ; mar 0B93 30 A db 30h ; apr 0B94 31 A db 31h ; may 0B95 30 A db 30h ; jun 0B96 31 A db 31h ; jul 0B97 31 A db 31h ; aug 0B98 30 A db 30h ; sep 0B99 31 A db 31h ; oct 0B9A 30 A db 30h ; nov 0B9B 31 A db 31h ; dec A A ;---------------------------------------------------------------------------- A ; BUMP - Bump Down a one byte counter in memory A ;---------------------------------------------------------------------------- A A ; Enter with HL pointing to byte to count down A 0B9C 7E A bump: ld a,(hl) ; get the byte 0B9D B7 A or a 0B9E C8 A ret z ; return if counter is zero A 0B9F 3D A dec a ; bump down 0BA0 77 A ld (hl),a ; save back 0BA1 C9 A ret A A A A ;---------------------------------------------------------------------------- A ; BUMP2 - Bump Down a two byte counter in memory A ;---------------------------------------------------------------------------- A A ; Enter with HL pointing to byte pair to count down A A ; Routine will return with A=0 and Zero Flag set A ; when count = Zero A A ; Routine will return with A=0FFH and Carry Flag set A ; when count = '1' A 0BA2 4E A bump2: ld c,(hl) ; get lsb 0BA3 23 A inc hl 0BA4 46 A ld b,(hl) ; get msb Counter now in BC A 0BA5 78 A ld a,b 0BA6 B1 A or a,c 0BA7 CA 0BBD A jp z,bump4 ; return if zero A 0BAA 0B A dec bc ; not zero, then bump down BC A 0BAB 70 A ld (hl),b ; save back msb 0BAC 2B A dec hl 0BAD 71 A ld (hl),c ; save back lsb A 0BAE 78 A ld a,b ; set the foreground task flag 0BAF B7 A or a ; as counter passes through '1' 0BB0 C2 0BB9 A jp nz,bump3 A 0BB3 79 A ld a,c 0BB4 FE 01 A cp 1 0BB6 CA 0BBF A jp z,bump5 A A ; Counter is at any count except '0' or '1' A 0BB9 3E FF A bump3: ld a,0ffh ; return with NZ 0BBB B7 A or a 0BBC C9 A ret A A ; Counter is at '0' A 0BBD AF A bump4: xor a ; return with A=0 and no flags 0BBE C9 A ret A A ; Counter is at '1' A 0BBF 3E FF A bump5: ld a,0ffh ; set the foreground task flag 0BC1 B7 A or a ; return with A=0ffh and 0BC2 37 A scf ; set carry flag 0BC3 C9 A ret A A A ;----------------------------------------------------------------------------- A ; Subroutine PREID - Tell Foreground that ID timer A ; will be timed-out before the current hang time is over A ;----------------------------------------------------------------------------- A 0BC4 11 03E8 A preid: ld de,1000 ; ten seconds (1000 10ms ticks) value in DE 0BC7 2A 804D A ld hl,(idtim) ; get the current ID timer value 0BCA CD 46B5 A call subhd ; subtract DE from HL, HL=result A ; CY is set if HLDE, plenty of ID timer left A 0BCE 3E FF A ld a,0ffh ; set-up for early ID 0BD0 32 8203 A ld (fidtm),a ; set the foreground task flag A 0BD3 C9 A ret A A A ;--------------------- end of file TISR.Z80 --------------------------------- ;============================================================================ ; GRSD - Get Receivers Delayed Status ; after Access/Release Delays ;============================================================================ 0BD4 C5 grsd: push bc 0BD5 3A 8067 ld a,(vdcos) ; get 6M delayed COS 0BD8 47 ld b,a 0BD9 3A 8068 ld a,(udcos) ; get 450 delayed COS 0BDC B0 or a,b 0BDD C1 pop bc 0BDE C9 ret ;---------------------------------------------------------------------------- ; Subroutine CTEST - Test MM58167 Status Byte ;---------------------------------------------------------------------------- ; Entry: A = value read from the counter ; Exit: A = value read from the counter ; Flags: Z = value OK ; NZ = rollover during read ; Uses: AF, B 0BDF 47 ctest: ld b,a ; save value 0BE0 3A D014 ld a,(cstat) ; read the status bit 0BE3 B7 or a ; set flags 0BE4 78 ld a,b ; restore value 0BE5 C9 ret include ucrt.z80 A A ;============================================================================ A ; CRT screen control codes for port status display A ;============================================================================ A 001F A offset equ 31 002A A col1 equ 42 ; col 42 0049 A c1off equ col1+offset 0035 A col2 equ 53 ; col 53 0054 A c2off equ col2+offset 003E A col3 equ 62 ; col 62 005D A c3off equ col3+offset A A A ; This is the Status Display Skeleton which is written to the A ; screen only once and re-written during a Refresh CRT Command (X) A ; A ; The CRT sequence for direct cursor positioning is A ; ESC Y row col - where the ASCII offset 31 needs to be A ; added to row and col. This sequence will only work with A ; terminals which use ESC Y row col unless the sequence is A ; modified. The GXYMSG routine also has ESC Y row col hard A ; coded. A 0BE6 3A 8215 A ucrtt: ld a,(umode) ; get the mode byte 0BE9 FE 01 A cp 1 0BEB CA 0FBB A jp z,ucrm1 A 0BEE FE 02 A cp 2 0BF0 CA 0F5F A jp z,ucrm2 A 0BF3 FE 03 A cp 3 0BF5 CA 0EA4 A jp z,ucrm3 A 0BF8 FE 04 A cp 4 0BFA CA 0DF3 A jp z,ucrm4 A 0BFD FE 05 A cp 5 0BFF CA 0D38 A jp z,ucrm5 A 0C02 CD 4541 A call vprint 0C05 1B 59 20 5D A defb esc,'Y',1+offset,c3off,2,'Input Port P0',1 0C19 1B 59 21 5D A defb esc,'Y',2+offset,c3off,'Ctrl' 0C21 1B 59 22 5D A defb esc,'Y',3+offset,c3off,'Stat' 0C29 1B 59 23 5D A defb esc,'Y',4+offset,c3off,2,'Receivers P1',1 0C3D 1B 59 24 5D A defb esc,'Y',5+offset,c3off,'Ctrl' 0C45 1B 59 25 5D A defb esc,'Y',6+offset,c3off,'Stat' 0C4D 1B 59 26 5D A defb esc,'Y',7+offset,c3off,2,'Input Port P2',1 0C61 1B 59 27 5D A defb esc,'Y',8+offset,c3off,'Ctrl' 0C69 1B 59 28 5D A defb esc,'Y',9+offset,c3off,'Stat' 0C71 1B 59 29 5D A defb esc,'Y',10+offset,c3off,2,'DTMF Decoders',1 0C84 1B 59 2A 5D A defb esc,'Y',11+offset,c3off,'Radio Digit:' 0C94 1B 59 2B 5D A defb esc,'Y',12+offset,c3off,'Phone Digit:' 0CA4 1B 59 2C 5D A defb esc,'Y',13+offset,c3off,2,'Output Port P4',1 0CB8 1B 59 2D 5D A defb esc,'Y',14+offset,c3off,'Ctrl' 0CC0 1B 59 2E 5D A defb esc,'Y',15+offset,c3off,'Stat' 0CC8 1B 59 2F 5D A defb esc,'Y',16+offset,c3off,2,'Output Port P5',1 0CDC 1B 59 30 5D A defb esc,'Y',17+offset,c3off,'Ctrl' 0CE4 1B 59 31 5D A defb esc,'Y',18+offset,c3off,'Stat' 0CEC 1B 59 32 5D A defb esc,'Y',19+offset,c3off,2,'Audio Gates P6',1 0D00 1B 59 33 5D A defb esc,'Y',20+offset,c3off,'Ctrl' 0D08 1B 59 34 5D A defb esc,'Y',21+offset,c3off,'Stat' 0D10 1B 59 35 5D A defb esc,'Y',22+offset,c3off,2,'TX/Patch P7',1 0D24 1B 59 36 5D A defb esc,'Y',23+offset,c3off,'Ctrl' 0D2C 1B 59 37 5D A defb esc,'Y',24+offset,c3off,'Stat',0 0D35 C3 1041 A jp ucrma A 0D38 CD 4541 A ucrm5: call vprint 0D3B 1B 59 20 5D A defb esc,'Y', 1+offset,c3off,2,'2M Channel 0',1 0D4D 1B 59 22 5D A defb esc,'Y', 3+offset,c3off,2,'2M Channel 1',1 0D5F 1B 59 24 5D A defb esc,'Y', 5+offset,c3off,2,'2M Channel 2',1 0D71 1B 59 26 5D A defb esc,'Y', 7+offset,c3off,2,'2M Channel 3',1 0D83 1B 59 28 5D A defb esc,'Y', 9+offset,c3off,2,'2M Channel 4',1 0D95 1B 59 2A 5D A defb esc,'Y',11+offset,c3off,2,'2M Channel 5',1 0DA7 1B 59 2C 5D A defb esc,'Y',13+offset,c3off,2,'2M Channel 6',1 0DB9 1B 59 2E 5D A defb esc,'Y',15+offset,c3off,2,'2M Channel 7',1 0DCB 1B 59 30 5D A defb esc,'Y',17+offset,c3off,2,'2M Channel 8',1 0DDD 1B 59 32 5D A defb esc,'Y',19+offset,c3off,2,'2M Channel 9',1,0 0DF0 C3 1041 A jp ucrma A 0DF3 CD 4541 A ucrm4: call vprint 0DF6 1B 59 20 5D A defb esc,'Y', 1+offset,c3off,2,'Macro Cmd 0',1 0E07 1B 59 22 5D A defb esc,'Y', 3+offset,c3off,2,'Macro Cmd 1',1 0E18 1B 59 24 5D A defb esc,'Y', 5+offset,c3off,2,'Macro Cmd 2',1 0E29 1B 59 26 5D A defb esc,'Y', 7+offset,c3off,2,'Macro Cmd 3',1 0E3A 1B 59 28 5D A defb esc,'Y', 9+offset,c3off,2,'Macro Cmd 4',1 0E4B 1B 59 2A 5D A defb esc,'Y',11+offset,c3off,2,'Macro Cmd 5',1 0E5C 1B 59 2C 5D A defb esc,'Y',13+offset,c3off,2,'Macro Cmd 6',1 0E6D 1B 59 2E 5D A defb esc,'Y',15+offset,c3off,2,'Macro Cmd 7',1 0E7E 1B 59 30 5D A defb esc,'Y',17+offset,c3off,2,'Macro Cmd 8',1 0E8F 1B 59 32 5D A defb esc,'Y',19+offset,c3off,2,'Macro Cmd 9',1,0 0EA1 C3 1041 A jp ucrma A 0EA4 CD 4541 A ucrm3: call vprint 0EA7 1B 59 20 5D A defb esc,'Y', 1+offset,c3off,2,'Speed Dial 0',1 0EB9 1B 59 22 5D A defb esc,'Y', 3+offset,c3off,2,'Speed Dial 1',1 0ECB 1B 59 24 5D A defb esc,'Y', 5+offset,c3off,2,'Speed Dial 2',1 0EDD 1B 59 26 5D A defb esc,'Y', 7+offset,c3off,2,'Speed Dial 3',1 0EEF 1B 59 28 5D A defb esc,'Y', 9+offset,c3off,2,'Speed Dial 4',1 0F01 1B 59 2A 5D A defb esc,'Y',11+offset,c3off,2,'Speed Dial 5',1 0F13 1B 59 2C 5D A defb esc,'Y',13+offset,c3off,2,'Speed Dial 6',1 0F25 1B 59 2E 5D A defb esc,'Y',15+offset,c3off,2,'Speed Dial 7',1 0F37 1B 59 30 5D A defb esc,'Y',17+offset,c3off,2,'Speed Dial 8',1 0F49 1B 59 32 5D A defb esc,'Y',19+offset,c3off,2,'Speed Dial 9',1,0 0F5C C3 1041 A jp ucrma A 0F5F CD 4541 A ucrm2: call vprint 0F62 1B 59 20 5D A defb esc,'Y', 1+offset,c3off,2,'450 TX Limit',1 0F74 1B 59 22 5D A defb esc,'Y', 3+offset,c3off,2,'Repeater Inactivity',1 0F8D 1B 59 24 5D A defb esc,'Y', 5+offset,c3off,2,'Temp PL Override',1 0FA3 1B 59 26 5D A defb esc,'Y', 7+offset,c3off,2,'DTMF Pass-Thru',1 0FB7 00 A defb 0 0FB8 C3 1041 A jp ucrma A 0FBB CD 4541 A ucrm1: call vprint 0FBE 1B 59 20 5D A defb esc,'Y', 1+offset,c3off,2,'Event 0',1 0FCB 1B 59 22 5D A defb esc,'Y', 3+offset,c3off,2,'Event 1',1 0FD8 1B 59 24 5D A defb esc,'Y', 5+offset,c3off,2,'Event 2',1 0FE5 1B 59 26 5D A defb esc,'Y', 7+offset,c3off,2,'Event 3',1 0FF2 1B 59 28 5D A defb esc,'Y', 9+offset,c3off,2,'Event 4',1 0FFF 1B 59 2A 5D A defb esc,'Y',11+offset,c3off,2,'Event 5',1 100C 1B 59 2C 5D A defb esc,'Y',13+offset,c3off,2,'Event 6',1 1019 1B 59 2E 5D A defb esc,'Y',15+offset,c3off,2,'Event 7',1 1026 1B 59 30 5D A defb esc,'Y',17+offset,c3off,2,'Event 8',1 1033 1B 59 32 5D A defb esc,'Y',19+offset,c3off,2,'Event 9',1,0 A 1041 CD 4541 A ucrma: call vprint 1044 1B 59 20 49 A tl01: defb esc,'Y',1+offset,c1off,2,'ID Timer:',1 1053 1B 59 22 49 A tl03: defb esc,'Y',3+offset,c1off,2,'6M RX:',1 1060 1B 59 24 49 A tl05: defb esc,'Y',5+offset,c1off,2,'450 RX:',1 106D 1B 59 26 49 A t107: defb esc,'Y',7+offset,c1off,2,'Aux TX:',1 107A 1B 59 28 49 A t109: defb esc,'Y',9+offset,c1off,2,'LL Ctrl:',1 1088 1B 59 2A 49 A tl11: defb esc,'Y',11+offset,c1off,2,'Patch:',1 1094 1B 59 2C 49 A tl13: defb esc,'Y',13+offset,c1off,2,'Transmit:',1 10A3 1B 59 2E 49 A tl15: defb esc,'Y',15+offset,c1off,2,'Date:',1 10AE 1B 59 31 49 A tl18: defb esc,'Y',18+offset,c1off,2,'Time:',1 10B9 1B 59 32 49 A t119: defb esc,'Y',19+offset,c1off,2,'Chime:',1,0 10C6 C9 A ret A A ;============================================================================ A ; CRT Update Enable/Disable/Mode A ;============================================================================ A 10C7 3A 8214 A ucrtc: ld a,(uflag) ; get the update flag 10CA B7 A or a 10CB C2 10D4 A jp nz,ucroff A 10CE 3E FF A ucron: ld a,0ffh ; set the update flag 10D0 32 8214 A ld (uflag),a 10D3 C9 A ret A 10D4 AF A ucroff: xor a ; reset the update flag 10D5 32 8214 A ld (uflag),a 10D8 C9 A ret A 10D9 CD 44A2 A cmode: call rech ; get the char 10DC FE 0D A cp cr ; no arguements? 10DE CA 114C A jp z,cmodet ; step through modes A 10E1 FE 30 A cp '0' 10E3 CA 1102 A jp z,cmode0 A 10E6 FE 31 A cp '1' 10E8 CA 1109 A jp z,cmode1 A 10EB FE 32 A cp '2' 10ED CA 1111 A jp z,cmode2 A 10F0 FE 33 A cp '3' 10F2 CA 1119 A jp z,cmode3 A 10F5 FE 34 A cp '4' 10F7 CA 1121 A jp z,cmode4 A 10FA FE 35 A cp '5' 10FC CA 1129 A jp z,cmode5 A 10FF C3 226D A jp error A 1102 AF A cmode0: xor a 1103 32 8215 A ld (umode),a 1106 C3 112E A jp cmmsg A 1109 3E 01 A cmode1: ld a,1 110B 32 8215 A ld (umode),a 110E C3 112E A jp cmmsg A 1111 3E 02 A cmode2: ld a,2 1113 32 8215 A ld (umode),a 1116 C3 112E A jp cmmsg A 1119 3E 03 A cmode3: ld a,3 111B 32 8215 A ld (umode),a 111E C3 112E A jp cmmsg A 1121 3E 04 A cmode4: ld a,4 1123 32 8215 A ld (umode),a 1126 C3 112E A jp cmmsg A 1129 3E 05 A cmode5: ld a,5 112B 32 8215 A ld (umode),a A 112E F5 A cmmsg: push af ; save the CRT Mode 112F CD 1F32 A call menu ; print screen menu 1132 CD 2289 A call stat ; print status line message 1135 43 52 54 20 A defb 'CRT Update Mode ',0 1146 F1 A pop af ; get the mode back 1147 C6 30 A add 30h ; make ASCII 1149 C3 1F18 A jp cout ; add mode number to status message and ret A A 114C 3A 8215 A cmodet: ld a,(umode) ; get the current mode 114F B7 A or a 1150 CA 1109 A jp z,cmode1 ; if zero, make mode one A 1153 FE 01 A cp 1 1155 CA 1111 A jp z,cmode2 ; if one, make mode 2 A 1158 FE 02 A cp 2 115A CA 1119 A jp z,cmode3 ; if two, make mode 3 A 115D FE 03 A cp 3 115F CA 1121 A jp z,cmode4 ; if three, make mode 4 A 1162 FE 04 A cp 4 1164 CA 1129 A jp z,cmode5 ; if four, make mode 5 A 1167 C3 1102 A jp cmode0 ; otherwise make mode zero A A ;---------------------------------------------------------------------------- A A ; Update the CRT port status display A 116A 3A 8214 A ucrt: ld a,(uflag) ; get the UCRT control flag 116D B7 A or a 116E C8 A ret z A 116F 3A 8053 A ld a,(eol) ; see if monitor loop is idle 1172 B7 A or a ; if EOL is nz (set), no pending command 1173 C8 A ret z ; Z is command pending, bypas ucrt A A ; This is the entry point UCRTE which is used to update the screen A ; without testing the above flags A 1174 E5 A ucrte: push hl 1175 D5 A push de 1176 C5 A push bc A 1177 3A 8259 A ld a,(muptim) ; preset update time 117A 32 8052 A ld (crt),a A 117D CD 4587 A call curoff ; turn off cursor A 1180 CD 4538 A call gxymsg ; send WORKING message 1183 18 2A A defb 24,col1 1185 01 57 6F 72 A defb 1,'Working',0 A 118E 3A 8215 A ld a,(umode) ; get the control byte 1191 FE 01 A cp 1 ; mode 1 (Events Display)? 1193 CA 126E A jp z,umod1 A 1196 FE 02 A cp 2 1198 CA 12DF A jp z,umod2 A 119B FE 03 A cp 3 119D CA 130E A jp z,umod3 A 11A0 FE 04 A cp 4 11A2 CA 137F A jp z,umod4 A 11A5 FE 05 A cp 5 11A7 CA 13F0 A jp z,umod5 A A ; jp umod0 A A ;----------------------------------------------------------------------------- A ; CRT Update Mode 0 A ;----------------------------------------------------------------------------- A 11AA CD 4519 A umod0: call at ; Port 0 / Interrupts (P0) 11AD 02 44 A defb 2,col3+6 11AF 3A 820D A ld a,(port0c) 11B2 6F A ld l,a 11B3 CD 447B A call bits A 11B6 CD 4519 A call at 11B9 03 44 A defb 3,col3+6 11BB 3A B000 A ld a,(port0) 11BE 2F A cpl 11BF 6F A ld l,a 11C0 CD 447B A call bits A 11C3 CD 4519 A call at ; Display Receivers (P1) 11C6 05 44 A defb 5,col3+6 11C8 3A 820E A ld a,(port1c) 11CB 6F A ld l,a 11CC CD 447B A call bits A 11CF CD 4519 A call at 11D2 06 44 A defb 6,col3+6 11D4 3A B001 A ld a,(port1) 11D7 2F A cpl 11D8 6F A ld l,a 11D9 CD 447B A call bits A 11DC CD 4519 A call at ; Display Input Port 2 11DF 08 44 A defb 8,col3+6 11E1 3A 820F A ld a,(port2c) 11E4 6F A ld l,a 11E5 CD 447B A call bits A 11E8 CD 4519 A call at 11EB 09 44 A defb 9,col3+6 11ED 3A B002 A ld a,(port2) 11F0 2F A cpl 11F1 6F A ld l,a 11F2 CD 447B A call bits A 11F5 CD 4519 A call at ; display the last Radio DTMF char in ASCII 11F8 0B 4B A defb 11,75 11FA 3A 8078 A ld a,(digitr) 11FD CD 1F18 A call cout A 1200 CD 4519 A call at ; display the last Phone DTMF char in ASCII 1203 0C 4B A defb 12,75 1205 3A 8079 A ld a,(digitp) 1208 CD 1F18 A call cout A 120B CD 4519 A call at ; Display Output Port 4 120E 0E 44 A defb 14,col3+6 1210 3A 8210 A ld a,(port4c) 1213 6F A ld l,a 1214 CD 447B A call bits A 1217 CD 4519 A call at 121A 0F 44 A defb 15,col3+6 121C 3A 8048 A ld a,(port4s) 121F 6F A ld l,a 1220 CD 447B A call bits A 1223 CD 4519 A call at ; Display Output Port 5 1226 11 44 A defb 17,col3+6 1228 3A 8211 A ld a,(port5c) 122B 6F A ld l,a 122C CD 447B A call bits A 122F CD 4519 A call at 1232 12 44 A defb 18,col3+6 1234 3A 8049 A ld a,(port5s) 1237 6F A ld l,a 1238 CD 447B A call bits A 123B CD 4519 A call at ; Display Audio Gates (P6) 123E 14 44 A defb 20,col3+6 1240 3A 8212 A ld a,(port6c) 1243 6F A ld l,a 1244 CD 447B A call bits A 1247 CD 4519 A call at 124A 15 44 A defb 21,col3+6 124C 3A 804A A ld a,(port6s) 124F 6F A ld l,a 1250 CD 447B A call bits A 1253 CD 4519 A call at ; Display Transmitters (P7) 1256 17 44 A defb 23,col3+6 1258 3A 8213 A ld a,(port7c) 125B 6F A ld l,a 125C CD 447B A call bits A 125F CD 4519 A call at 1262 18 44 A defb 24,col3+6 1264 3A 804B A ld a,(port7s) 1267 6F A ld l,a 1268 CD 447B A call bits A 126B C3 1460 A jp ucrt3 A A ;----------------------------------------------------------------------------- A ; CRT Update Mode 1 A ;----------------------------------------------------------------------------- A 126E CD 4519 A umod1: call at ; update scheduled event #0 1271 02 3E A defb 2,col3 1273 21 830D A ld hl,sch0 1276 CD 1676 A call ucev A 1279 CD 4519 A call at ; update scheduled event #1 127C 04 3E A defb 4,col3 127E 21 8317 A ld hl,sch1 1281 CD 1676 A call ucev A 1284 CD 4519 A call at ; update scheduled event #2 1287 06 3E A defb 6,col3 1289 21 8321 A ld hl,sch2 128C CD 1676 A call ucev A 128F CD 4519 A call at ; update scheduled event #3 1292 08 3E A defb 8,col3 1294 21 832B A ld hl,sch3 1297 CD 1676 A call ucev A 129A CD 4519 A call at ; update scheduled event #4 129D 0A 3E A defb 10,col3 129F 21 8335 A ld hl,sch4 12A2 CD 1676 A call ucev A 12A5 CD 4519 A call at ; update scheduled event #5 12A8 0C 3E A defb 12,col3 12AA 21 833F A ld hl,sch5 12AD CD 1676 A call ucev A 12B0 CD 4519 A call at ; update scheduled event #6 12B3 0E 3E A defb 14,col3 12B5 21 8349 A ld hl,sch6 12B8 CD 1676 A call ucev A 12BB CD 4519 A call at ; update scheduled event #7 12BE 10 3E A defb 16,col3 12C0 21 8353 A ld hl,sch7 12C3 CD 1676 A call ucev A 12C6 CD 4519 A call at ; update scheduled event #8 12C9 12 3E A defb 18,col3 12CB 21 835D A ld hl,sch8 12CE CD 1676 A call ucev A 12D1 CD 4519 A call at ; update scheduled event #9 12D4 14 3E A defb 20,col3 12D6 21 8367 A ld hl,sch9 12D9 CD 1676 A call ucev 12DC C3 1460 A jp ucrt3 A A ;----------------------------------------------------------------------------- A ; CRT Update Mode 2 A ;----------------------------------------------------------------------------- A 12DF CD 4519 A umod2: call at ; Display 450 TX inactivity timer 12E2 02 3E A defb 2,col3 12E4 2A 80B1 A ld hl,(utxlim) 12E7 CD 1650 A call ptsec A 12EA CD 4519 A call at ; Display repeater inactivity timer 12ED 04 3E A defb 4,col3 12EF 2A 80B3 A ld hl,(unact) 12F2 CD 1650 A call ptsec A 12F5 CD 4519 A call at ; Display Temp PL Override timer 12F8 06 3E A defb 6,col3 12FA 2A 806D A ld hl,(tmppl) 12FD CD 1650 A call ptsec A 1300 CD 4519 A call at ; Display DTMF Pass-Thru timer 1303 08 3E A defb 8,col3 1305 2A 807E A ld hl,(dnulm) 1308 CD 1650 A call ptsec A 130B C3 1460 A jp ucrt3 A A ;----------------------------------------------------------------------------- A ; CRT Update Mode 3 A ;----------------------------------------------------------------------------- A 130E CD 4519 A umod3: call at ; update speed dial #0 1311 02 3E A defb 2,col3 1313 21 8263 A ld hl,dial0 1316 CD 16CD A call ucsd A 1319 CD 4519 A call at ; update speed dial #1 131C 04 3E A defb 4,col3 131E 21 826F A ld hl,dial1 1321 CD 16CD A call ucsd A 1324 CD 4519 A call at ; update speed dial #2 1327 06 3E A defb 6,col3 1329 21 827B A ld hl,dial2 132C CD 16CD A call ucsd A 132F CD 4519 A call at ; update speed dial #3 1332 08 3E A defb 8,col3 1334 21 8287 A ld hl,dial3 1337 CD 16CD A call ucsd A 133A CD 4519 A call at ; update speed dial #4 133D 0A 3E A defb 10,col3 133F 21 8293 A ld hl,dial4 1342 CD 16CD A call ucsd A 1345 CD 4519 A call at ; update speed dial #5 1348 0C 3E A defb 12,col3 134A 21 829F A ld hl,dial5 134D CD 16CD A call ucsd A 1350 CD 4519 A call at ; update speed dial #6 1353 0E 3E A defb 14,col3 1355 21 82AB A ld hl,dial6 1358 CD 16CD A call ucsd A 135B CD 4519 A call at ; update speed dial #7 135E 10 3E A defb 16,col3 1360 21 82B7 A ld hl,dial7 1363 CD 16CD A call ucsd A 1366 CD 4519 A call at ; update speed dial #8 1369 12 3E A defb 18,col3 136B 21 82C3 A ld hl,dial8 136E CD 16CD A call ucsd A 1371 CD 4519 A call at ; update speed dial #9 1374 14 3E A defb 20,col3 1376 21 82CF A ld hl,dial9 1379 CD 16CD A call ucsd 137C C3 1460 A jp ucrt3 A A ;----------------------------------------------------------------------------- A ; CRT Update Mode 4 A ;----------------------------------------------------------------------------- A 137F CD 4519 A umod4: call at ; update Macro Cmd #0 1382 02 3E A defb 2,col3 1384 21 82DB A ld hl,mac0 1387 CD 16F8 A call ucpm A 138A CD 4519 A call at ; update Macro Cmd #1 138D 04 3E A defb 4,col3 138F 21 82E0 A ld hl,mac1 1392 CD 16F8 A call ucpm A 1395 CD 4519 A call at ; update Macro Cmd #2 1398 06 3E A defb 6,col3 139A 21 82E5 A ld hl,mac2 139D CD 16F8 A call ucpm A 13A0 CD 4519 A call at ; update Macro Cmd #3 13A3 08 3E A defb 8,col3 13A5 21 82EA A ld hl,mac3 13A8 CD 16F8 A call ucpm A 13AB CD 4519 A call at ; update Macro Cmd #4 13AE 0A 3E A defb 10,col3 13B0 21 82EF A ld hl,mac4 13B3 CD 16F8 A call ucpm A 13B6 CD 4519 A call at ; update Macro Cmd #5 13B9 0C 3E A defb 12,col3 13BB 21 82F4 A ld hl,mac5 13BE CD 16F8 A call ucpm A 13C1 CD 4519 A call at ; update Macro Cmd #6 13C4 0E 3E A defb 14,col3 13C6 21 82F4 A ld hl,mac5 13C9 CD 16F8 A call ucpm A 13CC CD 4519 A call at ; update Macro Cmd #7 13CF 10 3E A defb 16,col3 13D1 21 82FE A ld hl,mac7 13D4 CD 16F8 A call ucpm A 13D7 CD 4519 A call at ; update Macro Cmd #8 13DA 12 3E A defb 18,col3 13DC 21 8303 A ld hl,mac8 13DF CD 16F8 A call ucpm A 13E2 CD 4519 A call at ; update Macro Cmd #9 13E5 14 3E A defb 20,col3 13E7 21 8308 A ld hl,mac9 13EA CD 16F8 A call ucpm 13ED C3 1460 A jp ucrt3 A A ;----------------------------------------------------------------------------- A ; CRT Update Mode 5 A ;----------------------------------------------------------------------------- A 13F0 0E 00 A umod5: ld c,0 ; C = cycle counter (channel number) A 13F2 CD 4519 A call at ; update 2M Channel 0 13F5 02 3E A defb 2,col3 13F7 21 8371 A ld hl,twoc0 13FA CD 170A A call utwo A 13FD CD 4519 A call at ; update 2M Channel 1 1400 04 3E A defb 4,col3 1402 21 837A A ld hl,twoc1 1405 CD 170A A call utwo A 1408 CD 4519 A call at ; update 2M Channel 2 140B 06 3E A defb 6,col3 140D 21 8383 A ld hl,twoc2 1410 CD 170A A call utwo A 1413 CD 4519 A call at ; update 2M Channel 3 1416 08 3E A defb 8,col3 1418 21 838C A ld hl,twoc3 141B CD 170A A call utwo A 141E CD 4519 A call at ; update 2M Channel 4 1421 0A 3E A defb 10,col3 1423 21 8395 A ld hl,twoc4 1426 CD 170A A call utwo A 1429 CD 4519 A call at ; update 2M Channel 5 142C 0C 3E A defb 12,col3 142E 21 839E A ld hl,twoc5 1431 CD 170A A call utwo A 1434 CD 4519 A call at ; update 2M Channel 6 1437 0E 3E A defb 14,col3 1439 21 83A7 A ld hl,twoc6 143C CD 170A A call utwo A 143F CD 4519 A call at ; update 2M Channel 7 1442 10 3E A defb 16,col3 1444 21 83B0 A ld hl,twoc7 1447 CD 170A A call utwo A 144A CD 4519 A call at ; update 2M Channel 8 144D 12 3E A defb 18,col3 144F 21 83B9 A ld hl,twoc8 1452 CD 170A A call utwo A 1455 CD 4519 A call at ; update 2M Channel 9 1458 14 3E A defb 20,col3 145A 21 83C2 A ld hl,twoc9 145D CD 170A A call utwo A A A ;---------------------------------------------------------------------------- A 1460 CD 4519 A ucrt3: call at ; Display ID Timer 1463 01 35 A defb 1,col2 1465 2A 804D A ld hl,(idtim) 1468 CD 1650 A call ptsec A 146B CD 4519 A call at ; Display 6M RX timeout timer 146E 03 35 A defb 3,col2 1470 2A 8054 A ld hl,(vrtim) 1473 CD 1650 A call ptsec A 1476 CD 4519 A call at ; Display 450 RX timeout timer 1479 05 35 A defb 5,col2 147B 2A 8056 A ld hl,(urtim) 147E CD 1650 A call ptsec A 1481 CD 4519 A call at ; Display Aux TX timeout timer 1484 07 35 A defb 7,col2 1486 2A 80AA A ld hl,(attim) 1489 CD 1650 A call ptsec A 148C CD 4519 A call at ; Display Landline Access Time 148F 09 35 A defb 9,col2 1491 2A 8096 A ld hl,(maxll) 1494 CD 1650 A call ptsec A 1497 CD 4519 A call at ; Display Autopatch timeout timer 149A 0B 35 A defb 11,col2 149C 2A 8071 A ld hl,(teltim) 149F CD 1650 A call ptsec A 14A2 CD 4519 A call at ; Display TX hang timer 14A5 0D 35 A defb 13,col2 14A7 2A 8074 A ld hl,(hang) 14AA CD 1650 A call ptsec A 14AD CD 1E2D A call rdtim ; update time and date in memory A 14B0 CD 4519 A call at ; Display Date 14B3 0F 31 A defb 15,col2-4 A 14B5 3A 809F A ucrt4: ld a,(mmo) ; get month 1 to 12 14B8 B7 A or a 14B9 CA 14F6 A jp z,ucrt7 ; safety test, just in case zero A 14BC 3D A dec a ; make 0 to 11 A 14BD 21 0004 A ld hl,4 ; number of bytes per table entry 14C0 11 15C2 A ld de,motbl ; table to use 14C3 CD 15B5 A call scant ; scan table and print month A 14C6 3E 20 A ld a,' ' 14C8 CD 1F18 A call cout 14CB CD 4579 A call dim A 14CE 3A 80A0 A ucrt5: ld a,(mdt) ; get day 14D1 CD 44BD A call byte 14D4 3E 2C A ld a,',' 14D6 CD 1F18 A call cout A 14D9 3A 8262 A ld a,(mdfcty) ; get century 14DC CD 44BD A call byte A 14DF 3A 809E A ld a,(myr) ; get year 14E2 CD 44BD A call byte A 14E5 CD 4519 A call at 14E8 10 31 A defb 16,col2-4 A 14EA 3A 80A5 A ucrt6: ld a,(mda) ; get the day of the week 14ED 21 000A A ld hl,10 ; number of bytes per table entry 14F0 11 160A A ld de,daywk ; table to use 14F3 CD 15B5 A call scant ; scan table and print day of the week A 14F6 3A 8223 A ucrt7: ld a,(chena) ; get the hourly chime status 14F9 B7 A or a 14FA CA 1509 A jp z,ucrt8 ; Z = chime not enabled A 14FD CD 4538 A call gxymsg 1500 13 31 A defb 19,col1+7 1502 4F 4E 20 00 A defb 'ON ',0 1506 C3 1512 A jp ucrt9 A 1509 CD 4538 A ucrt8: call gxymsg 150C 13 31 A defb 19,col1+7 150E 4F 46 46 00 A defb 'OFF',0 A 1512 CD 4519 A ucrt9: call at 1515 12 31 A defb 18,col1+7 A 1517 3A 80A1 A ld a,(mhrs) ; get hours A 151A FE 12 A cp 12h ; AM or PM? 151C DA 1538 A jp c,ucrt11 ; its AM A 151F FE 12 A cp 12h ; is it noon 1521 CA 153E A jp z,ucrt13 ; yes, skip the subtraction A 1524 FE 20 A cp 20h ; 8PM? 1526 CA 1533 A jp z,ucrt10 A 1529 FE 21 A cp 21h ; 9PM? 152B CA 1533 A jp z,ucrt10 A 152E D6 12 A sub 12h ; make into 12 hour format 1530 C3 153E A jp ucrt13 A 1533 D6 18 A ucrt10: sub 18h ; make into 12 hour format 1535 C3 153E A jp ucrt13 A 1538 B7 A ucrt11: or a ; is it 12 AM? 1539 C2 153E A jp nz,ucrt13 A 153C 3E 12 A ld a,12h ; change it from 0 hours to 12 hours A 153E CD 44BD A ucrt13: call byte ; print in ASCII 1541 3E 3A A ld a,':' 1543 CD 1F18 A call cout ; print the colon A 1546 3A 80A2 A ucrt14: ld a,(mmin) ; get minutes 1549 CD 44BD A call byte ; print in ASCII 154C 3E 3A A ld a,':' 154E CD 1F18 A call cout A 1551 3A 809D A ld a,(clkp) ; clock present? (0ffh = not there) 1554 B7 A or a 1555 CA 155E A jp z,ucrt15 A 1558 3A 80A3 A ld a,(msec) 155B C3 1567 A jp ucrt16 A 155E 3A D002 A ucrt15: ld a,(sec) 1561 CD 0BDF A call ctest 1564 C2 155E A jp nz,ucrt15 ; NZ = rollover during read A 1567 CD 44BD A ucrt16: call byte A 156A 3A 80A1 A ld a,(mhrs) 156D FE 12 A cp 12h 156F DA 157C A jp c,ucrt17 ; C = AM A 1572 CD 4541 A call vprint 1575 20 50 4D 00 A defb ' PM',0 1579 C3 1583 A jp ucrt18 A 157C CD 4541 A ucrt17: call vprint 157F 20 41 4D 00 A defb ' AM',0 A 1583 3A 809D A ucrt18: ld a,(clkp) ; get the clock flag 1586 B7 A or a 1587 CA 1596 A jp z,ucrt19 ; Z = clock IC present A 158A CD 4538 A call gxymsg 158D 13 39 A defb 19,col1+15 158F 28 53 29 00 A defb '(S)',0 ; software clock indicator A 1593 C3 159F A jp ucrtx A 1596 CD 4538 A ucrt19: call gxymsg 1599 13 39 A defb 19,col1+15 159B 28 48 29 00 A defb '(H)',0 ; hardware clock indicator A 159F CD 4538 A ucrtx: call gxymsg ; clear WORKING message 15A2 18 2A A defb 24,col1 15A4 02 20 20 20 A defb 2,' ',1,0 A 15AE CD 43D1 A call prompt ; re-display READY Prompt A 15B1 C1 A pop bc 15B2 D1 A pop de 15B3 E1 A pop hl A 15B4 C9 A ret A A A ;---------------------------------------------------------------------------- A ; Subroutine SCANT - Scan a table A ;---------------------------------------------------------------------------- A A ; Entry: HL = number of bytes per entry A ; DE = Address of table to use A ; A = the desired table entry A ; NO RANGE CHECKING! A A ; Exit: String Printed at Console A A ; Uses: HL, DE, AF A 15B5 D5 A scant: push de 15B6 16 00 A ld d,0 15B8 5F A ld e,a ; put A into DE 15B9 CD 46C2 A call mulhd ; multiply month by number of bytes per entry 15BC D1 A pop de ; point to the table to use 15BD 19 A add hl,de ; add offset into table 15BE CD 4547 A call pstr 15C1 C9 A ret A A A ;---------------------------------------------------------------------------- A ; Month Table A ;---------------------------------------------------------------------------- A A ; Each entry must contain the same number of bytes! A ; (Four bytes per entry including trailing zero) A A ; 123 4 15C2 4A 61 6E 00 A motbl: defb 'Jan',0 15C6 46 65 62 00 A defb 'Feb',0 15CA 4D 61 72 00 A defb 'Mar',0 15CE 41 70 72 00 A defb 'Apr',0 15D2 4D 61 79 00 A defb 'May',0 15D6 4A 75 6E 00 A defb 'Jun',0 15DA 4A 75 6C 00 A defb 'Jul',0 15DE 41 75 67 00 A defb 'Aug',0 15E2 53 65 70 00 A defb 'Sep',0 15E6 20 20 20 00 A defb ' ',0 ; Padding needed because calendar 15EA 20 20 20 00 A defb ' ',0 ; output is packed BCD, not decimal 15EE 20 20 20 00 A defb ' ',0 15F2 20 20 20 00 A defb ' ',0 15F6 20 20 20 00 A defb ' ',0 15FA 20 20 20 00 A defb ' ',0 15FE 4F 63 74 00 A defb 'Oct',0 1602 4E 6F 76 00 A defb 'Nov',0 1606 44 65 63 00 A defb 'Dec',0 A A A ;---------------------------------------------------------------------------- A ; Day-of-the-week Table A ;---------------------------------------------------------------------------- A A ; Each entry must contain the same number of bytes! A ; (Ten bytes per entry including trailing zero) A A ; 123456789 10 160A 53 75 6E 64 A daywk: defb 'Sunday ',0 1614 4D 6F 6E 64 A defb 'Monday ',0 161E 54 75 65 73 A defb 'Tuesday ',0 1628 57 65 64 6E A defb 'Wednesday',0 1632 54 68 75 72 A defb 'Thursday ',0 163C 46 72 69 64 A defb 'Friday ',0 1646 53 61 74 75 A defb 'Saturday ',0 A A A A ;---------------------------------------------------------------------------- A ; Subroutine - PTSEC Print time in mm:ss format A ;---------------------------------------------------------------------------- A A ; Enter with HL pointing to the timer to read A 1650 11 0064 A ptsec: ld de,100 ; ticks are in 10 ms. intervals 1653 CD 4723 A call divhd ; divide by 100 to get seconds A 1656 E5 A push hl ; save total seconds 1657 11 003C A ld de,60 165A CD 4723 A call divhd ; divide by 60 to get remaining minutes 165D 7D A ld a,l 165E CD 4692 A call padc A 1661 3E 3A A ld a,':' ; print the colon 1663 CD 1F18 A call cout A 1666 11 003C A ld de,60 ; multiply by 60 1669 CD 46C2 A call mulhd ; HL has current number remaining minutes 166C EB A ex de,hl A 166D E1 A pop hl ; retrieve total seconds into HL 166E CD 46B5 A call subhd ; subtract 60 * remaining minutes A 1671 7D A ld a,l 1672 CD 4692 A call padc 1675 C9 A ret A A ;--------------------------------------------------------------------------- A ; Subroutine UCEV - Update CRT Scheduled Events A ;--------------------------------------------------------------------------- A 1676 7E A ucev: ld a,(hl) A 1677 FE FF A cp 0ffh ; active and pending? 1679 C2 1684 A jp nz,ucev1 A 167C 3E 50 A ld a,'P' ; print (P)ending 167E CD 1F18 A call cout 1681 C3 1696 A jp ucev3 A 1684 FE 80 A ucev1: cp 80h ; active and not pending? 1686 C2 1691 A jp nz,ucev2 A 1689 3E 41 A ld a,'A' ; print (A)ctive 168B CD 1F18 A call cout 168E C3 1696 A jp ucev3 A 1691 3E 4E A ucev2: ld a,'N' ; print (N)ot active 1693 CD 1F18 A call cout A 1696 CD 449D A ucev3: call sngl ; print space A 1699 23 A inc hl 169A 7E A ld a,(hl) ; get the priority byte 169B B7 A or a 169C C2 16A7 A jp nz,ucev4 A 169F 3E 4C A ld a,'L' ; print L(ow) priority 16A1 CD 1F18 A call cout 16A4 C3 16AC A jp ucev5 A 16A7 3E 48 A ucev4: ld a,'H' ; print H(igh) priority 16A9 CD 1F18 A call cout A 16AC CD 449D A ucev5: call sngl A 16AF 23 A inc hl 16B0 7E A ld a,(hl) ; get the event hours 16B1 CD 44BD A call byte ; print A 16B4 3E 3A A ld a,':' 16B6 CD 1F18 A call cout A 16B9 23 A inc hl 16BA 7E A ld a,(hl) ; get the event minutes 16BB CD 44BD A call byte ; print A 16BE CD 449A A call dubl ; print 2 spaces A 16C1 06 06 A ld b,6 ; print the next 6 chars in memory A 16C3 23 A ucev6: inc hl 16C4 7E A ld a,(hl) 16C5 CD 1F18 A call cout A 16C8 05 A dec b 16C9 C2 16C3 A jp nz,ucev6 16CC C9 A ret A A ;----------------------------------------------------------------------------- A ; Subroutine UCSD - Update Speed Dialer Display A ;----------------------------------------------------------------------------- A 16CD 7E A ucsd: ld a,(hl) ; get the first digit 16CE FE FF A cp 0ffh ; 0ffh = empty slot 16D0 CA 16EE A jp z,ucse A 16D3 06 00 A ld b,0 ; counter 16D5 7E A ucsd1: ld a,(hl) ; get the digit 16D6 FE FF A cp 0ffh ; done? 16D8 C8 A ret z ; return A 16D9 C6 30 A add 30h ; make ASCII 16DB CD 1F18 A call cout ; print the digit 16DE 23 A inc hl ; next digit 16DF 04 A inc b ; bump count A 16E0 78 A ld a,b ; get count 16E1 FE 03 A cp 3 ; 3 digits printed? 16E3 CC 16E9 A call z,ucdd ; yes = print dash char 16E6 C3 16D5 A jp ucsd1 ; loop back for more A A 16E9 3E 2D A ucdd: ld a,'-' 16EB C3 1F18 A jp cout A 16EE CD 4541 A ucse: call vprint 16F1 45 6D 70 74 A defb 'Empty',0 16F7 C9 A ret A A ;----------------------------------------------------------------------------- A ; Subroutine UCPM - Update Programmed Macro Commands Display A ;----------------------------------------------------------------------------- A 16F8 7E A ucpm: ld a,(hl) ; get the first digit 16F9 FE FF A cp 0ffh ; 0ffh = empty slot 16FB CA 16EE A jp z,ucse A 16FE 06 05 A ld b,5 ; counter 1700 7E A ucpm1: ld a,(hl) ; get the digit A 1701 CD 1F18 A call cout ; print the digit 1704 23 A inc hl ; next digit 1705 05 A dec b ; bump count 1706 C2 1700 A jp nz,ucpm1 ; loop back for more A 1709 C9 A ret A A ;----------------------------------------------------------------------------- A ; Subroutine UTWO - Update Two Meter Frequencies Display A ;----------------------------------------------------------------------------- A 170A 7E A utwo: ld a,(hl) ; get the first digit 170B FE FF A cp 0ffh ; 0ffh = empty slot 170D CA 16EE A jp z,ucse A 1710 06 07 A ld b,7 ; counter 1712 7E A utwo1: ld a,(hl) ; get the digit 1713 CD 1F18 A call cout ; print the next digit A 1716 23 A utwo2: inc hl ; next digit 1717 05 A dec b ; bump count 1718 C2 1712 A jp nz,utwo1 ; loop back for more A 171B 7E A ld a,(hl) ; get offset control digit 171C D6 30 A sub 30h ; convert from ascii 171E B7 A or a 171F CA 1745 A jp z,utwos ; 0 = Simplex, 1 = Repeat, 2 = Inverse A 1722 FE 02 A cp 2 ; auto offset mode? 1724 CA 1736 A jp z,utwoi A 1727 E5 A push hl 1728 CD 4541 A call vprint 172B 20 52 70 74 A rptstr: defb ' Rpt ',0 1732 E1 A pop hl A 1733 C3 1751 A jp utwo3 A 1736 E5 A utwoi: push hl 1737 CD 4541 A call vprint 173A 20 49 6E 76 A invstr: defb ' Inv ',0 1741 E1 A pop hl A 1742 C3 1751 A jp utwo3 A A 1745 E5 A utwos: push hl 1746 CD 4541 A call vprint 1749 20 53 78 20 A sxstr: defb ' Sx ',0 1750 E1 A pop hl A 1751 23 A utwo3: inc hl 1752 7E A ld a,(hl) ; get the power control digit 1753 D6 30 A sub 30h ; convert from ascii 1755 B7 A or a 1756 CA 1765 A jp z,utwol ; 0 = Low Power, 1 = High Power A 1759 E5 A push hl 175A CD 4541 A call vprint 175D 48 50 20 00 A hpstr: defb 'HP ',0 1761 E1 A pop hl A 1762 C3 176E A jp utwo4 A 1765 E5 A utwol: push hl 1766 CD 4541 A call vprint 1769 4C 50 20 00 A lpstr: defb 'LP ',0 176D E1 A pop hl A 176E 3A 83CB A utwo4: ld a,(twoac) ; get the active channel 1771 B9 A cp c ; compare to currently displayed channel 1772 C2 177C A jp nz,utwo5 A 1775 3E 2A A ld a,'*' ; print active channel indicator 1777 CD 1F18 A call cout 177A 0C A inc c ; next channel 177B C9 A ret A 177C 3E 20 A utwo5: ld a,' ' ; clear active channel indicator 177E CD 1F18 A call cout 1781 0C A inc c ; next channel 1782 C9 A ret A A ; ------------------------ end of file -- UCRT.Z80 ------------------------- A include master.z80 A A ;============================================================================ A ; MASTER LOOP (Foreground Routine) A ;============================================================================ A A ;----------------------------------------------------------------------------- A ; Foreground Task Address Table TASKADDR A ;----------------------------------------------------------------------------- A A ; This is a table of address for the varoius Foreground Tasks. The A ; order of the Task in the table determines its priority. The order A ; and number of routines must exactly correspond with the number and A ; order of the entries in the Foreground Task Flag Table (FGTF) in RAM. A A ; The Task Flag Table is a table of one byte entries. Each entry A ; corresponds to a table of Task Addresses in ROM. When the Task Flag A ; is set (by the Background Interrupt Routines) it will be serviced A ; by the Foreground Routine according to priority. A A 1783 A taskadr: 1783 19CB A defw beer ; Send Beer Message 1 1785 1957 A defw toav ; 6M Time-Out Alarm 2 1787 1988 A defw toau ; 450 Time-Out Alarm 3 1789 1804 A defw tstid ; MCW ID 4 178B 182F A defw vctg ; send 6M Courtesy Tone 5 178D 1876 A defw uctg ; send 450 Courtesy Tone 6 178F 1918 A defw pctg ; Landline Courtesy Tone 7 1791 1940 A defw dpatch ; Dump Autopatch 8 1793 194A A defw rtpl ; Temp PL Override Reset 9 1795 19DB A defw rdnul ; End of DTMF Pass-Thru 10 1797 1A04 A defw rltx ; Link TX Timed-out 11 1799 1A31 A defw rllc ; Reset Landline Control 12 179B 1A3B A defw ucrtf ; Update CRT Screen 13 A A A ; ----------------- The Master Looop starts here --------------------------- A 179D E5 A master: push hl ; save all registers 179E D5 A push de 179F C5 A push bc 17A0 F5 A push af A A 17A1 21 81FF A fore: ld hl,fgtf-1 ; point to start of task flag table 17A4 11 1781 A ld de,taskadr-2 ; point to start of task addr table 17A7 76 A halt ; wait for next interrupt to synchronize A A ; It takes 10 cycles through the TISR Interrupt Routine A ; to complete all system updates. Execute the Foreground A ; Routine only after all 10 cycles have been completed. A A ; ld a,(intcnt) ; get the interrupt cycle counter A ; cp 9 ; processes 0 thru 9 done? A ; jp nz,masty ; nope, bail out A 17A8 CD 1E97 A fore1: call tick ; tick the watchdog A 17AB CD 1A45 A call check ; check for pending task A A ; This is where the Foreground Tasks return A ; >---->---+ A ; | A ; v A 17AE DA 17B7 A jp c,mastx ; do the rest of the polled stuff if CY=1 A 17B1 7D A ld a,l ; see if more tasks to check 17B2 FE 0C A cp low fgtfe-1 17B4 C2 17A8 A jp nz,fore1 ; go back and do more A A A ; The following subsystems are polled every pass through the Master Loop A 17B7 CD 1A5A A mastx: call llctl ; process landline control/ringdown access 17BA CD 1C99 A call schev ; process scheduled events 17BD CD 17C5 A call tstcrt ; process CRT power up/down test A 17C0 F1 A masty: pop af ; restore all registers 17C1 C1 A pop bc 17C2 D1 A pop de 17C3 E1 A pop hl 17C4 C9 A ret A A ;----------------------------------------------------------------------------- A ; Subroutine TSTCRT - Test for CRT power up/down A ;----------------------------------------------------------------------------- A A ; This is a foreground task which is polled during every A ; pass and not prioritized by the Foreground Task Table A 17C5 3A A001 A tstcrt: ld a,(ttyc) ; read USART Status Information 17C8 E6 80 A and dsrmsk ; only look at DSR Bit 17CA CA 17E4 A jp z,tstc1 A A ; DSR is active (CRT is on), set the UFLAG and reset the display A 17CD 3A 80B5 A ld a,(dsrflg) ; see if flag is reset (DSR coming on) 17D0 B7 A or a 17D1 C0 A ret nz ; NZ = already set, DSR was already on A 17D2 CD 243F A call onesec 17D5 CD 17F7 A call clbuf 17D8 CD 21F6 A call cmenu ; reset the screen 17DB CD 10CE A call ucron ; enable refresh updates A 17DE 3E FF A ld a,0ffh ; set the DSR flag 17E0 32 80B5 A ld (dsrflg),a A 17E3 C9 A ret A A ; DSR is inactive (CRT is off), reset the UFLAG A 17E4 3A 80B5 A tstc1: ld a,(dsrflg) ; see if flag is set (DSR going off) 17E7 B7 A or a 17E8 C8 A ret z ; Z = already reset, DSR was already off A 17E9 CD 243F A call onesec 17EC CD 10D4 A call ucroff ; disable screen refresh updates 17EF CD 17F7 A call clbuf ; clear the type-ahead buffer A 17F2 AF A xor a ; reset the DSR flag 17F3 32 80B5 A ld (dsrflg),a A 17F6 C9 A ret A A ; Gobble up any chars which appear during CRT power up or down A ; by resetting the type-ahead buffer system A 17F7 AF A clbuf: xor a 17F8 32 8020 A ld (iptr),a 17FB 32 8021 A ld (optr),a A 17FE 3E 0D A ld a,cr 1800 CD 1EE1 A call putbuf A 1803 C9 A ret A A A A ;============================================================================= A ; Foreground Tasks for the Master Loop A ;============================================================================= A A A ;----------------------------------------------------------------------------- A ; Foreground Task TSTID - Test for Time to ID A ;----------------------------------------------------------------------------- A 1804 3A 804B A tstid: ld a,(port7s) ; are any TX on? 1807 E6 03 A and utx+vtx 1809 CA 1818 A jp z,tstid1 ; don't ID if TX off unless Broadcast flag set A 180C CD 0BD4 A call grsd ; get receivers delayed status 180F C2 182D A jp nz,tstidx A 1812 CD 24FC A call sndid ; polite ID, wait for COS off to send ID 1815 C3 1828 A jp tstid2 A 1818 3A 8082 A tstid1:ld a,(bidflg) ; get the Broadcast ID flag 181B B7 A or a 181C CA 182D A jp z,tstidx A 181F CD 0BD4 A call grsd ; get receivers delayed status 1822 C2 182D A jp nz,tstidx ; polite ID, wait for COS off to send ID A 1825 CD 2F71 A call sndsbd A 1828 AF A tstid2: xor a 1829 32 8082 A ld (bidflg),a ; reset the Broadcast ID flag A 182C 37 A scf 182D E1 A tstidx: pop hl 182E C9 A ret A A ;----------------------------------------------------------------------------- A ; Foreground Task VCTG - Generate 6M Courtesy Tone A ;----------------------------------------------------------------------------- A 182F 3A 8219 A vctg: ld a,(vctmod) ; get 6M courtesy tone mode 1832 47 A ld b,a ; save 1833 B7 A or a ; Z = Disabled (mode 0) 1834 CA 1870 A jp z,vcty A 1837 3A 8067 A ld a,(vdcos) ; 6M delayed COS 183A B7 A or a 183B C2 1874 A jp nz,vctx A 183E 78 A ld a,b ; get mode back 183F FE 01 A cp 1 ; mode 1 = first key-up only 1841 C2 1850 A jp nz,vctg1 A 1844 3A 80B7 A ld a,(cttflv) ; get 6M courtesy tone control flag 1847 B7 A or a ; see if first key-up 1848 C2 1870 A jp nz,vcty ; NZ = already done A 184B 3E FF A ld a,0ffh ; set the done flag 184D 32 80B7 A ld (cttflv),a A 1850 3A 8203 A vctg1: ld a,(fidtm) ; see if ID ready 1853 B7 A or a 1854 C4 24FC A call nz,sndid A 1857 CD 2404 A call t800 ; set 800 Hz tone 185A CD 25FC A call tonon ; tone on 185D CD 244E A call sec17 ; delay 1/7 second 1860 CD 23F2 A call t1200 ; set 1200 Hz tone 1863 CD 244E A call sec17 ; delay 1/7 second 1866 CD 2605 A call tonoff ; tone off 1869 CD 2449 A call qsec ; delay 1/4 second A 186C CD 18BD A call lctg ; see if any link courtesy tones needed A 186F 37 A scf A 1870 AF A vcty: xor a 1871 32 8204 A ld (fvctm),a ; reset foreground task flag A 1874 E1 A vctx: pop hl 1875 C9 A ret A A ;----------------------------------------------------------------------------- A ; Foreground Task UCTG - generate 450 Courtesy Tone A ;----------------------------------------------------------------------------- A 1876 3A 821A A uctg: ld a,(uctmod) ; get 450 courtesy tone mode 1879 47 A ld b,a ; save 187A B7 A or a ; Z = Disabled (mode 0) 187B CA 18B7 A jp z,ucty A 187E 3A 8068 A ld a,(udcos) ; 450 delayed COS 1881 B7 A or a 1882 C2 18BB A jp nz,uctx A 1885 78 A ld a,b ; get mode back 1886 FE 01 A cp 1 ; mode 1 = first key-up only 1888 C2 1897 A jp nz,uctg1 A 188B 3A 80B8 A ld a,(cttflu) ; get 450 courtesy tone control flag 188E B7 A or a ; see if first key-up 188F C2 18B7 A jp nz,ucty ; NZ = already done A 1892 3E FF A ld a,0ffh ; set the done flag 1894 32 80B8 A ld (cttflu),a A 1897 3A 8203 A uctg1: ld a,(fidtm) ; see if ID ready 189A B7 A or a 189B C4 24FC A call nz,sndid A 189E CD 23F2 A call t1200 ; set 1200 Hz tone 18A1 CD 25FC A call tonon ; tone on 18A4 CD 244E A call sec17 ; delay 1/7 second 18A7 CD 2404 A call t800 ; set 800 Hz tone 18AA CD 244E A call sec17 ; delay 1/7 second 18AD CD 2605 A call tonoff ; tone off 18B0 CD 2449 A call qsec ; delay 1/4 second A 18B3 CD 18BD A call lctg ; see if any link courtesy tones needed A 18B6 37 A scf A 18B7 AF A ucty: xor a 18B8 32 8205 A ld (fuctm),a ; reset foreground task flag A 18BB E1 A uctx: pop hl 18BC C9 A ret A A ;---------------------------------------------------------------------------- A ; Subroutine LCTG - Generate Link Courtesy Tones A ;---------------------------------------------------------------------------- A A ; This routine is called by both VCTG (6M) and UCTG (450) courtesy tone A ; routines above. A 18BD 3A 80B6 A lctg: ld a,(cttflg) ; see if main TX has been on 18C0 B7 A or a ; (skip aux courtesy tones 18C1 C0 A ret nz ; except for first main TX key) A 18C2 3E FF A ld a,0ffh ; set control flag 18C4 32 80B6 A ld (cttflg),a ; no aux courtesy tones next time A 18C7 3A 8213 A ld a,(port7c) ; read control port 18CA E6 08 A and a1tx ; see if AUX TX #1 enabled 18CC CA 18DE A jp z,lctg1 ; Z = transmitter not active A 18CF CD 23F8 A call t1000 ; set 1000 Hz tone 18D2 3A 825C A ld a,(mdfcb1) ; get the default character 18D5 CD 25AD A call cwl ; send the indicator character 18D8 CD 2449 A call qsec ; wait 1/4 second 18DB C3 18F2 A jp lctg2 ; go on to check AUX RX/TX #2 A 18DE 3A 820E A lctg1: ld a,(port1c) ; read control port 18E1 E6 10 A and a1cos ; see if AUX RX #1 enabled 18E3 CA 18F2 A jp z,lctg2 ; Z = receiver not active A 18E6 CD 23F8 A call t1000 ; set 1000 Hz tone 18E9 3A 825A A ld a,(mdfct1) ; get the default character 18EC CD 25AD A call cwl ; send the indicator character 18EF CD 2449 A call qsec ; wait 1/4 second A 18F2 3A 8213 A lctg2: ld a,(port7c) ; read control port 18F5 E6 10 A and a2tx ; see if AUX TX #2 enabled 18F7 CA 1906 A jp z,lctg3 ; Z = transmitter not active A 18FA CD 240A A call t660 ; set 660 Hz tone 18FD 3A 825D A ld a,(mdfcb2) ; get the default character 1900 CD 25AD A call cwl ; send the indicator character 1903 C3 2449 A jp qsec ; wait 1/4 second and return A 1906 3A 820E A lctg3: ld a,(port1c) ; read control port 1909 E6 20 A and a2cos ; see if AUX RX #2 enabled 190B C8 A ret z ; Z = receiver not active A 190C CD 240A A call t660 ; set 660 Hz tone 190F 3A 825A A ld a,(mdfct1) ; get the default character 1912 CD 25AD A call cwl ; send the indicator character 1915 C3 2449 A jp qsec ; wait 1/4 second and return A A ;----------------------------------------------------------------------------- A ; Foreground Task PCTG - generate Landline Courtesy Tone A ;----------------------------------------------------------------------------- A 1918 CD 1C4D A pctg: call tbeep4 ; beep the phone line A 191B CD 2289 A call stat 191E 4C 61 6E 64 A defb 'Landline close to Time-Out',0 A 1939 AF A xor a 193A 32 8206 A ld (fpctm),a ; reset foreground task flag A 193D 37 A scf 193E E1 A pop hl 193F C9 A ret A A A ;----------------------------------------------------------------------------- A ; Foreground Task DPATCH - Autopatch Time-Out A ;----------------------------------------------------------------------------- A 1940 CD 3455 A dpatch: call ptchoff ; dump patch with call to Control System A 1943 AF A xor a 1944 32 8207 A ld (fpatm),a ; reset foreground task flag A 1947 37 A scf 1948 E1 A pop hl 1949 C9 A ret A A ;---------------------------------------------------------------------------- A ; Foreground Task RTPL - Reset Temp PL Override A ;---------------------------------------------------------------------------- A 194A CD 4185 A rtpl: call tpld ; Reset with call to Control System 194D CD 23D8 A call cbeep A 1950 AF A xor a 1951 32 8208 A ld (ftplm),a ; reset foreground task flag A 1954 37 A scf 1955 E1 A pop hl 1956 C9 A ret A A ;----------------------------------------------------------------------------- A ; Foreground Task TOAV - 6M Time-Out Alarm A ;----------------------------------------------------------------------------- A 1957 CD 2404 A toav: call t800 ; 6M RX Alarm 195A CD 19BA A call toa A 195D CD 0BD4 A call grsd ; get receiver status 1960 C2 1986 A jp nz,toavx A 1963 2A 8231 A ld hl,(mdfto) ; preset default RX time-out 1966 22 8054 A ld (vrtim),hl A 1969 AF A xor a 196A 32 8201 A ld (fvtom),a ; reset foreground task flag A 196D CD 2289 A call stat 1970 36 4D 20 52 A defb '6M RX Time-Out Reset',0 A 1985 37 A scf 1986 E1 A toavx: pop hl 1987 C9 A ret A A ;----------------------------------------------------------------------------- A ; Foreground Task TOAU - 450 Time-Out Alarm A ;----------------------------------------------------------------------------- A 1988 CD 23F2 A toau: call t1200 ; 450 RX Alarm 198B CD 19BA A call toa A 198E CD 0BD4 A call grsd ; get receiver status 1991 C2 19B8 A jp nz,toaux A 1994 2A 8231 A ld hl,(mdfto) ; preset default RX time-out 1997 22 8056 A ld (urtim),hl A 199A AF A xor a 199B 32 8202 A ld (futom),a ; reset foreground task flag A 199E CD 2289 A call stat 19A1 34 35 30 20 A defb '450 RX Time-Out Reset',0 A 19B7 37 A scf 19B8 E1 A toaux: pop hl 19B9 C9 A ret A A A ;----------------------------------------------------------------------------- A ; Subroutine TOA - Time-Out Alarm A ;----------------------------------------------------------------------------- A 19BA CD 25FC A toa: call tonon ; time-out alarm 19BD 3E 19 A ld a,25 ; 250 ms delay 19BF CD 2455 A call delay 19C2 CD 2605 A call tonoff 19C5 3E 19 A ld a,25 ; 250 ms delay 19C7 CD 2455 A call delay A 19CA C9 A ret A A ;---------------------------------------------------------------------------- A ; Foreground Task BEER - Send Beer Message after Time-Outs A ;---------------------------------------------------------------------------- A 19CB CD 0BD4 A beer: call grsd ; get receiver status 19CE C2 19D9 A jp nz,beerx A 19D1 CD 2543 A call sndbeer ; send the beer message A 19D4 AF A xor a 19D5 32 8200 A ld (fberm),a ; reset foreground task flag A 19D8 37 A scf 19D9 E1 A beerx: pop hl 19DA C9 A ret A A ;---------------------------------------------------------------------------- A ; Foreground Task RDNUL - End of DTMF Pass-Thru A ;---------------------------------------------------------------------------- A 19DB CD 23D8 A rdnul: call cbeep A 19DE CD 2289 A call stat 19E1 44 54 4D 46 A defb 'DTMF Pass-Thru Timed-Out',0 A 19FA AF A xor a 19FB 32 807B A ld (bdtmfr),a ; restore radio DTMF interrupts 19FE 32 8209 A ld (fdnlm),a ; reset foreground task flag A 1A01 37 A scf 1A02 E1 A pop hl 1A03 C9 A ret A A ;---------------------------------------------------------------------------- A ; Foreground Task RLTX - Link Transmitters Timed-Out A ;---------------------------------------------------------------------------- A 1A04 3A 8213 A rltx: ld a,(port7c) ; get control byte 1A07 E6 E7 A and not (a1tx+a2tx) ; disable Aux TX bits 1A09 32 8213 A ld (port7c),a ; save back A 1A0C CD 2289 A call stat 1A0F 41 75 78 20 A defb 'Aux Transmitters Timed-Out',0 A 1A2A AF A xor a 1A2B 32 820A A ld (fltxm),a ; reset foreground task flag A 1A2E 37 A scf 1A2F E1 A pop hl 1A30 C9 A ret A A ;---------------------------------------------------------------------------- A ; Foreground Task RLLC - Reset Landline Control A ;---------------------------------------------------------------------------- A 1A31 CD 1B94 A rllc: call llrst ; call the reset routine A 1A34 AF A xor a 1A35 32 820B A ld (fltom),a ; reset foreground task flag A 1A38 37 A scf 1A39 E1 A pop hl 1A3A C9 A ret A A ;---------------------------------------------------------------------------- A ; Foreground Task UCRTF - Update CRT Screen A ;---------------------------------------------------------------------------- A 1A3B CD 116A A ucrtf: call ucrt A 1A3E AF A xor a 1A3F 32 820C A ld (fucrm),a ; reset foreground task flag A 1A42 37 A scf 1A43 E1 A pop hl 1A44 C9 A ret A A A ;----------------------------------------------------------------------------- A ; Check for Pending Tasks - CHECK A ;----------------------------------------------------------------------------- A A ; This routine checks the table of Task Pending Flags (FGTF) in RAM and A ; calls the appropriate Foreground Task if the flag is set. If the A ; Foreground Task executes, it returns with a SCF:POP HL (carry flag A ; set and HL pointing to the current task flag). If the Foreground Task A ; did not execute (because of conditionals not satisfied within the task) A ; then the task returns only with POP HL. The carry flag indicates that A ; the task was executed so we have to start scanning for new pending tasks A ; from the beginning again. A 1A45 23 A check: inc hl ; point to next task pending flag 1A46 7E A ld a,(hl) ; get the flag 1A47 B7 A or a 1A48 C8 A ret z ; return if not set (Z) A A ; DE is now pointing to a word which contains the address A ; of the Foreground Task we want to process A 1A49 A chk1: 1A49 E5 A push hl ; HL = Poistion in Task Flag Table 1A4A 7D A ld a,l 1A4B D6 00 A sub low fgtf 1A4D 11 9583 A ld de,taskadr-fgtf 1A50 19 A add hl,de ; calculate routine address 1A51 5F A ld e,a 1A52 16 00 A ld d,0 ; DE = offset value 1A54 19 A add hl,de ; HL = address in table 1A55 5E A ld e,(hl) 1A56 23 A inc hl 1A57 56 A ld d,(hl) 1A58 EB A ex de,hl ; HL = jump address 1A59 E9 A jp (hl) ; go there A A A A ; ----------------------- end of file MASTER.Z80 ----------------------------- include llctl.z80 A A ;---------------------------------------------------------------------------- A ; Land-Line Ringdown and Control System Access A ;---------------------------------------------------------------------------- A A 1A5A 3A 809A A llctl: ld a,(llful) ; is landline control unlocked? 1A5D B7 A or a 1A5E C0 A ret nz A 1A5F 2A 8092 A ld hl,(ansacc) ; control access pending? 1A62 7C A ld a,h 1A63 B5 A or a,l 1A64 C0 A ret nz A 1A65 2A 8094 A ld hl,(anshld) ; phone call hold in progress? 1A68 7C A ld a,h 1A69 B5 A or a,l 1A6A C2 1B17 A jp nz,llct2 A 1A6D 3A 809B A ld a,(llfhl) ; get the hold time-out flag 1A70 B7 A or a 1A71 C4 1C75 A call nz,llhlr ; reset from hold status A 1A74 3A 809C A ld a,(llfrt) ; inter-ring timed out? 1A77 B7 A or a 1A78 C2 1AF1 A jp nz,tstrnt A 1A7B 3A 8098 A ld a,(llfrg) ; phone has rung? 1A7E B7 A or a 1A7F C8 A ret z A A ;----------------------------------------------------------------------------- A ; Phone has rung A ;----------------------------------------------------------------------------- A 1A80 CD 2289 A tstrng: call stat 1A83 52 69 6E 67 A defb 'Ring! #',0 A 1A8C AF A xor a 1A8D 32 8098 A ld (llfrg),a ; reset the ring flag A 1A90 3A 824E A ld a,(mdfrgm) ; get the default max # of rings 1A93 47 A ld b,a A 1A94 3A 808F A ld a,(rgcnt) ; get the current ring counter 1A97 3C A inc a ; bump it up 1A98 32 808F A ld (rgcnt),a ; save back A 1A9B F5 A push af 1A9C C6 30 A add a,30h ; make ascii-1 1A9E CD 1F18 A call cout ; print on screen 1AA1 F1 A pop af A 1AA2 B8 A cp a,b ; did we reach the max # of rings? 1AA3 C0 A ret nz ; return if not A A ; Maximum number of rings is reached. Answer the phone. A 1AA4 AF A xor a ; enable DTMF interrupts from 1AA5 32 807C A ld (bdtmft),a ; telephone line decoder 1AA8 32 808F A ld (rgcnt),a ; reset the ring counter A 1AAB 3A 8048 A ld a,(port4s) ; access the landline relay 1AAE F6 02 A or iclr 1AB0 32 8048 A ld (port4s),a A 1AB3 2A 8255 A ld hl,(mdfmxl) ; preset the max landline time 1AB6 22 8096 A ld (maxll),hl A 1AB9 2A 8251 A ld hl,(mdfacc) ; preset the access time 1ABC 22 8092 A ld (ansacc),hl A 1ABF 2A 8253 A ld hl,(mdfhld) ; preset the hold time 1AC2 22 8094 A ld (anshld),hl A 1AC5 CD 2289 A call stat 1AC8 43 61 6C 6C A defb 'Call answered. Waiting for access. ',0 1AEE C3 43D1 A jp prompt A A A ; The inter-ring timer timed-out A 1AF1 AF A tstrnt: xor a 1AF2 32 808F A ld (rgcnt),a ; clear the ring counter 1AF5 32 809C A ld (llfrt),a ; clear the time-out flag A 1AF8 CD 2289 A call stat 1AFB 49 6E 63 6F A defb 'Incoming Ring Timed-Out.',0 1B14 C3 43D1 A jp prompt A A A ; Control was not unlocked, do ringdown and wait awhile A 1B17 3E FF A llct2: ld a,0ffh ; block DTMF interrupts from 1B19 32 807C A ld (bdtmft),a ; telephone line decoder A 1B1C 3A 8053 A ld a,(eol) ; command line active? 1B1F B7 A or a 1B20 C8 A ret z A 1B21 CD 1C07 A call llpm1 ; enable monitor mode 1B24 CD 2289 A call stat 1B27 49 6E 63 6F A defb 'Incoming call holding. ',0 1B40 CD 43D1 A call prompt A 1B43 CD 23B1 A llct3: call ding ; send the ring tone 1B46 CD 23B1 A call ding 1B49 CD 23B1 A call ding 1B4C CD 23B1 A call ding 1B4F CD 23B1 A call ding 1B52 CD 243A A call twosec 1B55 C9 A ret A A A ;-------------- Unlock Landline Control System ------------------------------ A 1B56 2A 8094 A llun: ld hl,(anshld) ; hold time in progress? 1B59 7C A ld a,h 1B5A B5 A or a,l 1B5B CA 226D A jp z,error ; nope, zero came in from somewhere A 1B5E CD 2289 A call stat 1B61 4C 61 6E 64 A defb 'Landline Control Unlock Successful.',0 1B85 CD 43D1 A call prompt A 1B88 AF A xor a ; enable DTMF interrupts from 1B89 32 807C A ld (bdtmft),a ; telephone line decoder A 1B8C 3E FF A ld a,0ffh 1B8E 32 809A A ld (llful),a ; unlock landline control 1B91 C3 1C50 A jp tbeep2 ; sent confirmation tone to phone user A A A ;-------------- Reset Landline Control System -------------------------------- A 1B94 CD 3489 A llrst: call ptchfq ; turn patch off which signals phone user A 1B97 CD 2289 A call stat 1B9A 4C 61 6E 64 A defb 'Landline Control Reset',0 1BB1 CD 43D1 A call prompt A 1BB4 21 0000 A llrs1: ld hl,0 1BB7 22 8092 A ld (ansacc),hl ; control access time 1BBA 22 8094 A ld (anshld),hl ; hold time 1BBD 22 8096 A ld (maxll),hl ; max landline time A 1BC0 AF A xor a 1BC1 32 809A A ld (llful),a ; drop unlock flag 1BC4 32 809B A ld (llfhl),a ; drop hold flag 1BC7 32 8099 A ld (llfan),a ; drop answer flag 1BCA 32 809C A ld (llfrt),a ; clear the time-out flag 1BCD 32 820B A ld (fltom),a ; reset foreground task flag A 1BD0 3E FF A ld a,0ffh ; block DTMF interrupts from 1BD2 32 807C A ld (bdtmft),a ; telephone line decoder A 1BD5 3A 8048 A ld a,(port4s) ; turn-off landline relay which hangs-up phone 1BD8 E6 F9 A and not (iclr+ptmon); and turn off Patch Monitor switch 1BDA 32 8048 A ld (port4s),a A 1BDD C9 A ret A A ;--------------- Enable Landline Monitor Mode -------------------------------- A 1BDE 3A 809A A llpm: ld a,(llful) ; see if control system unlocked 1BE1 B7 A or a 1BE2 CA 249F A jp z,sndno A 1BE5 CD 1C07 A call llpm1 1BE8 CD 2289 A call stat 1BEB 4C 61 6E 64 A defb 'Landline Monitor Mode',0 1C01 CD 3EEE A call prena ; enabled 1C04 C3 1C50 A jp tbeep2 ; send confirmation to phone user A 1C07 3A 804B A llpm1: ld a,(port7s) 1C0A E6 BF A and not ptchg 1C0C F6 04 A or ptchr ; turn-on only the patch relay 1C0E 32 804B A ld (port7s),a A 1C11 3A 8048 A ld a,(port4s) 1C14 F6 04 A or ptmon ; turn-on Patch Monitor switch 1C16 32 8048 A ld (port4s),a A 1C19 AF A xor a 1C1A 32 8073 A ld (ptchm),a ; clear patch flag A 1C1D C9 A ret A A ;--------------- Disable Landline Monitor Mode ------------------------------- A 1C1E 3A 809A A llpd: ld a,(llful) ; see if control system unlocked 1C21 B7 A or a 1C22 CA 249F A jp z,sndno A 1C25 CD 3489 A llpd1: call ptchfq 1C28 CD 2289 A call stat 1C2B 4C 61 6E 64 A defb 'Landline Monitor Mode',0 1C41 CD 3EFB A call prdis ; disabled 1C44 3A 8048 A ld a,(port4s) 1C47 E6 FB A and not ptmon ; turn-off Patch Monitor switch 1C49 32 8048 A ld (port4s),a A 1C4C C9 A ret A A ; -------------------- Beep signal to phone line user ---------------------- A 1C4D CD 1C50 A tbeep4: call tbeep2 ; 2 beeps and fall through for another pair A 1C50 CD 1C53 A tbeep2: call tbeep ; beep and fall through for a second beep A 1C53 3A 807C A tbeep: ld a,(bdtmft) ; get the current state of DTMF block flag 1C56 F5 A push af ; save it A 1C57 3E FF A ld a,0ffh ; block DTMF interrupts from 1C59 32 807C A ld (bdtmft),a ; telephone line decoder A 1C5C AF A xor a 1C5D F6 10 A or dgenc ; send tone signal to user via 1C5F 32 E000 A ld (port8),a ; DTMF dialer A 1C62 3E 0A A ld a,100/10 ; 100 ms. tone on 1C64 CD 2455 A call delay A 1C67 AF A xor a 1C68 32 E000 A ld (port8),a ; tone off A 1C6B 3E 0A A ld a,100/10 ; 100 ms. tone off 1C6D CD 2455 A call delay A 1C70 F1 A pop af ; restore previous DTMF block state 1C71 32 807C A ld (bdtmft),a A 1C74 C9 A ret A A A ; ---------------------- Release Landline Control -------------------------- A 1C75 CD 3489 A llhlr: call ptchfq ; turn patch off which signals phone user A 1C78 CD 2289 A call stat 1C7B 4C 61 6E 64 A defb 'Landline Hold Timed-Out',0 1C93 CD 43D1 A call prompt A 1C96 C3 1BB4 A jp llrs1 ; reset landline control system A A A ; --------------------- end of file LLCTL.Z80 -------------------------------- include schev.z80 A ;----------------------------------------------------------------------------- A ; Subroutine SCHEV - Process Scheduled Events A ;----------------------------------------------------------------------------- A A ; This routine is called from the Foreground A 1C99 CD 1E2D A schev: call rdtim ; read the clock chip (if there) A ; and save in memory A A ; See if it's time for an hourly chime A 1C9C CD 0BD4 A call grsd ; get main receivers status 1C9F C2 1DBD A jp nz,sche14 ; skip chime if receivers active A 1CA2 3A 8223 A ld a,(chena) ; get the chime control flag 1CA5 B7 A or a 1CA6 CA 1CE4 A jp z,sche1 ; Z = disabled A 1CA9 3A 80AC A ld a,(chdon) ; get the chime done flag 1CAC B7 A or a 1CAD C2 1DA4 A jp nz,sche12 ; NZ = done A 1CB0 3A 80A2 A ld a,(mmin) ; get the current minutes 1CB3 B7 A or a 1CB4 C2 1CE4 A jp nz,sche1 ; NZ = not time yet A 1CB7 CD 237C A call mbeep 1CBA CD 2444 A call halfsec A 1CBD CD 0BD4 A call grsd ; get main receivers status again 1CC0 C2 1DBD A jp nz,sche14 ; skip speech if receivers active A 1CC3 3A 8218 A ld a,(cwena) ; get the speech/MCW mode 1CC6 FE 02 A cp 2 1CC8 CC 2F85 A call z,stime ; speak the time if speech enabled A 1CCB 3E FF A ld a,0ffh ; set the chime done flag 1CCD 32 80AC A ld (chdon),a A 1CD0 3E FF A ld a,0ffh ; set the broadcast ID flag 1CD2 32 8082 A ld (bidflg),a A 1CD5 2A 804D A ld hl,(idtim) ; time to ID? 1CD8 7C A ld a,h 1CD9 B5 A or a,l 1CDA C2 1CE4 A jp nz,sche1 A 1CDD CD 2F5F A call sndsid ; send ID 1CE0 AF A xor a 1CE1 32 8082 A ld (bidflg),a ; reset the broadcast ID flag A A A ; Now, test the events to see if it is time to process any A ; scheduled events A A 1CE4 06 00 A sche1: ld b,0 ; number of events counter 1CE6 21 830D A ld hl,sch0 ; point to first event A 1CE9 7E A sche2: ld a,(hl) ; get the event pending byte 1CEA FE FF A cp 0ffh 1CEC C2 1D4E A jp nz,sche8 ; FF = Pending, 80 = Active, 00 = not Active A 1CEF 23 A inc hl ; point to priority byte A 1CF0 23 A sche3: inc hl ; point to event hours 1CF1 3A 80A1 A ld a,(mhrs) ; get the current hours 1CF4 BE A cp (hl) ; equal? 1CF5 C2 1D4C A jp nz,sche6 A 1CF8 23 A inc hl ; point to event minutes 1CF9 3A 80A2 A ld a,(mmin) ; get the current minutes 1CFC BE A cp (hl) 1CFD C2 1D4B A jp nz,sche5 A A ; Hours and minutes in event match current time A 1D00 2B A dec hl 1D01 2B A dec hl 1D02 7E A ld a,(hl) ; get priority byte 1D03 B7 A or a ; Z = low priority 1D04 C2 1D0D A jp nz,sche3a A 1D07 CD 0BD4 A call grsd ; see if main receivers are active 1D0A C2 1DC5 A jp nz,sche15 ; skip event processing completely if active A 1D0D E5 A sche3a: push hl 1D0E CD 2289 A call stat 1D11 53 63 68 65 A defb 'Scheduled Event #',0 1D23 78 A ld a,b 1D24 C6 30 A add 30h ; make ascii 1D26 CD 1F18 A call cout 1D29 CD 449A A call dubl ; two spaces 1D2C CD 243F A call onesec 1D2F E1 A pop hl A 1D30 2B A dec hl 1D31 3E 80 A ld a,80h ; mark the event as not pending 1D33 77 A ld (hl),a 1D34 23 A inc hl ; skip past Priority Byte, HH and MM 1D35 23 A inc hl 1D36 23 A inc hl A 1D37 23 A inc hl ; point to control code A 1D38 0E 06 A ld c,6 ; number of bytes to move A 1D3A 7E A sche4: ld a,(hl) ; get the char 1D3B CD 1EE1 A call putbuf ; put in the type-ahead buffer A 1D3E 23 A inc hl ; next char 1D3F 0D A dec c ; done with count? 1D40 C2 1D3A A jp nz,sche4 A 1D43 3E 0D A ld a,cr ; append the trailing CR 1D45 CD 1EE1 A call putbuf A 1D48 C3 1D52 A jp sche9 A 1D4B 2B A sche5: dec hl ; backup from MM, HH and priority byte 1D4C 2B A sche6: dec hl ; backup from MM and priority byte 1D4D 2B A sche7: dec hl ; backup from priority byte 1D4E 11 000A A sche8: ld de,10 ; we're at start of event (status byte) 1D51 19 A add hl,de ; offset to next event A 1D52 04 A sche9: inc b 1D53 78 A ld a,b 1D54 FE 0A A cp 10 1D56 DA 1CE9 A jp c,sche2 ; go back for more events A A A ; Now, test for 11:59 AM so that event pending updates can be made A 1D59 3A 80B0 A ld a,(eudon) ; get the event update done flag 1D5C B7 A or a 1D5D C2 1DB2 A jp nz,sche13 ; NZ = done A 1D60 3A 80A1 A ld a,(mhrs) ; get the current hours 1D63 FE 23 A cp 23h ; 11 pm? 1D65 C0 A ret nz A 1D66 3A 80A2 A ld a,(mmin) ; get the current minutes 1D69 FE 59 A cp 59H ; 11:59? 1D6B C0 A ret nz A 1D6C 21 830D A ld hl,sch0 ; first event 1D6F 11 000A A ld de,10 ; number of bytes per entry 1D72 06 0B A ld b,11 ; number of entries + 1 A 1D74 7E A sche10: ld a,(hl) ; get the pending byte 1D75 FE 80 A cp 80h ; active but not pending? 1D77 C2 1D7D A jp nz,sche11 A 1D7A 3E FF A ld a,0ffh ; make active and pending 1D7C 77 A ld (hl),a ; save back A 1D7D 19 A sche11: add hl,de ; point to next slot 1D7E 05 A dec b 1D7F C2 1D74 A jp nz,sche10 A 1D82 CD 2289 A call stat 1D85 45 76 65 6E A defb 'Event Processing Updated',0 A 1D9E 3E FF A ld a,0ffh ; set the event update done flag 1DA0 32 80B0 A ld (eudon),a A 1DA3 C9 A ret A A ; Chime was done, reset the chime done flag A 1DA4 3A 80A2 A sche12: ld a,(mmin) ; get the current minutes 1DA7 B7 A or a ; still zero? 1DA8 CA 1CE4 A jp z,sche1 ; go process scheduled events A 1DAB AF A xor a ; minutes advanced past zero 1DAC 32 80AC A ld (chdon),a ; reset the chime done flag 1DAF C3 1CE4 A jp sche1 ; go process scheduled events A A A ; Event Update was done, reset the event update done flag A 1DB2 3A 80A2 A sche13: ld a,(mmin) ; get the current minutes 1DB5 FE 59 A cp 59h ; still 59 minutes? 1DB7 C8 A ret z A 1DB8 AF A xor a ; minutes advanced to zero 1DB9 32 80B0 A ld (eudon),a ; reset the event update done flag 1DBC C9 A ret A A ; Receivers are in use, skip the chime completely A 1DBD 3E FF A sche14: ld a,0ffh 1DBF 32 80AC A ld (chdon),a ; set the chime done flag 1DC2 C3 1CE4 A jp sche1 ; go process scheduled events A A ; Receivers are in use, skip the event processing completely A 1DC5 2B A sche15: dec hl ; go back to control byte 1DC6 3E 80 A ld a,80h ; mark the event as not pending 1DC8 77 A ld (hl),a 1DC9 C3 1D4E A jp sche8 ; continue A A ;----------------------------------------------------------------------------- A ; Subroutine SETSCH - Program Scheduled Events A ;----------------------------------------------------------------------------- A A ; This routine is called from the control system A 1DCC 11 830D A setsch: ld de,sch0 ; start of the table to use 1DCF 21 000A A ld hl,10 ; number of bytes per entry 1DD2 CD 45DD A call mslot ; mslot is part of the macro code A A ; HL is now pointing to the event to program A 1DD5 3A 8044 A ld a,(clen) ; command line length 1DD8 B7 A or a 1DD9 CA 1E17 A jp z,setsc3 ; no args = toggle event active/not active A 1DDC 3E FF A ld a,0ffh ; first, mark the event 1DDE 77 A ld (hl),a ; as active and pending A 1DDF CD 44A2 A call rech ; get the priority code 0=low, 1=high 1DE2 FE 0D A cp cr ; no char there? 1DE4 CA 226D A jp z,error A 1DE7 CD 45F2 A call dchk ; convert to binary 1DEA FE 02 A cp 2 ; greater than 1 1DEC D2 226D A jp nc,error A 1DEF 23 A inc hl ; point to priority byte A 1DF0 FE 01 A cp 1 1DF2 C2 1DFB A jp nz,setsc1 A 1DF5 3E FF A ld a,0ffh 1DF7 77 A ld (hl),a ; save high priority 1DF8 C3 1DFD A jp setsc2 A 1DFB AF A setsc1: xor a 1DFC 77 A ld (hl),a ; save low priority A 1DFD CD 45C0 A setsc2: call gethx ; get the hours 1E00 FE 24 A cp 24h ; greater than 23 hours? 1E02 D2 226D A jp nc,error A 1E05 23 A inc hl ; point to hours byte 1E06 77 A ld (hl),a ; save hours in event A 1E07 CD 45C0 A call gethx ; get minutes 1E0A FE 60 A cp 60h ; greater than 59 minutes? 1E0C D2 226D A jp nc,error A 1E0F 23 A inc hl ; point to minutes byte 1E10 77 A ld (hl),a ; save minutes in event A 1E11 23 A inc hl ; point to control bytes A A ; store the next 6 bytes as a control code A 1E12 06 06 A ld b,6 1E14 C3 3710 A jp setma1 ; steal some code A A A ; Toggle the event control byte if no command line parameters A 1E17 7E A setsc3: ld a,(hl) ; get the current event status 1E18 B7 A or a ; Z = not active 1E19 CA 1E24 A jp z,setsc4 ; then make pending A 1E1C AF A xor a ; must be active or pending 1E1D 77 A ld (hl),a ; make event not active 1E1E CD 2981 A call ssfn ; speak 'function' 1E21 C3 24D5 A jp sndoff ; say 'off' A 1E24 3E FF A setsc4: ld a,0ffh 1E26 77 A ld (hl),a ; make event pending 1E27 CD 2981 A call ssfn ; speak 'function' 1E2A C3 24BD A jp sndon ; say 'on' A A A ;============================================================================= A ; Subroutine RDTIM - Read the Clock and save in memory A ;============================================================================= A 1E2D 3A 809D A rdtim: ld a,(clkp) ; clock present? (0ffh = not there) 1E30 B7 A or a 1E31 C2 1E76 A jp nz,rdtj ; NZ = software handling the calendar A 1E34 3A D007 A ld a,(month) ; get the current month 1E37 CD 0BDF A call ctest 1E3A C2 1E2D A jp nz,rdtim ; NZ = rollover during read 1E3D 32 809F A ld (mmo),a ; save A 1E40 3A D006 A rdmd1: ld a,(date) ; get the current day of the month 1E43 CD 0BDF A call ctest 1E46 C2 1E40 A jp nz,rdmd1 ; NZ = rollover during read 1E49 32 80A0 A ld (mdt),a ; save A 1E4C 3A D009 A rdmd2: ld a,(year) ; get the year register 1E4F 32 809E A ld (myr),a ; save it in memory A 1E52 3A D004 A ld a,(hrs) ; get the current hours 1E55 CD 0BDF A call ctest 1E58 C2 1E2D A jp nz,rdtim ; NZ = rollover during read 1E5B 32 80A1 A ld (mhrs),a ; save A 1E5E 3A D003 A rdtm1: ld a,(min) ; get the current minutes 1E61 CD 0BDF A call ctest 1E64 C2 1E5E A jp nz,rdtm1 ; NZ = rollover during read 1E67 32 80A2 A ld (mmin),a ; save A 1E6A 3A D002 A rdtm2: ld a,(sec) ; get the current seconds 1E6D CD 0BDF A call ctest 1E70 C2 1E6A A jp nz,rdtm2 ; NZ = rollover during read 1E73 32 80A3 A ld (msec),a ; save A A ; The math to convert Julian to Day-of-the-week is A ; DOW = JUL - ( INT ( JUL / 7 ) * 7 ) A 1E76 E5 A rdtj: push hl 1E77 D5 A push de 1E78 C5 A push bc A 1E79 21 809E A ld hl,timstr ; point to YY/MM/DD 1E7C CD 45FE A call bcd2jul ; convert to julian A A ; The Julian Date is in HL where 1 = Jan 1, 1978 A 1E7F 2B A dec hl ; start the date at zero 1E80 E5 A push hl ; save it 1E81 11 0007 A ld de,7 ; divide by 7 1E84 CD 4723 A call divhd ; with integer result 1E87 CD 46C2 A call mulhd ; multiply by 7 1E8A EB A ex de,hl ; put subtrahend in DE 1E8B E1 A pop hl ; get the julian date back as minuend 1E8C CD 46B5 A call subhd ; subtract result in DE from julian in HL A A ; HL now has a number from 0 to 6 representing SUN to SAT A 1E8F 7D A ld a,l 1E90 32 80A5 A ld (mda),a ; save in memory A 1E93 C1 A pop bc 1E94 D1 A pop de 1E95 E1 A pop hl 1E96 C9 A ret A A A ;----------------------- end of file SCHEV.Z80 ------------------------------- A ;============================================================================= ; Hardware Watchdog Timer Routines ;============================================================================= ; TICK is called from within the interrupt-driven background ; routine (TISR). This sets a one second timer. ; UNTICK is called from within the foreground Master Loop. ; As long as TICK and UNTICK are periodically called, the ; WatchDog bit will toggle on/off at approx. the rate at ; which the Master Loop is repeatedly executed. ; If the background routine TISR crashes, the WatchDog ; pulses will stop after the one second timer times-out. ; If the foreground Master Loop crashes, the WatchDog pulses ; will stop immediately. ; In any case, the actual time in which the WatchDog hardware ; timer can go without pulses from the processor is determined ; by the RC time constant of the timer -- approx. one second. 1E97 F5 tick: push af 1E98 3E 64 ld a,100 ; 1 sec watchdog time out 1E9A 32 8087 ld (tickt),a 1E9D F1 pop af 1E9E C9 ret 1E9F F5 untick: push af 1EA0 3A 8087 ld a,(tickt) ; get the watchdog time out value 1EA3 B7 or a 1EA4 CA 1EC9 jp z,untikz 1EA7 3A 8088 ld a,(tickm) 1EAA B7 or a 1EAB C2 1EBD jp nz,untik1 1EAE 3E FF ld a,0ffh ; toggle state of tickm 1EB0 32 8088 ld (tickm),a 1EB3 3A 8048 ld a,(port4s) ; tick ON 1EB6 F6 80 or wdog 1EB8 32 8048 ld (port4s),a 1EBB F1 pop af 1EBC C9 ret 1EBD AF untik1: xor a ; toggle state of tickm 1EBE 32 8088 ld (tickm),a 1EC1 3A 8048 ld a,(port4s) ; tick OFF 1EC4 E6 7F and not wdog 1EC6 32 8048 ld (port4s),a 1EC9 F1 untikz: pop af 1ECA C9 ret ;============================================================================ ; Console Buffer Input Routine (CRT / DTMF) ;============================================================================ 1ECB C5 cin: push bc 1ECC CD 179D cin1: call master ; call the Master Loop Foreground Processor 1ECF F3 di 1ED0 3A 8020 ld a,(iptr) ; get the input buffer pointer 1ED3 47 ld b,a ; save it 1ED4 3A 8021 ld a,(optr) ; get the output buffer pointer 1ED7 FB ei 1ED8 B8 cp a,b ; equal? 1ED9 CA 1ECC jp z,cin1 ; if pending char 1EDC CD 1EFD cin2: call getbuf ; get the character 1EDF C1 pop bc 1EE0 C9 ret ;----------------------------------------------------------------------------- ; PUTBUF - Put a character into the buffer ;----------------------------------------------------------------------------- ; ** Warning! ** PUTBUF is called from the interrupt routine KISR to ; save characters from the keyboard. It is imperative that PUTBUF save ; and restore all registers that it uses. ; Entry: A = Character to save in the buffer ; Exit: None ; Uses: None 1EE1 F3 putbuf: di ; don't allow me to be bothered 1EE2 E5 push hl ; whilst I put a character into the buffer 1EE3 F5 push af ; save the char 1EE4 3A 8020 ld a,(iptr) ; get the current input pointer 1EE7 3C inc a ; mark one deposited 1EE8 32 8020 ld (iptr),a 1EEB FE 20 cp iblen ; check that it wasn't advanced past end 1EED C2 1EF4 jp nz,putb1 1EF0 AF xor a ; reset back to zero 1EF1 32 8020 ld (iptr),a 1EF4 21 8000 putb1: ld hl,ibuf 1EF7 6F ld l,a 1EF8 F1 pop af ; get the char back 1EF9 77 ld (hl),a ; put into buffer 1EFA E1 pop hl 1EFB FB ei 1EFC C9 ret ;----------------------------------------------------------------------------- ; GETBUF - Get a character from the buffer ;----------------------------------------------------------------------------- ; Get a character from the type-ahead buffer ; Entry: None ; Exit: A = Next pending character from the buffer ; Uses: None 1EFD F3 getbuf: di ; don't allow me to be bothered 1EFE E5 push hl ; whilst I get a character from the buffer 1EFF 3A 8021 ld a,(optr) ; get the output buffer pointer 1F02 3C inc a ; mark one taken 1F03 32 8021 ld (optr),a 1F06 FE 20 cp iblen ; check that it wasn't advanced past end 1F08 C2 1F0F jp nz,getb1 1F0B AF xor a ; reset back to zero 1F0C 32 8021 ld (optr),a 1F0F 21 8000 getb1: ld hl,ibuf 1F12 6F ld l,a 1F13 7E ld a,(hl) ; get current char 1F14 B7 or a 1F15 E1 pop hl 1F16 FB ei 1F17 C9 ret ;============================================================================ ; Console Output Routine ;============================================================================ 1F18 F5 cout: push af 1F19 3A A001 out2: ld a,(ttyc) ; read status 1F1C E6 04 and outmask 1F1E CA 1F19 jp z,out2 ; not ready 1F21 CD 1E97 out3: call tick 1F24 3A 8086 ld a,(xon) ; get the XON status 1F27 B7 or a 1F28 C2 1F21 jp nz,out3 ; loop if XON WAIT status 1F2B F1 pop af 1F2C E6 7F and 07fh ; strip high bit 1F2E 32 A000 ld (ttyd),a ; send data 1F31 C9 ret ;============================================================================ ; Main Menu ;============================================================================ 1F32 CD 4595 menu: call tinit ; initialize CRT Terminal 1F35 CD 458E call cls ; clear screen 1F38 CD 4541 call vprint 1F3B 57 41 31 4C defb 'WA1LMV Repeater Controller Vers. ' 1F5D 31 2E 35 0D defb VERS/10+'0','.',VERS MOD 10+'0',cr,lf 1F62 31 30 2F defb VMONTH/10+'0',VMONTH MOD 10+'0','/' 1F65 32 39 2F defb VDAY/10+'0',VDAY MOD 10+'0','/' 1F68 31 39 defb VCENT/10+'0',VCENT MOD 10+'0' 1F6A 39 34 defb VYEAR/10+'0',VYEAR MOD 10+'0' 1F6C 20 20 20 20 defb ' by Rick Swenton',cr,lf,0 00FF 1 if a2020 1F8A CD 459C 1 call gron ; enter graphics mode 1F8D CD 4541 1 call vprint 1F90 5A 5A 5A 5A 1 defb 'ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ',0 1FB6 CD 45AE 1 call groff ; exit graphics mode 1 else 1 defb '-------------------------------------' endif 1FB9 CD 4541 call vprint 1FBC 0D 0A defb cr,lf 1FBE 41 20 2D 20 defb 'A - Control Codes N - Voice ID' 1FDE 0D 0A defb cr,lf 1FE0 42 20 2D 20 defb 'B - Macro Codes O - Output' 1FFE 0D 0A defb cr,lf 2000 43 20 2D 20 defb 'C - CRT Mode P - Chime Control' 2025 0D 0A defb cr,lf 2027 44 20 2D 20 defb 'D - Set Tone Dev. Q - Curly' 2044 0D 0A defb cr,lf 2046 45 20 2D 20 defb 'E - Set Speech Dev. R - 450 PL Control' 206C 0D 0A defb cr,lf 206E 46 20 2D 20 defb 'F - (not used) S - 450 TX Control' 2094 0D 0A defb cr,lf 2096 47 20 2D 20 defb 'G - Set Date T - 6M PL Control' 20BC 0D 0A defb cr,lf 20BE 48 20 2D 20 defb 'H - Set Time U - 6M TX Control' 20E4 0D 0A defb cr,lf 20E6 49 20 2D 20 defb 'I - Input V - Autopatch' 2107 0D 0A defb cr,lf 2109 4A 20 2D 20 defb 'J - Events W - Test Key TX' 212C 0D 0A defb cr,lf 212E 4B 20 2D 20 defb 'K - Voice Time X - Refresh CRT' 2151 0D 0A defb cr,lf 2153 4C 20 2D 20 defb 'L - (not used) Y - Refresh Status' 2179 0D 0A defb cr,lf 217B 4D 20 2D 20 defb 'M - MCW ID Z - Master Reset' 219F 0D 0A defb cr,lf 21A1 31 20 2D 20 defb '1 - 6M Temp PL 3 - Reset Temp PL' 21C6 0D 0A defb cr,lf 21C8 32 20 2D 20 defb '2 - 450 Temp PL 9 - DTMF Pass-Thru' 21EE 00 defb 0 21EF CD 0BE6 call ucrtt ; write display system skeleton 21F2 CD 1174 call ucrte ; send one screen update 21F5 C9 ret 21F6 CD 1F32 cmenu: call menu 21F9 3A 8FFF cmen1: ld a,(merr) ; get the error byte 21FC FE 01 cp 1 ; stack error #1? 21FE CA 220C jp z,stkerr 2201 FE 02 cp 2 ; execution error #2? 2203 CA 2228 jp z,exerr 2206 FE 03 cp 3 ; hardware reset 2208 CA 2248 jp z,crst 220B C9 ret 220C CD 2289 stkerr: call stat 220F 07 53 74 61 defb bell,'Stack Error #1! ',0 2222 CD 23D8 call cbeep ; 1 beep is stack error 2225 C3 2262 jp xxerr 2228 CD 2289 exerr: call stat 222B 07 45 78 65 defb bell,'Execution Error #2! ',0 2242 CD 23D5 call cbeep2 ; 2 beeps is execution error 2245 C3 2262 jp xxerr 2248 CD 2289 crst: call stat ; status line 224B 07 43 6F 6E defb bell,'Controller reset!',7,0 225F CD 23D2 call cbeep3 ; 3 beeps is normal reset 2262 AF xxerr: xor a 2263 32 8FFF ld (merr),a 2266 CD 243F call onesec 2269 CD 24FC call sndid ; which will initially preset the ID timer 226C C9 ret 226D CD 38CE error: call rmode ; restore current MCW/Speech Mode 2270 CD 2289 call stat ; status line 2273 49 6E 70 75 defb 'Input Error!',0 2280 CD 24ED call sndng 2283 CD 2292 call clstat ; clear again 2286 C3 22D0 jp warm ; reset the stack ;----------------------------------------------------------------------------- ; Clear the Status Line and print new Status Message ;----------------------------------------------------------------------------- 2289 E3 stat: ex (sp),hl ; save HL, get HL = string to print 228A CD 2292 call clstat ; clear the status line and return cursor 228D CD 4547 call pstr ; print the string 2290 E3 ex (sp),hl ; restore HL and stack past message 2291 C9 ret 2292 CD 4538 clstat: call gxymsg ; clear the status line 2295 18 01 defb 24,1 2297 20 20 20 20 defb ' ' 22B0 20 20 20 20 defb ' ',0 22CA CD 4519 call at ; return cursor 22CD 18 01 defb 24,1 22CF C9 ret ;----------------------------------------------------------------------------- ; Warm Start Entry ;----------------------------------------------------------------------------- 22D0 21 22D0 warm: ld hl,warm ; return here 22D3 E5 push hl 22D4 FB warm1: ei ; just in case 22D5 3A 8218 ld a,(cwena) ; save current MCW/Speech Mode 22D8 32 80A9 ld (cwtmp),a 22DB CD 436A call inclr ; console line - includes Master Loop 22DE CD 44A2 call rech 22E1 FE 0D cp cr 22E3 C8 ret z 22E4 CD 2345 call alta 22E7 1F defb 31 22E8 41 defb 'A' 22E9 3111 defw codes ; A - WA1LMV Control Code Emulator 22EB 42 defb 'B' 22EC 36A7 defw macod ; B - Macro Codes 22EE 43 defb 'C' 22EF 10D9 defw cmode ; C - CRT Mode 22F1 44 defb 'D' 22F2 428F defw tdev ; D - Test Tone Deviation 22F4 45 defb 'E' 22F5 42F3 defw sdev ; E - Test Speech Deviation 22F7 46 defb 'F' 22F8 226D defw error ; F - 22FA 47 defb 'G' 22FB 401E defw stdat ; G = Set Date 22FD 48 defb 'H' 22FE 3F09 defw sthrs ; H = Set Time 2300 49 defb 'I' 2301 4453 defw iport ; I = INPUT from PORT/MEMORY 2303 4A defb 'J' 2304 1DCC defw setsch ; J = Events 2306 4B defb 'K' 2307 2F85 defw stime ; K - Voice Time 2309 4C defb 'L' 230A 226D defw error ; L - 230C 4D defb 'M' 230D 24FC defw sndid ; M - MCW ID Start 230F 4E defb 'N' 2310 2F5F defw sndsid ; N - Voice ID Start 2312 4F defb 'O' 2313 448F defw oport ; O - OUTPUT to PORT/MEMORY 2315 50 defb 'P' 2316 3E06 defw chmt ; P - Chime Control 2318 51 defb 'Q' 2319 29DE defw sndnuk ; Q - Curly Routine 231B 52 defb 'R' 231C 37A7 defw tupl ; R - 450 PL Control 231E 53 defb 'S' 231F 38D5 defw tutx ; S - 450 TX Control 2321 54 defb 'T' 2322 3884 defw tvpl ; T - 6M PL Control 2324 55 defb 'U' 2325 392A defw tvtx ; U - 6M TX Control 2327 56 defb 'V' 2328 3445 defw patch ; V - Autopatch on/off 232A 57 defb 'W' 232B 4101 defw phtime ; W - Test Key TX - preset hang time to 5 mins 232D 58 defb 'X' 232E 21F6 defw cmenu ; X - Refresh Screen 2330 59 defb 'Y' 2331 10C7 defw ucrtc ; Y - Refresh Control 2333 5A defb 'Z' 2334 236B defw xreset ; Z - Master Reset 2336 30 defb '0' 2337 1B56 defw llun ; 0 - Unlock landline control 2339 31 defb '1' 233A 4131 defw vplo ; 1 - Temp 6M PL override 233C 32 defb '2' 233D 415B defw uplo ; 2 - Temp 450 PL override 233F 33 defb '3' 2340 4185 defw tpld ; 3 - Reset Temp PL Override 2342 39 defb '9' 2343 04AB defw dnul ; 9 - DTMF Pass-Through 2345 E3 alta: ex (sp),hl 2346 4E ld c,(hl) 2347 23 alt: inc hl 2348 BE cp (hl) 2349 23 inc hl 234A C2 2353 jp nz,alu 234D 5E ld e,(hl) 234E 23 inc hl 234F 56 ld d,(hl) 2350 EB ex de,hl 2351 E3 ex (sp),hl 2352 C9 ret 2353 0D alu: dec c 2354 23 inc hl 2355 C2 2347 jp nz,alt 2358 C3 226D jp error ; ;----------------------------------------------------------------------------- ; Stack Error - Display Message and restart controller ;----------------------------------------------------------------------------- 235B 3E 01 irst: ld a,1 235D 32 8FFF ld (merr),a ; set error #1 2360 C3 2373 jp reset ;----------------------------------------------------------------------------- ; Execution Error - Display Message and restart controller ;----------------------------------------------------------------------------- 2363 3E 02 erst: ld a,2 2365 32 8FFF ld (merr),a ; set error #2 2368 C3 2373 jp reset ;----------------------------------------------------------------------------- ; This is the entry point to Master Reset the controller ; AND pre-load RAM to the default settings in ROM ;----------------------------------------------------------------------------- 236B CD 252F xreset: call sndrst ; then fall through 236E 3E 03 ld a,3 2370 32 8FFF ld (merr),a ; set error #3 (hardware reset) ;----------------------------------------------------------------------------- ; This is the system-generated master reset entry point. ; A simple jump to address zero will cause a failure of the ; console port because the USART is already initialized. This ; routine will place the 8251 into mode instruction before ; jumping to zero. ;----------------------------------------------------------------------------- 2373 F3 reset: di 2374 3E 40 ld a,cmdrst ; put the 8251 into mode instruction 2376 32 A001 ld (ttyc),a ; send to the chip 2379 C3 024E jp startr ; now reset ;----------------------------------------------------------------------------- ; Mega-Beep! Alarm Clock and Chime Tone ;----------------------------------------------------------------------------- 237C CD 40F8 mbeep: call htime ; key the transmitters 237F CD 243F call onesec ; wait 2382 CD 2422 call t440 ; multi-freq super beep 440 Hz 2385 CD 25FC call tonon ; tone on 2388 3E 06 ld a,6 ; 60 ms. inter-tone delay 238A CD 2455 call delay 238D CD 240A call t660 ; 660 Hz. 2390 3E 06 ld a,6 2392 CD 2455 call delay 2395 CD 2404 call t800 ; 800 Hz. 2398 3E 06 ld a,6 239A CD 2455 call delay 239D CD 23F8 call t1000 ; 1000 Hz. 23A0 3E 06 ld a,6 23A2 CD 2455 call delay 23A5 CD 23F2 call t1200 ; 1200 Hz. 23A8 3E 06 beep1: ld a,6 23AA CD 2455 call delay 23AD CD 2605 beep2: call tonoff 23B0 C9 ret ;----------------------------------------------------------------------------- ; Simulate Phone Ringing Signal ;----------------------------------------------------------------------------- 23B1 E5 ding: push hl 23B2 2A 804D ld hl,(idtim) ; see if time to ID 23B5 7C ld a,h 23B6 B5 or a,l 23B7 C2 23BD jp nz,ding1 23BA CD 24FC call sndid 23BD E1 ding1: pop hl 23BE CD 40F8 call htime ; phone ring tone 23C1 CD 2422 call t440 ; set-up 440 Hz. 23C4 CD 25FC call tonon 23C7 3E 06 ld a,6 ; delay is 60 ms 23C9 CD 2455 call delay 23CC CD 240A call t660 ; set-up 660 Hz. 23CF C3 23A8 jp beep1 ; steal some code from above ;----------------------------------------------------------------------------- ; Control System Beep Tone ;----------------------------------------------------------------------------- 23D2 CD 23D8 cbeep3: call cbeep 23D5 CD 23D8 cbeep2: call cbeep ; and fall through 23D8 CD 40F8 cbeep: call htime ; key transmitters 23DB CD 2444 call halfsec ; control system tone 23DE CD 23F8 call t1000 ; set-up 1 KHz. tone 23E1 CD 25FC call tonon 23E4 3E 0C ld a,12 ; 120 ms delay 23E6 CD 2455 call delay 23E9 C3 2605 jp tonoff ;----------------------------------------------------------------------------- ; Set Audio Tones to various frequencies ;----------------------------------------------------------------------------- ; Calculation is Divisor = (clock/2) / Desired Freq (Hz.) 23EC 21 0510 t2000: ld hl,b2000 ; 2000 Hz. 23EF C3 2425 jp tone 23F2 21 0870 t1200: ld hl,b1200 ; 1200 Hz. 23F5 C3 2425 jp tone 23F8 21 0A20 t1000: ld hl,b1000 ; 1000 Hz. 23FB C3 2425 jp tone 23FE 21 0B3D t900: ld hl,b900 ; 900 Hz. 2401 C3 2425 jp tone 2404 21 0CA8 t800: ld hl,b800 ; 800 Hz. 2407 C3 2425 jp tone 240A 21 0F58 t660: ld hl,b660 ; 600 Hz. 240D C3 2425 jp tone 2410 21 1269 t550: ld hl,b550 ; 550 Hz. 2413 C3 2425 jp tone 2416 21 1441 t500: ld hl,b500 ; 500 Hz. 2419 C3 2425 jp tone 241C 21 1519 t480: ld hl,b480 ; 480 Hz. 241F C3 2425 jp tone 2422 21 1704 t440: ld hl,b440 ; 440 Hz. ; Set the tone frequency 2425 22 8050 tone: ld (trate),hl 2428 3E 36 ld a,00110110b ; PIT Control Word (counter 0, Mode 3 242A 32 A803 ld (pitctl),a ; send to PIC control port 242D 3A 8050 ld a,(trate) ; get Initial counter value LSB 2430 32 A800 ld (pitc0),a ; send to PIC counter 0 2433 3A 8051 ld a,(trate+1) ; get Initial counter value MSB 2436 32 A800 ld (pitc0),a ; send to PIC counter 0 2439 C9 ret ;---------------------------- Time Delays ------------------------------------ 243A 3E C8 twosec: ld a,200 ; two second delay 243C C3 2455 jp delay 243F 3E 64 onesec: ld a,100 ; one second delay 2441 C3 2455 jp delay 2444 3E 32 halfsec:ld a,50 ; half second delay 2446 C3 2455 jp delay 2449 3E 19 qsec: ld a,25 ; quarter second delay 244B C3 2455 jp delay 244E 3E 0E sec17: ld a,14 ; 1/7 second delay 2450 C3 2455 jp delay 2453 3E 0A tsec: ld a,10 ; tenth second delay ; fall through ;============================================================================ ; Interrupt managed Time Delay ; (Enter with A = # of 10 ms ticks of delay desired) ;============================================================================ 2455 32 806F delay: ld (gpt),a 2458 CD 1E97 dly1: call tick ; tick the watchdog 245B 3A 806F ld a,(gpt) 245E B7 or a 245F C2 2458 jp nz,dly1 2462 C9 ret include mcw.z80 A A ;---------------------------------------------------------------------------- A ; MCW Message Strings A ;---------------------------------------------------------------------------- A A ; MCW messages are entered here in plain ASCII terminated by A ; a trailing zero. Only letters, numbers and the "/" characters A ; are currently supported. Blank space characters control A ; spacing. A 2463 4F 4B 20 20 A okmsg: defb 'OK ',0 2468 A 2468 4E 47 20 20 A ngmsg: defb 'NG ',0 246D A 246D 4E 4F 20 20 A nomsg: defb 'NO ',0 2472 A 2472 44 45 20 57 A idmsg: defb 'DE WA1LMV /R ',0 2481 A 2481 42 45 45 52 A beermsg:defb 'BEER ',0 2488 A 2488 51 52 5A 20 A qrzmsg: defb 'QRZ ',0 248E A 248E 52 53 54 20 A rstmsg: defb 'RST ',0 2494 A 2494 4F 4E 20 20 A onmsg: defb 'ON ',0 2499 A 2499 4F 46 46 20 A offmsg: defb 'OFF ',0 249F A A ;---------------------------------------------------------------------------- A A A ;============================================================================ A ; Send MCW or Speech Messages A ;============================================================================ A 249F CD 24F6 A sndno: call tstcw ; check current Speech/MCW Mode 24A2 C2 24AB A jp nz,sndmno A 24A5 CD 2981 A call ssfn ; say FUNCTION 24A8 C3 2ABB A jp ssdis ; say DISABLED A 24AB CD 240A A sndmno: call t660 24AE 21 246D A ld hl,nomsg 24B1 C3 2568 A jp cw ; send NO A 24B4 CD 24F6 A sndcn: call tstcw 24B7 C2 24C3 A jp nz,sndon1 A 24BA CD 2B2D A call ssctl ; say CONTROL FUNCTION A 24BD CD 24F6 A sndon: call tstcw 24C0 CA 29B0 A jp z,sndson A 24C3 CD 240A A sndon1: call t660 24C6 21 2494 A ld hl,onmsg ; send ON 24C9 C3 2568 A jp cw A 24CC CD 24F6 A sndcff: call tstcw 24CF C2 24DB A jp nz,sndof1 A 24D2 CD 2B2D A call ssctl ; say CONTROL FUNCTION A 24D5 CD 24F6 A sndoff: call tstcw 24D8 CA 29C7 A jp z,sndsoff A 24DB CD 240A A sndof1: call t660 24DE 21 2499 A ld hl,offmsg ; send OFF 24E1 C3 2568 A jp cw A 24E4 CD 240A A sndok: call t660 24E7 21 2463 A ld hl,okmsg ; send OK 24EA C3 2568 A jp cw A 24ED CD 240A A sndng: call t660 24F0 21 2468 A ld hl,ngmsg ; send NG 24F3 C3 2568 A jp cw A 24F6 3A 8218 A tstcw: ld a,(cwena) ; see if speech enabled 24F9 FE 02 A cp 2 ; 2 = Speech Mode 24FB C9 A ret A A ; Send ID -- no test is made for CW enable because the ID A ; should never be disabled A 24FC 2A 822D A sndid: ld hl,(mdfcwt) 24FF CD 2425 A call tone ; set the MCW frequency A 2502 3E 01 A ld a,1 ; set CWPTT flag 2504 32 8070 A ld (cwptt),a A 2507 2A 822F A ld hl,(mdfid) ; preset default ID timer value 250A 22 804D A ld (idtim),hl A 250D AF A xor a 250E 32 8203 A ld (fidtm),a ; reset the foreground task flag 2511 32 8082 A ld (bidflg),a ; reset the Broadcast ID flag A 2514 CD 116A A call ucrt 2517 CD 2444 A call halfsec 251A 21 2472 A ld hl,idmsg ; send call letters 251D C3 2579 A jp cw2 ; bypass MCW enable test A 2520 CD 24F6 A sndcst: call tstcw 2523 CA 2F4A A jp z,sndscr ; speak CONTROL RESET 2526 CD 240A A call t660 2529 21 248E A ld hl,rstmsg 252C C3 2568 A jp cw ; send RST in MCW A 252F CD 24F6 A sndrst: call tstcw 2532 CA 2F44 A jp z,sndsmr ; speak MASTER RESET A 2535 CD 240A A sndrs1: call t660 2538 21 248E A ld hl,rstmsg 253B E5 A push hl 253C CD 2568 A call cw ; send RST 253F E1 A pop hl 2540 C3 2568 A jp cw ; send again A 2543 CD 23F8 A sndbeer:call t1000 2546 3E 01 A ld a,1 2548 32 8070 A ld (cwptt),a ; key transmitters 254B CD 243F A call onesec ; wait for them to come on 254E 21 2481 A ld hl,beermsg ; BEER message 2551 E5 A push hl 2552 CD 2568 A call cw ; send BEER 2555 E1 A pop hl 2556 CD 2568 A call cw ; send again 2559 C3 24FC A jp sndid ; now ID A 255C CD 240A A sndqrz: call t660 255F 21 2488 A ld hl,qrzmsg ; send QRZ 2562 CD 2568 A call cw 2565 C3 24FC A jp sndid A A A ;============================================================================ A ; CW - Send MCW tones according to the following input: A ; A ; hl points to a string of characters to send A ; 0 is the END-OF-STRING terminator A ; A ; Placing a NZ value in CWPTT will cause the interrupt service A ; routine to key the transmitters. The SNDID routine enters A ; at CW1. A ; A ;============================================================================ A 2568 3E 01 A cw: ld a,1 256A 32 8070 A ld (cwptt),a ; set the CW PTT flag A 256D 3A 8218 A cw1: ld a,(cwena) ; is MCW enabled? 2570 B7 A or a 2571 C2 2579 A jp nz,cw2 ; no, then bail out A 2574 AF A xor a 2575 32 8070 A ld (cwptt),a ; reset the CW PTT flag 2578 C9 A ret A 2579 3A 804B A cw2: ld a,(port7s) ; see if either transmitter 257C E6 03 A and utx+vtx ; is on 257E C2 2584 A jp nz,cw3 A 2581 CD 243F A call onesec ; wait for transmitter to come on A 2584 E5 A cw3: push hl 2585 D5 A push de 2586 C5 A push bc A 2587 7E A cw4: ld a,(hl) ; get the character 2588 B7 A or a 2589 CA 25A5 A jp z,cwx ; quit if zero A 258C FE 20 A cp 20h ; space 258E CA 259B A jp z,cw5 A 2591 CD 25AD A call cwl ; send the letter 2594 23 A inc hl ; get next ascii character 2595 CD 25ED A call sp1 2598 C3 2587 A jp cw4 A 259B CD 263B A cw5: call mcwdly ; perfect spacing calls for 4 259E CD 25EA A call sp3 ; element delays. Do one now 25A1 23 A inc hl ; and call sp3 to do 3 more. 25A2 C3 2587 A jp cw4 ; Go past the space char and get more. A 25A5 AF A cwx: xor a 25A6 32 8070 A ld (cwptt),a ; reset the CW PTT flag A 25A9 C1 A pop bc 25AA D1 A pop de 25AB E1 A pop hl 25AC C9 A ret A A A A ;---------------------------------------------------------------------------- A ; Send a letter in MCW A ;---------------------------------------------------------------------------- A A ; Enter with A containing the ASCII value of the character A ; to send in MCW A 25AD E5 A cwl: push hl 25AE D5 A push de 25AF C5 A push bc 25B0 F5 A push af A 25B1 FE 61 A cp 61h ; greater than ascii 'a'? 25B3 DA 25B8 A jp c,cwlu ; carry =numbers/symbols/Upper Case A 25B6 E6 5F A and 5fh ; make upper case 25B8 D6 2E A cwlu: sub 2eh ; ascii bias (start with period 2eh) 25BA 16 00 A ld d,0 25BC 5F A ld e,a ; put result in DE 25BD 21 260E A ld hl,cwtbl ; point to char table 25C0 19 A add hl,de ; offset to desired char 25C1 7E A ld a,(hl) 25C2 47 A cwl1: ld b,a 25C3 FE 80 A cp 80h 25C5 CA 25DC A jp z,cwl4 ; exit when shift results in 80h A 25C8 E6 80 A and 80h ; look at most significant bit 25CA CA 25D3 A jp z,cwl2 A 25CD CD 25E4 A call dash ; 1 is a dash 25D0 C3 25D6 A jp cwl3 A 25D3 CD 25F6 A cwl2: call dot ; 0 is a dot A 25D6 78 A cwl3: ld a,b 25D7 CB 17 A rl a ; rotate 25D9 C3 25C2 A jp cwl1 A 25DC CD 25F0 A cwl4: call sp0 ; space 25DF F1 A pop af 25E0 C1 A pop bc 25E1 D1 A pop de 25E2 E1 A pop hl 25E3 C9 A ret A A A ; Send a Dash A 25E4 CD 25FC A dash: call tonon 25E7 CD 263B A call mcwdly ; keep tone on for 3 time intervals 25EA CD 263B A sp3: call mcwdly 25ED CD 263B A sp1: call mcwdly 25F0 CD 2605 A sp0: call tonoff 25F3 C3 263B A jp mcwdly ; 1 interval inter-element space A A ; Send a tone A 25F6 CD 25FC A dot: call tonon 25F9 C3 25ED A jp sp1 ; wait one interval and off again A 25FC 3A 8048 A tonon: ld a,(port4s) ; turn-on tone 25FF F6 01 A or mcwt ; tone osc bit 2601 32 8048 A ld (port4s),a 2604 C9 A ret A 2605 3A 8048 A tonoff: ld a,(port4s) ; turn off tone 2608 E6 FE A and not mcwt ; tone osc bit 260A 32 8048 A ld (port4s),a 260D C9 A ret A A A A ;========================= CW Character Table =============================== A ; A ; The most significant bit is tested. 1 is a dash, 0 is a dot. A ; Finish with a 1. The byte is shifted left repeatedly A ; until an 80H is left. A ; A ; Example: / is (_.._.) 1001 0100 is 94h A ; 1 is (.____) 0111 1100 is 7ch A ; A ; Table is in ASCII numerical sequence A ; A ;============================================================================ A 260E 56 A cwtbl: defb 056h ; . 260F 94 A defb 094h ; / 2610 FC A defb 0fch ; 0 2611 7C A defb 07ch ; 1 2612 3C A defb 03ch ; 2 2613 1C A defb 01ch ; 3 2614 0C A defb 00ch ; 4 2615 04 A defb 004h ; 5 2616 84 A defb 084h ; 6 2617 C4 A defb 0c4h ; 7 2618 E4 A defb 0e4h ; 8 2619 F4 A defb 0f4h ; 9 261A 80 A defb 080h ; : undefined 261B 80 A defb 080h ; ; undefined 261C 80 A defb 080h ; < undefined 261D 80 A defb 080h ; = undefined 261E 80 A defb 080h ; > undefined 261F 32 A defb 032h ; ? 2620 80 A defb 080h ; @ undefined 2621 60 A defb 060h ; A 2622 88 A defb 088h ; B 2623 A8 A defb 0a8h ; C 2624 90 A defb 090h ; D 2625 40 A defb 040h ; E 2626 28 A defb 028h ; F 2627 D0 A defb 0d0h ; G 2628 08 A defb 008h ; H 2629 20 A defb 020h ; I 262A 78 A defb 078h ; J 262B B0 A defb 0b0h ; K 262C 48 A defb 048h ; L 262D E0 A defb 0e0h ; M 262E A0 A defb 0a0h ; N 262F F0 A defb 0f0h ; O 2630 68 A defb 068h ; P 2631 D8 A defb 0d8h ; Q 2632 50 A defb 050h ; R 2633 10 A defb 010h ; S 2634 C0 A defb 0c0h ; T 2635 30 A defb 030h ; U 2636 18 A defb 018h ; V 2637 70 A defb 070h ; W 2638 98 A defb 098h ; X 2639 B8 A defb 0b8h ; Y 263A C8 A defb 0c8h ; Z A 263B 3A 8245 A mcwdly: ld a,(mdfwpm) ; default dot length 263E 32 804F A ld (idspd),a A 2641 CD 1E97 A mcdly1: call tick ; tick the watchdog 2644 3A 804F A ld a,(idspd) 2647 B7 A or a 2648 C2 2641 A jp nz,mcdly1 264B C9 A ret A A ;------------------------- end of file MCW.Z80 ------------------------------- A include speech.z80 A A ;============================================================================ A ; Speech System A ;============================================================================ A 264C 3E 01 A speech: ld a,1 264E 32 8070 A ld (cwptt),a ; set the CW PTT flag (not an ID) A 2651 CD 24F6 A spch1: call tstcw ; see if Speech enabled 2654 C2 26AD A jp nz,slx ; bail out if non-zero A 2657 3A 825E A spch2: ld a,(mdfsr) ; get the default speech rate 265A E6 F0 A and 11110000b ; inflection is always 1000b lower nib 265C F6 08 A or 00001000b ; rate values are 08 through f8 265E 32 C002 A ld (rateinf),a ; set the rate/inflection A 2661 7E A ld a,(hl) ; get number of bytes to send 2662 4F A ld c,a ; save 2663 23 A inc hl A 2664 7E A sloop: ld a,(hl) ; get the filter frequency 2665 32 C004 A ld (filfreq),a ; set the filter frequency 2668 23 A inc hl A 2669 7E A ld a,(hl) ; get the inflection 266A E6 1F A and 00011111b ; only 5 bits allowed 0 to 31 266C D6 04 A sub 4 266E CB 07 A rlc a ; shift into upper position 2670 CB 07 A rlc a 2672 CB 07 A rlc a 2674 47 A ld b,a ; save 2675 3A 825F A ld a,(mdfir) ; get the default inflection rate 2678 E6 07 A and 00000111b ; only 3 bits allowed 0 to 7 267A B0 A or a,b 267B 32 C001 A ld (inflect),a ; set the inflection and rate 267E 23 A inc hl A 267F 3A 8260 A ld a,(mdfar) ; get the default articulation rate 2682 CB 07 A rlc a ; shift into upper position 2684 CB 07 A rlc a 2686 CB 07 A rlc a 2688 CB 07 A rlc a 268A E6 7F A and 01111111b ; block usb (CTL bit) just in case 268C 47 A ld b,a ; save 268D 7E A ld a,(hl) ; get the desired amplitude 268E E6 0F A and 00001111b ; only look at lower 4 bits (amplitude) 2690 B0 A or b ; or-in the articulation rate 2691 32 C003 A ld (cttramp),a ; set the articulation/amplitude 2694 23 A inc hl A 2695 7E A ld a,(hl) 2696 E6 3F A and 00111111b 2698 F6 40 A or 01000000b 269A 32 C000 A ld (durphon),a ; load the phoneme 269D 23 A inc hl A A 269E 3A B000 A sl2: ld a,(port0) ; get Request bit 26A1 E6 01 A and spreq ; goes from low to high to request 26A3 CA 269E A jp z,sl2 ; bit is hardware inverted, new phoneme A 26A6 CD 1E97 A call tick ; tick the watchdog A 26A9 0D A dec c 26AA C2 2664 A jp nz,sloop A 26AD AF A slx: xor a 26AE 32 C000 A ld (sbase),a ; turn-off the SSI-263 26B1 32 8070 A ld (cwptt),a ; reset the CW PTT flag A 26B4 C9 A ret A A A ;============================================================================= A ; Speech Tables: A ; A ; 1 - Filter Frequency A ; 2 - Inflection A ; 3 - Articulation/Ramp A ; 4 - Duration/Phoneme A 26B5 21 26BB A spap: ld hl,$+6 26B8 C3 264C A jp speech 26BB 0A A defb 10 ; number of 4-byte blocks in message A ; FF INF AMP DPH 26BC DE 10 08 10 A defb 0deh,16,8,010h ; AW (autopatch) 26C0 DE 10 08 10 A defb 0deh,16,8,010h ; AW 26C4 DE 10 08 28 A defb 0deh,16,8,028h ; T 26C8 DE 0F 08 11 A defb 0deh,15,8,011h ; O 26CC DE 0C 08 27 A defb 0deh,12,8,027h ; P 26D0 DE 0C 08 0C A defb 0deh,12,8,00ch ; AE 26D4 DE 0C 08 0C A defb 0deh,12,8,00ch ; AE 26D8 DE 0C 08 28 A defb 0deh,12,8,028h ; T 26DC DE 0C 08 32 A defb 0deh,12,8,032h ; SCH 26E0 DE 0C 08 00 A defb 0deh,12,8,000h A A 26E4 21 26EA A spat: ld hl,$+6 26E7 C3 264C A jp speech 26EA 05 A defb 5 ; number of 4-byte blocks in message A ; FF INF AMP DPH 26EB DE 10 08 0C A defb 0deh,16,8,00ch ; AE (at) 26EF DE 10 08 0C A defb 0deh,16,8,00ch ; AE 26F3 DE 10 08 28 A defb 0deh,16,8,028h ; T 26F7 DE 0C 08 00 A defb 0deh,12,8,000h 26FB DE 0C 08 00 A defb 0deh,12,8,000h A 26FF 21 2705 A sptod: ld hl,$+6 2702 C3 264C A jp speech 2705 0C A defb 12 ; number of 4-byte blocks in message A ; FF INF AMP DPH 2706 DE 0C 08 E8 A defb 0deh,12,8,0e8h ; T (today is) 270A DE 0E 08 D6 A defb 0deh,14,8,0d6h ; U 270E DE 10 08 D6 A defb 0deh,16,8,0d6h ; U 2712 DE 12 08 25 A defb 0deh,18,8,025h ; D 2716 DE 10 08 08 A defb 0deh,16,8,008h ; A 271A DE 10 08 08 A defb 0deh,16,8,008h ; A 271E DE 0E 08 01 A defb 0deh,14,8,001h ; E 2722 DE 0E 08 00 A defb 0deh,14,8,000h 2726 DE 0C 08 07 A defb 0deh,12,8,007h ; I 272A DE 0E 08 07 A defb 0deh,14,8,007h ; I 272E DE 10 08 2F A defb 0deh,16,8,02fh ; Z 2732 DE 10 08 00 A defb 0deh,16,8,000h A 2736 21 273C A sptx: ld hl,$+6 2739 C3 264C A jp speech 273C 0A A defb 10 ; number of 4-byte blocks in message A ; FF INF AMP DPH 273D DE 10 08 28 A defb 0deh,16,8,028h ; T (transmit) 2741 DE 10 08 1D A defb 0deh,16,8,01dh ; R 2745 DE 10 08 0C A defb 0deh,16,8,00ch ; AE 2749 DE 10 08 0C A defb 0deh,16,8,00ch ; AE 274D DE 10 08 38 A defb 0deh,16,8,038h ; N 2751 DE 10 08 30 A defb 0deh,16,8,030h ; S 2755 DE 10 08 37 A defb 0deh,16,8,037h ; M 2759 DE 10 08 07 A defb 0deh,16,8,007h ; I 275D DE 10 08 28 A defb 0deh,16,8,028h ; T 2761 DE 0F 08 00 A defb 0deh,15,8,000h A 2765 21 276B A spant: ld hl,$+6 2768 C3 264C A jp speech 276B 0A A defb 10 ; number of 4-byte blocks in message A ; FF INF AMP DPH 276C DE 0E 08 0D A defb 0deh,14,8,00dh ; AE1 (antenna) 2770 DE 0E 08 0D A defb 0deh,14,8,00dh ; AE1 2774 DE 0E 08 38 A defb 0deh,14,8,038h ; N 2778 DE 10 08 28 A defb 0deh,16,8,028h ; T 277C DE 12 08 0A A defb 0deh,18,8,00ah ; EH 2780 DE 12 08 0A A defb 0deh,18,8,00ah ; EH 2784 DE 10 08 38 A defb 0deh,16,8,038h ; N 2788 DE 10 08 0E A defb 0deh,16,8,00eh ; AH 278C DE 0F 08 00 A defb 0deh,15,8,000h 2790 DE 0F 08 00 A defb 0deh,15,8,000h A 2794 21 279A A sprx: ld hl,$+6 2797 C3 264C A jp speech 279A 07 A defb 7 ; number of 4-byte blocks in message A ; FF INF AMP DPH 279B DE 10 08 1D A defb 0deh,16,8,01dh ; R (receive) 279F DE 10 08 01 A defb 0deh,16,8,001h ; E 27A3 DE 10 08 30 A defb 0deh,16,8,030h ; S 27A7 DE 10 08 01 A defb 0deh,16,8,001h ; E 27AB DE 10 08 01 A defb 0deh,16,8,001h ; E 27AF DE 10 08 33 A defb 0deh,16,8,033h ; V 27B3 DE 0F 08 00 A defb 0deh,15,8,000h A 27B7 21 27BD A smeter: ld hl,$+6 27BA C3 264C A jp speech 27BD 08 A defb 8 ; number of 4-byte blocks in message A ; FF INF AMP DPH 27BE DE 10 08 37 A defb 0deh,16,8,037h ; M (meter) 27C2 DE 10 08 01 A defb 0deh,16,8,001h ; E 27C6 DE 10 08 01 A defb 0deh,16,8,001h ; E 27CA DE 10 08 28 A defb 0deh,16,8,028h ; T 27CE DE 10 08 1C A defb 0deh,16,8,01ch ; ER 27D2 DE 0F 08 00 A defb 0deh,15,8,000h 27D6 DE 0F 08 00 A defb 0deh,15,8,000h 27DA DE 0F 08 00 A defb 0deh,15,8,000h A 27DE CD 2CCB A sp450: call s4 ; say 450 27E1 C3 2E02 A jp s50 A 27E4 CD 2CFD A sp6m: call s6 ; say 6 Meter 27E7 C3 27B7 A jp smeter A 27EA CD 2CA1 A sp2m: call s2 ; say 2 Meter 27ED C3 27B7 A jp smeter A 27F0 CD 2D61 A sp10m: call s10 ; say 10 Meter 27F3 C3 27B7 A jp smeter A 27F6 21 27FC A sndshe: ld hl,$+6 27F9 C3 264C A jp speech 27FC 07 A defb 7 ; number of 4-byte blocks in message A ; FF INF AMP DPH 27FD DE 09 08 AC A defb 0deh,09,8,0ach ; HF (hello) 2801 DE 0C 08 CA A defb 0deh,12,8,0cah ; EH 2805 DE 0E 08 CA A defb 0deh,14,8,0cah ; EH 2809 DE 10 08 E0 A defb 0deh,16,8,0e0h ; L 280D DE 12 08 A0 A defb 0deh,18,8,0a0h ; L 2811 DE 11 08 D1 A defb 0deh,17,8,0d1h ; O 2815 DE 10 08 E3 A defb 0deh,16,8,0e3h ; W A 2819 21 281F A sndgd: ld hl,$+6 281C C3 264C A jp speech 281F 05 A defb 5 ; number of 4-byte blocks in message A ; FF INF AMP DPH 2820 DE 0C 08 26 A defb 0deh,12,8,026h ; KV (Good) 2824 DE 0C 08 18 A defb 0deh,12,8,018h ; UH 2828 DE 0C 08 18 A defb 0deh,12,8,018h ; UH 282C DE 0C 08 25 A defb 0deh,12,8,025h ; D 2830 DE 0C 08 00 A defb 0deh,12,8,000h A 2834 21 283A A sndmn: ld hl,$+6 2837 C3 264C A jp speech 283A 08 A defb 8 ; number of 4-byte blocks in message A ; FF INF AMP DPH 283B DE 13 08 37 A defb 0deh,19,8,037h ; M (morning) 283F DE 12 08 11 A defb 0deh,18,8,011h ; O 2843 DE 11 08 11 A defb 0deh,17,8,011h ; O 2847 DE 11 08 1D A defb 0deh,17,8,01dh ; R 284B DE 10 08 38 A defb 0deh,16,8,038h ; N 284F DE 0F 08 07 A defb 0deh,15,8,007h ; I 2853 DE 0C 08 39 A defb 0deh,12,8,039h ; NG 2857 DE 0F 08 00 A defb 0deh,15,8,000h A 285B 21 2861 A sndaf: ld hl,$+6 285E C3 264C A jp speech 2861 0A A defb 10 ; number of 4-byte blocks in message; FF INF RMP DPH A ; FF INF AMP DPH 2862 DE 0C 08 0C A defb 0deh,12,8,00ch ; AE (afternoon) 2866 DE 0C 08 0C A defb 0deh,12,8,00ch ; AE 286A DE 0C 08 34 A defb 0deh,12,8,034h ; F 286E DE 0C 08 28 A defb 0deh,12,8,028h ; T 2872 DE 0C 08 1C A defb 0deh,12,8,01ch ; ER 2876 DE 12 08 38 A defb 0deh,18,8,038h ; N 287A DE 11 08 16 A defb 0deh,17,8,016h ; U 287E DE 10 08 16 A defb 0deh,16,8,016h ; U 2882 DE 0F 08 38 A defb 0deh,15,8,038h ; N 2886 DE 0F 08 00 A defb 0deh,15,8,000h A 288A 21 2890 A sndeve: ld hl,$+6 288D C3 264C A jp speech 2890 08 A defb 8 ; number of 4-byte blocks in message A ; FF INF AMP DPH 2891 DE 12 08 01 A defb 0deh,18,8,001h ; E (evening) 2895 DE 12 08 01 A defb 0deh,18,8,001h ; E 2899 DE 11 08 33 A defb 0deh,17,8,033h ; V 289D DE 10 08 38 A defb 0deh,16,8,038h ; N 28A1 DE 0F 08 07 A defb 0deh,15,8,007h ; I 28A5 DE 0F 08 07 A defb 0deh,15,8,007h ; I 28A9 DE 0C 08 39 A defb 0deh,12,8,039h ; NG 28AD DE 0F 08 00 A defb 0deh,15,8,000h A 28B1 21 28B7 A welmsg: ld hl,$+6 28B4 C3 264C A jp speech 28B7 0D A defb 13 A ; FF INF AMP DPH 28B8 DE 0E 08 23 A defb 0deh,14,8,023h ; W (welcome) 28BC DE 10 08 0A A defb 0deh,16,8,00ah ; EH 28C0 DE 12 08 20 A defb 0deh,18,8,020h ; L 28C4 DE 10 08 29 A defb 0deh,16,8,029h ; K 28C8 DE 0E 08 18 A defb 0deh,14,8,018h ; UH 28CC DE 0D 08 37 A defb 0deh,13,8,037h ; M 28D0 DE 0D 08 00 A defb 0deh,13,8,000h 28D4 DE 0D 08 28 A defb 0deh,13,8,028h ; T (to) 28D8 DE 0E 08 16 A defb 0deh,14,8,016h ; U 28DC DE 0F 08 16 A defb 0deh,15,8,016h ; U 28E0 DE 10 08 35 A defb 0deh,16,8,035h ; THV (the) 28E4 DE 10 08 18 A defb 0deh,16,8,018h ; UH 28E8 DE 10 08 00 A defb 0deh,16,8,000h ; A 28EC 3E 01 A sidmsg: ld a,1 ; set the CWPTT flag 28EE 32 8070 A ld (cwptt),a A 28F1 2A 822F A ld hl,(mdfid) ; preset default ID timer value 28F4 22 804D A ld (idtim),hl A 28F7 AF A xor a 28F8 32 8203 A ld (fidtm),a ; reset foreground task flag 28FB 32 8082 A ld (bidflg),a ; reset the Broadcast ID flag A 28FE 21 2904 A ld hl,$+6 2901 C3 2651 A jp spch1 2904 1F A defb 31 A ; FF INF AMP DPH 2905 DE 11 08 25 A defb 0deh,17,8,025h ; D (W) 2909 DE 11 08 18 A defb 0deh,17,8,018h ; UH 290D DE 11 08 24 A defb 0deh,17,8,024h ; B 2911 DE 11 08 20 A defb 0deh,17,8,020h ; L 2915 DE 11 08 04 A defb 0deh,17,8,004h ; Y 2919 DE 11 08 16 A defb 0deh,17,8,016h ; U 291D DE 11 08 08 A defb 0deh,17,8,008h ; A (A) 2921 DE 12 08 08 A defb 0deh,18,8,008h ; A 2925 DE 11 08 01 A defb 0deh,17,8,001h ; E 2929 DE 10 08 23 A defb 0deh,16,8,023h ; W (1) 292D DE 0F 08 18 A defb 0deh,15,8,018h ; UH 2931 DE 0F 08 38 A defb 0deh,15,8,038h ; N 2935 DE 0F 08 00 A defb 0deh,15,8,000h ; 2939 DE 10 08 0A A defb 0deh,16,8,00ah ; EH (L) 293D DE 10 08 20 A defb 0deh,16,8,020h ; L 2941 DE 10 08 0A A defb 0deh,16,8,00ah ; EH (M) 2945 DE 10 08 37 A defb 0deh,16,8,037h ; M 2949 DE 10 08 33 A defb 0deh,16,8,033h ; V (V) 294D DE 11 08 33 A defb 0deh,17,8,033h ; V 2951 DE 12 08 01 A defb 0deh,18,8,001h ; E 2955 DE 11 08 01 A defb 0deh,17,8,001h ; E 2959 DE 10 08 00 A defb 0deh,16,8,000h 295D DE 10 08 00 A defb 0deh,16,8,000h 2961 DE 10 08 1D A defb 0deh,16,8,01dh ; R (repeater) 2965 DE 10 08 01 A defb 0deh,16,8,001h ; E 2969 DE 10 08 27 A defb 0deh,16,8,027h ; P 296D DE 11 08 01 A defb 0deh,17,8,001h ; E 2971 DE 0F 08 01 A defb 0deh,15,8,001h ; E 2975 DE 0D 08 28 A defb 0deh,13,8,028h ; T 2979 DE 0B 08 1C A defb 0deh,11,8,01ch ; ER 297D DE 0F 08 00 A defb 0deh,15,8,000h A A 2981 21 2987 A ssfn: ld hl,$+6 2984 C3 264C A jp speech 2987 0A A defb 10 A ; FF INF AMP DPH 2988 DE 10 08 34 A defb 0deh,16,8,034h ; F (function) 298C DE 11 08 19 A defb 0deh,17,8,019h ; UH 2990 DE 12 08 39 A defb 0deh,18,8,039h ; NG 2994 DE 11 08 29 A defb 0deh,17,8,029h ; K 2998 DE 08 08 32 A defb 0deh,08,8,032h ; SCH 299C DE 07 08 1B A defb 0deh,07,8,01bh ; UH3 29A0 DE 08 08 1B A defb 0deh,08,8,01bh ; UH3 29A4 DE 09 08 38 A defb 0deh,09,8,038h ; N 29A8 DE 10 08 38 A defb 0deh,16,8,038h ; N 29AC DE 10 08 00 A defb 0deh,16,8,000h ; A 29B0 21 29B6 A sndson: ld hl,$+6 29B3 C3 264C A jp speech 29B6 04 A defb 4 A ; FF INF AMP DPH 29B7 DD 13 08 0E A defb 0ddh,19,8,00eh ; AH (on) 29BB DD 11 08 0E A defb 0ddh,17,8,00eh ; AH 29BF DD 0F 08 38 A defb 0ddh,15,8,038h ; N 29C3 DD 0D 08 38 A defb 0ddh,13,8,038h ; N A 29C7 21 29CD A sndsoff:ld hl,$+6 29CA C3 264C A jp speech 29CD 04 A defb 4 A ; FF INF AMP DPH 29CE DD 13 08 10 A defb 0ddh,19,8,010h ; AW (off) 29D2 DD 11 08 10 A defb 0ddh,17,8,010h ; AW 29D6 DD 0F 08 34 A defb 0ddh,15,8,034h ; F 29DA DD 0D 08 34 A defb 0ddh,13,8,034h ; F A 29DE AF A sndnuk: xor a ; reset both 6M and 450 29DF 32 8204 A ld (fvctm),a ; courtesy tone foreground flags 29E2 32 8205 A ld (fuctm),a ; to eliminate trailing beep A 29E5 CD 40F8 A call htime ; the curly routine 29E8 CD 243F A call onesec 29EB CD 2422 A call t440 ; musical note A 29EE CD 25FC A call tonon ; tone on 29F1 CD 244E A call sec17 ; 1/7 second delay 29F4 CD 2416 A call t500 ; musical note B 29F7 CD 244E A call sec17 ; 1/7 second delay 29FA CD 2410 A call t550 ; musical note C# 29FD CD 244E A call sec17 ; 1/7 second delay 2A00 CD 2416 A call t500 ; musical note B 2A03 CD 244E A call sec17 ; 1/7 second delay 2A06 CD 2605 A call tonoff ; tone off 2A09 CD 244E A call sec17 ; 1/7 second delay 2A0C CD 25FC A call tonon 2A0F CD 2410 A call t550 ; musical note C# 2A12 CD 244E A call sec17 ; 1/7 second delay 2A15 CD 2422 A call t440 ; musical note A 2A18 CD 244E A call sec17 ; 1/7 second delay 2A1B CD 2605 A call tonoff A 2A1E 3A 825E A ld a,(mdfsr) ; get current speech rate 2A21 F5 A push af 2A22 3E B0 A ld a,0b0h ; set up faster speech rate 2A24 32 825E A ld (mdfsr),a 2A27 CD 2A41 A call sndnk 2A2A F1 A pop af 2A2B 32 825E A ld (mdfsr),a ; restore old speech rate 2A2E CD 2444 A call halfsec A 2A31 CD 23FE A call t900 ; musical note high A 2A34 CD 25FC A call tonon ; tone on 2A37 CD 244E A call sec17 ; 1/7 second delay 2A3A CD 2605 A call tonoff ; tone off 2A3D CD 243F A call onesec A 2A40 C9 A ret A A 2A41 21 2A47 A sndnk: ld hl,$+6 2A44 C3 264C A jp speech 2A47 14 A defb 20 A ; FF INF AMP DPH 2A48 EE 13 08 F8 A defb 0eeh,19,8,0f8h ; N (nuk, nuk ...) 2A4C EE 12 08 F8 A defb 0eeh,18,8,0f8h ; N 2A50 EE 11 08 DB A defb 0eeh,17,8,0dbh ; UH3 2A54 EE 10 08 E9 A defb 0eeh,16,8,0e9h ; K 2A58 EE 10 08 C0 A defb 0eeh,16,8,0c0h ; 2A5C EE 10 08 F8 A defb 0eeh,16,8,0f8h ; N 2A60 EE 0F 08 F8 A defb 0eeh,15,8,0f8h ; N 2A64 EE 0F 08 DB A defb 0eeh,15,8,0dbh ; UH3 2A68 EE 0E 08 E9 A defb 0eeh,14,8,0e9h ; K 2A6C EE 0E 08 C0 A defb 0eeh,14,8,0c0h ; 2A70 EE 0D 08 F8 A defb 0eeh,13,8,0f8h ; N 2A74 EE 0D 08 F8 A defb 0eeh,13,8,0f8h ; N 2A78 EE 0C 08 DB A defb 0eeh,12,8,0dbh ; UH3 2A7C EE 0C 08 E9 A defb 0eeh,12,8,0e9h ; K 2A80 EE 0B 08 C0 A defb 0eeh,11,8,0c0h ; 2A84 EE 0B 08 F8 A defb 0eeh,11,8,0f8h ; N 2A88 EE 0B 08 F8 A defb 0eeh,11,8,0f8h ; N 2A8C EE 0B 08 DB A defb 0eeh,11,8,0dbh ; UH3 2A90 EE 0B 08 E9 A defb 0eeh,11,8,0e9h ; K 2A94 EE 0B 08 C0 A defb 0eeh,11,8,0c0h ; A 2A98 21 2A9E A ssmst: ld hl,$+6 2A9B C3 264C A jp speech 2A9E 07 A defb 7 A ; FF INF AMP DPH 2A9F DE 0C 08 37 A defb 0deh,12,8,037h ; M (Master) 2AA3 DE 0E 08 0C A defb 0deh,14,8,00ch ; AE 2AA7 DE 10 08 0C A defb 0deh,16,8,00ch ; AE 2AAB DE 0F 08 30 A defb 0deh,15,8,030h ; S 2AAF DE 0B 08 28 A defb 0deh,11,8,028h ; T 2AB3 DE 0C 08 1C A defb 0deh,12,8,01ch ; ER 2AB7 DE 10 08 00 A defb 0deh,16,8,000h ; A 2ABB 3A 8218 A ssdis: ld a,(cwena) ; speech mode enabled? 2ABE FE 02 A cp 2 2AC0 C2 24D5 A jp nz,sndoff A 2AC3 21 2AC9 A ld hl,$+6 2AC6 C3 264C A jp speech 2AC9 0B A defb 11 A ; FF INF AMP DPH 2ACA DE 10 08 00 A defb 0deh,16,8,000h ; 2ACE DE 10 08 25 A defb 0deh,16,8,025h ; D (Disabled) 2AD2 DE 10 08 07 A defb 0deh,16,8,007h ; I 2AD6 DE 10 08 30 A defb 0deh,16,8,030h ; S 2ADA DE 11 09 08 A defb 0deh,17,9,008h ; A 2ADE DE 12 0A 08 A defb 0deh,18,10,008h ; A 2AE2 DE 11 09 01 A defb 0deh,17,9,001h ; E 2AE6 DE 10 08 24 A defb 0deh,16,8,024h ; B 2AEA DE 10 08 20 A defb 0deh,16,8,020h ; L 2AEE DE 10 08 20 A defb 0deh,16,8,020h ; L 2AF2 DE 10 08 25 A defb 0deh,16,8,025h ; D A 2AF6 3A 8218 A ssena: ld a,(cwena) ; speech mode enabled? 2AF9 FE 02 A cp 2 2AFB C2 24BD A jp nz,sndon A 2AFE 21 2B04 A ld hl,$+6 2B01 C3 264C A jp speech 2B04 0A A defb 10 A ; FF INF AMP DPH 2B05 DE 10 08 00 A defb 0deh,16,8,000h ; 2B09 DE 10 08 0A A defb 0deh,16,8,00ah ; E (Enabled) 2B0D DE 10 08 38 A defb 0deh,16,8,038h ; N 2B11 DE 11 09 08 A defb 0deh,17,9,008h ; A 2B15 DE 12 0A 08 A defb 0deh,18,10,008h ; A 2B19 DE 11 09 01 A defb 0deh,17,9,001h ; E 2B1D DE 10 08 24 A defb 0deh,16,8,024h ; B 2B21 DE 10 08 20 A defb 0deh,16,8,020h ; L 2B25 DE 10 08 20 A defb 0deh,16,8,020h ; L 2B29 DE 10 08 25 A defb 0deh,16,8,025h ; D A 2B2D CD 2B33 A ssctl: call ssctl1 ; say CONTROL 2B30 C3 2981 A jp ssfn ; say FUNCTION A 2B33 21 2B39 A ssctl1: ld hl,$+6 2B36 C3 264C A jp speech 2B39 0C A defb 12 A ; FF INF AMP DPH 2B3A DE 0C 08 29 A defb 0deh,12,8,029h ; K (Control) 2B3E DE 0C 08 29 A defb 0deh,12,8,029h ; K 2B42 DE 0C 08 19 A defb 0deh,12,8,019h ; UH1 2B46 DE 0D 08 38 A defb 0deh,13,8,038h ; N 2B4A DE 0E 08 38 A defb 0deh,14,8,038h ; N 2B4E DE 0F 08 28 A defb 0deh,15,8,028h ; T 2B52 DE 11 08 1D A defb 0deh,17,8,01dh ; R 2B56 DE 12 08 11 A defb 0deh,18,8,011h ; O 2B5A DE 11 08 11 A defb 0deh,17,8,011h ; O 2B5E DE 10 08 20 A defb 0deh,16,8,020h ; L 2B62 DE 10 08 00 A defb 0deh,16,8,000h ; 2B66 DE 10 08 00 A defb 0deh,16,8,000h ; A 2B6A CD 2B70 A ssusr: call ssusr1 ; say USER 2B6D C3 2981 A jp ssfn ; say FUNCTION A 2B70 21 2B76 A ssusr1: ld hl,$+6 2B73 C3 264C A jp speech 2B76 06 A defb 6 A ; FF INF AMP DPH 2B77 DE 0F 08 01 A defb 0deh,15,8,001h ; E (User) 2B7B DE 10 08 16 A defb 0deh,16,8,016h ; U 2B7F DE 12 08 16 A defb 0deh,18,8,016h ; U 2B83 DE 11 08 2F A defb 0deh,17,8,02fh ; Z 2B87 DE 10 08 1C A defb 0deh,16,8,01ch ; ER 2B8B DE 10 08 00 A defb 0deh,16,8,000h ; A 2B8F 21 2B95 A spspd: ld hl,$+6 2B92 C3 264C A jp speech 2B95 0C A defb 12 A ; FF INF AMP DPH 2B96 DE 0F 08 30 A defb 0deh,15,8,030h ; S (Speed Dial) 2B9A DE 10 08 27 A defb 0deh,16,8,027h ; P 2B9E DE 12 08 01 A defb 0deh,18,8,001h ; E 2BA2 DE 11 08 01 A defb 0deh,17,8,001h ; E 2BA6 DE 10 08 25 A defb 0deh,16,8,025h ; D 2BAA DE 10 08 00 A defb 0deh,16,8,000h ; 2BAE DE 0C 08 25 A defb 0deh,12,8,025h ; D 2BB2 DE 0E 08 0F A defb 0deh,14,8,00fh ; AH1 2BB6 DE 0E 08 0F A defb 0deh,14,8,00fh ; AH1 2BBA DE 0E 08 01 A defb 0deh,14,8,001h ; E 2BBE DE 0E 08 22 A defb 0deh,14,8,022h ; LF 2BC2 DE 10 08 00 A defb 0deh,16,8,000h ; A 2BC6 21 2BCC A ssrst: ld hl,$+6 2BC9 C3 264C A jp speech 2BCC 07 A defb 7 A ; FF INF AMP DPH 2BCD DE 0C 08 1D A defb 0deh,12,8,01dh ; R (Reset) 2BD1 DE 0F 08 01 A defb 0deh,15,8,001h ; E 2BD5 DE 11 08 01 A defb 0deh,17,8,001h ; E 2BD9 DE 0E 08 30 A defb 0deh,14,8,030h ; S 2BDD DE 0E 08 30 A defb 0deh,14,8,030h ; S 2BE1 DE 0E 08 0A A defb 0deh,14,8,00ah ; EH 2BE5 DE 0E 08 28 A defb 0deh,14,8,028h ; T A 2BE9 21 2BEF A sa: ld hl,$+6 2BEC C3 264C A jp speech 2BEF 04 A defb 4 A ; FF INF AMP DPH 2BF0 DE 0E 08 C8 A defb 0deh,14,8,0c8h ; A (A) 2BF4 DE 0F 08 C8 A defb 0deh,15,8,0c8h ; A 2BF8 DE 10 08 C1 A defb 0deh,16,8,0c1h ; E 2BFC DE 10 08 C1 A defb 0deh,16,8,0c1h ; E A A 2C00 21 2C06 A sb: ld hl,$+6 2C03 C3 264C A jp speech 2C06 04 A defb 4 A ; FF INF AMP DPH 2C07 DE 0E 08 E4 A defb 0deh,14,8,0e4h ; B (B) 2C0B DE 0F 08 E4 A defb 0deh,15,8,0e4h ; B 2C0F DE 10 08 C1 A defb 0deh,16,8,0c1h ; E 2C13 DE 10 08 C1 A defb 0deh,16,8,0c1h ; E A 2C17 21 2C1D A sc: ld hl,$+6 2C1A C3 264C A jp speech 2C1D 04 A defb 4 A ; FF INF AMP DPH 2C1E DE 0E 08 F0 A defb 0deh,14,8,0f0h ; S (C) 2C22 DE 0F 08 F0 A defb 0deh,15,8,0f0h ; S 2C26 DE 10 08 C1 A defb 0deh,16,8,0c1h ; E 2C2A DE 10 08 C1 A defb 0deh,16,8,0c1h ; E A 2C2E 21 2C34 A sd: ld hl,$+6 2C31 C3 264C A jp speech 2C34 04 A defb 4 A ; FF INF AMP DPH 2C35 DE 0E 08 E5 A defb 0deh,14,8,0e5h ; D (D) 2C39 DE 0F 08 E5 A defb 0deh,15,8,0e5h ; D 2C3D DE 10 08 C1 A defb 0deh,16,8,0c1h ; E 2C41 DE 10 08 C1 A defb 0deh,16,8,0c1h ; E A 2C45 21 2C4B A se: ld hl,$+6 2C48 C3 264C A jp speech 2C4B 03 A defb 3 A ; FF INF AMP DPH 2C4C DE 0E 08 C1 A defb 0deh,14,8,0c1h ; E (E) 2C50 DE 0F 08 C1 A defb 0deh,15,8,0c1h ; E 2C54 DE 10 08 C1 A defb 0deh,16,8,0c1h ; E A 2C58 21 2C5E A sf: ld hl,$+6 2C5B C3 264C A jp speech 2C5E 04 A defb 4 A ; FF INF AMP DPH 2C5F DE 0E 08 CA A defb 0deh,14,8,0cah ; EH (F) 2C63 DE 0F 08 CA A defb 0deh,15,8,0cah ; EH 2C67 DE 10 08 F4 A defb 0deh,16,8,0f4h ; F 2C6B DE 10 08 F4 A defb 0deh,16,8,0f4h ; F A 2C6F 21 2C75 A s0: ld hl,$+6 2C72 C3 264C A jp speech 2C75 05 A defb 5 A ; FF INF AMP DPH 2C76 DE 12 08 EF A defb 0deh,18,8,0efh ; Z (0) 2C7A DE 10 08 C1 A defb 0deh,16,8,0c1h ; E 2C7E DE 0E 08 DD A defb 0deh,14,8,0ddh ; R 2C82 DE 0E 08 D1 A defb 0deh,14,8,0d1h ; O 2C86 DE 0E 08 D1 A defb 0deh,14,8,0d1h ; O A 2C8A 21 2C90 A s1: ld hl,$+6 2C8D C3 264C A jp speech 2C90 04 A defb 4 A ; FF INF AMP DPH 2C91 DE 12 08 E3 A defb 0deh,18,8,0e3h ; W (1) 2C95 DE 10 08 D8 A defb 0deh,16,8,0d8h ; UH 2C99 DE 10 08 D8 A defb 0deh,16,8,0d8h ; UH 2C9D DE 0E 08 F8 A defb 0deh,14,8,0f8h ; N A 2CA1 21 2CA7 A s2: ld hl,$+6 2CA4 C3 264C A jp speech 2CA7 03 A defb 3 A ; FF INF AMP DPH 2CA8 DE 12 08 E8 A defb 0deh,18,8,0e8h ; T (2) 2CAC DE 10 08 D6 A defb 0deh,16,8,0d6h ; U 2CB0 DE 0E 08 D6 A defb 0deh,14,8,0d6h ; U A 2CB4 21 2CBA A s3: ld hl,$+6 2CB7 C3 264C A jp speech 2CBA 04 A defb 4 A ; FF INF AMP DPH 2CBB DE 0E 08 F5 A defb 0deh,14,8,0f5h ; THV (3) 2CBF DE 10 08 DD A defb 0deh,16,8,0ddh ; R 2CC3 DE 12 08 C1 A defb 0deh,18,8,0c1h ; E 2CC7 DE 10 08 C1 A defb 0deh,16,8,0c1h ; E A 2CCB 21 2CD1 A s4: ld hl,$+6 2CCE C3 264C A jp speech 2CD1 04 A defb 4 A ; FF INF AMP DPH 2CD2 DE 12 08 F4 A defb 0deh,18,8,0f4h ; F (4) 2CD6 DE 10 08 D1 A defb 0deh,16,8,0d1h ; O 2CDA DE 0E 08 D1 A defb 0deh,14,8,0d1h ; O 2CDE DE 0E 08 DC A defb 0deh,14,8,0dch ; ER A 2CE2 21 2CE8 A s5: ld hl,$+6 2CE5 C3 264C A jp speech 2CE8 05 A defb 5 A ; FF INF AMP DPH 2CE9 DE 12 08 F4 A defb 0deh,18,8,0f4h ; F (5) 2CED DE 12 08 CF A defb 0deh,18,8,0cfh ; AH1 2CF1 DE 10 08 CF A defb 0deh,16,8,0cfh ; AH1 2CF5 DE 0E 08 C1 A defb 0deh,14,8,0c1h ; E 2CF9 DE 0E 08 F3 A defb 0deh,14,8,0f3h ; V A 2CFD 21 2D03 A s6: ld hl,$+6 2D00 C3 264C A jp speech 2D03 05 A defb 5 A ; FF INF AMP DPH 2D04 DE 12 08 F0 A defb 0deh,18,8,0f0h ; S (6) 2D08 DE 12 08 F0 A defb 0deh,18,8,0f0h ; S 2D0C DE 10 08 C7 A defb 0deh,16,8,0c7h ; I 2D10 DE 0F 08 E9 A defb 0deh,15,8,0e9h ; K 2D14 DE 0E 08 F0 A defb 0deh,14,8,0f0h ; S A 2D18 21 2D1E A s7: ld hl,$+6 2D1B C3 264C A jp speech 2D1E 05 A defb 5 A ; FF INF AMP DPH 2D1F DE 12 08 F0 A defb 0deh,18,8,0f0h ; S (7) 2D23 DE 12 08 CA A defb 0deh,18,8,0cah ; EH 2D27 DE 10 08 F3 A defb 0deh,16,8,0f3h ; V 2D2B DE 12 08 CA A defb 0deh,18,8,0cah ; EH 2D2F DE 0E 08 F8 A defb 0deh,14,8,0f8h ; N A 2D33 21 2D39 A s8: ld hl,$+6 2D36 C3 264C A jp speech 2D39 03 A defb 3 A ; FF INF AMP DPH 2D3A DE 12 08 C8 A defb 0deh,18,8,0c8h ; A (8) 2D3E DE 10 08 C1 A defb 0deh,16,8,0c1h ; E 2D42 DE 0E 08 E8 A defb 0deh,14,8,0e8h ; T A 2D46 21 2D4C A s9: ld hl,$+6 2D49 C3 264C A jp speech 2D4C 05 A defb 5 A ; FF INF AMP DPH 2D4D DE 12 08 F8 A defb 0deh,18,8,0f8h ; N (9) 2D51 DE 12 08 CF A defb 0deh,18,8,0cfh ; AH1 2D55 DE 10 08 CF A defb 0deh,16,8,0cfh ; AH1 2D59 DE 0E 08 C1 A defb 0deh,14,8,0c1h ; E 2D5D DE 0E 08 F8 A defb 0deh,14,8,0f8h ; N A 2D61 21 2D67 A s10: ld hl,$+6 2D64 C3 264C A jp speech 2D67 05 A defb 5 A ; FF INF AMP DPH 2D68 DE 12 08 E8 A defb 0deh,18,8,0e8h ; T (TEN) 2D6C DE 12 08 E8 A defb 0deh,18,8,0e8h ; T 2D70 DE 10 08 CA A defb 0deh,16,8,0cah ; EH 2D74 DE 0E 08 CA A defb 0deh,14,8,0cah ; EH 2D78 DE 0E 08 F8 A defb 0deh,14,8,0f8h ; N A 2D7C 21 2D82 A s11: ld hl,$+6 2D7F C3 264C A jp speech 2D82 07 A defb 7 A ; FF INF AMP DPH 2D83 DE 10 08 C1 A defb 0deh,16,8,0c1h ; E (ELEVEN) 2D87 DE 10 08 C1 A defb 0deh,16,8,0c1h ; E 2D8B DE 11 08 E0 A defb 0deh,17,8,0e0h ; L 2D8F DE 12 08 CA A defb 0deh,18,8,0cah ; EH 2D93 DE 11 08 F3 A defb 0deh,17,8,0f3h ; V 2D97 DE 10 08 C2 A defb 0deh,16,8,0c2h ; E1 2D9B DE 0F 08 F8 A defb 0deh,15,8,0f8h ; N A 2D9F 21 2DA5 A s12: ld hl,$+6 2DA2 C3 264C A jp speech 2DA5 05 A defb 5 A ; FF INF AMP DPH 2DA6 DE 0E 08 E8 A defb 0deh,14,8,0e8h ; T (TWELVE) 2DAA DE 0F 08 E3 A defb 0deh,15,8,0e3h ; W 2DAE DE 10 08 CA A defb 0deh,16,8,0cah ; EH 2DB2 DE 0F 08 E1 A defb 0deh,15,8,0e1h ; L1 2DB6 DE 0E 08 F3 A defb 0deh,14,8,0f3h ; V A 2DBA 21 2E0B A s13: ld hl,s13msg 2DBD CD 264C A call speech 2DC0 C3 2E4D A jp steen A 2DC3 CD 2CCB A s14: call s4 2DC6 C3 2E4D A jp steen A 2DC9 21 2E18 A s15: ld hl,s15msg 2DCC CD 264C A call speech 2DCF C3 2E4D A jp steen A 2DD2 CD 2CFD A s16: call s6 2DD5 C3 2E4D A jp steen A 2DD8 CD 2D18 A s17: call s7 2DDB C3 2E4D A jp steen A 2DDE CD 2D33 A s18: call s8 2DE1 C3 2E4D A jp steen A 2DE4 CD 2D46 A s19: call s9 2DE7 C3 2E4D A jp steen A 2DEA 21 2E29 A s20: ld hl,s20msg 2DED CD 264C A call speech 2DF0 C3 2E3A A jp sty A 2DF3 21 2E0B A s30: ld hl,s13msg 2DF6 CD 264C A call speech 2DF9 C3 2E3A A jp sty A 2DFC CD 2CCB A s40: call s4 2DFF C3 2E3A A jp sty A 2E02 21 2E18 A s50: ld hl,s15msg 2E05 CD 264C A call speech 2E08 C3 2E3A A jp sty A A 2E0B 03 A s13msg: defb 3 A ; FF INF AMP DPH 2E0C DE 11 08 F6 A defb 0deh,17,8,0f6h ; TH (THIRteen) 2E10 DE 10 08 DC A defb 0deh,16,8,0dch ; ER 2E14 DE 0F 08 DC A defb 0deh,15,8,0dch ; ER A 2E18 04 A s15msg: defb 4 A ; FF INF AMP DPH 2E19 DE 10 08 F4 A defb 0deh,16,8,0f4h ; F (FIFteen) 2E1D DE 12 08 C7 A defb 0deh,18,8,0c7h ; I 2E21 DE 12 08 C7 A defb 0deh,18,8,0c7h ; I 2E25 DE 10 08 F4 A defb 0deh,16,8,0f4h ; F A 2E29 04 A s20msg: defb 4 A ; FF INF AMP DPH 2E2A DE 0E 08 E8 A defb 0deh,14,8,0e8h ; T (TWENty) 2E2E DE 0F 08 E3 A defb 0deh,15,8,0e3h ; W 2E32 DE 10 08 CA A defb 0deh,16,8,0cah ; EH 2E36 DE 0F 08 F8 A defb 0deh,15,8,0f8h ; N A 2E3A 21 2E40 A sty: ld hl,$+6 2E3D C3 264C A jp speech 2E40 03 A defb 3 A ; FF INF AMP DPH 2E41 DE 10 08 E8 A defb 0deh,16,8,0e8h ; T 2E45 DE 0F 08 C1 A defb 0deh,15,8,0c1h ; E 2E49 DE 0E 08 C1 A defb 0deh,14,8,0c1h ; E A 2E4D 21 2E53 A steen: ld hl,$+6 2E50 C3 264C A jp speech 2E53 04 A defb 4 A ; FF INF AMP DPH 2E54 DE 10 08 E8 A defb 0deh,16,8,0e8h ; T 2E58 DE 11 08 C1 A defb 0deh,17,8,0c1h ; E 2E5C DE 10 08 C1 A defb 0deh,16,8,0c1h ; E 2E60 DE 0F 08 F8 A defb 0deh,15,8,0f8h ; N A 2E64 21 2E6A A sp: ld hl,$+6 2E67 C3 264C A jp speech 2E6A 03 A defb 3 A ; FF INF AMP DPH 2E6B DE 11 08 E7 A defb 0deh,17,8,0e7h ; P (P) 2E6F DE 10 08 C1 A defb 0deh,16,8,0c1h ; E 2E73 DE 0E 08 C1 A defb 0deh,14,8,0c1h ; E A 2E77 21 2E7D A sm: ld hl,$+6 2E7A C3 264C A jp speech 2E7D 03 A defb 3 A ; FF INF AMP DPH 2E7E DE 10 08 CA A defb 0deh,16,8,0cah ; E (M) 2E82 DE 10 08 F7 A defb 0deh,16,8,0f7h ; M 2E86 DE 10 08 F7 A defb 0deh,16,8,0f7h ; M A 2E8A 21 2E90 A sl: ld hl,$+6 2E8D C3 264C A jp speech 2E90 03 A defb 3 A ; FF INF AMP DPH 2E91 DE 10 08 0A A defb 0deh,16,8,00ah ; EH (L) 2E95 DE 10 08 20 A defb 0deh,16,8,020h ; L 2E99 DE 10 08 20 A defb 0deh,16,8,020h ; L A 2E9D 0F A timmsg: defb 15 A ; FF INF AMP DPH 2E9E DE 0D 08 F5 A defb 0deh,13,8,0f5h ; THV (The) 2EA2 DE 0E 08 CE A defb 0deh,14,8,0ceh ; AH 2EA6 DE 0E 08 CE A defb 0deh,14,8,0ceh ; AH 2EAA DE 10 08 C0 A defb 0deh,16,8,0c0h ; 2EAE DE 12 08 E8 A defb 0deh,18,8,0e8h ; T (time) 2EB2 DE 12 08 CF A defb 0deh,18,8,0cfh ; AH1 2EB6 DE 10 08 CF A defb 0deh,16,8,0cfh ; AH1 2EBA DE 0E 08 C1 A defb 0deh,14,8,0c1h ; E 2EBE DE 0E 08 F7 A defb 0deh,14,8,0f7h ; M 2EC2 DE 0C 08 C0 A defb 0deh,12,8,0c0h ; 2EC6 DE 0E 08 C7 A defb 0deh,14,8,0c7h ; I (is 2ECA DE 10 08 F0 A defb 0deh,16,8,0f0h ; S 2ECE DE 10 08 C0 A defb 0deh,16,8,0c0h ; 2ED2 DE 10 08 C0 A defb 0deh,16,8,0c0h ; 2ED6 DE 10 08 C0 A defb 0deh,16,8,0c0h ; A 2EDA 21 2EE0 A sand: ld hl,$+6 2EDD C3 264C A jp speech 2EE0 05 A defb 5 A ; FF INF AMP DPH 2EE1 DE 10 08 C0 A defb 0deh,16,8,0c0h ; 2EE5 DE 10 08 CD A defb 0deh,16,8,0cdh ; A (AND) 2EE9 DE 10 08 F8 A defb 0deh,16,8,0f8h ; N 2EED DE 10 08 E5 A defb 0deh,16,8,0e5h ; D 2EF1 DE 10 08 C0 A defb 0deh,16,8,0c0h ; A 2EF5 21 2EFB A spnt: ld hl,$+6 2EF8 C3 264C A jp speech 2EFB 05 A defb 5 A ; FF INF AMP DPH 2EFC DE 10 08 E7 A defb 0deh,16,8,0e7h ; P (POINT) 2F00 DE 10 08 D1 A defb 0deh,16,8,0d1h ; O 2F04 DE 10 08 C1 A defb 0deh,16,8,0c1h ; E 2F08 DE 10 08 F8 A defb 0deh,16,8,0f8h ; N 2F0C DE 10 08 E8 A defb 0deh,16,8,0e8h ; T A A ;============================================================================= A ; Speak Letters or Numbers A ;============================================================================= A 2F10 CD 2345 A spkln: call alta 2F13 10 A defb 16 2F14 30 A defb '0' 2F15 2C6F A defw s0 ; zero 2F17 31 A defb '1' 2F18 2C8A A defw s1 ; one 2F1A 32 A defb '2' 2F1B 2CA1 A defw s2 ; two 2F1D 33 A defb '3' 2F1E 2CB4 A defw s3 ; three 2F20 34 A defb '4' 2F21 2CCB A defw s4 ; four 2F23 35 A defb '5' 2F24 2CE2 A defw s5 ; five 2F26 36 A defb '6' 2F27 2CFD A defw s6 ; six 2F29 37 A defb '7' 2F2A 2D18 A defw s7 ; seven 2F2C 38 A defb '8' 2F2D 2D33 A defw s8 ; eight 2F2F 39 A defb '9' 2F30 2D46 A defw s9 ; nine 2F32 41 A defb 'A' 2F33 2BE9 A defw sa ; A 2F35 42 A defb 'B' 2F36 2C00 A defw sb ; B 2F38 43 A defb 'C' 2F39 2C17 A defw sc ; C 2F3B 44 A defb 'D' 2F3C 2C2E A defw sd ; D 2F3E 45 A defb 'E' 2F3F 2C45 A defw se ; E 2F41 46 A defb 'F' 2F42 2C58 A defw sf ; F A 2F44 CD 2A98 A sndsmr: call ssmst ; Send MASTER 2F47 C3 2BC6 A jp ssrst ; Send RESET A 2F4A CD 2B33 A sndscr: call ssctl1 ; Send CONTROL 2F4D C3 2BC6 A jp ssrst ; Send RESET A 2F50 CD 24F6 A sndstd: call tstcw ; see if speech enabled 2F53 C2 24FC A jp nz,sndid 2F56 CD 2F85 A call stime ; speek the time 2F59 CD 243F A call onesec 2F5C C3 2F5F A jp sndsid ; Voice ID A 2F5F CD 24F6 A sndsid: call tstcw ; see if speech enabled 2F62 C2 24FC A jp nz,sndid A 2F65 CD 116A A call ucrt 2F68 CD 2444 A call halfsec ; wait for transmitter 2F6B CD 28B1 A call welmsg ; welcome message 2F6E C3 28EC A jp sidmsg ; call sign A 2F71 CD 24F6 A sndsbd: call tstcw ; see if speech enabled 2F74 C2 24FC A jp nz,sndid A 2F77 3E 02 A ld a,2 ; set the ID PTT flag 2F79 32 8070 A ld (cwptt),a A 2F7C CD 116A A call ucrt 2F7F CD 2444 A call halfsec ; wait for transmitter 2F82 C3 28EC A jp sidmsg A A A ;----------------------------------------------------------------------------- A ; Speak the Clock Time A ;----------------------------------------------------------------------------- A 2F85 CD 24F6 A stime: call tstcw ; see if speech enabled 2F88 C2 249F A jp nz,sndno A 2F8B CD 1E2D A call rdtim ; read the clock chip (if there) A ; and save in memory A 2F8E 3E 01 A ld a,1 2F90 32 8070 A ld (cwptt),a 2F93 CD 40F8 A call htime 2F96 CD 2444 A call halfsec 2F99 CD 116A A call ucrt A 2F9C CD 2819 A call sndgd ; say GOOD 2F9F 3A 80A1 A ld a,(mhrs) ; get the hours 2FA2 FE 18 A cp 18h ; greater than 6 PM? 2FA4 D2 2FB2 A jp nc,seve A 2FA7 FE 12 A cp 12h ; greater than 12 noon? 2FA9 D2 2FB8 A jp nc,saft A A 2FAC CD 2834 A call sndmn ; say MORNING 2FAF C3 2FBB A jp stima A 2FB2 CD 288A A seve: call sndeve 2FB5 C3 2FBB A jp stima A 2FB8 CD 285B A saft: call sndaf A 2FBB CD 243F A stima: call onesec 2FBE 21 2E9D A ld hl,timmsg 2FC1 CD 264C A call speech A 2FC4 CD 3015 A stimt: call shrs 2FC7 3E 0A A ld a,10 2FC9 CD 2455 A call delay A 2FCC 3A 80A2 A stim1: ld a,(mmin) ; get the current minutes 2FCF B7 A or a 2FD0 CA 2FE8 A jp z,stimx 2FD3 FE 0A A cp 0ah ; under 10 minutes? 2FD5 DA 2FFF A jp c,stimx2 ; speak units of minutes (1 -> 9) A 2FD8 FE 1A A cp 1ah ; under 20 minutes? 2FDA DA 3008 A jp c,stimx3 ; speak ELEVEN to NINETEEN A 2FDD E6 F0 A and 0f0h ; 20, 30, 40 or 50 minutes? 2FDF CA 300E A jp z,stimx4 A 2FE2 CD 30B2 A call sten2 ; speak the tens of minutes 2FE5 CD 3064 A call sunim ; speak the units of minutes A 2FE8 CD 244E A stimx: call sec17 ; 1/7 sec delay A 2FEB 3A 80A1 A stim2: ld a,(mhrs) 2FEE FE 12 A cp 12h 2FF0 DA 2FF9 A jp c,stimx1 A 2FF3 CD 2E64 A call sp 2FF6 C3 2E77 A jp sm A 2FF9 CD 2BE9 A stimx1: call sa 2FFC C3 2E77 A jp sm A 2FFF CD 2C6F A stimx2: call s0 ; time less than 10 minutes 3002 CD 3064 A call sunim ; say "zero", then units of minutes 3005 C3 2FE8 A jp stimx A 3008 CD 308B A stimx3: call sten1 300B C3 2FE8 A jp stimx A 300E CD 30B2 A stimx4: call sten2 3011 C3 2FE8 A jp stimx A 3014 C9 A stret: ret A 3015 3A 80A1 A shrs: ld a,(mhrs) ; get the current hours A 3018 CD 2345 A smom: call alta ; speak 24-hour time in 301B 18 A defb 24 ; 12 hour format 301C 00 A defb 0 301D 2D9F A defw s12 ; 12 AM 301F 01 A defb 1 3020 2C8A A defw s1 ; 1 AM 3022 02 A defb 2 3023 2CA1 A defw s2 ; 2 AM 3025 03 A defb 3 3026 2CB4 A defw s3 ; 3 AM 3028 04 A defb 4 3029 2CCB A defw s4 ; 4 AM 302B 05 A defb 5 302C 2CE2 A defw s5 ; 5 AM 302E 06 A defb 6 302F 2CFD A defw s6 ; 6 AM 3031 07 A defb 7 3032 2D18 A defw s7 ; 7 AM 3034 08 A defb 8 3035 2D33 A defw s8 ; 8 AM 3037 09 A defb 9 3038 2D46 A defw s9 ; 9 AM 303A 10 A defb 10h 303B 2D61 A defw s10 ; 10 AM 303D 11 A defb 11h 303E 2D7C A defw s11 ; 11 AM 3040 12 A defb 12h 3041 2D9F A defw s12 ; 12 PM 3043 13 A defb 13h 3044 2C8A A defw s1 ; 1 PM 3046 14 A defb 14h 3047 2CA1 A defw s2 ; 2 PM 3049 15 A defb 15h 304A 2CB4 A defw s3 ; 3 PM 304C 16 A defb 16h 304D 2CCB A defw s4 ; 4 PM 304F 17 A defb 17h 3050 2CE2 A defw s5 ; 5 PM 3052 18 A defb 18h 3053 2CFD A defw s6 ; 6 PM 3055 19 A defb 19h 3056 2D18 A defw s7 ; 7 PM 3058 20 A defb 20h 3059 2D33 A defw s8 ; 8 PM 305B 21 A defb 21h 305C 2D46 A defw s9 ; 9 PM 305E 22 A defb 22h 305F 2D61 A defw s10 ; 10 PM 3061 23 A defb 23h 3062 2D7C A defw s11 ; 11 PM A A 3064 3A 80A2 A sunim: ld a,(mmin) ; get the current minutes 3067 E6 0F A and 0fh ; look at lower nibble A 3069 CD 2345 A smuni: call alta 306C 0A A defb 10 306D 00 A defb 0 306E 3014 A defw stret ; 0 MIN 3070 01 A defb 1 3071 2C8A A defw s1 ; 1 MIN 3073 02 A defb 2 3074 2CA1 A defw s2 ; 2 MIN 3076 03 A defb 3 3077 2CB4 A defw s3 ; 3 MIN 3079 04 A defb 4 307A 2CCB A defw s4 ; 4 MIN 307C 05 A defb 5 307D 2CE2 A defw s5 ; 5 MIN 307F 06 A defb 6 3080 2CFD A defw s6 ; 6 MIN 3082 07 A defb 7 3083 2D18 A defw s7 ; 7 MIN 3085 08 A defb 8 3086 2D33 A defw s8 ; 8 MIN 3088 09 A defb 9 3089 2D46 A defw s9 ; 9 MIN A 308B 3A 80A2 A sten1: ld a,(mmin) ; get the current minutes 308E E6 0F A and 0fh ; look at lower nibble A 3090 CD 2345 A smtn1: call alta 3093 0A A defb 10 3094 00 A defb 0 3095 2D61 A defw s10 ; TEN minutes 3097 01 A defb 1 3098 2D7C A defw s11 ; ELEVEN minutes 309A 02 A defb 2 309B 2D9F A defw s12 ; TWELVE minutes 309D 03 A defb 3 309E 2DBA A defw s13 ; THIRTEEN minutes 30A0 04 A defb 4 30A1 2DC3 A defw s14 ; FOURTEEN minutes 30A3 05 A defb 5 30A4 2DC9 A defw s15 ; FIFTEEN minutes 30A6 06 A defb 6 30A7 2DD2 A defw s16 ; SIXTEEN minutes 30A9 07 A defb 7 30AA 2DD8 A defw s17 ; SEVENTEEN minutes 30AC 08 A defb 8 30AD 2DDE A defw s18 ; EIGHTEEN minutes 30AF 09 A defb 9 30B0 2DE4 A defw s19 ; NINETEEN minutes A 30B2 3A 80A2 A sten2: ld a,(mmin) ; get the current minutes 30B5 E6 F0 A and 0f0h ; look at upper nibble A 30B7 CD 2345 A smtn2: call alta 30BA 04 A defb 4 30BB 20 A defb 20h 30BC 2DEA A defw s20 ; TWENTY minutes 30BE 30 A defb 30h 30BF 2DF3 A defw s30 ; THIRTY minutes 30C1 40 A defb 40h 30C2 2DFC A defw s40 ; FOURTY minutes 30C4 50 A defb 50h 30C5 2E02 A defw s50 ; FIFTY minutes A A ;----------------------------------------------------------------------------- A ; Speak the Month/Date A ;----------------------------------------------------------------------------- A 30C7 CD 24F6 A spmo: call tstcw ; see if speech enabled 30CA C2 249F A jp nz,sndno A 30CD CD 26FF A call sptod ; say "Today is" 30D0 CD 2444 A call halfsec A 30D3 CD 1E2D A spmo1: call rdtim ; read clock chip (if there) and A ; save in memory A 30D6 3A 809F A ld a,(mmo) ; get the saved month 30D9 CD 3018 A call smom ; steal an available routine to speak 1 to 12 A 30DC CD 2444 A call halfsec 30DF 3A 80A0 A ld a,(mdt) ; get the saved date A 30E2 FE 0A A cp 0ah ; under 10? 30E4 DA 3069 A jp c,smuni ; speak units of days (1 -> 9) A 30E7 FE 1A A cp 1ah ; under 20 days? 30E9 DA 3101 A jp c,spmo3 ; speak ELEVEN to NINETEEN A 30EC E6 F0 A and 0f0h ; 20, 30, 40 or 50 days? 30EE CA 3109 A jp z,spmo4 A 30F1 3A 80A0 A ld a,(mdt) ; speak the tens of days 30F4 E6 F0 A and 0f0h ; look at upper nibble 30F6 CD 30B7 A call smtn2 A 30F9 3A 80A0 A ld a,(mdt) ; speak the units of days 30FC E6 0F A and 0fh ; look at lower nibble 30FE C3 3069 A jp smuni ; done A 3101 3A 80A0 A spmo3: ld a,(mdt) 3104 E6 0F A and 0fh ; look at lower nibble 3106 C3 3090 A jp smtn1 A 3109 3A 80A0 A spmo4: ld a,(mdt) 310C E6 F0 A and 0f0h ; look at upper nibble 310E C3 30B7 A jp smtn2 A A ;------------------------ end of file SPEECH.Z80 ----------------------------- include control.z80 A A ;============================================================================ A ; WA1LMV Repeater Control Code Emulator A ;============================================================================ A A ; This routine emulates the control system of the old repeater A ; using the sequences *2500 through *2599 as User Codes A A ; It also implememts an upper level system *6900 through *6999 A ; for Control System codes A A 3111 3A 8044 A codes: ld a,(clen) ; at least 4 chars needed 3114 FE 04 A cp 4 3116 DA 226D A jp c,error A 3119 CD 44A2 A call rech ; get character 311C 4F A ld c,a ; save the char 311D FE 41 A cp 'A' ; is it the silent command prefix? 311F C2 312C A jp nz,codes1 ; (two *'s from DTMF or two A's from TTY?) A A ;----------------------------------------------------------------------------- A ; Process User and Control Commands Silently A ;----------------------------------------------------------------------------- A 3122 CD 38C3 A call smode ; set silent mode A 3125 CD 3134 A call codes2 ; call CODES2 so we can come back A 3128 CD 38CE A call rmode ; restore the former MCW/Speech status A 312B C9 A ret A A ;----------------------------------------------------------------------------- A 312C 3A 8225 A codes1: ld a,(mudig1) 312F 47 A ld b,a 3130 79 A ld a,c ; get the original char back 3131 C3 313B A jp codes3 ; skip the RECH A 3134 3A 8225 A codes2: ld a,(mudig1) 3137 47 A ld b,a 3138 CD 44A2 A call rech ; get character A 313B B8 A codes3: cp b ; is it user first unlock digit? 313C CA 314C A jp z,ucode1 A 313F F5 A push af 3140 3A 8227 A ld a,(mcdig1) 3143 47 A ld b,a 3144 F1 A pop af 3145 B8 A cp b ; is it control first unlock digit? 3146 CA 328A A jp z,ccode1 3149 C3 226D A jp error A 314C 3A 8226 A ucode1: ld a,(mudig2) 314F 47 A ld b,a 3150 CD 44A2 A call rech ; get next character 3153 B8 A cp b ; is it the second unlock digit? 3154 C2 226D A jp nz,error A A ;----------------------- User Sub Command Dispatch Table --------------------- A 3157 3A 8217 A ld a,(uadflg) ; get the UAD flag 315A B7 A or a 315B C2 3162 A jp nz,ucode2 ; bail out if UAD codes not enabled A 315E CD 249F A call sndno ; send NO 3161 C9 A ret A 3162 CD 44A2 A ucode2: call rech ; get the next character 3165 CD 2345 A call alta 3168 0A A defb 10 ; ten commands in the table 3169 30 A defb '0' 316A 3187 A defw unit0 ; process *nn00 through *nn09 316C 31 A defb '1' 316D 31AC A defw unit1 ; process *nn10 through *nn19 316F 32 A defb '2' 3170 31D1 A defw unit2 ; process *nn20 through *nn29 3172 33 A defb '3' 3173 31F6 A defw unit3 ; process *nn30 through *nn39 3175 34 A defb '4' 3176 321B A defw unit4 ; process *nn40 through *nn49 3178 35 A defb '5' 3179 226D A defw error ; process *nn50 through *nn59 317B 36 A defb '6' 317C 226D A defw error ; process *nn60 through *nn69 317E 37 A defb '7' 317F 226D A defw error ; process *nn70 through *nn79 3181 38 A defb '8' 3182 3240 A defw unit8 ; process *nn80 through *nn89 3184 39 A defb '9' 3185 3265 A defw unit9 ; process *nn90 through *nn99 A A A ;----------------------------- Unit 00 Commands ---------------------------- A A 3187 CD 44A2 A unit0: call rech 318A CD 2345 A call alta 318D 0A A defb 10 318E 30 A defb '0' 318F 3455 A defw ptchoff ; Autopatch OFF 3191 31 A defb '1' 3192 3511 A defw ptchat ; Autopatch ON (automatic) 3194 32 A defb '2' 3195 352F A defw dialer ; Speed Dialer 3197 33 A defb '3' 3198 3603 A defw spksd0 ; Speak Last Dialed Number 319A 34 A defb '4' 319B 226D A defw error 319D 35 A defb '5' 319E 29DE A defw sndnuk ; Curly 31A0 36 A defb '6' 31A1 2F85 A defw stime ; Voice Time 31A3 37 A defb '7' 31A4 237C A defw mbeep ; super beep 31A6 38 A defb '8' 31A7 24FC A defw sndid ; MCW ID 31A9 39 A defb '9' 31AA 2F5F A defw sndsid ; Voice ID A A ;----------------------------- Unit 10 Commands ---------------------------- A A 31AC CD 44A2 A unit1: call rech 31AF CD 2345 A call alta 31B2 0A A defb 10 31B3 30 A defb '0' 31B4 3AB5 A defw a1rtd ; Aux RX/TX #1 Disable 31B6 31 A defb '1' 31B7 3986 A defw a1rxe ; Aux RX #1 Enable 31B9 32 A defb '2' 31BA 3A10 A defw a1txe ; Aux TX #1 Enable 31BC 33 A defb '3' 31BD 39F0 A defw a1txd ; Aux TX #1 Disable 31BF 34 A defb '4' 31C0 3B3E A defw a1chan ; Aux Channel Set 31C2 35 A defb '5' 31C3 3B6E A defw spk2m ; Speak Two Meter Frequency 31C5 36 A defb '6' 31C6 3C54 A defw pgm2mu ; Set 2M Channel 0 Frequency 31C8 37 A defb '7' 31C9 226D A defw error 31CB 38 A defb '8' 31CC 226D A defw error 31CE 39 A defb '9' 31CF 226D A defw error A A ;----------------------------- Unit 20 Commands ---------------------------- A A 31D1 CD 44A2 A unit2: call rech 31D4 CD 2345 A call alta 31D7 0A A defb 10 31D8 30 A defb '0' 31D9 3AD8 A defw a2rtd ; Aux RX/TX #2 Disable 31DB 31 A defb '1' 31DC 39BF A defw a2rxe ; Aux RX #2 Enable 31DE 32 A defb '2' 31DF 3A72 A defw a2txe ; Aux TX $2 Enable 31E1 33 A defb '3' 31E2 3A52 A defw a2txd ; Aux TX #2 Disable 31E4 34 A defb '4' 31E5 226D A defw error 31E7 35 A defb '5' 31E8 226D A defw error 31EA 36 A defb '6' 31EB 226D A defw error 31ED 37 A defb '7' 31EE 226D A defw error 31F0 38 A defb '8' 31F1 226D A defw error 31F3 39 A defb '9' 31F4 226D A defw error A A ;----------------------------- Unit 30 Commands ---------------------------- A A 31F6 CD 44A2 A unit3: call rech 31F9 CD 2345 A call alta 31FC 0A A defb 10 31FD 30 A defb '0' 31FE 4259 A defw utxld ; disable 450 TX activity limit 3200 31 A defb '1' 3201 4266 A defw utxle ; enable 450 TX activity limit 3203 32 A defb '2' 3204 226D A defw error 3206 33 A defb '3' 3207 226D A defw error 3209 34 A defb '4' 320A 3E1E A defw chmof ; disable chime 320C 35 A defb '5' 320D 3E0D A defw chmon ; enable chime 320F 36 A defb '6' 3210 30C7 A defw spmo ; speak date 3212 37 A defb '7' 3213 226D A defw error 3215 38 A defb '8' 3216 226D A defw error 3218 39 A defb '9' 3219 4000 A defw stnuk ; send time, ID and Curly routine A A ;----------------------------- Unit 40 Commands ---------------------------- A A 321B CD 44A2 A unit4: call rech 321E CD 2345 A call alta 3221 0A A defb 10 3222 30 A defb '0' 3223 226D A defw error 3225 31 A defb '1' 3226 3E6E A defw ant1 ; antenna #1 3228 32 A defb '2' 3229 3E3F A defw ant2 ; antenna #2 322B 33 A defb '3' 322C 226D A defw error 322E 34 A defb '4' 322F 226D A defw error 3231 35 A defb '5' 3232 226D A defw error 3234 36 A defb '6' 3235 226D A defw error 3237 37 A defb '7' 3238 226D A defw error 323A 38 A defb '8' 323B 226D A defw error 323D 39 A defb '9' 323E 226D A defw error A A ;----------------------------- Unit 80 Commands ---------------------------- A A 3240 CD 44A2 A unit8: call rech 3243 CD 2345 A call alta 3246 0A A defb 10 3247 30 A defb '0' 3248 226D A defw error 324A 31 A defb '1' 324B 406A A defw cwset ; CW/Speech Mode 324D 32 A defb '2' 324E 226D A defw error 3250 33 A defb '3' 3251 3C91 A defw vctset ; 6M Courtesy Tone Mode 3253 34 A defb '4' 3254 3CCD A defw uctset ; 450 Courtesy Tone Mode 3256 35 A defb '5' 3257 226D A defw error 3259 36 A defb '6' 325A 226D A defw error 325C 37 A defb '7' 325D 226D A defw error 325F 38 A defb '8' 3260 226D A defw error 3262 39 A defb '9' 3263 226D A defw error A A A A ;----------------------------- Unit 90 Commands ---------------------------- A A 3265 CD 44A2 A unit9: call rech 3268 CD 2345 A call alta 326B 0A A defb 10 326C 30 A defb '0' 326D 3455 A defw ptchoff ; full patch off 326F 31 A defb '1' 3270 34AE A defw ptchon ; full patch on 3272 32 A defb '2' 3273 226D A defw error 3275 33 A defb '3' 3276 226D A defw error 3278 34 A defb '4' 3279 226D A defw error 327B 35 A defb '5' 327C 226D A defw error 327E 36 A defb '6' 327F 1C1E A defw llpd ; disable landline monitor mode (half patch) 3281 37 A defb '7' 3282 1BDE A defw llpm ; enable landline monitor mode (half patch) 3284 38 A defb '8' 3285 1B94 A defw llrst ; landline control reset 3287 39 A defb '9' 3288 3EAB A defw urst ; UAD Codes Master Reset A A A A ;------------------- Control Codes ----------------------------------------- A 328A 3A 8228 A ccode1: ld a,(mcdig2) 328D 47 A ld b,a 328E CD 44A2 A call rech ; get next character 3291 B8 A cp b ; second control unlock digit? 3292 C2 226D A jp nz,error A A ;------------------ Control Sub Command Dispatch Table --------------------- A A 3295 CD 44A2 A ccode2: call rech ; get the next character 3298 CD 2345 A call alta 329B 0A A defb 10 ; ten commands in the table 329C 30 A defb '0' 329D 32BA A defw cnit0 ; process *nn00 through *nn09 329F 31 A defb '1' 32A0 32DF A defw cnit1 ; process *nn10 through *nn19 32A2 32 A defb '2' 32A3 3304 A defw cnit2 ; process *nn20 through *nn29 32A5 33 A defb '3' 32A6 3329 A defw cnit3 ; process *nn30 through *nn39 32A8 34 A defb '4' 32A9 226D A defw error ; process *nn40 through *nn49 32AB 35 A defb '5' 32AC 334E A defw cnit5 ; process *nn50 through *nn59 32AE 36 A defb '6' 32AF 3373 A defw cnit6 ; process *nn60 through *nn69 32B1 37 A defb '7' 32B2 3398 A defw cnit7 ; process *nn70 through *nn79 32B4 38 A defb '8' 32B5 33BD A defw cnit8 ; process *nn80 through *nn89 32B7 39 A defb '9' 32B8 33E2 A defw cnit9 ; process *nn90 through *nn99 A A A A A ;---------------------- Control 00 Commands -------------------------------- A 32BA CD 44A2 A cnit0: call rech 32BD CD 2345 A call alta 32C0 0A A defb 10 32C1 30 A defb '0' 32C2 340E A defw ptchdis ; Autopatch disable 32C4 31 A defb '1' 32C5 3429 A defw ptchen ; Autopatch enable 32C7 32 A defb '2' 32C8 35D9 A defw pgmsd ; Program Speed Dialer 32CA 33 A defb '3' 32CB 3618 A defw spksd ; Speak Speed Dialer Numbers 32CD 34 A defb '4' 32CE 3C5E A defw pgm2m ; Program 2M Channel Frequencies 32D0 35 A defb '5' 32D1 226D A defw error 32D3 36 A defb '6' 32D4 226D A defw error 32D6 37 A defb '7' 32D7 226D A defw error 32D9 38 A defb '8' 32DA 226D A defw error 32DC 39 A defb '9' 32DD 226D A defw error A A A ;---------------------- Control 10 Commands -------------------------------- A 32DF CD 44A2 A cnit1: call rech 32E2 CD 2345 A call alta 32E5 0A A defb 10 32E6 30 A defb '0' 32E7 226D A defw error 32E9 31 A defb '1' 32EA 3F09 A defw sthrs ; set the clock time 32EC 32 A defb '2' 32ED 401E A defw stdat ; set the clock date 32EF 33 A defb '3' 32F0 1DCC A defw setsch ; program scheduled events 32F2 34 A defb '4' 32F3 3F5C A defw hsub ; subtract one hour (Standard Time) 32F5 35 A defb '5' 32F6 3FB4 A defw hadd ; add one hour (Daylight Savings Time) 32F8 36 A defb '6' 32F9 226D A defw error 32FB 37 A defb '7' 32FC 226D A defw error 32FE 38 A defb '8' 32FF 226D A defw error 3301 39 A defb '9' 3302 226D A defw error A A A ;---------------------- Control 20 Commands -------------------------------- A 3304 CD 44A2 A cnit2: call rech 3307 CD 2345 A call alta 330A 0A A defb 10 330B 30 A defb '0' 330C 3DB5 A defw dplud ; 450 DTMF PL disable 330E 31 A defb '1' 330F 3DA7 A defw dplue ; 450 DTMF PL enable 3311 32 A defb '2' 3312 3D8B A defw dplvd ; 6M DTMF PL disable 3314 33 A defb '3' 3315 3D7D A defw dplve ; 6M DTMF PL enable 3317 34 A defb '4' 3318 3D62 A defw dmud ; DTMF Mute disable 331A 35 A defb '5' 331B 3D54 A defw dmue ; DTMF Mute enable 331D 36 A defb '6' 331E 226D A defw error 3320 37 A defb '7' 3321 226D A defw error 3323 38 A defb '8' 3324 226D A defw error 3326 39 A defb '9' 3327 226D A defw error A A ;---------------------- Control 30 Commands -------------------------------- A 3329 CD 44A2 A cnit3: call rech 332C CD 2345 A call alta 332F 0A A defb 10 3330 30 A defb '0' 3331 4214 A defw memr ; memory read 3333 31 A defb '1' 3334 4217 A defw memw ; memory write 3336 32 A defb '2' 3337 4297 A defw tdevf ; Tone Deviation Test OFF 3339 33 A defb '3' 333A 42B7 A defw tdevn ; Tone Deviation Test ON 333C 34 A defb '4' 333D 42FA A defw sdevf ; Speech Deviation Test OFF 333F 35 A defb '5' 3340 4321 A defw sdevn ; Speech Deviation Test ON 3342 36 A defb '6' 3343 226D A defw error 3345 37 A defb '7' 3346 226D A defw error 3348 38 A defb '8' 3349 226D A defw error 334B 39 A defb '9' 334C 226D A defw error A A A ;------------------------- Control 50 Commands ------------------------------ A 334E CD 44A2 A cnit5: call rech 3351 CD 2345 A call alta 3354 0A A defb 10 3355 30 A defb '0' 3356 3678 A defw macoff ; macro functions disabled 3358 31 A defb '1' 3359 3685 A defw macon ; macro functions enabled 335B 32 A defb '2' 335C 3705 A defw setmac ; program macro functions 335E 33 A defb '3' 335F 3D1B A defw uadd ; UAD Codes Disable 3361 34 A defb '4' 3362 3D0A A defw uade ; UAD Codes Enable 3364 35 A defb '5' 3365 226D A defw error 3367 36 A defb '6' 3368 226D A defw error 336A 37 A defb '7' 336B 226D A defw error 336D 38 A defb '8' 336E 226D A defw error 3370 39 A defb '9' 3371 226D A defw error A A ;------------------------- Conrrol 60 Commands ------------------------------ A 3373 CD 44A2 A cnit6: call rech 3376 CD 2345 A call alta 3379 0A A defb 10 337A 30 A defb '0' 337B 226D A defw error 337D 31 A defb '1' 337E 4101 A defw phtime ; preset hang time 3380 32 A defb '2' 3381 3DE3 A defw rgoff ; ring detect off 3383 33 A defb '3' 3384 3DD2 A defw rgon ; ring detect on 3386 34 A defb '4' 3387 226D A defw error 3389 35 A defb '5' 338A 226D A defw error 338C 36 A defb '6' 338D 226D A defw error 338F 37 A defb '7' 3390 226D A defw error 3392 38 A defb '8' 3393 226D A defw error 3395 39 A defb '9' 3396 226D A defw error A A A ;------------------------- Control 70 Commands ------------------------------ A 3398 CD 44A2 A cnit7: call rech 339B CD 2345 A call alta 339E 0A A defb 10 339F 30 A defb '0' 33A0 3860 A defw vrxd ; 6M RX Disable 33A2 31 A defb '1' 33A3 3895 A defw vrxe ; 6M RX Enable (with PL enabled) 33A5 32 A defb '2' 33A6 3753 A defw vrpld ; 6M RX PL Disable 33A8 33 A defb '3' 33A9 37E7 A defw vpltof ; 6M PL Time-Out Inhibit Disable 33AB 34 A defb '4' 33AC 37F7 A defw vplton ; 6M PL Time-Out Inhibit Enable 33AE 35 A defb '5' 33AF 41AD A defw vptod ; 6M PL Temp override Disable 33B1 36 A defb '6' 33B2 41BA A defw vptoe ; 6M PL Temp override Enable 33B4 37 A defb '7' 33B5 226D A defw error 33B7 38 A defb '8' 33B8 226D A defw error 33BA 39 A defb '9' 33BB 226D A defw error A A ;--------------------- Control 80 Commands ---------------------------------- A 33BD CD 44A2 A cnit8: call rech 33C0 CD 2345 A call alta 33C3 0A A defb 10 33C4 30 A defb '0' 33C5 3782 A defw urxd ; 450 RX Disable 33C7 31 A defb '1' 33C8 37B8 A defw urxe ; 450 RX Enable (with PL enabled) 33CA 32 A defb '2' 33CB 3723 A defw urpld ; 450 RX PL Disable 33CD 33 A defb '3' 33CE 3823 A defw upltof ; 450 PL Time-Out Inhibit Disable 33D0 34 A defb '4' 33D1 3833 A defw uplton ; 450 PL Time-Out Inhibit Disable 33D3 35 A defb '5' 33D4 41E0 A defw uptod ; 450 Temp PL override Disable 33D6 36 A defb '6' 33D7 41ED A defw uptoe ; 450 Temp PL override Enable 33D9 37 A defb '7' 33DA 226D A defw error 33DC 38 A defb '8' 33DD 226D A defw error 33DF 39 A defb '9' 33E0 226D A defw error A A ;---------------------- Control 90 Commands -------------------------------- A 33E2 CD 44A2 A cnit9: call rech 33E5 CD 2345 A call alta 33E8 0A A defb 10 33E9 30 A defb '0' 33EA 38E6 A defw utxd ; 450 TX Disable 33EC 31 A defb '1' 33ED 38FE A defw utxe ; 450 TX Enable 33EF 32 A defb '2' 33F0 393B A defw vtxd ; 6M TX Disable 33F2 33 A defb '3' 33F3 3953 A defw vtxe ; 6M TX Enable 33F5 34 A defb '4' 33F6 226D A defw error 33F8 35 A defb '5' 33F9 226D A defw error 33FB 36 A defb '6' 33FC 226D A defw error 33FE 37 A defb '7' 33FF 226D A defw error 3401 38 A defb '8' 3402 226D A defw error 3404 39 A defb '9' 3405 236B A defw xreset ; Master Reset A A A A ;============================================================================ A ; Control System A ;============================================================================ A A ; Toggle Autopatch Enable A 3407 3A 821C A patchc: ld a,(ptchc) ; read control byte 340A B7 A or a 340B CA 3429 A jp z,ptchen ; was off, turn on A ; was on, turn off (fall through A A ; Autopatch Disable A 340E CD 2289 A ptchdis:call stat ; status line 3411 41 75 74 6F A defb 'Autopatch',0 341B CD 3EFB A call prdis 341E CD 26B5 A call spap 3421 CD 2ABB A call ssdis A 3424 AF A xor a ; reset control byte 3425 32 821C A ld (ptchc),a ; save 3428 C9 A ret A A ; Autopatch Enable A 3429 3E FF A ptchen: ld a,0ffh ; set control byte 342B 32 821C A ld (ptchc),a ; save 342E CD 2289 A call stat ; status line 3431 41 75 74 6F A defb 'Autopatch',0 343B CD 3EEE A call prena 343E CD 26B5 A call spap 3441 CD 2AF6 A call ssena 3444 C9 A ret A A ; Toggle Autopatch ON/OFF A 3445 CD 38C3 A patch: call smode 3448 CD 344E A call patcht 344B C3 38CE A jp rmode A 344E 3A 8073 A patcht: ld a,(ptchm) ; read status byte 3451 B7 A or a 3452 CA 34AE A jp z,ptchon ; was off, turn on A ; was on, turn off (fall through A A ; Autopatch OFF A 3455 A ptchoff: 3455 3A 809A A ld a,(llful) ; see if someone on landline control 3458 B7 A or a 3459 C2 3489 A jp nz,ptchfq ; NZ = yes, dump patch quietly A 345C 3A 8073 A ld a,(ptchm) ; read status byte 345F B7 A or a ; is patch on now? 3460 CA 24AB A jp z,sndmno A 3463 CD 3489 A ptchf1: call ptchfq ; turn off A 3466 CD 26B5 A call spap ; say "Autopatch" 3469 CD 24D5 A call sndoff ; say "off" 346C CD 2444 A call halfsec A 346F 3A 809D A ld a,(clkp) ; clock chip present? (0ffh = not there) 3472 B7 A or a 3473 C0 A ret nz A 3474 CD 29B0 A call sndson ; say "on" 3477 CD 2444 A call halfsec 347A CD 30D3 A call spmo1 ; speak the month/date 347D CD 2444 A call halfsec 3480 CD 26E4 A call spat ; say "at" 3483 CD 1E2D A call rdtim ; read time 3486 C3 2FC4 A jp stimt ; say the time A A A ; Autopatch OFF (quietly) A 3489 CD 2289 A ptchfq: call stat ; status line 348C 41 75 74 6F A defb 'Autopatch OFF',0 A 349A 3A 804B A ld a,(port7s) ; read status byte 349D E6 BB A and not (ptchr+ptchg) ; disable bits 349F 32 804B A ld (port7s),a ; save back A 34A2 AF A xor a 34A3 32 8073 A ld (ptchm),a ; clear patch on flag A 34A6 3A 809A A ld a,(llful) ; see if someone on landline control 34A9 B7 A or a 34AA C2 1C50 A jp nz,tbeep2 ; signal for landline user and exit A 34AD C9 A ret A A ; Autopatch ON A 34AE 3A 821C A ptchon: ld a,(ptchc) ; read control byte 34B1 B7 A or a 34B2 CA 249F A jp z,sndno ; send NO and return from there A 34B5 21 0000 A ld hl,0 ; clear possible answer hold time 34B8 22 8094 A ld (anshld),hl A 34BB CD 3523 A call ptchoq ; turn patch off if it is on now A 34BE CD 2289 A call stat ; status line 34C1 41 75 74 6F A defb 'Autopatch ON',0 A 34CE 3A 809A A ld a,(llful) ; see if someone on landline control 34D1 B7 A or a 34D2 C2 350B A jp nz,ptchon2 A 34D5 3E FF A ld a,0ffh ; block DTMF interrupts from 34D7 32 807C A ld (bdtmft),a ; telephone line decoder A 34DA CD 26B5 A call spap ; say "Autopatch" 34DD CD 24BD A call sndon ; say "ON" A 34E0 2A 8246 A ld hl,(mdftel) ; preset patch timer 34E3 22 8071 A ld (teltim),hl ; to default value A 34E6 3A 8048 A ld a,(port4s) 34E9 E6 FD A and not iclr ; drop possible landline hold relay 34EB 32 8048 A ld (port4s),a ; just in case A 34EE AF A xor a 34EF 32 808F A ld (rgcnt),a ; clear ring counter 34F2 32 809C A ld (llfrt),a ; clear ring time-out flag A 34F5 A ptchon1: 34F5 3A 804B A ld a,(port7s) ; read status byte 34F8 F6 44 A or ptchr+ptchg ; enable bits 34FA 32 804B A ld (port7s),a ; save back A 34FD 3A 8048 A ld a,(port4s) 3500 E6 FB A and not ptmon ; disable monitor switch 3502 32 8048 A ld (port4s),a ; just in case A 3505 3E FF A ld a,0ffh 3507 32 8073 A ld (ptchm),a ; set patch on flag A 350A C9 A ret A 350B A ptchon2: 350B CD 1C50 A call tbeep2 350E C3 34F5 A jp ptchon1 A A A ; Autopatch ON (Automatic) A 3511 3A 8044 A ptchat: ld a,(clen) ; Command String Length 3514 B7 A or a 3515 CA 34AE A jp z,ptchon ; no trailing digits, just turn patch on A 3518 21 8263 A ld hl,dial0 ; save number in dialer slot 0 351B E5 A push hl 351C CD 35DC A call pgmsd0 ; go and program slot 0 351F E1 A pop hl 3520 C3 353C A jp dialb A A A ;----------------------------------------------------------------------------- A A ; Turn Patch off quietly -- used for turning patch on without A ; having to turn it off first A 3523 3A 8073 A ptchoq: ld a,(ptchm) ; see if patch is on now 3526 B7 A or a 3527 C8 A ret z ; turn off if it is on A 3528 CD 3489 A call ptchfq ; turn patch off quietly 352B CD 243F A call onesec A 352E C9 A ret A A ;----------------------------------------------------------------------------- A ; Speed Dialer A ;----------------------------------------------------------------------------- A 352F 3A 809A A dialer: ld a,(llful) ; see if someone on landline control 3532 B7 A or a 3533 C2 249F A jp nz,sndno A 3536 CD 3523 A call ptchoq ; turn patch off if it is on now A 3539 CD 3650 A call dslot ; determine desired dialer slot A 353C 3A 821B A dialb: ld a,(dmutc) ; get DTMF mute control byte 353F B7 A or a ; 0FFH = enabled 3540 CA 3550 A jp z,dialc ; 0 = disabled A 3543 3A 8213 A ld a,(port7c) 3546 E6 BF A and not ptchg ; mute the patch gate 3548 32 8213 A ld (port7c),a A 354B 3E FF A ld a,0ffh ; block DTMF interrupts from 354D 32 807C A ld (bdtmft),a ; telephone line decoder A 3550 7E A dialc: ld a,(hl) ; get the first digit 3551 FE FF A cp 0ffh ; is it 0ffh? 3553 CA 35B1 A jp z,nodial ; if the first digit is 0ffh, A ; then the slot is empty A 3556 E5 A push hl ; ptchon destroys HL 3557 CD 34AE A call ptchon ; turn-on patch 355A CD 243F A call onesec ; wait for dialtone 355D CD 2422 A call t440 ; set tone pitch 3560 CD 2289 A call stat ; status line 3563 44 69 61 6C A defb 'Dialing: ',0 356D E1 A pop hl A 356E 7E A dloop: ld a,(hl) ; get digit 356F FE FF A cp 0ffh ; end of entry? 3571 CA 35A8 A jp z,dloopx ; then done A 3574 F5 A push af 3575 C6 30 A add 30h ; make ASCII 3577 CD 1F18 A call cout ; print on CRT 357A F1 A pop af A 357B B7 A or a ; is it a zero? 357C C2 3581 A jp nz,dloop1 A 357F 3E 0A A ld a,00001010b ; special case A 3581 E6 0F A dloop1: and dgend ; data mask 3583 32 E000 A ld (port8),a ; send 4-bit digit to dialer port 3586 F6 10 A or dgenc ; raise the latch bit 3588 32 E000 A ld (port8),a ; send to dialer port A A ; The telco central office autodialer spec is 51 +-1 ms 50% duty cycle. A ; I chose 60 ms here to be on the safe side. A 358B F5 A push af 358C CD 25FC A call tonon ; transpond tone 358F 3E 06 A ld a,60/10 ; 60 ms DTMF tone length 3591 CD 2455 A call delay 3594 F1 A pop af A 3595 E6 EF A and not dgenc ; drop latch bit 3597 32 E000 A ld (port8),a ; send to dialer port A 359A F5 A push af 359B CD 2605 A call tonoff ; transpond tone 359E 3E 06 A ld a,60/10 ; 60 ms interdigit delay 35A0 CD 2455 A call delay 35A3 F1 A pop af A 35A4 23 A inc hl ; point to next entry 35A5 C3 356E A jp dloop A 35A8 3A 8213 A dloopx: ld a,(port7c) 35AB F6 40 A or ptchg ; un-mute the patch gate 35AD 32 8213 A ld (port7c),a A 35B0 C9 A ret A 35B1 AF A nodial: xor a ; reset the MCW transpond flag 35B2 32 8083 A ld (cwtf),a A 35B5 CD 2289 A call stat ; status line 35B8 44 69 61 6C A defb 'Dialer slot not programmed',0 35D3 CD 24AB A call sndmno ; send an MCW "no" 35D6 C3 35A8 A jp dloopx A A A ;----------------------------------------------------------------------------- A ; Program Speed Dialer Slots A ;----------------------------------------------------------------------------- A 35D9 CD 3650 A pgmsd: call dslot ; set up the desired dialer slot A 35DC 06 0B A pgmsd0: ld b,11 ; count up to 11 characters A 35DE CD 44A2 A pgmsd1: call rech ; get next character 35E1 FE 0D A cp cr ; end of line? 35E3 CA 35F4 A jp z,pgmsdx A 35E6 CD 45F2 A call dchk ; convert to binary A 35E9 77 A ld (hl),a ; save in the dialer slot 35EA 78 A ld a,b ; check max count 35EB B7 A or a 35EC CA 35FD A jp z,pgmsde A 35EF 05 A dec b 35F0 23 A inc hl ; next position in slot 35F1 C3 35DE A jp pgmsd1 ; go back for more characters A 35F4 E5 A pgmsdx: push hl 35F5 CD 24E4 A call sndok ; send OK 35F8 E1 A pop hl A 35F9 3E FF A ld a,0ffh ; mark end of slot 35FB 77 A ld (hl),a 35FC C9 A ret A 35FD 3E FF A pgmsde: ld a,0ffh ; mark end of slot 35FF 77 A ld (hl),a 3600 C3 226D A jp error A A A ;----------------------------------------------------------------------------- A ; Speak Numbers in Speed Dialer Slots A ;----------------------------------------------------------------------------- A 3603 3A 8218 A spksd0: ld a,(cwena) ; see if MCW/Speech Disabled 3606 B7 A or a 3607 CA 249F A jp z,sndno A 360A 3E FF A ld a,0ffh ; set the MCW transpond flag 360C 32 8083 A ld (cwtf),a A 360F CD 240A A call t660 3612 21 8263 A ld hl,dial0 ; point to slot 3615 C3 362A A jp spksd1 A 3618 3A 8218 A spksd: ld a,(cwena) ; see if MCW/Speech Disabled 361B B7 A or a 361C CA 249F A jp z,sndno A 361F 3E FF A ld a,0ffh ; set the MCW transpond flag 3621 32 8083 A ld (cwtf),a A 3624 CD 240A A call t660 A 3627 CD 3650 A call dslot ; set-up the desired dialer slot A 362A 7E A spksd1: ld a,(hl) ; get the first digit 362B FE FF A cp 0ffh ; is it 0ffh? 362D CA 35B1 A jp z,nodial ; if the first digit is 0ffh, A ; then the slot is empty A 3630 CD 2289 A call stat ; status line 3633 44 69 61 6C A defb 'Dialer: ',0 A 363C 7E A spksd2: ld a,(hl) ; get a digit 363D FE FF A cp 0ffh ; last one? 363F CA 364B A jp z,spksdx A 3642 E5 A push hl 3643 CD 44C8 A call nybl ; speak the digit 3646 E1 A pop hl A 3647 23 A inc hl ; next char 3648 C3 363C A jp spksd2 A 364B AF A spksdx: xor a 364C 32 8083 A ld (cwtf),a ; reset the MCW transpond flag 364F C9 A ret A A ;----------------------------------------------------------------------------- A ; Subroutine - DSLOT Determine the desired dialer slot A ;----------------------------------------------------------------------------- A 3650 CD 44A2 A dslot: call rech ; get a character from the command line 3653 FE 0D A cp cr ; no char there? 3655 CA 226D A jp z,error A 3658 F5 A push af 3659 CD 2B8F A call spspd ; speak "Dialer slot:" 365C F1 A pop af A 365D F5 A push af 365E CD 2F10 A call spkln ; speak the number of the slot 3661 F1 A pop af A 3662 F5 A push af 3663 CD 2444 A call halfsec 3666 F1 A pop af A 3667 CD 45F2 A call dchk ; convert to binary A 366A 21 000C A ld hl,12 ; number of bytes per entry 366D 16 00 A ld d,0 366F 5F A ld e,a ; get request into DE 3670 CD 46C2 A call mulhd ; multiply request by number of bytes A ; per entry 3673 11 8263 A ld de,dial0 ; start of table to use 3676 19 A add hl,de ; add offset into table A 3677 C9 A ret ; HL points to desired dialer slot A A ;----------------- End of Subroutine DSLOT ----------------------------------- A A A ;----------------------------------------------------------------------------- A ; Macro Commands Control A ;----------------------------------------------------------------------------- A 3678 AF A macoff: xor a ; Macro Commands OFF 3679 32 8216 A ld (mflag),a 367C CD 3693 A call macm 367F CD 3EFB A call prdis 3682 C3 24CC A jp sndcff A 3685 3E FF A macon: ld a,0ffh ; Macro Commands ON 3687 32 8216 A ld (mflag),a 368A CD 3693 A call macm 368D CD 3EEE A call prena 3690 C3 24B4 A jp sndcn A 3693 CD 2289 A macm: call stat ; status line 3696 4D 61 63 72 A defb 'Macro Functions',0 36A6 C9 A ret A A ;----------------------------------------------------------------------------- A ; Subroutine MACOD Process Macro Functions A ;----------------------------------------------------------------------------- A 36A7 3A 8216 A macod: ld a,(mflag) ; see if macro functions allowed 36AA B7 A or a 36AB CA 249F A jp z,sndno A 36AE 11 82DB A ld de,mac0 ; start of table to use 36B1 21 0005 A ld hl,5 ; number of bytes per entry A 36B4 CD 44A2 A call rech ; get the char 36B7 FE 42 A cp 'B' ; is it silent transpond char? 36B9 CA 36C2 A jp z,macos ; yep, then silent A 36BC CD 45E0 A call mslot1 ; determine macro slot, skip rech 36BF C3 36CA A jp maco0 A 36C2 3E FF A macos: ld a,0ffh ; set macro silent flag 36C4 32 80BA A ld (macsil),a A 36C7 CD 45DD A call mslot ; determine macro slot A 36CA E5 A maco0: push hl ; save slot address A 36CB 21 83EC A ld hl,mbuf ; holding buffer for command tail 36CE CD 44A2 A maco1: call rech 36D1 77 A ld (hl),a ; save tail chars in buffer 36D2 FE 0D A cp cr ; end of tail? 36D4 CA 36DB A jp z,maco2 ; then done 36D7 23 A inc hl 36D8 C3 36CE A jp maco1 A 36DB 3A 80BA A maco2: ld a,(macsil) ; silent macro command? 36DE B7 A or a 36DF CA 36EB A jp z,macoq A 36E2 3E 41 A ld a,'A' ; prefix silent command char 36E4 CD 1EE1 A call putbuf A 36E7 AF A xor a 36E8 32 80BA A ld (macsil),a ; reset macro silent flag A 36EB E1 A macoq: pop hl ; get slot address back A A ; HL is pointing to desired macro function A ; Copy the fucntion into the type-ahead buffer - IBUF A 36EC 06 05 A ld b,5 ; number of bytes to move A 36EE 7E A maco3: ld a,(hl) ; get the byte 36EF CD 1EE1 A call putbuf ; save in the buffer A 36F2 23 A inc hl 36F3 05 A dec b ; done? 36F4 C2 36EE A jp nz,maco3 ; loop until 5 chars added A 36F7 21 83EC A ld hl,mbuf ; now, append the command tail A 36FA 7E A maco4: ld a,(hl) ; get the next tail char 36FB CD 1EE1 A call putbuf ; save in the buffer A 36FE FE 0D A cp cr ; end of line? 3700 C8 A ret z ; all done A 3701 23 A inc hl 3702 C3 36FA A jp maco4 ; go back for more A A ;----------------------------------------------------------------------------- A ; Subroutine SETMAC - Program Macro Functions A ;----------------------------------------------------------------------------- A 3705 11 82DB A setmac: ld de,mac0 ; start of table to use 3708 21 0005 A ld hl,5 ; number of bytes per entry 370B CD 45DD A call mslot ; set up desired macro slot 370E 06 05 A ld b,5 ; count up to 5 chars A 3710 CD 44A2 A setma1: call rech ; get next character 3713 FE 0D A cp cr ; end of line? 3715 CA 24E4 A jp z,sndok ; finished A 3718 77 A ld (hl),a ; save in the macro slot 3719 78 A ld a,b ; check max count 371A B7 A or a 371B CA 226D A jp z,error ; too many chars A 371E 05 A dec b 371F 23 A inc hl ; next position in slot 3720 C3 3710 A jp setma1 A A A A ;----------------------------------------------------------------------------- A ; Disable 450 RX PL (by enabling COS bit) A ;----------------------------------------------------------------------------- A 3723 CD 2289 A urpld: call stat ; status line 3726 34 35 30 20 A defb '450 Receiver PL',0 3736 CD 3EFB A call prdis 3739 CD 27DE A call sp450 373C CD 2794 A call sprx 373F CD 2E64 A call sp 3742 CD 2E8A A call sl 3745 CD 2ABB A call ssdis A 3748 3A 820E A ld a,(port1c) ; read control byte 374B E6 F7 A and not urtos ; disable tos 374D F6 04 A or urcos ; enable cos 374F 32 820E A ld (port1c),a ; save back 3752 C9 A ret A A A ; Disable 6M RX PL (by enabling COS bit) A 3753 CD 2289 A vrpld: call stat ; status line 3756 36 4D 20 52 A defb '6M Receiver PL',0 3765 CD 3EFB A call prdis 3768 CD 27E4 A call sp6m 376B CD 2794 A call sprx 376E CD 2E64 A call sp 3771 CD 2E8A A call sl 3774 CD 2ABB A call ssdis A 3777 3A 820E A ld a,(port1c) ; read control byte 377A E6 FD A and not vrtos ; disable tos 377C F6 01 A or vrcos ; enable cos 377E 32 820E A ld (port1c),a ; save back 3781 C9 A ret A A A ; Disable 450 RX A 3782 CD 2289 A urxd: call stat ; status line 3785 34 35 30 20 A defb '450 Receiver',0 3792 CD 3EFB A call prdis 3795 CD 27DE A call sp450 3798 CD 2794 A call sprx 379B CD 2ABB A call ssdis A 379E 3A 820E A ld a,(port1c) ; read control byte 37A1 E6 F3 A and not (urcos+urtos) ; disable bits 37A3 32 820E A ld (port1c),a ; save back 37A6 C9 A ret A A ; Toggle 450 PL enable A 37A7 CD 38C3 A tupl: call smode 37AA CD 37B0 A call tuplt 37AD C3 38CE A jp rmode A 37B0 3A 820E A tuplt: ld a,(port1c) ; read control byte 37B3 E6 04 A and urcos ; control bit 37B5 CA 3723 A jp z,urpld ; COS was off, turn on A ; COS was on, turn off (fall through) A A ; Enable 450 RX (with PL) A 37B8 3A 820E A urxe: ld a,(port1c) ; read control byte 37BB E6 FB A and not urcos ; disable cos 37BD F6 08 A or urtos ; enable tos 37BF 32 820E A ld (port1c),a ; save back A 37C2 CD 2289 A call stat ; status line 37C5 34 35 30 20 A defb '450 Receiver (PL-ON)',0 37DA CD 3EEE A call prena 37DD CD 27DE A call sp450 37E0 CD 2794 A call sprx 37E3 CD 2AF6 A call ssena 37E6 C9 A ret A A ;----------------------------------------------------------------------------- A A ; Disable 6M PL Time-Out Inhibit A 37E7 AF A vpltof: xor a 37E8 32 821F A ld (vpltf),a ; reset the 6M PL Time-Out Flag A 37EB CD 3808 A call vpltm ; print screen message 37EE CD 3EFB A call prdis 37F1 CD 2B2D A call ssctl 37F4 C3 2ABB A jp ssdis A A A ; Enable 6M PL Time-Out Inhibit A 37F7 A vplton: 37F7 3E FF A ld a,0ffh 37F9 32 821F A ld (vpltf),a ; set the 6M PL Time-Out Flag A 37FC CD 3808 A call vpltm ; print screen message 37FF CD 3EEE A call prena 3802 CD 2B2D A call ssctl 3805 C3 2AF6 A jp ssena A 3808 CD 2289 A vpltm: call stat ; status line 380B 36 4D 20 50 A defb '6M PL Time-Out Inhibit',0 3822 C9 A ret A A ;----------------------------------------------------------------------------- A A ; Disable 450 PL Time-Out Inhibit A 3823 AF A upltof: xor a 3824 32 8220 A ld (upltf),a ; reset the 450 PL Time-Out Flag A 3827 CD 3844 A call upltm ; print screen message 382A CD 3EFB A call prdis 382D CD 2B2D A call ssctl 3830 C3 2ABB A jp ssdis A A A ; Enable 450 PL Time-Out Inhibit A 3833 A uplton: 3833 3E FF A ld a,0ffh 3835 32 8220 A ld (upltf),a ; set the 450 PL Time-Out Flag A 3838 CD 3844 A call upltm ; print screen message 383B CD 3EEE A call prena 383E CD 2B2D A call ssctl 3841 C3 2AF6 A jp ssena A 3844 CD 2289 A upltm: call stat ; status line 3847 34 35 30 20 A defb '450 PL Time-Out Inhibit',0 385F C9 A ret A A ;----------------------------------------------------------------------------- A A ; Disable 6M RX A 3860 CD 2289 A vrxd: call stat ; status line 3863 36 4D 20 52 A defb '6M Receiver',0 386F CD 3EFB A call prdis 3872 CD 27E4 A call sp6m 3875 CD 2794 A call sprx 3878 CD 2ABB A call ssdis A 387B 3A 820E A ld a,(port1c) ; read control byte 387E E6 FC A and not (vrcos+vrtos) ; disable bit 3880 32 820E A ld (port1c),a ; save back 3883 C9 A ret A A ; Toggle 6M PL enable A 3884 CD 38C3 A tvpl: call smode 3887 CD 388D A call tvplt 388A C3 38CE A jp rmode A 388D 3A 820E A tvplt: ld a,(port1c) ; read control byte 3890 E6 01 A and vrcos ; control bit 3892 CA 3753 A jp z,vrpld ; COS was off, turn on A ; COS was on, turn off (fall through) A A ; Enable 6M RX (with PL) A 3895 3A 820E A vrxe: ld a,(port1c) ; read control byte 3898 E6 FE A and not vrcos ; disable cos 389A F6 02 A or vrtos ; enable tos 389C 32 820E A ld (port1c),a ; save back 389F CD 2289 A call stat ; status line 38A2 36 4D 20 52 A defb '6M Receiver (PL-ON)',0 38B6 CD 3EEE A call prena 38B9 CD 27E4 A call sp6m 38BC CD 2794 A call sprx 38BF CD 2AF6 A call ssena 38C2 C9 A ret A A ;----------------------------------------------------------------------------- A A ; Quiet/Verbose Command Response Control A A A ; Save Mode A 38C3 3A 8218 A smode: ld a,(cwena) ; save the current MCW/Speech mode 38C6 32 80A9 A ld (cwtmp),a A 38C9 AF A xor a ; set mode 0 38CA 32 8218 A ld (cwena),a 38CD C9 A ret A A ; Restore Mode A 38CE 3A 80A9 A rmode: ld a,(cwtmp) ; restore the prev MCW/Speech mode 38D1 32 8218 A ld (cwena),a 38D4 C9 A ret A A A ;----------------------------------------------------------------------------- A A ; Toggle 450 TX enable A 38D5 CD 38C3 A tutx: call smode 38D8 CD 38DE A call tutxt 38DB C3 38CE A jp rmode A A 38DE 3A 8213 A tutxt: ld a,(port7c) ; read control byte 38E1 E6 02 A and utx ; control bit 38E3 CA 38FE A jp z,utxe ; was off, turn on A ; was on, turn off (fall through) A A ; Disable 450 TX A 38E6 CD 3916 A utxd: call utxm ; print screen message 38E9 CD 3EFB A call prdis 38EC CD 27DE A call sp450 38EF CD 2736 A call sptx 38F2 CD 2ABB A call ssdis A 38F5 3A 8213 A ld a,(port7c) ; read control byte 38F8 E6 FD A and not utx ; disable bit 38FA 32 8213 A ld (port7c),a ; save back 38FD C9 A ret A A ; Enable 450 TX A 38FE 3A 8213 A utxe: ld a,(port7c) ; read control byte 3901 F6 02 A or utx ; enable bit 3903 32 8213 A ld (port7c),a ; save back A 3906 CD 3916 A call utxm ; print screen message 3909 CD 3EEE A call prena 390C CD 27DE A call sp450 390F CD 2736 A call sptx 3912 CD 2AF6 A call ssena 3915 C9 A ret A 3916 CD 2289 A utxm: call stat ; status line 3919 34 35 30 20 A defb '450 Transmitter',0 3929 C9 A ret A A ;----------------------------------------------------------------------------- A A ; Toggle 6M TX enable A 392A CD 38C3 A tvtx: call smode 392D CD 3933 A call tvtxt 3930 C3 38CE A jp rmode A 3933 3A 8213 A tvtxt: ld a,(port7c) ; read control byte 3936 E6 01 A and vtx ; control bit 3938 CA 3953 A jp z,vtxe ; was off, turn on A ; was on, turn off (fall through) A A ; Disable 6M TX A 393B CD 396A A vtxd: call vtxm ; print screen message 393E CD 3EFB A call prdis 3941 CD 27E4 A call sp6m 3944 CD 2736 A call sptx 3947 CD 2ABB A call ssdis A 394A 3A 8213 A ld a,(port7c) ; read control byte 394D E6 FE A and not vtx ; disable bit 394F 32 8213 A ld (port7c),a ; save back 3952 C9 A ret A A ; Enable 6M TX A 3953 3A 8213 A vtxe: ld a,(port7c) ; read control byte 3956 F6 01 A or vtx ; enable bit 3958 32 8213 A ld (port7c),a ; save back A 395B CD 396A A call vtxm ; print screen message 395E CD 3EEE A call prena 3961 CD 27E4 A call sp6m 3964 CD 2736 A call sptx 3967 C3 2AF6 A jp ssena A 396A CD 2289 A vtxm: call stat ; status line 396D 36 4D 20 54 A defb '6M Transmitter',0 397C C9 A ret A A ;----------------------------------------------------------------------------- A A ; Disable Aux RX #1 A 397D 3A 820E A a1rxd: ld a,(port1c) ; read control byte 3980 E6 EF A and not a1cos ; disable bit 3982 32 820E A ld (port1c),a ; save back 3985 C9 A ret A A ; Enable Aux RX #1 A 3986 CD 3A07 A a1rxe: call a1txd1 ; dump the transmitter if on 3989 3A 820E A ld a,(port1c) ; read control byte 398C F6 10 A or a1cos ; enable bit 398E 32 820E A ld (port1c),a ; save back A 3991 CD 2289 A call stat ; status line 3994 32 20 4D 65 A defb '2 Meter Receiver',0 39A5 CD 3EEE A call prena A 39A8 3A 8218 A ld a,(cwena) ; get the MCW/Speech control byte 39AB FE 01 A cp 1 39AD CA 24C3 A jp z,sndon1 A 39B0 CD 27EA A call sp2m ; speak '2-Meter' 39B3 C3 2794 A jp sprx ; speak 'Receive' A A A ; Disable Aux RX #2 A 39B6 3A 820E A a2rxd: ld a,(port1c) ; read control byte 39B9 E6 DF A and not a2cos ; disable bit 39BB 32 820E A ld (port1c),a ; save back 39BE C9 A ret A A ; Enable Aux RX #2 A 39BF CD 3A69 A a2rxe: call a2txd1 ; dump the transmitter if on 39C2 3A 820E A ld a,(port1c) ; read control byte 39C5 F6 20 A or a2cos ; enable bit 39C7 32 820E A ld (port1c),a ; save back A 39CA CD 2289 A call stat ; status line 39CD 31 30 2D 4D A defb '10-Meter Receiver',0 39DF CD 3EEE A call prena A 39E2 3A 8218 A ld a,(cwena) ; get the MCW/Speech control byte 39E5 FE 01 A cp 1 39E7 CA 24C3 A jp z,sndon1 A 39EA CD 27F0 A call sp10m ; speak '10-meter' 39ED C3 2794 A jp sprx ; speak 'Receive' A A A ; Disable Aux TX #1 A 39F0 CD 3A3A A a1txd: call a1txm ; print screen message 39F3 CD 3EFB A call prdis A 39F6 3A 8218 A ld a,(cwena) ; get the MCW/Speech control byte 39F9 FE 01 A cp 1 39FB CA 24DB A jp z,sndof1 A 39FE CD 27EA A call sp2m ; speak '2-meter' 3A01 CD 2736 A call sptx ; speak 'Transmit' 3A04 C3 29C7 A jp sndsoff ; speak 'off' A A 3A07 3A 8213 A a1txd1: ld a,(port7c) ; read control byte 3A0A E6 F7 A and not a1tx ; disable bit 3A0C 32 8213 A ld (port7c),a ; save back 3A0F C9 A ret A A ; Enable Aux TX #1 A 3A10 3A 820E A a1txe: ld a,(port1c) ; read control byte 3A13 E6 10 A and a1cos ; see if receiver is enabled 3A15 CA 249F A jp z,sndno A 3A18 3A 8213 A ld a,(port7c) ; read control byte 3A1B F6 08 A or a1tx ; enable bit 3A1D 32 8213 A ld (port7c),a ; save back A 3A20 2A 823D A ld hl,(mdfatt) ; preset Aux Transmit Time Limit 3A23 22 80AA A ld (attim),hl A 3A26 CD 3A3A A call a1txm ; print screen message 3A29 CD 3EEE A call prena A 3A2C 3A 8218 A ld a,(cwena) ; get the MCW/Speech control byte 3A2F FE 01 A cp 1 3A31 CA 24C3 A jp z,sndon1 A 3A34 CD 27EA A call sp2m ; speak '2-meter' 3A37 C3 2736 A jp sptx ; speak 'Transmit' A 3A3A CD 2289 A a1txm: call stat ; status line 3A3D 32 2D 4D 65 A defb '2-Meter Transmitter',0 3A51 C9 A ret A A ; Disable Aux TX #2 A 3A52 CD 3A9C A a2txd: call a2txm ; print screen message 3A55 CD 3EFB A call prdis A 3A58 3A 8218 A ld a,(cwena) ; get the MCW/Speech control byte 3A5B FE 01 A cp 1 3A5D CA 24DB A jp z,sndof1 A 3A60 CD 27F0 A call sp10m ; speak '10-Meter' 3A63 CD 2736 A call sptx ; speak 'Transmit' 3A66 C3 29C7 A jp sndsoff ; speak 'off' A 3A69 3A 8213 A a2txd1: ld a,(port7c) ; read control byte 3A6C E6 EF A and not a2tx ; disable bit 3A6E 32 8213 A ld (port7c),a ; save back 3A71 C9 A ret A A ; Enable Aux TX #2 A 3A72 3A 820E A a2txe: ld a,(port1c) ; read control byte 3A75 E6 20 A and a2cos ; see if receiver is enabled 3A77 CA 249F A jp z,sndno A 3A7A 3A 8213 A ld a,(port7c) ; read control byte 3A7D F6 10 A or a2tx ; enable bit 3A7F 32 8213 A ld (port7c),a ; save back A 3A82 2A 823D A ld hl,(mdfatt) ; preset Aux Transmit Time Limit 3A85 22 80AA A ld (attim),hl A 3A88 CD 3A9C A call a2txm ; print screen message 3A8B CD 3EEE A call prena A 3A8E 3A 8218 A ld a,(cwena) ; get the MCW/Speech control byte 3A91 FE 01 A cp 1 3A93 CA 24C3 A jp z,sndon1 A 3A96 CD 27F0 A call sp10m ; speak '10-Meter' 3A99 C3 2736 A jp sptx ; speak 'Transmit' A 3A9C CD 2289 A a2txm: call stat ; status line 3A9F 31 30 2D 4D A defb '10-Meter Transmitter',0 3AB4 C9 A ret A A ; Disable Both RX/TX #1 A 3AB5 CD 397D A a1rtd: call a1rxd ; aux 1 RX disable 3AB8 CD 3A07 A call a1txd1 ; aux 1 TX disable 3ABB CD 3AFB A call a1rtm ; print screen message 3ABE CD 3EFB A call prdis ; print 'disabled' A 3AC1 3A 8218 A ld a,(cwena) ; get the MCW/Speech control byte 3AC4 FE 01 A cp 1 3AC6 CA 24DB A jp z,sndof1 A 3AC9 CD 27EA A call sp2m ; speak '2-meter 3ACC CD 2794 A call sprx ; speak 'receive' 3ACF CD 2EDA A call sand ; speak 'and' 3AD2 CD 2736 A call sptx ; speak 'transmit' 3AD5 C3 29C7 A jp sndsoff ; speak 'off' A A A ; Disable Both RX/TX #2 A 3AD8 CD 39B6 A a2rtd: call a2rxd ; aux 2 RX disable 3ADB CD 3A69 A call a2txd1 ; aux 2 TX disable 3ADE CD 3B1C A call a2rtm ; print screen message 3AE1 CD 3EFB A call prdis ; print 'disabled' A 3AE4 3A 8218 A ld a,(cwena) ; get the MCW/Speech control byte 3AE7 FE 01 A cp 1 3AE9 CA 24DB A jp z,sndof1 A 3AEC CD 27F0 A call sp10m ; speak '10-Meter' 3AEF CD 2794 A call sprx ; speak 'receive' 3AF2 CD 2EDA A call sand ; speak 'and' 3AF5 CD 2736 A call sptx ; speak 'transmit' 3AF8 C3 29C7 A jp sndsoff ; speak 'off' A 3AFB CD 2289 A a1rtm: call stat ; status line 3AFE 32 2D 4D 65 A defb '2-Meter Receiver/Transmitter',0 3B1B C9 A ret A 3B1C CD 2289 A a2rtm: call stat ; status line 3B1F 31 30 2D 4D A defb '10-Meter Receiver/Transmitter',0 3B3D C9 A ret A A ;----------------------------------------------------------------------------- A ; Set Two Meter RX/TX Active Channel A ;----------------------------------------------------------------------------- A 3B3E CD 3B52 A a1chan: call a1chm ; print screen message 3B41 CD 44A2 A call rech ; get next character 3B44 CD 1F18 A call cout ; echo to screen A 3B47 FE 0D A cp cr ; no char there 3B49 CA 226D A jp z,error A 3B4C CD 45F2 A call dchk ; convert to binary A A 3B4F C3 24E4 A jp sndok ; send OK to user A 3B52 CD 2289 A a1chm: call stat 3B55 32 2D 4D 65 A defb '2-Meter set to Channel ',0 3B6D C9 A ret A A ;----------------------------------------------------------------------------- A ; Speak Frequencies in Two Meter Channel Slots A ;----------------------------------------------------------------------------- A 3B6E 3A 8218 A spk2m: ld a,(cwena) ; see if MCW/Speech Disabled 3B71 B7 A or a 3B72 CA 249F A jp z,sndno A 3B75 3E FF A ld a,0ffh ; set the MCW transpond flag 3B77 32 8083 A ld (cwtf),a A 3B7A CD 240A A call t660 A 3B7D 11 8371 A ld de,twoc0 ; channel table start 3B80 21 0009 A ld hl,9 ; 9 bytes per entry 3B83 CD 44A2 A call rech ; get the channel character 3B86 F5 A push af ; save the channel number 3B87 CD 45E0 A call mslot1 ; set-up the desired channel slot A 3B8A F1 A pop af ; get the requested channel 3B8B F5 A push af ; save back 3B8C CD 25AD A call cwl ; send in mcw A 3B8F CD 2444 A call halfsec ; wait A 3B92 7E A spk2m1: ld a,(hl) ; get the first digit 3B93 FE FF A cp 0ffh ; is it 0ffh? 3B95 CA 3C28 A jp z,nofreq ; if the first digit is 0ffh, A ; then the slot is empty A 3B98 CD 2289 A call stat ; status line 3B9B 32 4D 20 43 A defb '2M Channel ',0 A 3BA7 F1 A pop af 3BA8 CD 1F18 A call cout ; print the channel A 3BAB CD 4541 A call vprint 3BAE 3A 20 20 00 A defb ': ',0 A 3BB2 06 00 A spk2m2: ld b,0 ; counter 3BB4 7E A spk2m3: ld a,(hl) ; get a digit A 3BB5 C5 A push bc 3BB6 CD 44C8 A call nybl ; speak the digit 3BB9 C1 A pop bc A 3BBA 04 A inc b ; bump count 3BBB 23 A inc hl ; next digit 3BBC 78 A ld a,b 3BBD FE 07 A cp 7 ; speak only 7 digits (0 to 6) 3BBF C2 3BB4 A jp nz,spk2m3 ; loop back for more A 3BC2 E5 A push hl ; save mode byte A 3BC3 CD 2444 A call halfsec A 3BC6 3E 20 A ld a,' ' 3BC8 CD 1F18 A call cout A 3BCB 7E A ld a,(hl) 3BCC D6 30 A sub 30h ; convert from ascii 3BCE B7 A or a ; 0 = Simplex 3BCF CA 3BE5 A jp z,spk2m4 A 3BD2 FE 02 A cp 2 ; 2 = Auto-Inverse mode 3BD4 CA 3BF3 A jp z,spk2m5 A A ; The strings rptstr, sxstr, invstr, hpstr and lpstr A ; are in the UCRT routine A 3BD7 21 172B A ld hl,rptstr A 3BDA E5 A push hl 3BDB CD 4547 A call pstr ; type "Repeat" 3BDE E1 A pop hl A 3BDF CD 2568 A call cw ; send "Repeat" in MCW 3BE2 C3 3BF3 A jp spk2m5 A 3BE5 21 1749 A spk2m4: ld hl,sxstr A 3BE8 E5 A push hl 3BE9 CD 4547 A call pstr ; type "Simplex" 3BEC E1 A pop hl A 3BED CD 2568 A call cw ; send "Simplex" in MCW 3BF0 C3 3BFE A jp spk2m6 A 3BF3 21 173A A spk2m5: ld hl,invstr A 3BF6 E5 A push hl 3BF7 CD 4547 A call pstr ; type "Inverse" 3BFA E1 A pop hl A 3BFB CD 2568 A call cw ; send "Inverse" in MCW A 3BFE CD 2444 A spk2m6: call halfsec 3C01 E1 A pop hl 3C02 23 A inc hl ; get the power control byte A 3C03 7E A ld a,(hl) 3C04 D6 30 A sub 30h ; convert from ascii 3C06 B7 A or a ; 0 = Low Power 3C07 CA 3C18 A jp z,spk2m7 A 3C0A 21 175D A ld hl,hpstr A 3C0D E5 A push hl 3C0E CD 4547 A call pstr ; type "HP" 3C11 E1 A pop hl A 3C12 CD 2568 A call cw ; send "HP" in MCW 3C15 C3 3C23 A jp spk2m8 A 3C18 21 1769 A spk2m7: ld hl,lpstr A 3C1B E5 A push hl 3C1C CD 4547 A call pstr ; type "LP" 3C1F E1 A pop hl A 3C20 CD 2568 A call cw ; send "LP" in MCW A A 3C23 AF A spk2m8: xor a 3C24 32 8083 A ld (cwtf),a ; reset MCW transpond flag 3C27 C9 A ret A A 3C28 AF A nofreq: xor a ; reset transpond flag 3C29 32 8083 A ld (cwtf),a A 3C2C CD 2289 A call stat 3C2F 54 77 6F 20 A defb 'Two Meter Channel not programmed.',0 3C51 C3 24AB A jp sndmno A A A ;----------------------------------------------------------------------------- A ; Program Two Meter Channel Frequencies A ;----------------------------------------------------------------------------- A A ; This entry point allows a user to change the frequency in chan zero A 3C54 AF A pgm2mu: xor a 3C55 32 83CB A ld (twoac),a ; set active channel to zero A 3C58 21 8371 A ld hl,twoc0 ; point to chan zero slot 3C5B C3 3C71 A jp pgm2me ; A A A ; This entry point allows a control operator to change any 2M chan freq. A 3C5E 11 8371 A pgm2m: ld de,twoc0 ; start of table to use 3C61 21 0009 A ld hl,9 ; number of bytes per entry 3C64 CD 44A2 A call rech ; get the next char (chan #) 3C67 F5 A push af ; save it 3C68 CD 45E0 A call mslot1 ; set up desired channel slot 3C6B F1 A pop af 3C6C D6 30 A sub 30h ; convert from ascii 3C6E 32 83CB A ld (twoac),a ; set active channel A 3C71 06 06 A pgm2me: ld b,6 ; count up to 6 incoming chars A 3C73 23 A inc hl ; skip over the 1 3C74 23 A inc hl ; skip over the 4 A 3C75 CD 44A2 A pgm2m1: call rech ; get next character 3C78 4F A ld c,a ; save it 3C79 FE 0D A cp cr ; end of line? 3C7B CA 24E4 A jp z,sndok A 3C7E 78 A ld a,b ; get the count 3C7F FE 05 A cp 5 ; time to skip the decimal? 3C81 C2 3C85 A jp nz,pgm2m2 A 3C84 23 A inc hl ; skip over decimal point A 3C85 79 A pgm2m2: ld a,c ; get the char back 3C86 77 A ld (hl),a ; save in memory A 3C87 78 A ld a,b ; get the count 3C88 B7 A or a 3C89 CA 226D A jp z,error A 3C8C 05 A dec b ; bump down the count 3C8D 23 A inc hl ; next digit in slot 3C8E C3 3C75 A jp pgm2m1 A A A ;----------------------------------------------------------------------------- A A ; 6M Courtesy Tone Mode Control A 3C91 CD 3CB2 A vctset: call vctm ; print screen message 3C94 CD 44A2 A call rech ; get the next character A 3C97 FE 32 A cp '2' ; mode 2 - each key-up 3C99 CA 3CA6 A jp z,vct1 A 3C9C FE 31 A cp '1' ; mode 1 - first key up 3C9E CA 3CA6 A jp z,vct1 A 3CA1 FE 30 A cp '0' ; mode 0 - disabled 3CA3 C2 226D A jp nz,error A 3CA6 CD 1F18 A vct1: call cout ; print the char on the screen 3CA9 D6 30 A sub 30H ; convert to binary 3CAB 32 8219 A ld (vctmod),a ; save the mode 3CAE CD 24E4 A call sndok 3CB1 C9 A ret A 3CB2 CD 2289 A vctm: call stat ; status line 3CB5 36 4D 20 43 A defb '6M Courtesy Tone Mode ',0 3CCC C9 A ret A A ;---------------------------------------------------------------------------- A A ; 450 Courtesy Tone Mode Control A 3CCD CD 3CEE A uctset: call uctm ; print screen message 3CD0 CD 44A2 A call rech ; get the next character A 3CD3 FE 32 A cp '2' ; mode 2 - each key-up 3CD5 CA 3CE2 A jp z,uct1 A 3CD8 FE 31 A cp '1' ; mode 1 - first key up 3CDA CA 3CE2 A jp z,uct1 A 3CDD FE 30 A cp '0' ; mode 0 - disabled 3CDF C2 226D A jp nz,error A 3CE2 CD 1F18 A uct1: call cout ; print the char on the screen 3CE5 D6 30 A sub 30H ; convert to binary 3CE7 32 821A A ld (uctmod),a ; save the mode 3CEA CD 24E4 A call sndok 3CED C9 A ret A 3CEE CD 2289 A uctm: call stat ; status line 3CF1 34 35 30 20 A defb '450 Courtesy Tone Mode ',0 3D09 C9 A ret A A ;----------------------------------------------------------------------------- A A ; Enable UAD functions A 3D0A 3E FF A uade: ld a,0ffh 3D0C 32 8217 A ld (uadflg),a 3D0F CD 3D2B A call uadm ; print screen message 3D12 CD 3EEE A call prena 3D15 CD 2B6A A call ssusr 3D18 C3 2AF6 A jp ssena A A ; Disable UAD functions A 3D1B AF A uadd: xor a 3D1C 32 8217 A ld (uadflg),a 3D1F CD 3D2B A call uadm ; print screen message 3D22 CD 3EFB A call prdis 3D25 CD 2B6A A call ssusr 3D28 C3 2ABB A jp ssdis A 3D2B CD 2289 A uadm: call stat ; status line 3D2E 55 73 65 72 A defb 'User Functions',0 3D3D C9 A ret A A ;----------------------------------------------------------------------------- A 3D3E CD 2289 A cadm: call stat ; status line 3D41 43 6F 6E 74 A defb 'Control Functions',0 3D53 C9 A ret A A ;---------------------------------------------------------------------------- A A ; DTMF Mute Control A 3D54 3E FF A dmue: ld a,0ffh 3D56 32 821B A ld (dmutc),a ; set the DTMF Mute enabled flag 3D59 CD 3D6F A call dmum ; print screen message 3D5C CD 3EEE A call prena 3D5F C3 24B4 A jp sndcn A A 3D62 AF A dmud: xor a 3D63 32 821B A ld (dmutc),a ; reset the DTMF Mute enabled flag 3D66 CD 3D6F A call dmum ; print screen message 3D69 CD 3EFB A call prdis 3D6C C3 24CC A jp sndcff A 3D6F CD 2289 A dmum: call stat ; status line 3D72 44 54 4D 46 A defb 'DTMF Mute',0 3D7C C9 A ret A A ;----------------------------------------------------------------------------- A A ; DTMF PL Control 6M enable A 3D7D 3E FF A dplve: ld a,0ffh 3D7F 32 821D A ld (dtplv),a 3D82 CD 3D98 A call dplvm ; print screen message 3D85 CD 3EEE A call prena 3D88 C3 24B4 A jp sndcn A A ; DTMF PL Control 6M disable A 3D8B AF A dplvd: xor a 3D8C 32 821D A ld (dtplv),a 3D8F CD 3D98 A call dplvm ; print screen message 3D92 CD 3EFB A call prdis 3D95 C3 24CC A jp sndcff A 3D98 CD 2289 A dplvm: call stat ; status line 3D9B 36 4D 20 44 A defb '6M DTMF PL',0 3DA6 C9 A ret A A ;----------------------------------------------------------------------------- A A ; DTMF PL Control 450 enable A 3DA7 3E FF A dplue: ld a,0ffh 3DA9 32 821E A ld (dtplu),a 3DAC CD 3DC2 A call dplum ; print screen message 3DAF CD 3EEE A call prena 3DB2 C3 24B4 A jp sndcn A A ; DTMF PL Control 450 disable A 3DB5 AF A dplud: xor a 3DB6 32 821E A ld (dtplu),a 3DB9 CD 3DC2 A call dplum ; print screen message 3DBC CD 3EFB A call prdis 3DBF C3 24CC A jp sndcff A 3DC2 CD 2289 A dplum: call stat ; status line 3DC5 34 35 30 20 A defb '450 DTMF PL',0 3DD1 C9 A ret A A ;----------------------------------------------------------------------------- A A ; Control Ring Detector A 3DD2 3A 820E A rgon: ld a,(port1c) 3DD5 F6 40 A or ring 3DD7 32 820E A ld (port1c),a 3DDA CD 3DF4 A call rngm ; print screen message 3DDD CD 3EEE A call prena 3DE0 C3 24B4 A jp sndcn A 3DE3 3A 820E A rgoff: ld a,(port1c) 3DE6 E6 BF A and not ring 3DE8 32 820E A ld (port1c),a 3DEB CD 3DF4 A call rngm ; print screen message 3DEE CD 3EFB A call prdis 3DF1 C3 24CC A jp sndcff A 3DF4 CD 2289 A rngm: call stat ; status line 3DF7 52 69 6E 67 A defb 'Ring Detector',0 3E05 C9 A ret A A ;----------------------------------------------------------------------------- A A ; Chime Control A 3E06 3A 8223 A chmt: ld a,(chena) ; get the chime enable byte 3E09 B7 A or a 3E0A C2 3E1E A jp nz,chmof ; if on (NZ) then turn on A 3E0D 3E FF A chmon: ld a,0ffh 3E0F 32 8223 A ld (chena),a ; turn on 3E12 CD 3E2E A call chmm ; print screen message 3E15 CD 3EEE A call prena 3E18 CD 2981 A call ssfn 3E1B C3 24BD A jp sndon A 3E1E AF A chmof: xor a 3E1F 32 8223 A ld (chena),a ; turn off 3E22 CD 3E2E A call chmm ; print screen message 3E25 CD 3EFB A call prdis 3E28 CD 2981 A call ssfn 3E2B C3 24D5 A jp sndoff A 3E2E CD 2289 A chmm: call stat ; status line 3E31 48 6F 75 72 A defb 'Hourly Chime',0 3E3E C9 A ret A 3E3F 3A 8213 A ant2: ld a,(port7c) ; get TX control byte 3E42 47 A ld b,a ; save for later 3E43 E6 FC A and not (vtx+utx) ; disable main transmitters now 3E45 32 8213 A ld (port7c),a A 3E48 CD 2444 A call halfsec ; wait A 3E4B 3A 804B A ld a,(port7s) ; switch to antenna #1 3E4E F6 80 A or antt 3E50 32 804B A ld (port7s),a A 3E53 78 A ld a,b ; get previous control byte 3E54 32 8213 A ld (port7c),a ; restore transmitters A 3E57 CD 2444 A call halfsec ; wait A 3E5A CD 3E9D A call antm ; print screen message 3E5D 3E 32 A ld a,'2' 3E5F CD 1F18 A call cout 3E62 CD 3EEE A call prena 3E65 CD 2765 A call spant 3E68 CD 2CA1 A call s2 3E6B C3 2AF6 A jp ssena A 3E6E 3A 8213 A ant1: ld a,(port7c) ; get TX control byte 3E71 47 A ld b,a ; save for later 3E72 E6 FC A and not (vtx+utx) ; disable main transmitters now 3E74 32 8213 A ld (port7c),a A 3E77 CD 2444 A call halfsec ; wait A 3E7A 3A 804B A ld a,(port7s) ; switch to antenna #1 3E7D E6 7F A and not antt 3E7F 32 804B A ld (port7s),a A 3E82 78 A ld a,b ; get previous control byte 3E83 32 8213 A ld (port7c),a ; restore transmitters A 3E86 CD 2444 A call halfsec ; wait A 3E89 CD 3E9D A call antm ; print screen message 3E8C 3E 31 A ld a,'1' 3E8E CD 1F18 A call cout 3E91 CD 3EEE A call prena 3E94 CD 2765 A call spant 3E97 CD 2C8A A call s1 3E9A C3 2AF6 A jp ssena A 3E9D CD 2289 A antm: call stat ; status line 3EA0 41 6E 74 65 A defb 'Antenna #',0 3EAA C9 A ret A A A ;----------------------------------------------------------------------------- A A ; UAD Codes Master Reset A 3EAB CD 38C3 A urst: call smode A 3EAE AF A xor a 3EAF 32 8218 A ld (cwena),a ; disable MCW/Speech A 3EB2 CD 3455 A call ptchoff ; patch off 3EB5 CD 3AB5 A call a1rtd ; Aux RX/TX #1 off 3EB8 CD 3AD8 A call a2rtd ; Aux RX/TX #2 off 3EBB CD 3D54 A call dmue ; DTMF Mute enable 3EBE CD 1B94 A call llrst ; reset landline control A 3EC1 CD 2289 A call stat ; status line 3EC4 55 73 65 72 A defb 'User Functions RESET',0 A 3ED9 CD 38CE A call rmode ; restore previous state A 3EDC CD 24F6 A call tstcw ; see if speech enabled 3EDF C2 3EE8 A jp nz,urst1 A 3EE2 CD 2B6A A call ssusr ; say USER 3EE5 C3 2BC6 A jp ssrst ; say RESET A 3EE8 21 248E A urst1: ld hl,rstmsg 3EEB C3 2568 A jp cw ; send "reset" A A 3EEE CD 4541 A prena: call vprint 3EF1 20 45 6E 61 A defb ' Enabled',0 3EFA C9 A ret A 3EFB CD 4541 A prdis: call vprint 3EFE 20 44 69 73 A defb ' Disabled',0 3F08 C9 A ret A A ;============================================================================ A ; Set the time A ;============================================================================ A 3F09 CD 45C0 A sthrs: call gethx ; get the hours 3F0C FE 24 A cp 24h ; greater than 23 hours? 3F0E D2 226D A jp nc,error A 3F11 32 D004 A ld (hrs),a ; save in clock chip 3F14 32 80A1 A ld (mhrs),a ; save in memory A 3F17 CD 45C0 A call gethx ; get the minutes 3F1A FE 60 A cp 60h ; greater than 59 minutes? 3F1C D2 226D A jp nc,error A 3F1F 32 D003 A ld (min),a ; save in clock chip 3F22 32 80A2 A ld (mmin),a ; save in memory A 3F25 3A 8044 A ld a,(clen) ; see if user entered seconds 3F28 B7 A or a 3F29 C2 3F36 A jp nz,sthr1 A 3F2C AF A xor a ; zero out the seconds 3F2D 32 D002 A ld (sec),a ; save in clock chip 3F30 32 80A3 A ld (msec),a ; save in memory 3F33 C3 3F44 A jp sthr2 A 3F36 CD 45C0 A sthr1: call gethx ; get the seconds 3F39 FE 60 A cp 60h ; greater than 59 seconds? 3F3B D2 226D A jp nc,error A 3F3E 32 D002 A ld (sec),a ; save in clock chip 3F41 32 80A3 A ld (msec),a ; save in memory A 3F44 CD 1174 A sthr2: call ucrte ; update the screen 3F47 CD 2289 A call stat ; status line 3F4A 43 6C 6F 63 A defb 'Clock Time Set',0 A 3F59 C3 24E4 A jp sndok A A A ; Subtract one hour from the time for return to A ; Standard Time A 3F5C 3A 809D A hsub: ld a,(clkp) ; get the clock present flag 3F5F B7 A or a 3F60 C2 3F93 A jp nz,nohs ; ffh = no clock A 3F63 3A D004 A ld a,(hrs) ; read the clock chip hours 3F66 B7 A or a ; is it 00:xx? 3F67 CA 3F8B A jp z,wraps ; Z = wrap to 23:xx A 3F6A FE 20 A cp 20h ; is it 8 PM? 3F6C CC 3F88 A call z,subbcd ; adjust for packed BCD A 3F6F FE 10 A cp 10h ; is it 10 AM? 3F71 CC 3F88 A call z,subbcd ; adjust for packed BCD A 3F74 D6 01 A sub 1 ; decrement hours 3F76 32 D004 A ld (hrs),a ; save back into clock A A 3F79 CD 24E4 A hexit: call sndok ; send OK 3F7C CD 2444 A call halfsec A 3F7F 3A 8218 A ld a,(cwena) ; check speech mode 3F82 FE 02 A cp 2 ; speech enabled? 3F84 CC 2F85 A call z,stime ; speak the time A 3F87 C9 A ret ; all done A 3F88 D6 05 A subbcd: sub 5 ; decrement from 20h to 19h 3F8A C9 A ret ; or from 10h to 9h A 3F8B 3E 23 A wraps: ld a,23h ; preset to 23:xx 3F8D 32 D004 A ld (hrs),a ; save back into clock 3F90 C3 3F79 A jp hexit ; go and speak the time A A A ; Clock Chip not there, do operations on time in memory A 3F93 3A 80A1 A nohs: ld a,(mhrs) ; read the hours in memory 3F96 B7 A or a ; is it 00:xx? 3F97 CA 3FAC A jp z,wrams ; Z = wrap to 23:xx A 3F9A FE 20 A cp 20h ; is it 8 PM? 3F9C CC 3F88 A call z,subbcd ; adjust for packed BCD A 3F9F FE 10 A cp 10h ; is it 10 AM? 3FA1 CC 3F88 A call z,subbcd ; adjust for packed BCD A 3FA4 D6 01 A sub 1 ; decrement hours 3FA6 32 80A1 A ld (mhrs),a ; save back into memory 3FA9 C3 3F79 A jp hexit ; go and speak the time A 3FAC 3E 23 A wrams: ld a,23h ; preset to 23:xx 3FAE 32 80A1 A ld (mhrs),a ; save back into memory 3FB1 C3 3F79 A jp hexit ; go and speak the time A A ; Add one hour to the time for return to A ; Daylight Savings Time A 3FB4 3A 809D A hadd: ld a,(clkp) ; get the clock present flag 3FB7 B7 A or a 3FB8 C2 3FDF A jp nz,noha ; ffh = no clock A 3FBB 3A D004 A ld a,(hrs) ; read the clock chip hours 3FBE FE 23 A cp 23h ; is it 23:xx? 3FC0 CA 3FD8 A jp z,wrapa ; Z = wrap to 00:xx A 3FC3 FE 19 A cp 19h ; is it 7 PM? 3FC5 CC 3FD5 A call z,addbcd ; adjust for packed BCD A 3FC8 FE 09 A cp 9h ; is it 9 AM? 3FCA CC 3FD5 A call z,addbcd ; adjust for packed BCD A 3FCD C6 01 A add 1 ; increment hours 3FCF 32 D004 A ld (hrs),a ; save back into clock 3FD2 C3 3F79 A jp hexit ; go and speak the time A 3FD5 C6 05 A addbcd: add 5 ; increment from 19h to 20h 3FD7 C9 A ret ; or from 9h to 10h A 3FD8 AF A wrapa: xor a ; preset to 00:xx 3FD9 32 D004 A ld (hrs),a ; save back into clock 3FDC C3 3F79 A jp hexit ; go and speak the time A A A ; Clock Chip not there, do operations on time in memory A 3FDF 3A 80A1 A noha: ld a,(mhrs) ; read the hours in memory 3FE2 FE 23 A cp 23h ; is it 23:xx? 3FE4 CA 3FF9 A jp z,wrama ; Z = wrap to 23:xx A 3FE7 FE 19 A cp 19h ; is it 7 PM? 3FE9 CC 3FD5 A call z,addbcd ; adjust for packed BCD A 3FEC FE 09 A cp 9h ; is it 9 AM? 3FEE CC 3FD5 A call z,addbcd ; adjust for packed BCD A 3FF1 C6 01 A add 1 ; increment hours 3FF3 32 80A1 A ld (mhrs),a ; save back into memory 3FF6 C3 3F79 A jp hexit ; go and speak the time A 3FF9 AF A wrama: xor a ; preset to 00:xx 3FFA 32 80A1 A ld (mhrs),a ; save back into memory 3FFD C3 3F79 A jp hexit ; go and speak the time A A A ; Send the time, ID and Curly routine A ; (mostly for Noon and Midnight chimes from the scheduler) A 4000 3A 8223 A stnuk: ld a,(chena) ; see if hourly chime enabled 4003 B7 A or a 4004 C2 29DE A jp nz,sndnuk ; go right to curly routine A 4007 CD 237C A call mbeep ; mega beep chime A 400A 3A 8218 A ld a,(cwena) ; check speech mode 400D FE 02 A cp 2 ; speech enabled? 400F CC 2F85 A call z,stime ; speak the time A 4012 CD 2444 A call halfsec 4015 CD 2F5F A call sndsid ; speak the ID 4018 CD 2444 A call halfsec 401B C3 29DE A jp sndnuk ; do curly A A A ;============================================================================ A ; Set the date A ;============================================================================ A 401E CD 45C0 A stdat: call gethx ; get two ascii chars and make hex 4021 FE 13 A cp 13h ; greater than December? 4023 D2 226D A jp nc,error A 4026 32 D007 A ld (month),a ; save month in IC 4029 32 809F A ld (mmo),a ; save month in memory A 402C CD 45C0 A call gethx 402F FE 32 A cp 32h ; greater than 31? 4031 D2 226D A jp nc,error A 4034 32 D006 A ld (date),a ; save date in IC 4037 32 80A0 A ld (mdt),a ; save date in memory A 403A 3A 8044 A ld a,(clen) ; how many digits left? 403D FE 02 A cp 2 ; full 4-digit year entered? 403F CA 4048 A jp z,stda2 ; Z = no, skip century entry A 4042 CD 45C0 A call gethx 4045 32 8262 A ld (mdfcty),a ; save century A 4048 CD 45C0 A stda2: call gethx 404B 32 D009 A ld (year),a ; save year in IC 404E 32 809E A ld (myr),a ; save year in memory A 4051 CD 1174 A stda3: call ucrte ; update the screen 4054 CD 2289 A call stat ; status line 4057 43 6C 6F 63 A defb 'Clock Date Set',0 4066 CD 24E4 A call sndok 4069 C9 A ret A A A ;============================================================================= A ; MCW/Speech Mode Control A ;============================================================================= A 406A CD 44A2 A cwset: call rech ; get the next char A 406D FE 32 A cp '2' ; mode 2? 406F CA 40C1 A jp z,enasp ; enable Speech/CW mode A 4072 FE 31 A cp '1' ; mode 1? 4074 CA 409D A jp z,enacw ; enable CW-Only mode A 4077 FE 30 A cp '0' ; mode 0? 4079 C2 226D A jp nz,error A 407C AF A discw: xor a ; disable CW/Speech 407D 32 8218 A ld (cwena),a ; (does not disable ID) A 4080 CD 2289 A call stat ; status line 4083 53 70 65 65 A defb 'Speech/MCW Disabled',0 4097 CD 2981 A call ssfn 409A C3 24D5 A jp sndoff A 409D 3E 01 A enacw: ld a,1 ; enable MCW Mode 409F 32 8218 A ld (cwena),a A 40A2 CD 2289 A call stat ; status line 40A5 4D 43 57 2D A defb 'MCW-only Mode Enabled',0 40BB CD 2981 A call ssfn 40BE C3 24BD A jp sndon A 40C1 CD 4791 A enasp: call chksp ; see if chip is there 40C4 CA 24AB A jp z,sndmno ; send NO (mode 1 was forced) A 40C7 3E 02 A ld a,2 ; enable Speech Mode 40C9 32 8218 A ld (cwena),a A 40CC CD 2289 A call stat ; status line 40CF 53 70 65 65 A defb 'Speech Mode Enabled',0 40E3 CD 2981 A call ssfn 40E6 C3 24BD A jp sndon A A A A A ;============================================================================= A ; Set Transmitter Hang Timer (This will key the transmitters) A ;============================================================================= A 40E9 3A 822C A ihtim: ld a,(mdfit) ; preset ID PTT to default value 40EC 32 808C A ld (idptim),a 40EF C3 40F8 A jp htime A 40F2 3A 822B A lhtim: ld a,(mdflt) ; preset hang timer to default value 40F5 32 8085 A ld (lhang),a ; for link transmitters A 40F8 E5 A htime: push hl 40F9 2A 8229 A ld hl,(mdfht) ; preset hang timer to default value 40FC 22 8074 A ld (hang),hl ; for main transmitters 40FF E1 A pop hl 4100 C9 A ret A A ; Preset the hang time to five minutes to key the A ; transmitters for testing A 4101 CD 24E4 A phtime: call sndok 4104 CD 2444 A call halfsec 4107 CD 24FC A call sndid ; force ID now to reset ID timer 410A CD 243F A call onesec 410D 21 7530 A ld hl,5*60*100 ; preset HL to five minutes A A ; (5 mins) * (60 sec/min) * 100 ticks/sec -- 10 ms per tick A 4110 22 8074 A ld (hang),hl ; preset the hang timer A 4113 CD 2289 A call stat ; status line 4116 2A 2A 20 54 A defb '** Transmitters Keyed! **',0 4130 C9 A ret A A ;----------------------------------------------------------------------------- A ; 6M Temporary Receiver PL Override A ;----------------------------------------------------------------------------- A 4131 3A 8217 A vplo: ld a,(uadflg) ; get the UAD enable flag 4134 B7 A or a 4135 C8 A ret z A 4136 3A 820E A ld a,(port1c) ; get the control byte 4139 E6 03 A and vrcos+vrtos ; see if receiver is enabled 413B C8 A ret z A 413C 3A 8221 A ld a,(vplom) ; get the enable control byte 413F B7 A or a 4140 C8 A ret z ; Z = Disabled A 4141 3E FF A ld a,0ffh 4143 32 806B A ld (pltv),a ; set the 6M temp PL override flag A 4146 2A 823F A ld hl,(mdftpl) ; get the default Temp PL time limit 4149 22 806D A ld (tmppl),hl ; preset the time A 414C CD 41C8 A call vptom ; print screen message 414F CD 4541 A call vprint 4152 20 41 63 74 A defb ' Active',0 A 415A C9 A ret A A ;----------------------------------------------------------------------------- A ; 450 Temporary Receiver PL Override A ;----------------------------------------------------------------------------- A 415B 3A 8217 A uplo: ld a,(uadflg) ; get the UAD enable flag 415E B7 A or a 415F C8 A ret z A 4160 3A 820E A ld a,(port1c) ; get the control byte 4163 E6 0C A and urcos+urtos ; see if receiver is enabled 4165 C8 A ret z A 4166 3A 8222 A ld a,(uplom) ; get the enable control byte 4169 B7 A or a 416A C8 A ret z ; Z = Disabled A 416B 3E FF A ld a,0ffh 416D 32 806C A ld (pltu),a ; set the 450 temp PL override flag A 4170 2A 823F A ld hl,(mdftpl) ; get the default Temp PL time limit 4173 22 806D A ld (tmppl),hl ; preset the time A 4176 CD 41FB A call uptom ; print screen message 4179 CD 4541 A call vprint 417C 20 41 63 74 A defb ' Active',0 A 4184 C9 A ret A A ;----------------------------------------------------------------------------- A ; Force Reset 6M and 450 Temp PL Override A ;----------------------------------------------------------------------------- A 4185 21 0000 A tpld: ld hl,0 4188 22 806D A ld (tmppl),hl ; reset the timer A 418B AF A xor a ; reset 6M and 450 temp PL override flags 418C 32 806B A ld (pltv),a 418F 32 806C A ld (pltu),a A 4192 CD 2289 A call stat ; print screen message 4195 54 65 6D 70 A defb 'Temp PL Override Reset',0 A 41AC C9 A ret A A ;----------------------------------------------------------------------------- A ; 6M Temporary Receiver PL Override Control A ;----------------------------------------------------------------------------- A 41AD AF A vptod: xor a 41AE 32 8221 A ld (vplom),a A 41B1 CD 41C8 A call vptom ; print screen message 41B4 CD 3EFB A call prdis ; disabled 41B7 C3 24CC A jp sndcff A A 41BA 3E FF A vptoe: ld a,0ffh 41BC 32 8221 A ld (vplom),a A 41BF CD 41C8 A call vptom ; print screen message 41C2 CD 3EEE A call prena ; enabled 41C5 C3 24B4 A jp sndcn A 41C8 CD 2289 A vptom: call stat ; status line 41CB 36 4D 20 54 A defb '6M Temp PL Override',0 41DF C9 A ret A A ;----------------------------------------------------------------------------- A ; 450 Temporary Receiver PL Override Control A ;----------------------------------------------------------------------------- A 41E0 AF A uptod: xor a 41E1 32 8222 A ld (uplom),a A 41E4 CD 41FB A call uptom ; print screen message 41E7 CD 3EFB A call prdis ; disabled 41EA C3 24CC A jp sndcff A 41ED 3E FF A uptoe: ld a,0ffh 41EF 32 8222 A ld (uplom),a A 41F2 CD 41FB A call uptom ; print screen message 41F5 CD 3EEE A call prena ; enabled 41F8 C3 24B4 A jp sndcn A 41FB CD 2289 A uptom: call stat ; status line 41FE 34 35 30 20 A defb '450 Temp PL Override',0 4213 C9 A ret A A ;----------------------------------------------------------------------------- A ; Memory Read with voice/MCW readout A ;----------------------------------------------------------------------------- A 4214 C3 444B A memr: jp iport1 A A ;----------------------------------------------------------------------------- A ; Memory Write with voice/MCW readout A ;----------------------------------------------------------------------------- A A 4217 CD 440C A memw: call readhl ; read the port or address 421A E5 A push hl ; save 421B E5 A push hl 421C CD 440C A call readhl ; read the data 421F 7D A ld a,l 4220 E1 A pop hl 4221 77 A ld (hl),a A 4222 3E FF A ld a,0ffh 4224 32 8083 A ld (cwtf),a ; set the MCW transpond flag A 4227 CD 240A A call t660 ; 660 Hz. tone pitch A 422A CD 2292 A call clstat 422D CD 4538 A call gxymsg 4230 18 01 A defb 24,1 4232 41 64 64 72 A defb 'Address/Memory: ',0 A 4243 E1 A pop hl ; get the address back 4244 CD 4513 A call tyhl 4247 CD 449D A call sngl 424A CD 2444 A call halfsec ; put space in case of speech 424D 7E A ld a,(hl) ; get the byte 424E 6F A ld l,a 424F CD 44BD A call byte 4252 CD 449D A call sngl 4255 C3 447B A jp bits A 4258 C9 A ret A A A ; ---------------------------------------------------------------------------- A ; Control 450 TX Transmit Time Limit A ;----------------------------------------------------------------------------- A 4259 AF A utxld: xor a 425A 32 8224 A ld (limuhf),a A 425D CD 4274 A call utlm ; print screen message 4260 CD 3EFB A call prdis ; disabled 4263 C3 24CC A jp sndcff A 4266 3E FF A utxle: ld a,0ffh 4268 32 8224 A ld (limuhf),a A 426B CD 4274 A call utlm ; print screen message 426E CD 3EEE A call prena ; enabled 4271 C3 24B4 A jp sndcn A 4274 CD 2289 A utlm: call stat ; status line 4277 34 35 30 20 A defb '450 TX Activity Limit ',0 428E C9 A ret A A A ;----------------------------------------------------------------------------- A ; Tone Deviation Test A ;----------------------------------------------------------------------------- A A ; Toggle Test Tone A 428F 3A 8048 A tdev: ld a,(port4s) ; read status byte 4292 E6 01 A and mcwt ; device bit 4294 CA 42B7 A jp z,tdevn ; was off, turn on A ; was on, turn off (fall through) A A ; Turn-Off Test Tone A 4297 3A 8048 A tdevf: ld a,(port4s) ; read the status byte 429A E6 FE A and not(mcwt) ; drop the device bit 429C 32 8048 A ld (port4s),a ; save back A 429F 21 0000 A ld hl,0 42A2 22 8074 A ld (hang),hl ; unkey the transmitters A 42A5 CD 2289 A call stat 42A8 54 65 73 74 A defb 'Test Tone OFF',0 A 42B6 C9 A ret A A A ; Turn-On Test Tone A 42B7 3A 804B A tdevn: ld a,(port7s) ; see if landline monitor or 42BA E6 04 A and ptchr ; autopatch is active 42BC C2 249F A jp nz,sndno ; (patch relay is on for both) A 42BF 2A 822D A ld hl,(mdfcwt) ; set to default MCW pitch 42C2 CD 2425 A call tone A 42C5 3A 8048 A ld a,(port4s) ; read the status byte 42C8 F6 01 A or mcwt ; set device bit 42CA 32 8048 A ld (port4s),a ; save back A 42CD 21 7530 A ld hl,5*60*100 ; preset HL to 5 minutes 42D0 22 8074 A ld (hang),hl ; key transmitters A 42D3 CD 2289 A call stat 42D6 2A 2A 20 54 A defb '** Test Tone + Transmit! **',0 A 42F2 C9 A ret A A ;----------------------------------------------------------------------------- A ; Speech Deviation Test A ;----------------------------------------------------------------------------- A A ; Toggle Test Speech A 42F3 3A 80B9 A sdev: ld a,(sdevm) ; read status byte 42F6 B7 A or a 42F7 CA 4321 A jp z,sdevn ; was off, turn on A ; was on, turn off (fall through) A A ; Turn-Off Test Speech A 42FA CD 24F6 A sdevf: call tstcw ; see if speech allowed 42FD C2 249F A jp nz,sndno A 4300 AF A xor a ; drop the status byte 4301 32 80B9 A ld (sdevm),a ; save back 4304 32 C000 A ld (durphon),a ; turn off speech chip A 4307 CD 2289 A call stat 430A 54 65 73 74 A defb 'Test Speech OFF',0 A 431A CD 2444 A call halfsec A 431D CD 24CC A call sndcff ; this will also unkey the TX A 4320 C9 A ret A A A ; Turn-On Test Speech A 4321 CD 24F6 A sdevn: call tstcw ; see if speech allowed 4324 C2 249F A jp nz,sndno A 4327 3A 804B A ld a,(port7s) ; see if landline monitor or 432A E6 04 A and ptchr ; autopatch is active 432C C2 249F A jp nz,sndno ; (patch relay is on for both) A 432F 3E FF A ld a,0ffh ; set status byte 4331 32 80B9 A ld (sdevm),a ; save back A 4334 CD 2444 A call halfsec A 4337 CD 2289 A call stat 433A 2A 2A 20 54 A defb '** Test Speech + Transmit! **',0 A 4358 CD 24B4 A call sndcn ; speak something to preset registers A 435B 21 7530 A ld hl,5*60*100 ; preset HL to 5 minutes 435E 22 8074 A ld (hang),hl ; key transmitters A 4361 CD 2444 A call halfsec A 4364 3E 0E A ld a,0eh ; say "Ahhhh" 4366 32 C000 A ld (durphon),a A 4369 C9 A ret A A A ; ------------------------ end of file CONTROL.Z80 --------------------------- ;============================================================================ ; Input a line from the Console and put it ; into the buffer. Carriage return ends the ; line. Rubout or CTRL H corrects last ; entry. ;============================================================================ 436A CD 43D1 inclr: call prompt 436D 3E FF ld a,0ffh ; set EOL flag 436F 32 8053 ld (eol),a 4372 E5 incl: push hl 4373 C5 push bc 4374 21 8022 ld hl,cbuf ; buffer address 4377 22 8042 ld (cptr),hl ; save pointer 437A 0E 00 ld c,0 ; count 437C CD 1ECB inpli: call cin ; get char or wait 437F F5 push af 4380 AF xor a ; reset EOL flag 4381 32 8053 ld (eol),a 4384 F1 pop af 4385 FE 08 cp ctrh ; backspace? 4387 CA 43C0 jp z,inplb 438A FE 7F cp del ; delete? 438C CA 43C0 jp z,inplb 438F FE 0D cp cr ; end of input? 4391 CA 43B8 jp z,inplc 4394 FE 61 cp 'a' ; if less than lower case 'a' 4396 DA 43A0 jp c,inpl3 ; then already upper case 4399 FE 7B cp 'z'+1 ; if greater than lower case 'z' 439B D2 43A0 jp nc,inpl3 ; then not a lower case letter 439E E6 5F and 5fh ; make upper 43A0 77 inpl3: ld (hl),a ; into buffer 43A1 3E 1F ld a,cblen-1 ; buffer size 43A3 B9 cp c ; full? 43A4 CA 43B0 jp z,inplf 43A7 7E ld a,(hl) ; get char 43A8 23 inc hl ; increment pointer 43A9 0C inc c ; and count 43AA CD 1F18 inple: call cout ; print char 43AD C3 437C jp inpli ; next char 43B0 3E 07 inplf: ld a,bell ; buffer is full, 43B2 CD 1F18 call cout ; ring the bell 43B5 C3 437C jp inpli ; End of input line 43B8 79 inplc: ld a,c ; count 43B9 32 8044 ld (clen),a ; save 43BC B7 or a 43BD C1 pop bc 43BE E1 pop hl 43BF C9 ret ; Delete prior character if any 43C0 79 inplb: ld a,c ; char count 43C1 B7 or a ; zero? 43C2 CA 437C jp z,inpli ; yes 43C5 2B dec hl ; back pointer 43C6 0D dec c ; and count 43C7 CD 4541 call vprint ; send BS,SPACE,BS chars 43CA 08 20 08 00 defb backup,' ',backup,0 43CE C3 437C jp inpli 43D1 CD 4538 prompt: call gxymsg 43D4 16 01 defb 22,1 43D6 0F 52 65 61 defb 15,'Ready >' 43DE 20 20 20 20 defb ' ',0 4403 CD 4519 call at 4406 16 09 defb 22,9 4408 CD 4580 call curon ; turn-on cursor 440B C9 ret ; Input HL from console 440C D5 readhl: push de 440D C5 push bc ; Save registers 440E 21 0000 ld hl,0 ; clear 4411 CD 44A2 rdhl2: call rech ; get character 4414 FE 0D cp cr 4416 CA 4432 jp z,rdhl5 ; line feed 4419 CD 4435 call nib ; to binary 441C DA 4428 jp c,rdhl4 ; not hex 441F 29 add hl,hl ; times 2 4420 29 add hl,hl ; times 4 4421 29 add hl,hl ; times 8 4422 29 add hl,hl ; times 16 4423 B5 or l ; add new character 4424 6F ld l,a 4425 C3 4411 jp rdhl2 ; next ; Check for blank at end 4428 FE F7 rdhl4: cp apos ; apostrophe 442A CA 4432 jp z,rdhl5 ; ASCII input 442D FE F0 cp (' '-'0') and 0ffh 442F C2 226D jp nz,error ; no 4432 C1 rdhl5: pop bc 4433 D1 pop de ; restore registers 4434 C9 ret ; Convert ASCII characters to Binary 4435 D6 30 nib: sub '0' ; ASCII bias 4437 D8 ret c ; <0 4438 FE 17 cp 'F'-'0'+1 443A 3F ccf ; invert 443B D8 ret c ; error, >F 443C FE 0A cp 10 443E 3F ccf ; invert 443F D0 ret nc ; number 0-9 4440 D6 07 sub 'A'-'9'-1 4442 FE 0A cp 10 ; skip to 4444 C9 ret ; letter A-F ; Start new line, give address 4445 CD 2289 crhl: call stat ; status line 4448 C3 4513 jp tyhl ; Input from any port or memory address 444B 3E FF iport1: ld a,0ffh 444D 32 8083 ld (cwtf),a ; set the MCW Transpond Flag 4450 CD 240A call t660 ; 660 Hz MCW Pitch 4453 CD 2289 iport: call stat ; status line 4456 41 64 64 72 defb 'Address/Memory: ',0 4467 CD 440C call readhl ; port or address 446A CD 4513 call tyhl 446D CD 449D call sngl 4470 CD 2444 call halfsec 4473 7E ld a,(hl) ; get the byte 4474 6F ld l,a 4475 CD 44BD call byte 4478 CD 449D call sngl ; Print L register in binary (8080 Version) 447B 06 08 bits: ld b,8 ; 8 bits 447D 7D bit2: ld a,l 447E 87 add a,a ; shift left 447F 6F ld l,a 4480 3E 18 ld a,'0'/2 ; half of zero 4482 8F adc a,a ; double + carry 4483 CD 1F18 call cout ; print the bit 4486 05 dec b 4487 C2 447D jp nz,bit2 ; 8 times 448A AF xor a 448B 32 8083 ld (cwtf),a ; reset the MCW Transpond Flag 448E C9 ret ; Output Byte to Port or Memory ; Format is: O,PORT or MEMORY,BYTE 448F CD 440C oport: call readhl ; port or address 4492 E5 push hl ; save 4493 CD 440C call readhl ; data 4496 7D ld a,l 4497 E1 pop hl 4498 77 ld (hl),a 4499 C9 ret ; Type one or two spaces. 449A CD 449D dubl: call sngl 449D 3E 20 sngl: ld a,' ' 449F C3 1F18 jp cout ; Fetch a character into A from command line 44A2 E5 rech: push hl 44A3 21 8044 ld hl,clen ; Command string length 44A6 7E ld a,(hl) 44A7 B7 or a 44A8 3E 0D ld a,cr ; Fake CR from empty buffer 44AA CA 44B6 jp z,recx 44AD 35 dec (hl) 44AE 2A 8042 ld hl,(cptr) ; Pointer to command buffer 44B1 7E ld a,(hl) 44B2 23 inc hl 44B3 22 8042 ld (cptr),hl ; Pointer to command buffer 44B6 E1 recx: pop hl 44B7 C9 ret ; Type A as two nibbles 44B8 7A word: ld a,d 44B9 CD 44BD call byte 44BC 7B ld a,e 44BD C5 byte: push bc 44BE F5 push af 44BF 1F rra 44C0 1F rra 44C1 1F rra 44C2 1F rra 44C3 CD 44C8 call nybl 44C6 F1 pop af 44C7 C1 pop bc 44C8 FE 2E nybl: cp '.' ; is it a decimal point? 44CA CA 44D5 jp z,nybld 44CD E6 0F and 0fh 44CF C6 90 add a,90h 44D1 27 daa 44D2 CE 40 adc a,40h 44D4 27 daa 44D5 CD 1F18 nybld: call cout ; A to console 44D8 47 ld b,a ; save the character 44D9 3A 8083 ld a,(cwtf) ; MCW Transpond flag set? 44DC B7 or a 44DD C8 ret z 44DE 3A 8218 ld a,(cwena) ; MCW and Speech Disabled? 44E1 B7 or a 44E2 C8 ret z ; Mode 0 is both disabled 44E3 FE 02 cp 2 ; speech enabled? (Mode 2) 44E5 CA 4502 jp z,nybl1 44E8 CD 4780 call tsttx ; tey transmitters 44EB 3A 8245 ld a,(mdfwpm) ; get the existing MCW speed 44EE 4F ld c,a ; save it 44EF 3E 5A ld a,90 ; slow it down 44F1 32 8245 ld (mdfwpm),a 44F4 78 ld a,b ; get the char back 44F5 CD 25AD call cwl ; send it in MCW 44F8 3E 10 ld a,16 44FA CD 2455 call delay ; wait 44FD 79 ld a,c ; get the old speed back 44FE 32 8245 ld (mdfwpm),a ; restore it 4501 C9 ret 4502 D5 nybl1: push de 4503 C5 push bc 4504 CD 4780 call tsttx ; key transmitters 4507 78 ld a,b ; get the char back 4508 CD 2F10 call spkln ; speak it 450B 3E 32 ld a,50 ; inter-digit delay 450D CD 2455 call delay 4510 C1 pop bc 4511 D1 pop de 4512 C9 ret ; Type hl as four nibbles 4513 EB tyhl: ex de,hl 4514 CD 44B8 call word 4517 EB ex de,hl 4518 C9 ret ;----------------------------------------------------------------------------- ; AT - Position Cursor at coordinates specified directly after the CALL ;----------------------------------------------------------------------------- ; Format: CALL AT ; DEFB rr,cc ; ; where: rr - is the decimal row coordinate ; cc - is the decimal column coordinate 4519 E3 at: ex (sp),hl ; save HL, get HL = coordinates 451A CD 451F call at1 451D E3 ex (sp),hl ; restore hl and stack past the message 451E C9 ret ;-------- AT1 is a subroutine because it is also called by GXYMSG ------------ 451F 3E 1B at1: ld a,esc ; first, send ESC Y 4521 CD 1F18 call cout 4524 3E 59 ld a,'Y' 4526 CD 1F18 call cout 4529 7E ld a,(hl) ; get row 452A C6 1F add a,31 ; add offset 452C CD 1F18 call cout ; send 452F 23 inc hl 4530 7E ld a,(hl) ; get column 4531 C6 1F add a,31 ; add offset 4533 CD 1F18 call cout ; send 4536 23 inc hl ; point to the next byte 4537 C9 ret ;----------------------------------------------------------------------------- ;----------------------------------------------------------------------------- ; GXYMSG - Direct Cursor Positioning and print text string ;----------------------------------------------------------------------------- ; Format: CALL GXYMSG ; DEFB rr,cc ; DEFB 2,'text'1,0 ; ; where: rr - is the decimal row coordinate ; cc - is the decimal column coordinate ; where: 1 = dim video command ; 2 = bright video command ; 'text' is any ASCII text delimited by quotes ; and terminated with a trailing zero 4538 E3 gxymsg: ex (sp),hl ; Save HL, get HL = coordinates 4539 CD 451F call at1 453C CD 4547 gxym1: call pstr 453F E3 ex (sp),hl ; restore hl and stack past the message 4540 C9 ret ;----------------------------------------------------------------------------- ;----------------------------------------------------------------------------- ; VPRINT - Inline Print Routine ;----------------------------------------------------------------------------- ; Format: CALL vprint ; DEFB 1,'text',2,0 ; ; where: 1 = dim video command ; 2 = bright video command ; 'text' is any ASCII text delimited by quotes ; and terminated with a trailing zero 4541 E3 vprint: ex (sp),hl 4542 CD 4547 call pstr 4545 E3 ex (sp),hl ; restore hl and stack past the message 4546 C9 ret ;----------------------------------------------------------------------------- ;----------------------------------------------------------------------------- ; PSTR - Print the String pointed to by HL ;----------------------------------------------------------------------------- ; Format: LD HL,MSG ; CALL PSTR ; ..................... ; MSG: DEFB 1,'text',2,0 ; ; where: 1 = dim video command ; 2 = bright video command ; 'text' is any ASCII text delimited by quotes ; and terminated with a trailing zero 4547 7E pstr: ld a,(hl) ; get the character 4548 23 inc hl ; point to next one 4549 B7 or a ; zero? (end of string) 454A C8 ret z ; yes, return 454B FE 02 cp 2 ; bright? 454D CA 455B jp z,pstb 4550 FE 01 cp 1 ; dim? 4552 CA 4561 jp z,pstd 4555 CD 1F18 call cout ; send the character 4558 C3 4547 jp pstr ; go back for more 455B CD 4567 pstb: call bright ; process bright or normal video command 455E C3 4547 jp pstr 4561 CD 4579 pstd: call dim ; process dim or reverse video command 4564 C3 4547 jp pstr ;----------------------------------------------------------------------------- ; Bright or Normal Video Routine ;----------------------------------------------------------------------------- 4567 E5 bright: push hl 4568 21 83D8 ld hl,bristr ; point to bright or normal video string 456B 7E brigh1: ld a,(hl) ; get the character 456C B7 or a 456D CA 4577 jp z,brigh2 ; zero is end of string 4570 CD 1F18 call cout ; send the char 4573 23 inc hl ; point to next one 4574 C3 456B jp brigh1 ; loop back 4577 E1 brigh2: pop hl 4578 C9 ret ;----------------------------------------------------------------------------- ; Dim or Reverse Video Routine ;----------------------------------------------------------------------------- 4579 E5 dim: push hl 457A 21 83D3 ld hl,dimstr ; point to the dim or reverse video string 457D C3 456B jp brigh1 ; re-use above code ;----------------------------------------------------------------------------- ; Cursor ON Routine ;----------------------------------------------------------------------------- 4580 E5 curon: push hl 4581 21 83E2 ld hl,constr ; point to cursor on string 4584 C3 456B jp brigh1 ; re-use above code ;----------------------------------------------------------------------------- ; Cursor OFF Routine ;----------------------------------------------------------------------------- 4587 E5 curoff: push hl 4588 21 83E7 ld hl,cofstr ; point to cursor off string 458B C3 456B jp brigh1 ; re-use above code ;----------------------------------------------------------------------------- ; Clear Screen Routine ;----------------------------------------------------------------------------- 458E E5 cls: push hl 458F 21 83DD ld hl,clsstr ; point to clear screen string 4592 C3 456B jp brigh1 ; re-use above code ;----------------------------------------------------------------------------- ; Initialize Terminal Routine ;----------------------------------------------------------------------------- 4595 E5 tinit: push hl 4596 21 83CC ld hl,inistr ; point to init terminal string 4599 C3 456B jp brigh1 ; re-use above code ;----------------------------------------------------------------------------- ; Enter Graphics Mode ;----------------------------------------------------------------------------- 459C F5 gron: push af 00FF 1 if a2020 459D 3E 1B 1 ld a,esc 459F CD 1F18 1 call cout 45A2 3E 48 1 ld a,'H' 45A4 CD 1F18 1 call cout 45A7 3E 02 1 ld a,2 45A9 CD 1F18 1 call cout endif ; a2020 0000 1 if heath 1 ld a,esc 1 call cout 1 ld a,'F' 1 call cout endif ; heath 45AC F1 pop af 45AD C9 ret ;----------------------------------------------------------------------------- ; Exit Graphics Mode ;----------------------------------------------------------------------------- 45AE F5 groff: push af 00FF 1 if a2020 45AF 3E 1B 1 ld a,esc 45B1 CD 1F18 1 call cout 45B4 3E 48 1 ld a,'H' 45B6 CD 1F18 1 call cout 45B9 3E 03 1 ld a,3 45BB CD 1F18 1 call cout endif ; a2020 0000 1 if heath 1 ld a,esc 1 call cout 1 ld a,'G' 1 call cout endif ; heath 45BE F1 pop af 45BF C9 ret ; -- END Subroutines AT, GXYMSG, VPRINT, PSTR, BRIGHT, DIM, CURON, CUROFF --- ;----------------------------------------------------------------------------- include rptsubs.z80 A A ; File of subroutines for WA1LMV Controller A A ;----------------------------------------------------------------------------- A ; GETHX - Read two ASCII characters from the command line A ; and convert to binary A ;----------------------------------------------------------------------------- A 45C0 CD 44A2 A gethx: call rech ; get the next command line digit 45C3 CD 4435 A call nib ; convert to binary 45C6 DA 226D A jp c,error ; not hex 45C9 CB 07 A rlc a 45CB CB 07 A rlc a 45CD CB 07 A rlc a 45CF CB 07 A rlc a 45D1 47 A ld b,a ; save 45D2 CD 44A2 A call rech 45D5 CD 4435 A call nib 45D8 DA 226D A jp c,error ; not hex 45DB B0 A or a,b 45DC C9 A ret A A A ;----------------------------------------------------------------------------- A ; Subroutine MSLOT - Determine Memory Slot A ;----------------------------------------------------------------------------- A A ; Entry - DE points to start of the table to use A ; HL = number of bytes per entry A ; Exit - HL points to desired memory slot A 45DD CD 44A2 A mslot: call rech ; get next char 45E0 FE 0D A mslot1: cp cr ; no char there? 45E2 CA 226D A jp z,error A 45E5 CD 45F2 A call dchk ; test value A 45E8 D5 A push de 45E9 16 00 A ld d,0 ; HL = number of bytes per entry 45EB 5F A ld e,a ; get request into DE 45EC CD 46C2 A call mulhd ; multiply request by number of bytes A ; per entry 45EF D1 A pop de ; point to table to use 45F0 19 A add hl,de ; add offset into table A 45F1 C9 A ret ; HL is pointing to desired memory slot A A A ;----------------------------------------------------------------------------- A ; Subroutine DCHK Convert character to binary and only allow 0 to 9 A ;----------------------------------------------------------------------------- A A 45F2 CD 4435 A dchk: call nib ; convert to binary 45F5 DA 226D A jp c,error ; not hex 45F8 FE 0A A cp 0ah ; greater than 9? 45FA D2 226D A jp nc,error ; only 0 to 9 allowed 45FD C9 A ret A A ;---------------------------------------------------------------------------- A ; Library: ZSLIB A ; Version: 3.0 A ; Module: BCD2JUL A ; Version: 1.1 A ; Author: Gene Pizzetta A ; Date: July 9, 1991 A ; Changes: Was destroying BCD date in buffer, an undocumented feature. A ; Now uses a scratch buffer. A ; A ; Version: 1.0 A ; Author: Bridger Mitchell, Howard Goldstein A ; Date: April 16, 1988 A ; A ; BCD2JUL -- BCD to Julian date routine. A ; A ; Entry: HL = address of date string in BCD yy mm dd A ; Exit: HL = Julian date (1/1/78 = 1) A ; Uses: HL A ; Notes: Covers from January 1, 1978 to December 31, 2077. If year is A ; greater than 78, this routine wraps to the next century. A ; A ; BIN2JUL -- Binary to Julian date routine. A ; A ; Entry: HL = address of date string in binary yy mm dd A ; Exit: HL = Julian date (1/1/78 = 1) A ; Uses: HL A ; Notes: Covers from January 1, 1978 to December 31, 2077. If year is A ; greater than 78, this routine wraps to the next century. A ; A ; PUBLIC BCD2JUL A ; PUBLIC BIN2JUL A A ; EXTRN JBCD2BN,DPERMO ; ZSLIB A A ; BCD to Julian date A 45FE A BCD2JUL: 45FE F5 A push af 45FF C5 A push bc 4600 D5 A push de 4601 11 80AD A ld de,tmpbuf ; DE -> temporary buffer 4604 D5 A push de ; save buffer address 4605 06 03 A ld b,3 ; convert BCD yy mm dd to binary 4607 7E A BINLP: ld a,(hl) ; at HL... 4608 CD 466B A call JBCD2BN 460B 12 A ld (de),a 460C 23 A inc hl 460D 13 A inc de A 460E 05 A dec b 460F C2 4607 A jp nz,BINLP A 4612 E1 A pop hl ; recover buffer address in HL 4613 D1 A pop de 4614 C1 A pop bc 4615 F1 A pop af A A ; fall thru... A A ; Binary to Julian date A 4616 A BIN2JUL: 4616 F5 A push af 4617 C5 A push bc 4618 D5 A push de 4619 7E A ld a,(hl) ; A = year 461A 23 A inc hl A 461B F5 A push af 461C 7E A ld a,(hl) 461D 4F A ld c,a 461E F1 A pop af A 461F 23 A inc hl 4620 E5 A push hl ; save pointer to day 4621 F5 A push af ; save year A A ; Set HL = initial Julian value of 12/31/77 A 4622 21 0000 A ld hl,0 4625 D6 4E A sub 78 4627 CA 4641 A jp z,B2JUL3 462A D2 462F A jp nc,B2JUL0 462D C6 64 A add a,100 ; greater than 78, assume next century 462F 47 A B2JUL0: ld b,a ; B = number of years greater than 78 4630 3E 01 A ld a,1 ; init modulo 4 counter 4632 11 016D A ld de,365 ; days/year 4635 19 A B2JUL1: add hl,de ; calc Julian value of (1/1/year - 1) 4636 3C A inc a 4637 E6 03 A and 3 ; every 4 years, 4639 C2 463D A jp nz,B2JUL2 463C 23 A inc hl ; ..add 1 for leap year 463D A B2JUL2: 463D 05 A dec b 463E C2 4635 A jp nz,B2JUL1 A A A ; HL now = number of days in years before current year A 4641 F1 A B2JUL3: pop af 4642 E6 03 A and 3 ; if current year == leap year 4644 C2 464E A jp nz,B2JUL5 4647 79 A ld a,c 4648 FE 03 A cp 3 ; ..and month >= March 464A DA 464E A jp c,B2JUL5 464D 23 A inc hl ; ..add the extra day (Feb 29) A 464E 41 A B2JUL5: ld b,c ; B = month = number of months + 1 to sum 464F 11 467B A ld de,DPERMO ; point at table 4652 C3 4659 A jp B2JUL7 A 4655 CD 4665 A B2JUL6: call ADDHL ; add number of days in this month 4658 13 A inc de ; bump table pointer 4659 A B2JUL7: 4659 05 A dec b 465A C2 4655 A jp nz,B2JUL6 A A 465D D1 A pop de ; pointer to day 465E CD 4665 A call ADDHL 4661 D1 A pop de 4662 C1 A pop bc 4663 F1 A pop af 4664 C9 A ret A 4665 1A A ADDHL: ld a,(de) ; add day of current month A 4666 85 A ADDA2HL:add l 4667 6F A ld l,a 4668 D0 A ret nc 4669 24 A inc h 466A C9 A ret A 466B A JBCD2BN: 466B D5 A push de 466C 5F A ld e,a ; save original byte 466D E6 0F A and 0fh 466F 57 A ld d,a ; lower nibble 4670 7B A ld a,e 4671 E6 F0 A and 0f0h ; mask LSN 4673 0F A rrca ; x2 4674 5F A ld e,a 4675 0F A rrca 4676 0F A rrca ; x4 4677 83 A add a,e ; x8 4678 82 A add a,d ; x10 4679 D1 A pop de 467A C9 A ret A A 467B 1F A DPERMO: db 31 ; jan 467C 1C A db 28 ; feb 467D 1F A db 31 ; mar 467E 1E A db 30 ; apr 467F 1F A db 31 ; may 4680 1E A db 30 ; jun 4681 1F A db 31 ; jul 4682 1F A db 31 ; aug 4683 1E A db 30 ; sep 4684 1F A db 31 ; oct 4685 1E A db 30 ; nov 4686 1F A db 31 ; dec A A A ;----------------------------------------------------------------------------- A ; MOVEIT - Move a block of memory from one location to another A ; A ; Entry: BC = number of bytes to move A ; HL = Source Address A ; DE = Destination Address A ;----------------------------------------------------------------------------- A 4687 7E A moveit: ld a,(hl) ; get the source byte 4688 12 A ld (de),a ; put in destination location 4689 23 A inc hl ; increment source pointer 468A 13 A inc de ; increment destination pointer 468B 0B A dec bc ; decrement byte counter 468C 78 A ld a,b ; test for zero in A because 468D B1 A or a,c ; dec bc does not affect flags 468E C2 4687 A jp nz,moveit ; loop back if more bytes left to copy 4691 C9 A ret A A A ;----------------------------------------------------------------------------- A ; PADC -- Print A as two decimal characters A ;----------------------------------------------------------------------------- A 4692 A padc: 4692 C5 A push bc ; save registers 4693 F5 A push af ; A A ; Print Routine A 4694 06 0A A padc1: ld b,10 ; print tens 4696 CD 46A1 A call pac 4699 C6 30 A add '0' ; convert to ASCII 469B CD 1F18 A call cout ; print 469E F1 A pop af ; restore A 469F C1 A pop bc ; restore registers 46A0 C9 A ret A A A ; Print result of division of A by B w/leading space (intiger division) A 46A1 0E 00 A pac: ld c,0 ; set count 46A3 90 A pacl: sub b ; compute count 46A4 DA 46AB A jp c,pacd 46A7 0C A inc c ; increment count 46A8 C3 46A3 A jp pacl 46AB 80 A pacd: add a,b ; add B back in 46AC 5F A ld e,a ; save A 46AD 79 A pacd1: ld a,c ; get count 46AE C6 30 A add '0' ; convert to decimal 46B0 CD 1F18 A call cout ; print it 46B3 7B A ld a,e ; restore A 46B4 C9 A ret A A A A ;---------------------------------------------------------------------------- A ; SUBHD -- Subtract DE from HL, result in HL A ; Return with HL=result, CARRY set if HL DE A 472D 7C A ld a,h 472E BA A cp d ; H > D? 472F DA 4765 A jp c,dovfl ; zero result if H < D 4732 C2 473A A jp nz,dnovfl 4735 7D A ld a,l 4736 BB A cp e ; L > E? 4737 DA 4765 A jp c,dovfl ; zero result if HL < DE 473A A dnovfl: 473A 06 10 A ld b,16 ; 16 loops 473C A dvhd: 473C CD 476B A call shftlh ; shift divident left 473F E5 A push hl ; save dividend 4740 2A 805A A ld hl,(acc) ; get acc 4743 CD 477C A call shflch ; rotate acc and move in carry 4746 22 805A A ld (acc),hl ; new acc 4749 7D A ld a,l ; low comparison 474A 93 A sub e ; compare and subtract 474B 6F A ld l,a 474C 7C A ld a,h ; high comparison 474D 9A A sbc a,d ; compare and subtract 474E 67 A ld h,a 474F DA 475D A jp c,dvhd0 4752 22 805A A ld (acc),hl ; save new acc 4755 E1 A pop hl ; get dividend 4756 7D A ld a,l ; place in A 1 to quotient 4757 F6 01 A or 1 4759 6F A ld l,a 475A C3 475E A jp dvhd1 475D A dvhd0: 475D E1 A pop hl ; get dividend and leave lsb at zero 475E A dvhd1: 475E 05 A dec b ; count down 475F C2 473C A jp nz,dvhd 4762 A dvret: 4762 C1 A pop bc 4763 F1 A pop af 4764 C9 A ret 4765 A dovfl: 4765 21 0000 A ld hl,0 ; result is zero 4768 C3 4762 A jp dvret A A A ; Shift Routines A 476B A shftlh: ; shift HL left 476B F5 A push af 476C A7 A and a ; clear carry 476D A shfl: 476D 7D A ld a,l ; shift low 476E 17 A rla ; rotate 9-bit acc left 476F 6F A ld l,a 4770 7C A ld a,h ; shift high 4771 17 A rla 4772 67 A ld h,a 4773 D2 4779 A jp nc,okret 4776 F1 A pop af 4777 37 A scf ; set carry for overflow 4778 C9 A ret 4779 A okret: 4779 F1 A pop af 477A B7 A or a ; clear carry for no overflow 477B C9 A ret 477C A shflch: ; shift HL left, but shift in carry flag 477C F5 A push af 477D C3 476D A jp shfl A A A ; ---------------------------------------------------------------------------- A ; Subroutine TSTTX - Key Main Transmitters. Wait for them A ; to come on. Keep them keyed if already on. A ; ---------------------------------------------------------------------------- A 4780 3A 804B A tsttx: ld a,(port7s) ; get current status of transmitters 4783 E6 03 A and utx+vtx 4785 CC 478B A call z,tsttx1 ; if not on, wait for them to come up 4788 C3 40F8 A jp htime ; keep them on A 478B CD 40F8 A tsttx1: call htime 478E C3 243F A jp onesec ; wait A A A ;----------------------------------------------------------------------------- A ; Check for existance of the SSI-263 Speech Chip A ;----------------------------------------------------------------------------- A A ; Entry: none A ; Exit: Flag - NZ = speech chip present and ready A ; Z = speech chip not ready or not there A ; also forces CW/Speech mode 1 A ; Uses: A A 4791 CD 2444 A chksp: call halfsec ; should be stable 4794 3A B000 A ld a,(port0) 4797 E6 01 A and spreq ; look at request bit 4799 C0 A ret nz ; chip there and ready A 479A 3E 01 A ld a,1 ; force MCW mode 1 479C 32 8218 A ld (cwena),a A 479F C9 A ret A A A A ;---------------------- end of file RPTSUBS.Z80 ------------------------------ 0000 1 if $ gt 7fffh 1 Program is greater than 32K! endif psiz macro plen .printx plen endm 0010 .radix 16 47A0 psiz %$ 000A .radix 10 47A0 psiz %(($/128)+1) include memory.z80 A A ;============================================================================ A ; System RAM storage definitions A ;============================================================================ A 8000 A org rambase A A ;---------------------------------------------------------------------------- A ; Warning! ibuf is a circular buffer which must start at an even A ; page boundary. Only one byte is used to index into the buffer. A ; The buffer size can be changed by varying IBLEN up to 256 but A ; it will be of no value unless CBLEN is also increased. A 0020 A iblen equ 32 8000 0020 A ibuf: defs iblen ; set up 32 byte character buffer 8020 A A ; ************************* DO NOT MOVE IBUF! **************************** A ;---------------------------------------------------------------------------- A 8020 0001 A iptr: defs 1 ; interrupt driven input pointer to ibuf 8021 0001 A optr: defs 1 ; CIN driven output pointer to ibuf 8022 A 0020 A cblen equ 32 8022 0020 A cbuf: defs cblen 8042 0002 A cptr: defs 2 ; Pointer to cbuf 8044 0001 A clen: defs 1 ; Command string length 8045 A 8045 0001 A port0s: defs 1 ; I/O Port status bytes 8046 0001 A port1s: defs 1 8047 0001 A port2s: defs 1 8048 0001 A port4s: defs 1 8049 0001 A port5s: defs 1 804A 0001 A port6s: defs 1 804B 0001 A port7s: defs 1 804C A A 804C 0001 A intcnt: defs 1 ; interrupt cycle counter 804D 0002 A idtim: defs 2 ; ID timer 804F 0001 A idspd: defs 1 ; ID dot length timer (speed) 8050 0002 A trate: defs 2 ; PIT tone rate counter value 8052 0001 A crt: defs 1 ; status refresh time 8053 0001 A eol: defs 1 ; end-of-line flag (monitor loop idle) 8054 0002 A vrtim: defs 2 ; 6M RX time-out timer 8056 0002 A urtim: defs 2 ; 450 RX time-out timer 8058 0001 A acf: defs 1 ; Aux R1 cos flag 8059 0001 A bcf: defs 1 ; Aux R2 cos flag 805A 0002 A acc: defs 2 ; temp accumulator (mulhd, divhd routines) 805C 0001 A ovfl: defs 1 ; overflow flag (mulhd, divhd routines) 805D 0001 A vadly: defs 1 ; 6M Access Delay 805E 0001 A vrdly: defs 1 ; 6M Release Delay 805F 0001 A vgdly: defs 1 ; 6M audio Access Delay 8060 0001 A uadly: defs 1 ; 450 Access Delay 8061 0001 A urdly: defs 1 ; 450 Release Delay 8062 0001 A ugdly: defs 1 ; 450 audio Access Delay 8063 0001 A aadly: defs 1 ; Aux R1 Access Delay 8064 0001 A ardly: defs 1 ; Aux R1 Release Delay 8065 0001 A badly: defs 1 ; Aux R2 Access Delay 8066 0001 A brdly: defs 1 ; Aux R2 Release Delay 8067 0001 A vdcos: defs 1 ; 6M Delayed COS 8068 0001 A udcos: defs 1 ; 450 Delayed COS 8069 0001 A adcos: defs 1 ; Aux R1 Delayed COS 806A 0001 A bdcos: defs 1 ; Aux R2 Delayed COS 806B 0001 A pltv: defs 1 ; 6M temp PL override flag 806C 0001 A pltu: defs 1 ; 450 temp PL override flag 806D 0002 A tmppl: defs 2 ; temp PL override Timer 806F 0001 A gpt: defs 1 ; General Purpose Timer 8070 0001 A cwptt: defs 1 ; CW PTT flag 8071 0002 A teltim: defs 2 ; Patch timer 8073 0001 A ptchm: defs 1 ; Autopatch Control flag 8074 0002 A hang: defs 2 ; Transmitter Hang Timer 8076 0001 A rmute: defs 1 ; Radio DTMF Mute timer 8077 0001 A tmute: defs 1 ; Telephone DTMF Mute timer 8078 0001 A digitr: defs 1 ; last Radio DTMF digit memory 8079 0001 A digitp: defs 1 ; last Phone DTMF digit memory 807A 0001 A dtmfn: defs 1 ; DTMF Decoder select byte 807B 0001 A bdtmfr: defs 1 ; Radio DTMF interrupt block control 807C 0001 A bdtmft: defs 1 ; Telephone DTMF interrupt block control 807D 0001 A rdvdly: defs 1 ; Radio DTMF Data Valid Delay 807E 0002 A dnulm: defs 2 ; DTMF Pass-Through Delay 8080 0001 A atime: defs 1 ; Control time-out timer 8081 0001 A crflag: defs 1 ; CR Flag 8082 0001 A bidflg: defs 1 ; Broadcast ID flag 8083 0001 A cwtf: defs 1 ; CW Transpond flag 8084 0001 A alpha: defs 1 ; DTMF Alpha character flag 8085 0001 A lhang: defs 1 ; Link TX Hang Time 8086 0001 A xon: defs 1 ; X-ON/X-OFF wait status 8087 0001 A tickt: defs 1 ; Watchdog Tick time out time 8088 0001 A tickm: defs 1 ; Watchdog state toggle 8089 0001 A sflag: defs 1 ; star flag (control sequence pending) 808A 0001 A pflag: defs 1 ; pound flag (macro sequence pending) 808B 0001 A mampm: defs 1 ; AM/PM indicator 808C 0001 A idptim: defs 1 ; ID PTT Hang Timer 808D 0001 A rgdlya: defs 1 ; ring detect access delay timer 808E 0001 A rgdlyr: defs 1 ; ring detect release delay timer 808F 0001 A rgcnt: defs 1 ; ring count 8090 0002 A rgird: defs 2 ; inter-ring delay 8092 0002 A ansacc: defs 2 ; answer access time 8094 0002 A anshld: defs 2 ; answer hold time 8096 0002 A maxll: defs 2 ; maximum landline time 8098 0001 A llfrg: defs 1 ; ring flag 8099 0001 A llfan: defs 1 ; answer time out flag 809A 0001 A llful: defs 1 ; unlock flag 809B 0001 A llfhl: defs 1 ; hold time out flag 809C 0001 A llfrt: defs 1 ; ring time out flag 809D 0001 A clkp: defs 1 ; clock present flag 809E A timstr equ $ 809E 0001 A myr: defs 1 ; year storage 809F 0001 A mmo: defs 1 ; month storage 80A0 0001 A mdt: defs 1 ; date storage 80A1 0001 A mhrs: defs 1 ; hours storage 80A2 0001 A mmin: defs 1 ; minutes storage 80A3 0001 A msec: defs 1 ; seconds storage 80A4 0001 A st10: defs 1 ; tens of milliseconds storage 80A5 0001 A mda: defs 1 ; day of the week 80A6 0001 A mahrs: defs 1 ; alarm hours storage 80A7 0001 A mamin: defs 1 ; alarm minutes storage 80A8 0001 A cinti: defs 1 ; clock/calendar interrupt status pending 80A9 0001 A cwtmp: defs 1 ; Temporary storage for CWENA 80AA 0002 A attim: defs 2 ; Aux TX time Limit 80AC A 80AC 0001 A chdon: defs 1 ; chime done flag 80AD 0003 A tmpbuf: defs 3 ; julian date conversion buffer 80B0 0001 A eudon: defs 1 ; event update done flag 80B1 0002 A utxlim: defs 2 ; 450 TX usage limit time 80B3 0002 A unact: defs 2 ; inactivity timer 80B5 0001 A dsrflg: defs 1 ; DSR flag 80B6 0001 A cttflg: defs 1 ; aux courtesy tone flag 80B7 0001 A cttflv: defs 1 ; 6M courtesy tone flag 80B8 0001 A cttflu: defs 1 ; 450 courtesy tone flag 80B9 0001 A sdevm: defs 1 ; Speech Deviation Test control flag 80BA 0001 A macsil: defs 1 ; Silent Macro Command flag 80BB A 8200 A org 08200h ; move to next page boundary A A ; This is the table of Foreground Task Flags. It must be in exactly A ; the same order as the Task Address Table in the Foreground A ; routine of the Master Loop. The order determines priority. A 8200 A fgtf equ $ ; Foreground Task Flag Table 8200 0001 A fberm: defs 1 ; Send BEER message 1 8201 0001 A fvtom: defs 1 ; 6M Time-Out Alarm 2 8202 0001 A futom: defs 1 ; 450 Time-Out Alarm 3 8203 0001 A fidtm: defs 1 ; ID Timed-Out 4 8204 0001 A fvctm: defs 1 ; 6M Courtesy Tone Request 5 8205 0001 A fuctm: defs 1 ; 450 Courtesy Tone Request 6 8206 0001 A fpctm: defs 1 ; Landline Courtesy Tone 7 8207 0001 A fpatm: defs 1 ; Patch Timed-Out 8 8208 0001 A ftplm: defs 1 ; Temp PL Override Timed-Out 9 8209 0001 A fdnlm: defs 1 ; DTMF Pass-Thru Timed-Out 10 820A 0001 A fltxm: defs 1 ; Aux TX Timed-Out 11 820B 0001 A fltom: defs 1 ; Landline Control Timed-Out 12 820C 0001 A fucrm: defs 1 ; Update CRT Screen 13 820D A fgtfe equ $ ; mark table end 820D A A ;============================================================================ A ; Memory Storage for System Start-Up Variables A ;============================================================================ A A ; WARNING! This table must be in the same sequence A ; and contain the same number of assigned storage locations A ; as there are bytes in the System Data Table in ROM. A ; It can start anywhere as long as it fits in memory. A 820D A ramdat equ $ ; location to begin storing system data table A A ; Input Port Control Bytes: A 820D 0001 A port0c: defs 1 ; Input Port 0 820E 0001 A port1c: defs 1 ; Receivers P1 820F 0001 A port2c: defs 1 ; Input Port 2 8210 A A ; Output Port Control Bytes A 8210 0001 A port4c: defs 1 ; Output Port 4 8211 0001 A port5c: defs 1 ; Output Port 5 8212 0001 A port6c: defs 1 ; Audio Gates P6 8213 0001 A port7c: defs 1 ; Transmitters P7 8214 A 8214 0001 A uflag: defs 1 ; CRT update control 8215 0001 A umode: defs 1 ; CRT update mode 8216 0001 A mflag: defs 1 ; Macro Functions control 8217 0001 A uadflg: defs 1 ; UAD Functions control 8218 0001 A cwena: defs 1 ; MCW/Speech Mode 8219 0001 A vctmod: defs 1 ; 6M Courtesy Tone Mode 821A 0001 A uctmod: defs 1 ; 450 Courtesy Tone Mode 821B 0001 A dmutc: defs 1 ; DTMF Mute control 821C 0001 A ptchc: defs 1 ; Autopatch control 821D 0001 A dtplv: defs 1 ; 6M DTMF PL control 821E 0001 A dtplu: defs 1 ; 450 DTMF PL control 821F 0001 A vpltf: defs 1 ; 6M PL inhibit timeout control 8220 0001 A upltf: defs 1 ; 450 PL inhibit timeout control 8221 0001 A vplom: defs 1 ; 6M temp PL override control flag 8222 0001 A uplom: defs 1 ; 450 temp PL override control flag 8223 0001 A chena: defs 1 ; chime enable control byte 8224 0001 A limuhf: defs 1 ; 450 TX inactivity time limit control flag 8225 A A A ; User Functions (*2500 Series) A 8225 0001 A mudig1: defs 1 ; first unlock digit 8226 0001 A mudig2: defs 1 ; second unlock digit 8227 A A ; Control Functions (*6900 Series) A 8227 0001 A mcdig1: defs 1 ; first unlock digit 8228 0001 A mcdig2: defs 1 ; second unlock digit 8229 A A ; Default time constants memory stoarge area A 8229 0002 A mdfht: defs 2 ; default main tx hang time 822B 0001 A mdflt: defs 1 ; default aux tx hang time 822C 0001 A mdfit: defs 1 ; default IDPTT time 822D 0002 A mdfcwt: defs 2 ; MCW tone rate counter value 822F 0002 A mdfid: defs 2 ; default ID timer time 7 mins. 8231 0002 A mdfto: defs 2 ; default Time Out timer 3 Mins. 8233 0001 A mdfvad: defs 1 ; default 6M access delay 8234 0001 A mdfvrd: defs 1 ; default 6M release delay 8235 0001 A mdfvgd: defs 1 ; default 6M audio access delay 8236 0001 A mdfuad: defs 1 ; default 450 access delay 8237 0001 A mdfurd: defs 1 ; default 450 release delay 8238 0001 A mdfugd: defs 1 ; default 450 audio access delay 8239 0001 A mdfaad: defs 1 ; default Aux R1 access delay 823A 0001 A mdfard: defs 1 ; default Aux R1 release delay 823B 0001 A mdfbad: defs 1 ; default Aux R2 access delay 823C 0001 A mdfbrd: defs 1 ; default Aux R2 release delay 823D 0002 A mdfatt: defs 2 ; default Aux TX Time Limit 823F 0002 A mdftpl: defs 2 ; default Temp PL Override Time Limit 8241 0002 A mdfulm: defs 2 ; default 450 TX inactivity limit 8243 0002 A mdfina: defs 2 ; default inactivity limit reset time 8245 0001 A mdfwpm: defs 1 ; default MCW dot length (speed) 8246 0002 A mdftel: defs 2 ; default patch timer 8248 0001 A mdfctl: defs 1 ; default control system time-out 8249 0001 A mdfrut: defs 1 ; default Radio DTMF Mute delay 824A 0001 A mdftut: defs 1 ; default Telephone DTMF Mute delay 824B 0001 A mdfrdv: defs 1 ; default Radio DTMF Data Valid Delay 824C 0002 A mdfnul: defs 2 ; default DTMF Pass-Through Delay 824E 0001 A mdfrgm: defs 1 ; default # of rings to answer 824F 0002 A mdfird: defs 2 ; default inter-ring delay 8251 0002 A mdfacc: defs 2 ; ring control access delay 8253 0002 A mdfhld: defs 2 ; answer hold time 8255 0002 A mdfmxl: defs 2 ; default maximum landline time 8257 0002 A mdfpct: defs 2 ; default landline courtesy tone time 8259 0001 A muptim: defs 1 ; CRT refresh time 1 sec. 825A 0001 A mdfct1: defs 1 ; Default RX #1 Indicator Char 825B 0001 A mdfct2: defs 1 ; Default RX #2 Indicator Char 825C 0001 A mdfcb1: defs 1 ; Default TX #1 Indicator Char 825D 0001 A mdfcb2: defs 1 ; Default TX #2 Indicator Char 825E 0001 A mdfsr: defs 1 ; Default Speech Rate 825F 0001 A mdfir: defs 1 ; Default Inflection Rate 8260 0001 A mdfar: defs 1 ; Default Articulation Rate 8261 0001 A mdfrd: defs 1 ; Default ring detect delay 8262 0001 A mdfcty: defs 1 ; Default century 8263 A 8263 000C A dial0: defs 12 ; speed dialer entries 826F 000C A dial1: defs 12 827B 000C A dial2: defs 12 8287 000C A dial3: defs 12 8293 000C A dial4: defs 12 829F 000C A dial5: defs 12 82AB 000C A dial6: defs 12 82B7 000C A dial7: defs 12 82C3 000C A dial8: defs 12 82CF 000C A dial9: defs 12 82DB A 82DB 0005 A mac0: defs 5 ; Programmed Macro Codes 82E0 0005 A mac1: defs 5 82E5 0005 A mac2: defs 5 82EA 0005 A mac3: defs 5 82EF 0005 A mac4: defs 5 82F4 0005 A mac5: defs 5 82F9 0005 A mac6: defs 5 82FE 0005 A mac7: defs 5 8303 0005 A mac8: defs 5 8308 0005 A mac9: defs 5 830D A 830D 000A A sch0: defs 10 ; Scheduled Events 8317 000A A sch1: defs 10 8321 000A A sch2: defs 10 832B 000A A sch3: defs 10 8335 000A A sch4: defs 10 833F 000A A sch5: defs 10 8349 000A A sch6: defs 10 8353 000A A sch7: defs 10 835D 000A A sch8: defs 10 8367 000A A sch9: defs 10 8371 A 8371 0009 A twoc0: defs 9 ; Two Meter Frequencies 837A 0009 A twoc1: defs 9 8383 0009 A twoc2: defs 9 838C 0009 A twoc3: defs 9 8395 0009 A twoc4: defs 9 839E 0009 A twoc5: defs 9 83A7 0009 A twoc6: defs 9 83B0 0009 A twoc7: defs 9 83B9 0009 A twoc8: defs 9 83C2 0009 A twoc9: defs 9 83CB A 83CB 0001 A twoac: defs 1 ; Two Meter Active Channel 83CC A A ;---------------------------------------------------------------------------- A ; CRT Parameters Storage A ;---------------------------------------------------------------------------- A 83CC 0007 A inistr: defs 7 ; terminal initialization string 83D3 0005 A dimstr: defs 5 ; dim or reverse video string 83D8 0005 A bristr: defs 5 ; bright or normal video string 83DD 0005 A clsstr: defs 5 ; clear screen string 83E2 0005 A constr: defs 5 ; cursor ON string 83E7 0005 A cofstr: defs 5 ; cursor OFF string 83EC A A ;---------------------------------------------------------------------------- A 83EC A memend equ $ ; mark the end of the RAM data table A 83EC 0020 A mbuf: defs 32 ; command tail storage 840C A 840C A datend equ $ A A ; Place the stack at the very top of memory. A ; We know where it is so we can test for a run-away program. A 8EFF A org ramtop-256 A 8EFF 00FF A defs 255 8FFE 0000 A stack: defs 0 ; this is location 08fffh 8FFE A 8FFF A org ramtop 8FFF 0001 A merr: defs 1 ; controller error type byte 9000 A A 01DF A memlen equ memend-ramdat ; calculate the length of the RAM data table A 0000 A1 if syslen ne memlen A1 err1 equ junk1 ; error out if table lengths don't match A endif A 0000 A1 if datend ge stack-255 A1 err2 equ junk2 ; error out if data reaching stack area A endif A A ; ------------------------ end of file MEMORY.Z80 ---------------------------- A end 0 Error(s) Detected. 36864 Absolute Bytes. 1239 Symbols Detected.