# cpp -undef -nostdinc -traditional -Wcomment -DLANGUAGE_ASSEMBLY -Dz80 -DPROM -DP8x -DRD58 r58.asm # BASE = 0 # # !---------------------------------------------------------------------- # ! # ! Looks like P8E works all right with (unnecessary) P8N saves/restores. # ! # # # # # # !---------------------------------------------------------------------- # ! # ! Select one of 1, RC58 or RB58 # ! # # # # # # # # # # # # # # # # # # # # # # # # # # # # !---------------------------------------------------------------------- # # !---------------------------------------------------------------------- # # !---------------------------------------------------------------------- # # VIP_COUNT = 10 # # !---------------------------------------------------------------------- # ! # ! crc = crchi ^ crc16_table[crclo ^ c] # ! # # # # # # # # # # # # # # # !---------------------------------------------------------------------- # ! # ! Convenience macros # ! # # # # # # # # # # # # # # # # # # # # !---------------------------------------------------------------------- # ! # ! I/O map # ! # # # # # # # # # # # # # # # # # # # # # # # # # # # # # !---------------------------------------------------------------------- # ! # ! FX429 # ! # # # # # # # # # # # # # # # # # # # # # !---------------------------------------------------------------------- # ! # ! 8254 timer # ! # # # # # # # # # # # # # # !---------------------------------------------------------------------- # ! # ! 0x10 defs # ! # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # !---------------------------------------------------------------------- # ! # ! Output latch bits # ! # # # # # # # # # # # # # # # # # # ! # ! Changes only by mainline. # ! # # # # # # # # # # # # # # # # # # !---------------------------------------------------------------------- # ! # ! 0x00 and 0x10 controls # ! # # # # # # # # # # # # # # # # # # # # # # # # !---------------------------------------------------------------------- # ! # ! CU58AF defines # ! # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # !---------------------------------------------------------------------- # ! # ! LATCH bits # ! # # # # # # # # # # # # # # # # # # # # ! Special LCD segments # # # # # # # # # # # # # # # # # # # !---------------------------------------------------------------------- # ! # ! realstart # ! # .text # # .org BASE # L0000: F3 # di ! 1st op has to be 'di' for ram-loaded # # ld a, 0x08 L0001: 3E 08 L0003: D3 60 # out [0x60], a # ld a, 0x80 L0005: 3E 80 L0007: D3 70 # out [0x70], a # # # # # # # # ld hl, 0x0FFF ! Depends on clock freq... XXX shit L0009: 21 FF 0F # 1: L000C: 2B # dec hl L000D: 7C # ld a, h L000E: B5 # or l # jr nz, 1b ! Wait but not too long for defined wd state L000F: 20 FB # L0011: D3 90 # out [0x90], a ! ok, now start # jp start L0013: C3 6B 01 # # # # !---------------------------------------------------------------------- # # .org 0x0038 # L0038: F3 # di ! 1st op has to be 'di' for ram-loaded L0039: D3 90 # out [0x90], a # jp start L003B: C3 6B 01 # # !---------------------------------------------------------------------- # ! # ! NMI # ! # .org 0x0066 # L0066: F3 # di ! IFF1 and IFF2 cleared L0067: D3 90 # out [0x90], a # # # ld c, 0x80 L0069: 0E 80 # ld d, (0x08 | 0x20) & ~0x08 L006B: 16 20 # ld e, (0x08 | 0x20) L006D: 1E 28 # ld b, nvend - nvmisc L006F: 06 2C # ld hl, nvmisc L0071: 21 F4 C1 # 1: L0074: 7E # ld a, [hl] L0075: ED 51 # out [c], d L0077: 77 # ld [hl], a L0078: ED 59 # out [c], e L007A: 23 # inc hl # djnz 1b L007B: 10 F7 # # L007D: D3 90 # out [0x90], a # # ld sp, 1f L007F: 31 84 00 L0082: ED 45 # retn ! restart to (IFF1 still clear) # 1: # .word start ! start in prom L0084: 6B 01 # # # # !---------------------------------------------------------------------- # # banner: L0086: 40 28 23 29 # .ascii "@(#)" L008A: 52 44 35 38 20 31 32 38 2F 38 36 2E 35 31 32 35 # .ascii "RD58 128/86.5125" L009A: 20 # .ascii " " # # L009B: 50 38 4E 2F 50 38 45 20 # .ascii "P8N/P8E " # # # L00A3: 50 52 4F 4D 20 # .ascii "PROM " # # # version: L00A8: 31 2E 31 20 43 55 35 33 2F 43 55 35 38 41 46 20 30 30 30 33 30 37 00 # .asciz "1.1 CU53/CU58AF 000307" # # !---------------------------------------------------------------------- # ! # ! Interrupt table, short-aligned, on one page. # ! # .align 4 L00BF: 00 [ 01 ] # # intvec: # # sio_base: # .word siob_tbe L00C0: F1 02 # .word siob_esc L00C2: 3D 03 # .word siob_rca L00C4: 1E 03 # .word siob_src L00C6: 57 03 # .word sioa_tbe L00C8: 64 03 # .word sioa_esc L00CA: 72 03 # .word sioa_rca L00CC: 6C 03 # .word sioa_src L00CE: F7 03 # # pioa_base: # .word pioa_int L00D0: 05 04 # piob_base: # .word piob_int L00D2: 01 04 # # !---------------------------------------------------------------------- # ! # ! Initialization commands for 0x00, 0x10 and 8254 # ! In that order, A/B, A/B, 0/1/2 ! # ! # # init_chips: # 1: # .byte LO(pioa_base) ! load interrupt vector L00D4: D0 # .byte 0xcf ! set operating mode 3 L00D5: CF # .byte 0xff ! i/o selection, 1 for input, 0 for output L00D6: FF # .byte 0x97 ! set interrupt control, IE, OR, LOW, MASK L00D7: 97 # .byte 0xfe ! input bit monitoring mask, A0. L00D8: FE # PIOA_INIT = . - 1b # # 1: # .byte LO(piob_base) ! load interrupt vector L00D9: D2 # .byte 0xCF ! set operating mode 3 L00DA: CF # .byte 0x3E ! i/o selection, 1 for input, 0 for output L00DB: 3E # .byte 0x97 ! set interrupt control, IE, OR, LOW, MASK L00DC: 97 # !.byte 0xDF ! input bit monitoring mask, only B5 (TMR0) # .byte 0xFF ! input bit monitoring mask, nothing L00DD: FF # PIOB_INIT = . - 1b # # 1: # .byte 0x18 L00DE: 18 L00DF: 04 # .byte 4, 0x04 | 0x40 L00E0: 44 L00E1: 03 # .byte 3, 0xc0 L00E2: C0 L00E3: 05 # .byte 5, 0x60 | 0x02 | 0x80 L00E4: E2 L00E5: 01 # .byte 1, 0x04 | 0x01 L00E6: 05 # SIOA_INIT = . - 1b # # 1: # .byte 0x18 L00E7: 18 L00E8: 04 # .byte 4, 0x04 | 0x40 L00E9: 44 L00EA: 03 # .byte 3, 0xc0 | 0x01 L00EB: C1 L00EC: 05 # .byte 5, 0x60 | 0x02 | 0x80 | 0x08 L00ED: EA L00EE: 01 # .byte 1, 0x04 | 0x01 | 0x02 | 0x10 L00EF: 17 L00F0: 02 # .byte 2, LO(sio_base) L00F1: C0 # SIOB_INIT = . - 1b # # ! # ! All timer-gates are fixed on. # ! timer-clocks 0 and 1 are 4.032 MHz, 2 is 1968.75 Hz # ! # ! System hz is 100, from 0x00 B5 and TMR0_2 # ! # # # LP_3600HZ = 4032000 / 3600 / 100 # # MT_300HZ = (4032000 / (300)) # MT_600HZ = (4032000 / (600)) # MT_1000HZ = (4032000 / (1000)) # MT_1200HZ = (4032000 / (1200)) # MT_1400HZ = (4032000 / (1400)) # MT_1750HZ = (4032000 / (1750)) # # ! Control words, then initial counts. # 1: # .byte 0x00 | 0x30 | 0x06 L00F2: 36 # .byte 0x40 | 0x30 | 0x06 L00F3: 76 # .byte 0x80 | 0x30 | 0x04 L00F4: B4 # TMR_INIT = . - 1b # # .word LP_3600HZ ! LP Filter L00F5: 0B 00 # .word 4 ! TX- and audible tones L00F7: 04 00 # !.word 20 ! 100 Hz clock interrupt to 0x00 B5 # .word -1 ! Slowest possible. unused. L00F9: FF FF # # # !---------------------------------------------------------------------- # ! # ! 76543210 # ! 876543210 # ! # ! PV QQ SS Pwr Vol sQuelch Sig # ! MM-434775 mem frequency # ! # ! 0 1 23456789 # ! 10 1112 # # # # # ! top row # # # # # # !---------------------------------------------------------------------- # ! # ! XXYYZZ # ! 9876543210 # ! # ! V P S vola pwr srssi # ! CH 433500 channel frequency # ! # # ! bottom row # # CU53AN_segs_bottom_row: L00FB: 38 L00FC: 39 L00FD: 3A L00FE: 3B L00FF: 78 L0100: 79 # CU53AN_segs_d_digit_9: .byte 56, 57, 58, 59, 120, 121, 122 L0101: 7A L0102: 3C L0103: 3D L0104: 3E L0105: 3F L0106: 7C L0107: 7D # CU53AN_segs_d_digit_8: .byte 60, 61, 62, 63, 124, 125, 126 L0108: 7E L0109: 00 L010A: 01 L010B: 02 L010C: 03 L010D: 40 L010E: 41 # CU53AN_segs_d_digit_7: .byte 0, 1, 2, 3, 64, 65, 66 L010F: 42 L0110: 04 L0111: 05 L0112: 06 L0113: 07 L0114: 44 L0115: 45 # CU53AN_segs_d_digit_6: .byte 4, 5, 6, 7, 68, 69, 70 L0116: 46 L0117: 08 L0118: 09 L0119: 0A L011A: 0B L011B: 48 L011C: 49 # CU53AN_segs_d_digit_5: .byte 8, 9, 10, 11, 72, 73, 74 L011D: 4A L011E: 0C L011F: 0D L0120: 0E L0121: 0F L0122: 4C L0123: 4D # CU53AN_segs_d_digit_4: .byte 12, 13, 14, 15, 76, 77, 78 L0124: 4E L0125: 10 L0126: 11 L0127: 12 L0128: 13 L0129: 50 L012A: 51 # CU53AN_segs_d_digit_3: .byte 16, 17, 18, 19, 80, 81, 82 L012B: 52 L012C: 14 L012D: 15 L012E: 16 L012F: 17 L0130: 54 L0131: 55 # CU53AN_segs_d_digit_2: .byte 20, 21, 22, 23, 84, 85, 86 L0132: 56 L0133: 18 L0134: 19 L0135: 1A L0136: 1B L0137: 58 L0138: 59 # CU53AN_segs_d_digit_1: .byte 24, 25, 26, 27, 88, 89, 90 L0139: 5A L013A: 1C L013B: 1D L013C: 1E L013D: 1F L013E: 5C L013F: 5D # CU53AN_segs_d_digit_0: .byte 28, 29, 30, 31, 92, 93, 94 L0140: 5E # # ! top row # L0141: 20 L0142: 21 L0143: 22 L0144: 23 L0145: 60 L0146: 61 # CU53AN_segs_u_digit_5: .byte 32, 33, 34, 35, 96, 97, 98 L0147: 62 L0148: 24 L0149: 25 L014A: 26 L014B: 27 L014C: 64 L014D: 65 # CU53AN_segs_u_digit_4: .byte 36, 37, 38, 39, 100, 101, 102 L014E: 66 L014F: 28 L0150: 29 L0151: 2A L0152: 2B L0153: 68 L0154: 69 # CU53AN_segs_u_digit_3: .byte 40, 41, 42, 43, 104, 105, 106 L0155: 6A L0156: 2C L0157: 2D L0158: 2E L0159: 2F L015A: 6C L015B: 6D # CU53AN_segs_u_digit_2: .byte 44, 45, 46, 47, 108, 109, 110 L015C: 6E L015D: 30 L015E: 31 L015F: 32 L0160: 33 L0161: 70 L0162: 71 # CU53AN_segs_u_digit_1: .byte 48, 49, 50, 51, 112, 113, 114 L0163: 72 L0164: 34 L0165: 35 L0166: 36 L0167: 37 L0168: 74 L0169: 75 # CU53AN_segs_u_digit_0: .byte 52, 53, 54, 55, 116, 117, 118 L016A: 76 # # !---------------------------------------------------------------------- # ! # ! Initialization before main # ! # # start: L016B: F3 # di L016C: D3 90 # out [0x90], a # # ld sp, 0 ! stack down from end of ram (last 16kB) L016E: 31 00 00 # # ld a, HI(intvec) L0171: 3E 00 L0173: ED 47 # ld iv, a L0175: ED 5E # im2 # # ! # ! Output latches # ! # # ld a, 0x00 ! volume setting at lowest level L0177: 3E 00 L0179: 32 29 C2 # ld [output_0], a L017C: D3 60 # out [0x60], a # # ld a, 0x80 ! no tx, idle all L017E: 3E 80 L0180: 32 20 C2 # ld [output_1], a L0183: D3 70 # out [0x70], a # L0185: D3 90 # out [0x90], a # ! # ! Prep RAM selects for max workspace # ! # ld a, 0x08 ! select ram 0, i hope, on L0187: 3E 08 L0189: D3 80 # out [0x80], a # # ld a, 1 L018B: 3E 01 L018D: D3 B0 # out [0xB0], a ! select full 16k page of ram on , nop on # # ld a, 0 L018F: 3E 00 L0191: 32 2A C2 # ld [txon], a # L0194: D3 90 # out [0x90], a # # ! # ! Disable NMT modem # ! # # ld a, 0x00 L0196: 3E 00 L0198: D3 A3 # out [0xA0 + 3], a # # ! # ! 0x00, 0x10 and 8254 # ! # # ld a, 0 L019A: 3E 00 L019C: D3 01 # out [0x00+1], a ! B0, EXAL, OFF all zero. SDA low but direction read. # # ld hl, init_chips L019E: 21 D4 00 # # ld bc, ((0x00 + 2) | (( PIOA_INIT) << 8)) L01A1: 01 02 05 L01A4: ED B3 # otir L01A6: D3 90 # out [0x90], a # # ld bc, ((0x00 + 3) | (( PIOB_INIT) << 8)) L01A8: 01 03 05 L01AB: ED B3 # otir L01AD: D3 90 # out [0x90], a # # ! Set output bits, and check if restarted from powerdown nmi. # # ld a, 0 L01AF: 3E 00 L01B1: D3 01 # out [0x00+1], a ! B0, EXAL, OFF all zero, again ? # L01B3: DB 00 # in a, [0x00+0] # and 0x08 L01B5: E6 08 # jp nz, powerdown L01B7: C2 20 18 # # ld bc, ((0x10 + 2) | (( SIOA_INIT) << 8)) L01BA: 01 12 09 L01BD: ED 78 # in a, [c] L01BF: ED B3 # otir L01C1: D3 90 # out [0x90], a # # ld bc, ((0x10 + 3) | (( SIOB_INIT) << 8)) L01C3: 01 13 0B L01C6: ED 78 # in a, [c] L01C8: ED B3 # otir L01CA: D3 90 # out [0x90], a # # ld bc, ((0x20 + 3) | (( TMR_INIT) << 8)) L01CC: 01 23 03 L01CF: ED B3 # otir # ld bc, ((0x20 + 0) | (( 2) << 8)) L01D1: 01 20 02 L01D4: ED B3 # otir # ld bc, ((0x20 + 1) | (( 2) << 8)) L01D6: 01 21 02 L01D9: ED B3 # otir # ld bc, ((0x20 + 2) | (( 2) << 8)) L01DB: 01 22 02 L01DE: ED B3 # otir # L01E0: D3 90 # out [0x90], a # # call cu58af_init ! First init. another below L01E2: CD 3B 1E # L01E5: D3 90 # out [0x90], a # # ld hl, mbusrx_buf L01E7: 21 00 C3 L01EA: 22 21 C2 # ld [mbusrx_rp], hl L01ED: 22 23 C2 # ld [mbusrx_wp], hl # # ld hl, mbustx_buf L01F0: 21 00 C4 L01F3: 22 25 C2 # ld [mbustx_rp], hl L01F6: 22 27 C2 # ld [mbustx_wp], hl # L01F9: D3 90 # out [0x90], a # # ld de, _bss L01FB: 11 00 C3 # ld a, 0 L01FE: 3E 00 # 1: L0200: D3 90 # out [0x90], a # ld hl, _end L0202: 21 F4 C5 L0205: A7 # and a L0206: ED 52 # sbc hl, de # jr z, 1f L0208: 28 04 L020A: 12 # ld [de], a L020B: 13 # inc de # jr 1b L020C: 18 F2 # 1: # ! # ! Initialize variables after bss clear # ! # # # ld hl, packet L020E: 21 D8 C5 L0211: 22 E9 C5 # ld [pkt_ptr], hl ! rewind packet pointer # # call blip L0214: CD 69 1A # # call load_nvdata L0217: CD 8F 2B # L021A: 3A F7 C1 # ld a, [sec100] # cp 100 L021D: FE 64 # jr nc, 1f L021F: 30 0E L0221: 3A F6 C1 # ld a, [seconds] # cp 60 L0224: FE 3C # jr nc, 1f L0226: 30 07 L0228: 3A F5 C1 # ld a, [minutes] # cp 60 L022B: FE 3C # jr c, 2f L022D: 38 0E # 1: # ld a, 0 L022F: 3E 00 L0231: 32 F7 C1 # ld [sec100], a L0234: 32 F6 C1 # ld [seconds], a L0237: 32 F5 C1 # ld [minutes], a L023A: 32 F4 C1 # ld [hours], a # 2: # ld hl, 1 L023D: 21 01 00 L0240: 22 A5 C5 # ld [energy_unit_per_second], hl # # ld a, -1 L0243: 3E FF L0245: 32 82 C5 # ld [key], a L0248: 32 81 C5 # ld [lastkey], a L024B: 32 80 C5 # ld [lastdigit], a # L024E: D3 90 # out [0x90], a # # # ! # ! Initialize NMT modem # ! # # ld a, 0x04 L0250: 3E 04 L0252: D3 A3 # out [0xA0 + 3], a ! Write 04 to control register # # ld hl, 10000 L0254: 21 10 27 # 1: L0257: D3 90 # out [0x90], a # L0259: 2B # dec hl L025A: 7C # ld a, h L025B: B5 # or l # jr nz, 1b ! Wait at least 1 bit. L025C: 20 F9 # # ld a, 0x00 L025E: 3E 00 L0260: D3 A3 # out [0xA0 + 3], a ! Write zeros to control register # # # L0262: D3 90 # out [0x90], a # # ld b, 2 L0264: 06 02 # ld c, 0 L0266: 0E 00 # ld d, 0 ! delay 2 * 256 * 256 L0268: 16 00 # 1: L026A: D3 90 # out [0x90], a L026C: 00 # nop L026D: 00 # nop L026E: 00 # nop L026F: 00 # nop L0270: 15 # dec d # jr nz, 1b L0271: 20 F7 L0273: 0D # dec c # jr nz, 1b L0274: 20 F4 L0276: 05 # dec b # jr nz, 1b ! Give time for LCD to reset itself ! L0277: 20 F1 # L0279: DB 23 # in a, [0x20+3] ! dummy read to raise 0x00 B5 (remove int) L027B: D3 90 # out [0x90], a # # call cu58af_init L027D: CD 3B 1E # L0280: D3 90 # out [0x90], a # L0282: DB 13 # in a, [0x10+3] # ld a, 0x10 L0284: 3E 10 L0286: D3 13 # out [0x10+3], a L0288: DB 13 # in a, [0x10+3] # and 0x10 ! inverted... L028A: E6 10 # jp z, 1f ! go if LOCAL idle high L028C: CA 94 02 # ld a, 1 L028F: 3E 01 L0291: 32 F1 C5 # ld [local_mode], a # 1: # L0294: DB 12 # in a, [0x10+2] # ld a, 0x10 L0296: 3E 10 L0298: D3 12 # out [0x10+2], a L029A: DB 12 # in a, [0x10+2] # and 0x20 ! inverted... L029C: E6 20 # jp nz, 1f ! go if DA low, idle state DA low vs. /INT high L029E: C2 A6 02 # ld a, 1 L02A1: 3E 01 L02A3: 32 F0 C5 # ld [cu_is_alfa], a # 1: # # !------- L02A6: 3A F0 C5 # ld a, [cu_is_alfa] L02A9: B7 # or a # ld a, (1 << 2) L02AA: 3E 04 # jr nz, 1f L02AC: 20 0C # ld hl, segments + (0x63 / 8) L02AE: 21 0C C5 L02B1: CB DE # set 0x63 % 8, [hl] # # ld hl, segments + (0x4f / 8) L02B3: 21 09 C5 L02B6: CB FE # set 0x4f % 8, [hl] # # ld a, (1 << 5) L02B8: 3E 20 # 1: L02BA: 32 40 C5 # ld [indicators], a # # !------- # ld a, 1 L02BD: 3E 01 L02BF: 32 EF C5 # ld [portable], a ! Assume /POR L02C2: DB 01 # in a, [0x00+1] # and 0x02 L02C4: E6 02 # jr z, 1f L02C6: 28 08 # ld a, 0 L02C8: 3E 00 L02CA: 32 EF C5 # ld [portable], a ! Not portable # call cu_lights_on L02CD: CD C9 2B # 1: L02D0: FB # ei # L02D1: 3A FA C1 # ld a, [currmem] # call getmemflags L02D4: CD 1A 13 L02D7: 32 79 C5 # ld [memflags], a # # ld a, VIP_COUNT L02DA: 3E 0A # ld de, vip_list ! destination L02DC: 11 A8 C5 # 1: # ld hl, currmem L02DF: 21 FA C1 # ld bc, 4 L02E2: 01 04 00 L02E5: ED B0 # ldir ! one record L02E7: 3D # dec a # jr nz, 1b ! VIP_COUNT times L02E8: 20 F5 # # jp main L02EA: C3 71 06 # # !---------------------------------------------------------------------- # # doreti: L02ED: F1 # pop af L02EE: FB # ei L02EF: ED 4D # reti # # !---------------------------------------------------------------------- # ! # ! 0x10 interrupts # ! # # siob_tbe: L02F1: F5 # push af L02F2: 3A 41 C5 # ld a, [mbustx_cnt] L02F5: 3D # dec a L02F6: 32 41 C5 # ld [mbustx_cnt], a # jr z, siob_tbe_close L02F9: 28 14 L02FB: E5 # push hl L02FC: 2A 25 C2 # ld hl, [mbustx_rp] L02FF: 7E # ld a, [hl] L0300: 2C # inc l L0301: 22 25 C2 # ld [mbustx_rp], hl L0304: E1 # pop hl L0305: D3 11 # out [0x10+1], a # ld a, 25 L0307: 3E 19 L0309: 32 43 C5 # ld [mbus_timer], a ! keep transmit timer on # jp doreti L030C: C3 ED 02 # # siob_tbe_close: # ld a, 0x28 L030F: 3E 28 L0311: D3 13 # out [0x10+3], a # jp doreti L0313: C3 ED 02 # # siob_rca_drop: # call bleep L0316: CD 74 1A # # siob_rca_ignore: L0319: DB 11 # in a, [0x10+1] # # jp doreti L031B: C3 ED 02 # # siob_rca: L031E: F5 # push af L031F: 3A 43 C5 # ld a, [mbus_timer] L0322: B7 # or a # jr nz, siob_rca_ignore L0323: 20 F4 L0325: 3A 42 C5 # ld a, [mbusrx_cnt] L0328: 3C # inc a # jr z, siob_rca_drop ! no room L0329: 28 EB L032B: 32 42 C5 # ld [mbusrx_cnt], a L032E: E5 # push hl L032F: 2A 23 C2 # ld hl, [mbusrx_wp] L0332: DB 11 # in a, [0x10+1] L0334: 77 # ld [hl], a L0335: 2C # inc l L0336: 22 23 C2 # ld [mbusrx_wp], hl L0339: E1 # pop hl # jp doreti L033A: C3 ED 02 # # ! # ! 0x10 B ext/status change # ! # siob_esc: L033D: F5 # push af L033E: DB 13 # in a, [0x10+3] # and 0x20 L0340: E6 20 L0342: 3A 84 C5 # ld a, [pttdn] # jr z, 1f L0345: 28 04 L0347: CB C7 # set 0, a # jr 2f L0349: 18 02 # 1: L034B: CB 87 # res 0, a # 2: L034D: 32 84 C5 # ld [pttdn], a # # ld a, 0x10 L0350: 3E 10 L0352: D3 13 # out [0x10+3], a # jp doreti L0354: C3 ED 02 # # ! # ! 0x10 B special receive condition # ! # siob_src: L0357: F5 # push af L0358: DB 11 # in a, [0x10+1] # ld a, 0x30 L035A: 3E 30 L035C: D3 13 # out [0x10+3], a # # call bleep L035E: CD 74 1A # # jp doreti L0361: C3 ED 02 # # sioa_tbe: L0364: F5 # push af # ld a, 0x28 L0365: 3E 28 L0367: D3 12 # out [0x10+2], a # jp doreti L0369: C3 ED 02 # # sioa_rca: L036C: F5 # push af L036D: DB 10 # in a, [0x10+0] # jp doreti L036F: C3 ED 02 # # ! # ! 0x10 A ext/status change # ! # ! # ! CU53 and CU58AF behave differently. # ! # ! CU53 raises DA on make, and drops it on break. # ! CU58AF drops /INT each time a button makes or breaks. # ! 'keydown' flags a pressed key, and is also used for debouncing. # ! When it increments to 10 in systick() the data is fetched from CU. # ! With CU53 the break is detected here, but CU58AF has to fetch # ! nil data with i2c. 'keydown' is restarted from 1 on each i2c /INT. # ! # sioa_esc: L0372: F5 # push af # # ! # ! /CTS inverts the input... # ! L0373: 3A F0 C5 # ld a, [cu_is_alfa] L0376: B7 # or a # jr nz, 3f L0377: 20 0F # L0379: DB 12 # in a, [0x10+2] # and 0x20 L037B: E6 20 # jp nz, 1f ! go (skip) if DA low L037D: C2 96 03 L0380: 3A 85 C5 # ld a, [keydown] L0383: B7 # or a # jr nz, 2f ! go if already seen it L0384: 20 2A # jr 4f L0386: 18 07 # 3: L0388: DB 12 # in a, [0x10+2] # and 0x20 L038A: E6 20 # jp z, 2f ! go (skip) if /INT high. We only look for drops. L038C: CA B0 03 # 4: # ld a, 1 L038F: 3E 01 L0391: 32 85 C5 # ld [keydown], a ! start debouncing # jr 2f L0394: 18 1A # 1: # ld a, 0 L0396: 3E 00 L0398: 32 46 C5 # ld [key_timer], a L039B: 32 85 C5 # ld [keydown], a L039E: 3A 80 C5 # ld a, [lastdigit] # cp -1 L03A1: FE FF # jr z, 2f L03A3: 28 0B L03A5: 3A 80 C5 # ld a, [lastdigit] L03A8: 32 82 C5 # ld [key], a ! Quick press of digit. # ld a, -1 L03AB: 3E FF L03AD: 32 80 C5 # ld [lastdigit], a # 2: # # L03B0: 3A 2A C2 # ld a, [txon] L03B3: B7 # or a # jr nz, 1f ! ignore during xmit L03B4: 20 38 L03B6: DB A3 # in a, [0xA0 + 3] # and 0x40 | 0x01 L03B8: E6 41 # jr z, 1f ! no sync nor data L03BA: 28 32 L03BC: E5 # push hl # cp 0x40 L03BD: FE 40 # jr nz, 3f ! not sync only (never both simultaneously ?!?!?) L03BF: 20 08 # ld hl, packet L03C1: 21 D8 C5 L03C4: 22 E9 C5 # ld [pkt_ptr], hl ! rewind packet pointer # jr 2f L03C7: 18 24 # 3: # and 0x01 L03C9: E6 01 # jr z, 2f L03CB: 28 20 L03CD: DB A2 # in a, [0xA0 + 2] L03CF: 2A E9 C5 # ld hl, [pkt_ptr] L03D2: 77 # ld [hl], a L03D3: 23 # inc hl L03D4: 22 E9 C5 # ld [pkt_ptr], hl L03D7: 7D # ld a, l # cp LO(packet + SIZE(packet)) L03D8: FE E0 # jr nz, 2f L03DA: 20 11 # ld hl, packet L03DC: 21 D8 C5 L03DF: 22 E9 C5 # ld [pkt_ptr], hl ! rewind packet pointer L03E2: C5 # push bc L03E3: D5 # push de L03E4: DD E5 # push ix # call check_packet L03E6: CD F9 0C L03E9: DD E1 # pop ix L03EB: D1 # pop de L03EC: C1 # pop bc # 2: L03ED: E1 # pop hl # 1: # # L03EE: DB 23 # in a, [0x20+3] ! dummy read to raise 0x00 B5 (remove int) # # ld a, 0x10 L03F0: 3E 10 L03F2: D3 12 # out [0x10+2], a # jp doreti L03F4: C3 ED 02 # # ! # ! 0x10 A special receive condition # ! # sioa_src: L03F7: F5 # push af L03F8: DB 10 # in a, [0x10+0] # ld a, 0x30 L03FA: 3E 30 L03FC: D3 12 # out [0x10+2], a # jp doreti L03FE: C3 ED 02 # # !---------------------------------------------------------------------- # ! # ! 0x00 interrupts # ! # # ! Change in B5 # ! Should not get this now, as monitormask is empty... # # piob_int: L0401: F5 # push af # # jp doreti L0402: C3 ED 02 # # ! Change in A0, 1968.75 Hz square # # pioa_int: L0405: 08 # ex af L0406: D9 # exx L0407: 0D # dec c # jr z, systick L0408: 28 4C L040A: 05 # dec b # jr z, 1f L040B: 28 0F L040D: 08 # ex af L040E: D9 # exx L040F: FB # ei L0410: ED 4D # reti # 2: L0412: 32 98 C5 # ld [ad_select], a # ld b, 5 L0415: 06 05 L0417: 08 # ex af L0418: D9 # exx L0419: FB # ei L041A: ED 4D # reti # 1: L041C: 3A 98 C5 # ld a, [ad_select] # cp (0x50 + 2) L041F: FE 52 # jr nz, 1f L0421: 20 0D L0423: DB 50 # in a, [0x50] L0425: 32 2F C2 # ld [ad_batt], a # L0428: D3 51 # out [(0x50 + 1)], a ! value not important L042A: D3 51 # out [(0x50 + 1)], a ! twice to settle analog mux, it changed # ld a, (0x50 + 1) L042C: 3E 51 # jr 2b L042E: 18 E2 # 1: # cp (0x50 + 1) L0430: FE 51 # jr nz, 1f L0432: 20 15 L0434: 3A 1B C2 # ld a, [squelch_dir] ! ascending or descending squelch # and 1 ! depends on bit 0 L0437: E6 01 L0439: DB 50 # in a, [0x50] # jr nz, 3f L043B: 20 01 L043D: 2F # cpl # 3: L043E: 32 2E C2 # ld [ad_sql], a # L0441: D3 50 # out [(0x50 + 0)], a ! value not important L0443: D3 50 # out [(0x50 + 0)], a ! twice to settle analog mux, it changed # ld a, (0x50 + 0) L0445: 3E 50 # jr 2b L0447: 18 C9 # 1: L0449: DB 50 # in a, [0x50] L044B: 32 2D C2 # ld [ad_rssi], a # L044E: D3 52 # out [(0x50 + 2)], a ! value not important L0450: D3 52 # out [(0x50 + 2)], a ! twice to settle analog mux, it changed # ld a, (0x50 + 2) L0452: 3E 52 # jr 2b L0454: 18 BC # # systick: L0456: D3 90 # out [0x90], a ! keep watchdog happy. # # ! # ! Hook interest # ! L0458: 3A EB C5 # ld a, [pioa_data] L045B: 6F # ld l, a ! old bits L045C: DB 00 # in a, [0x00+0] L045E: 32 EB C5 # ld [pioa_data], a # and 0x02 L0461: E6 02 # jr z, 9f ! on hook L0463: 28 19 L0465: AD # xor l ! extract change # and 0x02 L0466: E6 02 # jr z, 9f ! not changed L0468: 28 14 # # call cu_lights_on L046A: CD C9 2B # L046D: 3A EF C5 # ld a, [portable] L0470: B7 # or a # jr z, 1f L0471: 28 06 # ld hl, 100 * 5 L0473: 21 F4 01 L0476: 22 4B C5 # ld [light_ltimer], hl ! for 5 seconds. # 1: # ld hl, sir L0479: 21 7A C5 L047C: CB CE # set DPYSIR, [hl] ! Update CU later # 9: # L047E: 3A 19 C2 # ld a, [scan_mode] L0481: B7 # or a # jr z, 9f L0482: 28 15 L0484: 3A 51 C5 # ld a, [scan_timer] L0487: B7 # or a # jr z, 1f L0488: 28 04 L048A: 3D # dec a L048B: 32 51 C5 # ld [scan_timer], a # 1: L048E: 2A 52 C5 # ld hl, [scan_ltimer] L0491: 7C # ld a, h L0492: B5 # or l # jr z, 1f L0493: 28 04 L0495: 2B # dec hl L0496: 22 52 C5 # ld [scan_ltimer], hl # 1: # 9: # L0499: 3A 45 C5 # ld a, [mt_timer] L049C: B7 # or a # jr z, 1f L049D: 28 0F L049F: 3A 29 C2 # ld a, [output_0] L04A2: D3 60 # out [0x60], a L04A4: 3A 45 C5 # ld a, [mt_timer] L04A7: 3D # dec a L04A8: 32 45 C5 # ld [mt_timer], a # call z, stop_marker_tone L04AB: CC E5 1A # 1: # # ! # ! Decrement timer for handset lights # ! L04AE: 3A 85 C5 # ld a, [keydown] L04B1: B7 # or a # jr nz, 1f ! not if button still pressed L04B2: 20 18 L04B4: 3A EF C5 # ld a, [portable] L04B7: B7 # or a # jr z, 1f L04B8: 28 12 L04BA: 2A 4B C5 # ld hl, [light_ltimer] L04BD: 7C # ld a, h L04BE: B5 # or l # jr z, 1f ! not if timer not running L04BF: 28 0B L04C1: 2B # dec hl L04C2: 22 4B C5 # ld [light_ltimer], hl L04C5: 7C # ld a, h L04C6: B5 # or l # jr nz, 1f L04C7: 20 03 # call cu_lights_off ! Time to dim the lights. L04C9: CD E2 2B # 1: # ! # ! Decrement MBUS activity timer # ! L04CC: 3A 43 C5 # ld a, [mbus_timer] L04CF: B7 # or a # jr z, 1f L04D0: 28 04 L04D2: 3D # dec a L04D3: 32 43 C5 # ld [mbus_timer], a # 1: # ! # ! Alert timer # ! L04D6: 2A 49 C5 # ld hl, [alert_ltimer] L04D9: 7C # ld a, h L04DA: B5 # or l # jr z, 1f L04DB: 28 04 L04DD: 2B # dec hl L04DE: 22 49 C5 # ld [alert_ltimer], hl # 1: # ! # ! ccir timer # ! L04E1: 3A 50 C5 # ld a, [ccir_tx_timer] L04E4: B7 # or a # jr z, 1f L04E5: 28 04 L04E7: 3D # dec a L04E8: 32 50 C5 # ld [ccir_tx_timer], a # 1: # ! # ! One second trail after end of xmit # ! L04EB: 3A 4F C5 # ld a, [txtail_timer] L04EE: B7 # or a # jr z, 1f ! Not counting anymore L04EF: 28 0D L04F1: 3A 2A C2 # ld a, [txon] L04F4: B7 # or a # jr nz, 1f ! Still xmit L04F5: 20 07 L04F7: 3A 4F C5 # ld a, [txtail_timer] L04FA: 3D # dec a L04FB: 32 4F C5 # ld [txtail_timer], a ! One 10msec less of tail # 1: # ! # ! See if keypad has data coming and debouncing # ! allows it to be fetched # ! L04FE: 3A 85 C5 # ld a, [keydown] L0501: B7 # or a # jr z, 1f ! not key down L0502: 28 12 L0504: 3C # inc a # jr z, 1f ! been a long time, 256 softicks L0505: 28 0F L0507: 32 85 C5 # ld [keydown], a # cp 10 L050A: FE 0A # jr nz, 1f ! not at debounce-position L050C: 20 08 L050E: 3A 7A C5 # ld a, [sir] L0511: CB C7 # set KEYSIR, a L0513: 32 7A C5 # ld [sir], a ! go get it. # 1: # # ! S meter and squelch control # L0516: 3A 4F C5 # ld a, [txtail_timer] # cp 90 L0519: FE 5A # jp nc, 9f ! Skip if tx during last 100 msec L051B: D2 8D 05 L051E: 3A 9B C5 # ld a, [mton] L0521: B7 # or a # jp nz, 9f ! Skip if tone on. L0522: C2 8D 05 # L0525: 3A 2E C2 # ld a, [ad_sql] L0528: 47 # ld b, a # L0529: 3A 08 C2 # ld a, [squelch_limit_open] L052C: B8 # cp b ! open_limit - rssi # jr nc, 3f ! go if below open limit L052D: 30 1A # 1: # ld a, 1 L052F: 3E 01 L0531: 32 99 C5 # ld [squelch_open], a # L0534: 3A 54 C5 # ld a, [scan_mute] L0537: B7 # or a # jr nz, 1f ! Scanner forced no audio. L0538: 20 35 # # call cu_serv_on L053A: CD FB 2B # 4: L053D: 3A 29 C2 # ld a, [output_0] # or 0x10 L0540: F6 10 L0542: 32 29 C2 # ld [output_0], a L0545: D3 60 # out [0x60], a # jr 1f L0547: 18 26 # 3: L0549: 3A 07 C2 # ld a, [squelch_limit_close] L054C: B8 # cp b ! close_limit - rssi # jr nc, 2f ! go if below close limit L054D: 30 08 L054F: 3A 9A C5 # ld a, [squelch_forced] L0552: B7 # or a # jr nz, 4b ! Manually forced open. L0553: 20 E8 # jr 1f L0555: 18 18 # 2: # call cu_serv_off ! below close limit. close L0557: CD 10 2C # ld a, 0 L055A: 3E 00 L055C: 32 99 C5 # ld [squelch_open], a # L055F: 3A 9A C5 # ld a, [squelch_forced] L0562: B7 # or a # jr nz, 4b ! Manually forced open. L0563: 20 D8 # L0565: 3A 29 C2 # ld a, [output_0] # and ~0x10 L0568: E6 EF L056A: 32 29 C2 # ld [output_0], a L056D: D3 60 # out [0x60], a # 1: # # ! smoothing rssi display # L056F: 3A 2D C2 # ld a, [ad_rssi] L0572: 47 # ld b, a # L0573: 3A 2C C2 # ld a, [srssi] L0576: B8 # cp b ! smoothed - rssi # jr c, 1f ! go if raising L0577: 38 06 L0579: 3A 44 C5 # ld a, [rssi_timer] L057C: 3D # dec a # jr nz, 2f ! go if still timing L057D: 20 0B # 1: # ld a, 1 L057F: 3E 01 L0581: 32 A2 C5 # ld [redraw_req], a L0584: 78 # ld a, b L0585: 32 2C C2 # ld [srssi], a # ld a, 50 ! one second L0588: 3E 32 # 2: L058A: 32 44 C5 # ld [rssi_timer], a # 9: # # ! Typematic # L058D: 3A 85 C5 # ld a, [keydown] L0590: B7 # or a # jr z, 9f L0591: 28 39 L0593: 3A 46 C5 # ld a, [key_timer] L0596: B7 # or a # jr z, 9f L0597: 28 33 L0599: 3D # dec a L059A: 32 46 C5 # ld [key_timer], a # jr nz, 9f L059D: 20 2D L059F: 3A 47 C5 # ld a, [key_speed] L05A2: 32 46 C5 # ld [key_timer], a L05A5: 3A 78 C5 # ld a, [key_time] L05A8: 3C # inc a # jr z, 1f L05A9: 28 03 L05AB: 32 78 C5 # ld [key_time], a # 1: L05AE: 3A 48 C5 # ld a, [key_blips] L05B1: B7 # or a # jr z, 1f L05B2: 28 07 L05B4: 3D # dec a L05B5: 32 48 C5 # ld [key_blips], a # call blip L05B8: CD 69 1A # 1: L05BB: 3A 81 C5 # ld a, [lastkey] # cp 10 L05BE: FE 0A # jr nc, 1f L05C0: 30 02 # or 0x80 ! Repeating digit is a function. L05C2: F6 80 # 1: L05C4: 32 82 C5 # ld [key], a # ld a, -1 L05C7: 3E FF L05C9: 32 80 C5 # ld [lastdigit], a # # 9: # # L05CC: 3A F7 C1 # ld a, [sec100] L05CF: 3C # inc a # cp 100 L05D0: FE 64 # jr c, 1f ! less than full second. L05D2: 38 31 # L05D4: 2A 09 C2 # ld hl, [energy] L05D7: ED 4B A5 C5 # ld bc, [energy_unit_per_second] L05DB: A7 # and a L05DC: ED 42 # sbc hl, bc L05DE: 22 09 C2 # ld [energy], hl ! keep track how much energy is used # L05E1: 3A F6 C1 # ld a, [seconds] L05E4: 3C # inc a # cp 60 L05E5: FE 3C # jr c, 2f ! less than full minute L05E7: 38 17 L05E9: 3A F5 C1 # ld a, [minutes] L05EC: 3C # inc a # cp 60 L05ED: FE 3C # jr c, 3f L05EF: 38 0A L05F1: 3A F4 C1 # ld a, [hours] # add 1 ! overflows to 0... L05F4: C6 01 L05F6: 32 F4 C1 # ld [hours], a # ld a, 0 L05F9: 3E 00 # 3: L05FB: 32 F5 C1 # ld [minutes], a # ld a, 0 L05FE: 3E 00 # 2: L0600: 32 F6 C1 # ld [seconds], a # ld a, 0 L0603: 3E 00 # 1: L0605: 32 F7 C1 # ld [sec100], a # # ld c, 20 ! 1969 / 100 hard ticks to next L0608: 0E 14 # ld b, 5 ! hard ticks between A/D stuff L060A: 06 05 L060C: D9 # exx # # ! softlevel # L060D: 3A 7B C5 # ld a, [nosir] L0610: B7 # or a # jr nz, 1f ! Cannot do it now. L0611: 20 06 L0613: 3A 7A C5 # ld a, [sir] L0616: B7 # or a # jr nz, 2f ! there are sirs L0617: 20 04 # 1: L0619: 08 # ex af # 8: L061A: FB # ei L061B: ED 4D # reti # 2: L061D: CB 7F # bit INSIR, a # jr nz, 1b ! already here L061F: 20 F8 # L0621: CB FF # set INSIR, a L0623: 32 7A C5 # ld [sir], a ! note sir starting # L0626: 08 # ex af # L0627: F5 # push af L0628: C5 # push bc L0629: D5 # push de L062A: E5 # push hl L062B: DD E5 # push ix L062D: FD E5 # push iy ! sir runs with normal regset # # call 8b L062F: CD 1A 06 # call dosir L0632: CD 48 06 L0635: F3 # di # L0636: 3A 7A C5 # ld a, [sir] L0639: CB BF # res INSIR, a L063B: 32 7A C5 # ld [sir], a # L063E: FD E1 # pop iy L0640: DD E1 # pop ix L0642: E1 # pop hl L0643: D1 # pop de L0644: C1 # pop bc L0645: F1 # pop af # L0646: FB # ei # ret L0647: C9 # # dosir: # # ld hl, sir L0648: 21 7A C5 L064B: CB 46 # bit KEYSIR, [hl] # jr z, 1f L064D: 28 05 L064F: CB 86 # res KEYSIR, [hl] # call keypad L0651: CD 60 19 # 1: # ld hl, sir L0654: 21 7A C5 L0657: CB 4E # bit DPYSIR, [hl] # jr z, 1f L0659: 28 05 L065B: CB 8E # res DPYSIR, [hl] # call display L065D: CD 52 1D # 1: # ld hl, sir L0660: 21 7A C5 L0663: CB 56 # bit DTMFSIR, [hl] # jr z, 1f L0665: 28 09 L0667: CB 96 # res DTMFSIR, [hl] L0669: 3A F0 C5 # ld a, [cu_is_alfa] L066C: B7 # or a # call nz, i2c_dtmf L066D: C4 D2 1D # 1: # # ret L0670: C9 # # !---------------------------------------------------------------------- # ! # ! Mainline # ! # # main: # # ! # ! XXX # ! # # # # # # # # L0671: 3A 08 C2 # ld a, [squelch_limit_open] # sub 8 L0674: D6 08 # jr nc, 1f L0676: 30 02 # ld a, 0 L0678: 3E 00 # 1: L067A: 32 07 C2 # ld [squelch_limit_close], a # # ld hl, 1024 ! 12.5 step L067D: 21 00 04 L0680: 22 7E C5 # ld [bstep_R], hl # # # ! Enable modem receiver # # ld a, 0x04 L0683: 3E 04 L0685: D3 A3 # out [0xA0 + 3], a # # # ld a, 0xFF L0687: 3E FF L0689: 32 83 C5 # ld [dark], a L068C: 32 2F C2 # ld [ad_batt], a # # ! # ! End XXX # ! # call set_vola L068F: CD 5B 15 # # ld a, 0 L0692: 3E 00 L0694: 32 2D C2 # ld [ad_rssi], a L0697: 32 2E C2 # ld [ad_sql], a # # call reset_synth L069A: CD 0B 21 # # 1: L069D: 3A 85 C5 # ld a, [keydown] L06A0: B7 # or a # jp nz, 1b ! wait release L06A1: C2 9D 06 L06A4: 3A 84 C5 # ld a, [pttdn] L06A7: B7 # or a # jp nz, 1b ! wait release L06A8: C2 9D 06 # ld a, -1 L06AB: 3E FF L06AD: 32 82 C5 # ld [key], a # # # # # # # # # # call lookup_rfc L06B0: CD 45 2B # call change_rxsynth L06B3: CD 00 22 # # call redraw L06B6: CD A1 1B # call redraw L06B9: CD A1 1B # L06BC: 3A 19 C2 # ld a, [scan_mode] L06BF: B7 # or a # jr z, 1f L06C0: 28 0B L06C2: 32 11 C2 # ld [defscan], a # ld a, 0 L06C5: 3E 00 L06C7: 32 19 C2 # ld [scan_mode], a # call scanner_start L06CA: CD BD 08 # 1: # # mainloop: # call battcheck L06CD: CD 5E 07 # call pttcheck L06D0: CD 9D 16 # call keycheck L06D3: CD B7 07 # call redrawcheck L06D6: CD CB 07 # L06D9: 3A E8 C5 # ld a, [packet_rdy] L06DC: B7 # or a # jr z, 1f L06DD: 28 08 # call packet_for_whom L06DF: CD F9 06 # ld a, 0 L06E2: 3E 00 L06E4: 32 E8 C5 # ld [packet_rdy], a ! Ignores quick successive packets # 1: L06E7: 3A 19 C2 # ld a, [scan_mode] L06EA: B7 # or a # jr z, 1f L06EB: 28 09 L06ED: 2A 55 C5 # ld hl, [scanner_state] L06F0: E5 # push hl # ret L06F1: C9 # scanner_ret: L06F2: E1 # pop hl L06F3: 22 55 C5 # ld [scanner_state], hl # 1: # jp mainloop L06F6: C3 CD 06 # # packet_for_whom: # ld iy, packet_good L06F9: FD 21 E0 C5 # ld ix, mycall L06FD: DD 21 14 C2 # L0701: FD 7E 03 L0704: CB 3F L0706: CB 3F L0708: CB 3F L070A: CB 3F L070C: DD BE 00 L070F: C0 # ld a, [iy + 3]; srl a ; srl a ; srl a ; srl a; cp [ix + 0]; ret nz L0710: FD 7E 03 L0713: E6 0F L0715: DD BE 01 L0718: C0 # ld a, [iy + 3]; and 0xF; cp [ix + 1]; ret nz L0719: FD 7E 04 L071C: CB 3F L071E: CB 3F L0720: CB 3F L0722: CB 3F L0724: DD BE 02 L0727: C0 # ld a, [iy + 4]; srl a ; srl a ; srl a ; srl a; cp [ix + 2]; ret nz L0728: FD 7E 04 L072B: E6 0F L072D: DD BE 03 L0730: C0 # ld a, [iy + 4]; and 0xF; cp [ix + 3]; ret nz L0731: FD 7E 05 L0734: CB 3F L0736: CB 3F L0738: CB 3F L073A: CB 3F L073C: DD BE 04 L073F: C0 # ld a, [iy + 5]; srl a ; srl a ; srl a ; srl a; cp [ix + 4]; ret nz # # call cu_call_on L0740: CD 25 2C # call ding L0743: CD 7F 1A # ld a, 1 L0746: 3E 01 L0748: 32 A4 C5 # ld [call_dpyed], a # L074B: 3A EF C5 # ld a, [portable] L074E: B7 # or a # jr z, 1f ! Not portable -> lights on always L074F: 28 06 # ld hl, 100 * 3 L0751: 21 2C 01 L0754: 22 4B C5 # ld [light_ltimer], hl # 1: # call cu_lights_on L0757: CD C9 2B # # call redraw L075A: CD A1 1B # ret L075D: C9 # # battcheck: # L075E: 3A 4F C5 # ld a, [txtail_timer] ! did xmit lately ? L0761: B7 # or a # jr z, 2f L0762: 28 0E L0764: 3A 2F C2 # ld a, [ad_batt] # cp 80 * 256 / 156 ! 8V L0767: FE 83 # jp c, powerdown L0769: DA 20 18 # cp 90 * 256 / 156 ! 9V, was 11.2V, 184 L076C: FE 93 # jr c, 1f L076E: 38 20 # jr 3f L0770: 18 0C # 2: L0772: 3A 2F C2 # ld a, [ad_batt] # cp 90 * 256 / 156 ! 9V, was 10.2V, 167 L0775: FE 93 # jp c, powerdown L0777: DA 20 18 # cp 100 * 256 / 156 ! 10V, was 11.2V, 184 L077A: FE A4 # jr c, 1f L077C: 38 12 # 3: L077E: 3A F0 C5 # ld a, [cu_is_alfa] L0781: B7 # or a # jr nz, 2f L0782: 20 06 # ld hl, segments + (0x4b / 8) L0784: 21 09 C5 L0787: CB 9E # res 0x4b % 8, [hl] # ret L0789: C9 # 2: # ld hl, segments + ((24 + 1) / 8) L078A: 21 03 C5 L078D: CB 8E # res (24 + 1) % 8, [hl] # ret L078F: C9 # # 1: L0790: 3A F0 C5 # ld a, [cu_is_alfa] L0793: B7 # or a # jr nz, 2f L0794: 20 07 # ld hl, segments + (0x4b / 8) L0796: 21 09 C5 L0799: CB DE # set 0x4b % 8, [hl] # jr 1f L079B: 18 05 # 2: # ld hl, segments + ((24 + 1) / 8) L079D: 21 03 C5 L07A0: CB CE # set (24 + 1) % 8, [hl] # 1: # L07A2: 2A 49 C5 # ld hl, [alert_ltimer] L07A5: 7C # ld a, h L07A6: B5 # or l L07A7: C0 # ret nz # # ld hl, 6000 L07A8: 21 70 17 L07AB: 22 49 C5 # ld [alert_ltimer], hl ! every 60 sec # # ld hl, MT_300HZ L07AE: 21 80 34 # ld d, 100 ! one second alert tone L07B1: 16 64 # call start_marker_tone L07B3: CD D0 1A # # ret L07B6: C9 # # keycheck: # L07B7: 3A 82 C5 # ld a, [key] # cp -1 L07BA: FE FF L07BC: C8 # ret z # L07BD: 4F # ld c, a # ld a, -1 L07BE: 3E FF L07C0: 32 82 C5 # ld [key], a L07C3: 79 # ld a, c # # call dokey L07C4: CD DA 07 # call redraw L07C7: CD A1 1B # ret L07CA: C9 # # redrawcheck: # L07CB: 3A A2 C5 # ld a, [redraw_req] # cp 0 L07CE: FE 00 L07D0: C8 # ret z # # ld a, 0 L07D1: 3E 00 L07D3: 32 A2 C5 # ld [redraw_req], a # call redraw L07D6: CD A1 1B # # ret L07D9: C9 # # dokey: ! whatever we call will do ret # # cp 10 L07DA: FE 0A # jp c, insdig L07DC: DA A0 13 # # cp 'C' L07DF: FE 43 # jp z, backspace L07E1: CA B8 13 # cp 'E' L07E4: FE 45 # jp z, execute L07E6: CA AB 0F # cp '#' L07E9: FE 23 # jp z, command L07EB: CA BF 0E # cp '*' L07EE: FE 2A # jp z, beep1750 L07F0: CA D1 0D # cp '+' L07F3: FE 2B # jp z, up_vola L07F5: CA 5F 15 # cp '-' L07F8: FE 2D # jp z, dn_vola L07FA: CA 6B 15 # cp 'B' L07FD: FE 42 # jp z, monitor_audio L07FF: CA D4 13 # # cp 0x81 L0802: FE 81 # jp z, up_sqlv L0804: CA B8 14 # cp 0x84 L0807: FE 84 # jp z, dn_sqlv L0809: CA D7 14 # cp 0x87 L080C: FE 87 # jp z, def_sqlv L080E: CA 5C 14 # # cp 0x82 L0811: FE 82 # jp z, up_memo L0813: CA C4 12 # cp 0x85 L0816: FE 85 # jp z, dn_memo L0818: CA EF 12 # cp 0x88 L081B: FE 88 # jp z, def_memo L081D: CA 7F 12 # # cp 0x83 L0820: FE 83 # jp z, up_freq L0822: CA 3B 16 # cp 0x86 L0825: FE 86 # jp z, dn_freq L0827: CA 68 16 # cp 0x89 L082A: FE 89 # jp z, def_freq L082C: CA D2 15 # cp 0x80 L082F: FE 80 # jp z, def_vola L0831: CA 19 15 # # cp 'S' L0834: FE 53 # jp z, scanner_start L0836: CA BD 08 # # cp 'R' L0839: FE 52 # jp z, toggle_rptr_or_insert_A L083B: CA 97 0E # # cp 'K' L083E: FE 4B # jp z, step_audio_dst L0840: CA 4F 2C # # ret L0843: C9 # # clear_rejects: # ld a, 2 L0844: 3E 02 L0846: 32 77 C5 # ld [adj_feedback], a # call redraw L0849: CD A1 1B # 1: L084C: 3A 85 C5 # ld a, [keydown] L084F: B7 # or a # jp nz, 1b L0850: C2 4C 08 # ld a, -1 L0853: 3E FF L0855: 32 82 C5 # ld [key], a # # ld a, 0 L0858: 3E 00 L085A: 32 77 C5 # ld [adj_feedback], a # # ld b, 10 * 3 L085D: 06 1E # ld a, 0 L085F: 3E 00 # ld hl, rejects L0861: 21 58 C5 # 1: L0864: 77 # ld [hl], a L0865: 23 # inc hl # djnz 1b L0866: 10 FC # ret L0868: C9 # # add_reject: # ld a, 1 L0869: 3E 01 L086B: 32 77 C5 # ld [adj_feedback], a # call redraw L086E: CD A1 1B # 1: L0871: 3A 78 C5 # ld a, [key_time] # cp 2 L0874: FE 02 # jp nc, clear_rejects L0876: D2 44 08 L0879: 3A 85 C5 # ld a, [keydown] L087C: B7 # or a # jp nz, 1b L087D: C2 71 08 # ld a, -1 L0880: 3E FF L0882: 32 82 C5 # ld [key], a # # ld a, 0 L0885: 3E 00 L0887: 32 77 C5 # ld [adj_feedback], a # L088A: 3A 76 C5 # ld a, [reject_idx] L088D: 3C # inc a # cp 10 L088E: FE 0A # jr c, 1f L0890: 38 02 # ld a, 0 L0892: 3E 00 # 1: L0894: 32 76 C5 # ld [reject_idx], a L0897: 4F # ld c, a # ld b, 0 L0898: 06 00 # ld ix, rejects L089A: DD 21 58 C5 L089E: DD 09 # add ix, bc L08A0: DD 09 # add ix, bc L08A2: DD 09 # add ix, bc L08A4: 3A FB C1 # ld a, [currfreq + 0] L08A7: DD 77 00 # ld [ix + 0], a L08AA: 3A FC C1 # ld a, [currfreq + 1] L08AD: DD 77 01 # ld [ix + 1], a L08B0: 3A FD C1 # ld a, [currfreq + 2] L08B3: DD 77 02 # ld [ix + 2], a # # ld hl, scan_do_step L08B6: 21 51 09 L08B9: 22 55 C5 # ld [scanner_state], hl # # ret L08BC: C9 # # scanner_start: # ld a, 0 L08BD: 3E 00 L08BF: 32 9A C5 # ld [squelch_forced], a ! Scanner removes hard sq open. # L08C2: 3A F0 C5 # ld a, [cu_is_alfa] L08C5: B7 # or a # jr nz, 1f L08C6: 20 05 # ld hl, segments + (0x6b / 8) L08C8: 21 0D C5 L08CB: CB 9E # res 0x6b % 8, [hl] # 1: # call redraw L08CD: CD A1 1B # 1: L08D0: 3A 78 C5 # ld a, [key_time] # cp 1 L08D3: FE 01 # jp nc, add_reject L08D5: D2 69 08 L08D8: 3A 85 C5 # ld a, [keydown] L08DB: B7 # or a # jr nz, 1b L08DC: 20 F2 # ld a, -1 L08DE: 3E FF L08E0: 32 82 C5 # ld [key], a # # ld hl, scan_do_step L08E3: 21 51 09 L08E6: 22 55 C5 # ld [scanner_state], hl # L08E9: 3A F0 C5 # ld a, [cu_is_alfa] L08EC: B7 # or a # jr nz, 1f L08ED: 20 07 # ld hl, segments + (0x7f / 8) L08EF: 21 0F C5 L08F2: CB FE # set 0x7f % 8, [hl] # jr 2f L08F4: 18 05 # 1: # ld hl, segments + ((24 + 2) / 8) L08F6: 21 03 C5 L08F9: CB D6 # set (24 + 2) % 8, [hl] # 2: L08FB: 3A 86 C5 # ld a, [digidx] L08FE: B7 # or a # jr z, 1f L08FF: 28 0E # call a2i L0901: CD 3C 27 L0904: 7D # ld a, l L0905: B7 # or a # jr z, 2f L0906: 28 0C L0908: 32 19 C2 # ld [scan_mode], a L090B: 32 11 C2 # ld [defscan], a # ret L090E: C9 # 1: L090F: 3A 19 C2 # ld a, [scan_mode] L0912: B7 # or a L0913: C0 # ret nz # 2: L0914: 3A 11 C2 # ld a, [defscan] L0917: B7 # or a # jr nz, 1f L0918: 20 02 # ld a, 1 L091A: 3E 01 # 1: L091C: 32 19 C2 # ld [scan_mode], a L091F: 32 11 C2 # ld [defscan], a # ret L0922: C9 # # scanner_stop: L0923: 3A 19 C2 # ld a, [scan_mode] L0926: B7 # or a L0927: C8 # ret z # # ld a, 0 L0928: 3E 00 L092A: 32 19 C2 # ld [scan_mode], a L092D: 32 54 C5 # ld [scan_mute], a # L0930: 3A F0 C5 # ld a, [cu_is_alfa] L0933: B7 # or a # jr nz, 1f L0934: 20 07 # ld hl, segments + (0x7f / 8) L0936: 21 0F C5 L0939: CB BE # res 0x7f % 8, [hl] # jr 2f L093B: 18 05 # 1: # ld hl, segments + ((24 + 2) / 8) L093D: 21 03 C5 L0940: CB 96 # res (24 + 2) % 8, [hl] # 2: # ld a, 0 L0942: 3E 00 L0944: 32 A7 C5 # ld [vip_idx], a # call next_vip L0947: CD AF 11 # ret L094A: C9 # # scan_bad: # call scanner_stop L094B: CD 23 09 # call scanner_ret L094E: CD F2 06 # # scan_do_step: # # ld a, 0 L0951: 3E 00 L0953: 32 57 C5 # ld [scan_oops], a # # scan_do_step_again: # # ld a, 1 L0956: 3E 01 L0958: 32 54 C5 # ld [scan_mute], a # L095B: 3A 57 C5 # ld a, [scan_oops] L095E: 3D # dec a L095F: 32 57 C5 # ld [scan_oops], a # jp z, scan_bad L0962: CA 4B 09 # L0965: 3A 19 C2 # ld a, [scan_mode] # cp 2 L0968: FE 02 # jp z, scan_next_simplex L096A: CA F3 09 # cp 3 L096D: FE 03 # jp z, scan_next_rptr L096F: CA 1D 0A # cp 4 L0972: FE 04 # jp z, scan_next_memory L0974: CA 36 0B # cp 7 L0977: FE 07 # jp z, scan_next_everything L0979: CA C7 0A # cp 77 L097C: FE 4D # jp z, scan_next_everything_down L097E: CA 9B 0A # cp 8 L0981: FE 08 # jp z, scan_next_9xmemory L0983: CA 11 0B # cp 9 L0986: FE 09 # jp z, scan_next_nmt L0988: CA 71 0A # cp 99 L098B: FE 63 # jp z, scan_next_nmt_mobile L098D: CA 47 0A # # jp scan_next_fm L0990: C3 93 09 # # scan_next_fm: # L0993: 2A FB C1 L0996: 3A FD C1 # ld hl, [currfreq] ; ld a, [(currfreq) + 2] # ld de, 25 L0999: 11 19 00 L099C: 19 # add hl, de # adc 0 L099D: CE 00 L099F: 22 FB C1 L09A2: 32 FD C1 # ld [currfreq], hl ; ld [(currfreq) + 2], a # L09A5: 2A FB C1 L09A8: 3A FD C1 # ld hl, [currfreq] ; ld a, [(currfreq) + 2] L09AB: 11 C0 9D L09AE: A7 L09AF: ED 52 # ld de, (433600) % 65536 ; and a ; sbc hl, de ; sbc (433600) / 65536 L09B1: DE 06 # jp c, scan_currfreq ! < 433600 L09B3: DA F1 0A # # ! >= 433600 L09B6: 2A FB C1 L09B9: 3A FD C1 # ld hl, [currfreq] ; ld a, [(currfreq) + 2] L09BC: 11 A8 A1 L09BF: A7 L09C0: ED 52 # ld de, (434600) % 65536 ; and a ; sbc hl, de ; sbc (434600) / 65536 L09C2: DE 06 # jr nc, 1f L09C4: 30 0E # ! >= 433600 and < 434600 L09C6: 21 A8 A1 # ld hl, (434600) % 65536 ; ld a, (434600) / 65536 L09C9: 3E 06 L09CB: 22 FB C1 L09CE: 32 FD C1 # ld [currfreq], hl ; ld [(currfreq) + 2], a # jp scan_currfreq L09D1: C3 F1 0A # 1: # ! >= 434600 L09D4: 2A FB C1 L09D7: 3A FD C1 # ld hl, [currfreq] ; ld a, [(currfreq) + 2] L09DA: 11 38 A3 L09DD: A7 L09DE: ED 52 # ld de, (435000) % 65536 ; and a ; sbc hl, de ; sbc (435000) / 65536 L09E0: DE 06 # jp c, scan_currfreq ! >= 434600 and < 435000 L09E2: DA F1 0A # ! >= 435000 L09E5: 21 F8 9C # ld hl, (433400) % 65536 ; ld a, (433400) / 65536 L09E8: 3E 06 L09EA: 22 FB C1 L09ED: 32 FD C1 # ld [currfreq], hl ; ld [(currfreq) + 2], a # jp scan_currfreq L09F0: C3 F1 0A # # scan_next_simplex: # L09F3: 2A FB C1 L09F6: 3A FD C1 # ld hl, [currfreq] ; ld a, [(currfreq) + 2] # ld de, 25 L09F9: 11 19 00 L09FC: 19 # add hl, de # adc 0 L09FD: CE 00 L09FF: 22 FB C1 L0A02: 32 FD C1 # ld [currfreq], hl ; ld [(currfreq) + 2], a # L0A05: 11 C0 9D L0A08: A7 L0A09: ED 52 # ld de, (433600) % 65536 ; and a ; sbc hl, de ; sbc (433600) / 65536 L0A0B: DE 06 # jr c, 1f L0A0D: 38 0B L0A0F: 21 F8 9C # ld hl, (433400) % 65536 ; ld a, (433400) / 65536 L0A12: 3E 06 L0A14: 22 FB C1 L0A17: 32 FD C1 # ld [currfreq], hl ; ld [(currfreq) + 2], a # 1: # jp scan_currfreq L0A1A: C3 F1 0A # # scan_next_rptr: L0A1D: 2A FB C1 L0A20: 3A FD C1 # ld hl, [currfreq] ; ld a, [(currfreq) + 2] # ld de, 25 L0A23: 11 19 00 L0A26: 19 # add hl, de # adc 0 L0A27: CE 00 L0A29: 22 FB C1 L0A2C: 32 FD C1 # ld [currfreq], hl ; ld [(currfreq) + 2], a # L0A2F: 11 38 A3 L0A32: A7 L0A33: ED 52 # ld de, (435000) % 65536 ; and a ; sbc hl, de ; sbc (435000) / 65536 L0A35: DE 06 # jr c, 1f L0A37: 38 0B L0A39: 21 A8 A1 # ld hl, (434600) % 65536 ; ld a, (434600) / 65536 L0A3C: 3E 06 L0A3E: 22 FB C1 L0A41: 32 FD C1 # ld [currfreq], hl ; ld [(currfreq) + 2], a # 1: # jp scan_currfreq L0A44: C3 F1 0A # # scan_next_nmt_mobile: # L0A47: 2A FB C1 L0A4A: 3A FD C1 # ld hl, [currfreq] ; ld a, [(currfreq) + 2] # ld de, 25 L0A4D: 11 19 00 L0A50: 19 # add hl, de # adc 0 L0A51: CE 00 L0A53: 22 FB C1 L0A56: 32 FD C1 # ld [currfreq], hl ; ld [(currfreq) + 2], a # L0A59: 11 10 FD L0A5C: A7 L0A5D: ED 52 # ld de, (458000) % 65536 ; and a ; sbc hl, de ; sbc (458000) / 65536 L0A5F: DE 06 # jr c, 1f L0A61: 38 0B L0A63: 21 88 E9 # ld hl, (453000) % 65536 ; ld a, (453000) / 65536 L0A66: 3E 06 L0A68: 22 FB C1 L0A6B: 32 FD C1 # ld [currfreq], hl ; ld [(currfreq) + 2], a # 1: # jp scan_currfreq L0A6E: C3 F1 0A # # scan_next_nmt: # L0A71: 2A FB C1 L0A74: 3A FD C1 # ld hl, [currfreq] ; ld a, [(currfreq) + 2] # ld de, 25 L0A77: 11 19 00 L0A7A: 19 # add hl, de # adc 0 L0A7B: CE 00 L0A7D: 22 FB C1 L0A80: 32 FD C1 # ld [currfreq], hl ; ld [(currfreq) + 2], a # L0A83: 11 20 24 L0A86: A7 L0A87: ED 52 # ld de, (468000) % 65536 ; and a ; sbc hl, de ; sbc (468000) / 65536 L0A89: DE 07 # jr c, 1f L0A8B: 38 0B L0A8D: 21 98 10 # ld hl, (463000) % 65536 ; ld a, (463000) / 65536 L0A90: 3E 07 L0A92: 22 FB C1 L0A95: 32 FD C1 # ld [currfreq], hl ; ld [(currfreq) + 2], a # 1: # jp scan_currfreq L0A98: C3 F1 0A # # scan_next_everything_down: # L0A9B: 2A FB C1 L0A9E: 3A FD C1 # ld hl, [currfreq] ; ld a, [(currfreq) + 2] # ld de, 25 L0AA1: 11 19 00 L0AA4: A7 # and a L0AA5: ED 52 # sbc hl, de # sbc 0 L0AA7: DE 00 L0AA9: 22 FB C1 L0AAC: 32 FD C1 # ld [currfreq], hl ; ld [(currfreq) + 2], a # # # # # L0AAF: 11 80 1A L0AB2: A7 L0AB3: ED 52 # ld de, (400000) % 65536 ; and a ; sbc hl, de ; sbc (400000) / 65536 L0AB5: DE 06 # jr nc, 1f ! currfreq below floor ? L0AB7: 30 0B # L0AB9: 21 20 A1 # ld hl, (500000) % 65536 ; ld a, (500000) / 65536 L0ABC: 3E 07 L0ABE: 22 FB C1 L0AC1: 32 FD C1 # ld [currfreq], hl ; ld [(currfreq) + 2], a # 1: # jp scan_currfreq L0AC4: C3 F1 0A # # scan_next_everything: # L0AC7: 2A FB C1 L0ACA: 3A FD C1 # ld hl, [currfreq] ; ld a, [(currfreq) + 2] # ld de, 25 L0ACD: 11 19 00 L0AD0: 19 # add hl, de # adc 0 L0AD1: CE 00 L0AD3: 22 FB C1 L0AD6: 32 FD C1 # ld [currfreq], hl ; ld [(currfreq) + 2], a # L0AD9: 11 20 A1 L0ADC: A7 L0ADD: ED 52 # ld de, (500000) % 65536 ; and a ; sbc hl, de ; sbc (500000) / 65536 L0ADF: DE 07 # jr c, 1f L0AE1: 38 0B L0AE3: 21 80 1A # ld hl, (400000) % 65536 ; ld a, (400000) / 65536 L0AE6: 3E 06 L0AE8: 22 FB C1 L0AEB: 32 FD C1 # ld [currfreq], hl ; ld [(currfreq) + 2], a # 1: # jp scan_currfreq L0AEE: C3 F1 0A # # scan_currfreq: # # ld a, -1 L0AF1: 3E FF L0AF3: 32 FA C1 # ld [currmem], a # L0AF6: 2A FB C1 L0AF9: 3A FD C1 # ld hl, [currfreq] ; ld a, [(currfreq) + 2] # call freq2div L0AFC: CD 28 28 L0AFF: 22 04 C2 L0B02: 32 06 C2 # ld [tx_divisor], hl ; ld [(tx_divisor) + 2], a # call default_rptr L0B05: CD 61 0E # call lookup_rfc L0B08: CD 45 2B # call change_rxsynth L0B0B: CD 00 22 # # jp scan_do_wait L0B0E: C3 55 0B # # scan_next_9xmemory: # # ld e, 101 L0B11: 1E 65 L0B13: 3A FA C1 # ld a, [currmem] # 2: L0B16: 1D # dec e # jp z, scan_bad L0B17: CA 4B 09 L0B1A: 3C # inc a # cp 100 L0B1B: FE 64 # jr c, 1f L0B1D: 38 02 # ld a, 90 L0B1F: 3E 5A # 1: # cp 90 L0B21: FE 5A # jr nc, 1f L0B23: 30 02 # ld a, 90 L0B25: 3E 5A # 1: L0B27: 57 # ld d, a # call getmemflags L0B28: CD 1A 13 # and MEM_EMPTY L0B2B: E6 80 L0B2D: 7A # ld a, d # jr nz, 2b L0B2E: 20 E6 # # call gomem_a ! Next memory L0B30: CD 56 13 # # jp scan_do_wait L0B33: C3 55 0B # # scan_next_memory: # # ld e, 101 L0B36: 1E 65 L0B38: 3A FA C1 # ld a, [currmem] # 2: L0B3B: 1D # dec e # jp z, scan_bad L0B3C: CA 4B 09 L0B3F: 3C # inc a # cp 100 L0B40: FE 64 # jr c, 1f L0B42: 38 02 # ld a, 0 L0B44: 3E 00 # 1: L0B46: 57 # ld d, a # call getmemflags L0B47: CD 1A 13 # and MEM_EMPTY | MEM_NOSCAN L0B4A: E6 84 L0B4C: 7A # ld a, d # jr nz, 2b L0B4D: 20 EC # # call gomem_a ! Next memory L0B4F: CD 56 13 # # jp scan_do_wait L0B52: C3 55 0B # # scan_do_wait: # # ld ix, rejects L0B55: DD 21 58 C5 # ld b, 10 L0B59: 06 0A # 2: L0B5B: 3A FB C1 # ld a, [currfreq + 0] L0B5E: DD BE 00 # cp [ix + 0] # jr nz, 1f L0B61: 20 13 L0B63: 3A FC C1 # ld a, [currfreq + 1] L0B66: DD BE 01 # cp [ix + 1] # jr nz, 1f L0B69: 20 0B L0B6B: 3A FD C1 # ld a, [currfreq + 2] L0B6E: DD BE 02 # cp [ix + 2] # jr nz, 1f L0B71: 20 03 # jp scan_do_step_again L0B73: C3 56 09 # 1: L0B76: DD 23 # inc ix L0B78: DD 23 # inc ix L0B7A: DD 23 # inc ix # djnz 2b L0B7C: 10 DD # L0B7E: 3A 99 C5 # ld a, [squelch_open] L0B81: B7 # or a # ld a, 5 ! Wait 50 ms L0B82: 3E 05 # jr z, 1f L0B84: 28 02 # ld a, 20 ! but make it longer if channel is busy. L0B86: 3E 14 # 1: L0B88: 32 51 C5 # ld [scan_timer], a # # call redraw L0B8B: CD A1 1B # 1: # call scanner_ret L0B8E: CD F2 06 L0B91: 3A 51 C5 # ld a, [scan_timer] L0B94: B7 # or a # jr nz, 1b ! The wait. L0B95: 20 F7 # L0B97: 3A 9A C5 # ld a, [squelch_forced] L0B9A: B7 # or a # jp nz, 2f ! Squelch manually forced open, act as if signal. L0B9B: C2 A8 0B # L0B9E: 3A 99 C5 # ld a, [squelch_open] L0BA1: B7 # or a # jp z, scan_do_step ! No signal. Next. L0BA2: CA 51 09 # # call remember_vip L0BA5: CD 20 10 # 2: # ld hl, 15 * 100 L0BA8: 21 DC 05 L0BAB: 22 52 C5 # ld [scan_ltimer], hl ! 15 seconds max. # # # L0BAE: 3A 19 C2 # ld a, [scan_mode] # cp 9 L0BB1: FE 09 # jr z, 8f L0BB3: 28 02 # # # # # jr 7f L0BB5: 18 15 # 8: # ld a, 10 L0BB7: 3E 0A L0BB9: 32 51 C5 # ld [scan_timer], a # 1: # call scanner_ret L0BBC: CD F2 06 L0BBF: 3A 51 C5 # ld a, [scan_timer] L0BC2: B7 # or a # jr nz, 1b L0BC3: 20 F7 # L0BC5: DB A3 # in a, [0xA0 + 3] # and 0x04 L0BC7: E6 04 # jp nz, scan_do_step L0BC9: C2 51 09 # # 7: # # 1: # call scanner_ret L0BCC: CD F2 06 L0BCF: 2A 52 C5 # ld hl, [scan_ltimer] L0BD2: 7C # ld a, h L0BD3: B5 # or l # jp z, scan_do_step ! Lost patience. Next. L0BD4: CA 51 09 # # ld a, 0 L0BD7: 3E 00 L0BD9: 32 54 C5 # ld [scan_mute], a ! Open audio. # L0BDC: 3A 9A C5 # ld a, [squelch_forced] L0BDF: B7 # or a # jr nz, 2b ! Squelch forced open. Stay forever and 15 sec more. L0BE0: 20 C6 L0BE2: 3A 99 C5 # ld a, [squelch_open] L0BE5: B7 # or a # jr nz, 1b ! There is signal. Stay. L0BE6: 20 E4 # # ld a, 100 L0BE8: 3E 64 L0BEA: 32 51 C5 # ld [scan_timer], a ! Stay 1 sec without signal. # 2: # call scanner_ret L0BED: CD F2 06 L0BF0: 3A 99 C5 # ld a, [squelch_open] L0BF3: B7 # or a # jr nz, 1b ! Again signal. Keep listening. L0BF4: 20 D6 L0BF6: 3A 51 C5 # ld a, [scan_timer] L0BF9: B7 # or a # jr nz, 2b ! No signal for 1 sec... L0BFA: 20 F1 # # jp scan_do_step ! ... so Next. L0BFC: C3 51 09 # # send_call_packet: # # call tx_on L0BFF: CD 6A 26 # jp c, tx_error L0C02: DA 1C 0E # L0C05: F3 # di L0C06: 3A 29 C2 # ld a, [output_0] # and ~0x20 L0C09: E6 DF # or 0x80 L0C0B: F6 80 L0C0D: 32 29 C2 # ld [output_0], a L0C10: D3 60 # out [0x60], a L0C12: FB # ei # 1: # call redraw L0C13: CD A1 1B L0C16: 3A 85 C5 # ld a, [keydown] L0C19: B7 # or a # jp nz, 1b L0C1A: C2 13 0C # ld a, -1 L0C1D: 3E FF L0C1F: 32 82 C5 # ld [key], a # # call build_packet_buffer L0C22: CD 3E 0C # call append_packet_crc L0C25: CD AB 0C # # call send_packet_buffer L0C28: CD 74 0D # call mdm_delay L0C2B: CD B7 0D # call send_packet_buffer L0C2E: CD 74 0D # call mdm_delay L0C31: CD B7 0D # call send_packet_buffer L0C34: CD 74 0D # # call tx_off L0C37: CD FB 26 # call clear_buffer L0C3A: CD 97 16 # # ret L0C3D: C9 # # build_packet_buffer: # # ld hl, digbuf L0C3E: 21 87 C5 L0C41: 3A 86 C5 # ld a, [digidx] L0C44: 47 # ld b, a # cp 1 L0C45: FE 01 # jr nz, 1f L0C47: 20 04 L0C49: 7E # ld a, [hl] # cp 0 L0C4A: FE 00 L0C4C: C8 # ret z ! 0* = send it again # 1: # ld de, outpacket L0C4D: 11 D0 C5 # ld ix, mycall L0C50: DD 21 14 C2 L0C54: 3E C0 L0C56: DD B6 00 L0C59: 12 L0C5A: 13 # ld a, 0xC0; or [ix + 0]; ld [de], a; inc de L0C5B: DD 7E 01 L0C5E: CB 27 L0C60: CB 27 L0C62: CB 27 L0C64: CB 27 L0C66: DD B6 02 L0C69: 12 L0C6A: 13 # ld a, [ix + 1]; sla a ; sla a ; sla a ; sla a; or [ix + 2]; ld [de], a; inc de L0C6B: DD 7E 03 L0C6E: CB 27 L0C70: CB 27 L0C72: CB 27 L0C74: CB 27 L0C76: DD B6 04 L0C79: 12 L0C7A: 13 # ld a, [ix + 3]; sla a ; sla a ; sla a ; sla a; or [ix + 4]; ld [de], a; inc de # ld c, 3 L0C7B: 0E 03 # 1: L0C7D: 0C # inc c L0C7E: 7E # ld a, [hl] L0C7F: 23 # inc hl L0C80: CB 27 L0C82: CB 27 L0C84: CB 27 L0C86: CB 27 # sla a; sla a; sla a; sla a # or 0xF L0C88: F6 0F L0C8A: 12 # ld [de], a L0C8B: 13 # inc de L0C8C: 05 # dec b # jr z, 1f L0C8D: 28 0F # and 0xF0 L0C8F: E6 F0 L0C91: B6 # or [hl] L0C92: 23 # inc hl L0C93: 1B # dec de L0C94: 12 # ld [de], a L0C95: 13 # inc de L0C96: 05 # dec b # jr z, 1f L0C97: 28 05 L0C99: 79 # ld a, c # cp SIZE(outpacket) - 2 L0C9A: FE 06 # jr nz, 1b L0C9C: 20 DF # 1: L0C9E: 79 # ld a, c # cp SIZE(outpacket) - 2 L0C9F: FE 06 # jr z, 1f L0CA1: 28 07 # ld a, 0xFF L0CA3: 3E FF L0CA5: 12 # ld [de], a L0CA6: 13 # inc de L0CA7: 0C # inc c # jr 1b L0CA8: 18 F4 # 1: # ret L0CAA: C9 # # append_packet_crc: # L0CAB: 06 FF L0CAD: 3E FF L0CAF: DD 21 D0 C5 # ld b, 0xFF ; ld a, 0xFF ; ld ix, outpacket ; # L0CB3: 26 2D L0CB5: DD AE 00 L0CB8: 6F L0CB9: 78 L0CBA: 46 L0CBB: 24 L0CBC: AE # ld h, HI(crctbls) ; xor [ix + (0)] ; ld l, a ; ld a, b ; ld b, [hl] ; inc h ; xor [hl] ; L0CBD: 26 2D L0CBF: DD AE 01 L0CC2: 6F L0CC3: 78 L0CC4: 46 L0CC5: 24 L0CC6: AE # ld h, HI(crctbls) ; xor [ix + (1)] ; ld l, a ; ld a, b ; ld b, [hl] ; inc h ; xor [hl] ; L0CC7: 26 2D L0CC9: DD AE 02 L0CCC: 6F L0CCD: 78 L0CCE: 46 L0CCF: 24 L0CD0: AE # ld h, HI(crctbls) ; xor [ix + (2)] ; ld l, a ; ld a, b ; ld b, [hl] ; inc h ; xor [hl] ; L0CD1: 26 2D L0CD3: DD AE 03 L0CD6: 6F L0CD7: 78 L0CD8: 46 L0CD9: 24 L0CDA: AE # ld h, HI(crctbls) ; xor [ix + (3)] ; ld l, a ; ld a, b ; ld b, [hl] ; inc h ; xor [hl] ; L0CDB: 26 2D L0CDD: DD AE 04 L0CE0: 6F L0CE1: 78 L0CE2: 46 L0CE3: 24 L0CE4: AE # ld h, HI(crctbls) ; xor [ix + (4)] ; ld l, a ; ld a, b ; ld b, [hl] ; inc h ; xor [hl] ; L0CE5: 26 2D L0CE7: DD AE 05 L0CEA: 6F L0CEB: 78 L0CEC: 46 L0CED: 24 L0CEE: AE # ld h, HI(crctbls) ; xor [ix + (5)] ; ld l, a ; ld a, b ; ld b, [hl] ; inc h ; xor [hl] ; # L0CEF: 2F # cpl L0CF0: DD 77 07 # ld [ix + 7], a L0CF3: 78 # ld a, b L0CF4: 2F # cpl L0CF5: DD 77 06 # ld [ix + 6], a # # ret L0CF8: C9 # # check_packet: # L0CF9: 06 FF L0CFB: 3E FF L0CFD: DD 21 D8 C5 # ld b, 0xFF ; ld a, 0xFF ; ld ix, packet ; # L0D01: 26 2D L0D03: DD AE 00 L0D06: 6F L0D07: 78 L0D08: 46 L0D09: 24 L0D0A: AE # ld h, HI(crctbls) ; xor [ix + (0)] ; ld l, a ; ld a, b ; ld b, [hl] ; inc h ; xor [hl] ; L0D0B: 26 2D L0D0D: DD AE 01 L0D10: 6F L0D11: 78 L0D12: 46 L0D13: 24 L0D14: AE # ld h, HI(crctbls) ; xor [ix + (1)] ; ld l, a ; ld a, b ; ld b, [hl] ; inc h ; xor [hl] ; L0D15: 26 2D L0D17: DD AE 02 L0D1A: 6F L0D1B: 78 L0D1C: 46 L0D1D: 24 L0D1E: AE # ld h, HI(crctbls) ; xor [ix + (2)] ; ld l, a ; ld a, b ; ld b, [hl] ; inc h ; xor [hl] ; L0D1F: 26 2D L0D21: DD AE 03 L0D24: 6F L0D25: 78 L0D26: 46 L0D27: 24 L0D28: AE # ld h, HI(crctbls) ; xor [ix + (3)] ; ld l, a ; ld a, b ; ld b, [hl] ; inc h ; xor [hl] ; L0D29: 26 2D L0D2B: DD AE 04 L0D2E: 6F L0D2F: 78 L0D30: 46 L0D31: 24 L0D32: AE # ld h, HI(crctbls) ; xor [ix + (4)] ; ld l, a ; ld a, b ; ld b, [hl] ; inc h ; xor [hl] ; L0D33: 26 2D L0D35: DD AE 05 L0D38: 6F L0D39: 78 L0D3A: 46 L0D3B: 24 L0D3C: AE # ld h, HI(crctbls) ; xor [ix + (5)] ; ld l, a ; ld a, b ; ld b, [hl] ; inc h ; xor [hl] ; # L0D3D: 2F # cpl L0D3E: DD BE 07 # cp [ix + 7] # jr nz, 1f L0D41: 20 30 L0D43: 78 # ld a, b L0D44: 2F # cpl L0D45: DD BE 06 # cp [ix + 6] # jr nz, 1f L0D48: 20 29 L0D4A: 3A D8 C5 L0D4D: 32 E0 C5 # ld a, [packet + 0]; ld [packet_good + 0], a L0D50: 3A D9 C5 L0D53: 32 E1 C5 # ld a, [packet + 1]; ld [packet_good + 1], a L0D56: 3A DA C5 L0D59: 32 E2 C5 # ld a, [packet + 2]; ld [packet_good + 2], a L0D5C: 3A DB C5 L0D5F: 32 E3 C5 # ld a, [packet + 3]; ld [packet_good + 3], a L0D62: 3A DC C5 L0D65: 32 E4 C5 # ld a, [packet + 4]; ld [packet_good + 4], a L0D68: 3A DD C5 L0D6B: 32 E5 C5 # ld a, [packet + 5]; ld [packet_good + 5], a # ld a, 1 L0D6E: 3E 01 L0D70: 32 E8 C5 # ld [packet_rdy], a # 1: # ret L0D73: C9 # # send_packet_buffer: # # ld a, 0x01 L0D74: 3E 01 L0D76: D3 A3 # out [0xA0 + 3], a # # ld hl, nosir L0D78: 21 7B C5 L0D7B: CB C6 # set 0, [hl] # # ld hl, packet_header L0D7D: 21 A0 0D # ld b, packet_header_size L0D80: 06 07 # call send_some_data L0D82: CD A7 0D # # ld hl, outpacket L0D85: 21 D0 C5 # ld b, SIZE(outpacket) L0D88: 06 08 # call send_some_data L0D8A: CD A7 0D # # ld hl, nosir L0D8D: 21 7B C5 L0D90: CB 86 # res 0, [hl] # # call mdm_delay L0D92: CD B7 0D # 1: L0D95: DB A3 # in a, [0xA0 + 3] # and 0x10 L0D97: E6 10 # jr z, 1b L0D99: 28 FA # # ld a, 0x04 L0D9B: 3E 04 L0D9D: D3 A3 # out [0xA0 + 3], a # # ret L0D9F: C9 # # packet_header: # .byte 0b10101010 L0DA0: AA # .byte 0b10101010 L0DA1: AA # .byte 0b10101010 L0DA2: AA # .byte 0b10101010 L0DA3: AA # .byte 0b10101010 L0DA4: AA # .byte 0b11000100 L0DA5: C4 # .byte 0b11010111 L0DA6: D7 # packet_header_size = . - packet_header # # send_some_data: # 1: # call mdm_delay L0DA7: CD B7 0D L0DAA: DB A3 # in a, [0xA0 + 3] # and 0x08 L0DAC: E6 08 # jr z, 1b L0DAE: 28 F7 L0DB0: 7E # ld a, [hl] L0DB1: 23 # inc hl L0DB2: D3 A2 # out [0xA0 + 2], a # djnz 1b L0DB4: 10 F1 # ret L0DB6: C9 # # mdm_delay: L0DB7: 00 L0DB8: 00 L0DB9: 00 L0DBA: 00 L0DBB: 00 # nop; nop; nop; nop; nop L0DBC: 00 L0DBD: 00 L0DBE: 00 L0DBF: 00 L0DC0: 00 # nop; nop; nop; nop; nop L0DC1: 00 L0DC2: 00 L0DC3: 00 L0DC4: 00 L0DC5: 00 # nop; nop; nop; nop; nop L0DC6: 00 L0DC7: 00 L0DC8: 00 L0DC9: 00 L0DCA: 00 # nop; nop; nop; nop; nop L0DCB: 00 L0DCC: 00 L0DCD: 00 L0DCE: 00 L0DCF: 00 # nop; nop; nop; nop; nop # ret L0DD0: C9 # # beep1750: # L0DD1: 3A 86 C5 # ld a, [digidx] L0DD4: B7 # or a # jp nz, send_call_packet L0DD5: C2 FF 0B # # call tx_on L0DD8: CD 6A 26 # jp c, tx_error L0DDB: DA 1C 0E # # call battcheck L0DDE: CD 5E 07 L0DE1: F3 # di ! No digits, repeater beep # ld a, 0 L0DE2: 3E 00 L0DE4: 32 45 C5 # ld [mt_timer], a # # ld a, LO(MT_1750HZ) L0DE7: 3E 00 L0DE9: D3 21 # out [0x20 + 1], a # ld a, HI(MT_1750HZ) L0DEB: 3E 09 L0DED: D3 21 # out [0x20 + 1], a # L0DEF: 3A 29 C2 # ld a, [output_0] # or 0x20 | 0x80 L0DF2: F6 A0 L0DF4: 32 29 C2 # ld [output_0], a L0DF7: D3 60 # out [0x60], a L0DF9: FB # ei # 1: # call redraw L0DFA: CD A1 1B L0DFD: 3A 85 C5 # ld a, [keydown] L0E00: B7 # or a # jp nz, 1b L0E01: C2 FA 0D # ld a, -1 L0E04: 3E FF L0E06: 32 82 C5 # ld [key], a # L0E09: F3 # di L0E0A: 3A 29 C2 # ld a, [output_0] # and ~(0x20 | 0x80) L0E0D: E6 5F L0E0F: 32 29 C2 # ld [output_0], a L0E12: D3 60 # out [0x60], a # call stop_marker_tone L0E14: CD E5 1A L0E17: FB # ei # # call tx_off L0E18: CD FB 26 # # ret L0E1B: C9 # # tx_error: # ld hl, MT_300HZ L0E1C: 21 80 34 # ld d, 100 L0E1F: 16 64 # call start_marker_tone L0E21: CD D0 1A # 1: # call redraw L0E24: CD A1 1B L0E27: 3A 85 C5 # ld a, [keydown] L0E2A: B7 # or a # jr nz, 1b L0E2B: 20 F7 L0E2D: 3A 84 C5 # ld a, [pttdn] L0E30: B7 # or a # jr nz, 1b L0E31: 20 F1 # ld a, -1 L0E33: 3E FF L0E35: 32 82 C5 # ld [key], a # # ret L0E38: C9 # # save_ahl_to_tx_offset: L0E39: C5 # push bc L0E3A: D5 # push de L0E3B: E5 # push hl L0E3C: F5 # push af L0E3D: 4D # ld c, l L0E3E: 44 # ld b, h L0E3F: 5F # ld e, a L0E40: 22 FE C1 L0E43: 32 00 C2 # ld [tx_offset], hl ; ld [(tx_offset) + 2], a ! Assume positive L0E46: 3A 1F C2 # ld a, [plus_duplex] # and 1 L0E49: E6 01 # jr nz, 1f ! it was. L0E4B: 20 0F # ld hl, 0 L0E4D: 21 00 00 # ld a, 0 L0E50: 3E 00 L0E52: A7 # and a L0E53: ED 42 # sbc hl, bc ! 0 - offset L0E55: 9B # sbc e L0E56: 22 FE C1 L0E59: 32 00 C2 # ld [tx_offset], hl ; ld [(tx_offset) + 2], a ! No, negative # 1: L0E5C: F1 # pop af L0E5D: E1 # pop hl L0E5E: D1 # pop de L0E5F: C1 # pop bc # ret L0E60: C9 # # default_rptr: L0E61: 2A FB C1 L0E64: 3A FD C1 # ld hl, [currfreq] ; ld a, [(currfreq) + 2] L0E67: 11 A8 A1 L0E6A: A7 L0E6B: ED 52 # ld de, (434600) % 65536 ; and a ; sbc hl, de ; sbc (434600) / 65536 L0E6D: DE 06 # jr c, 1f ! if below 434600 L0E6F: 38 1D # L0E71: 2A FB C1 L0E74: 3A FD C1 # ld hl, [currfreq] ; ld a, [(currfreq) + 2] L0E77: 11 38 A3 L0E7A: A7 L0E7B: ED 52 # ld de, (435000) % 65536 ; and a ; sbc hl, de ; sbc (435000) / 65536 L0E7D: DE 06 # jr nc, 1f ! if at or above 435000 L0E7F: 30 0D # L0E81: 2A 1C C2 L0E84: 3A 1E C2 # ld hl, [rptr_sub] ; ld a, [(rptr_sub) + 2] # call freq2div L0E87: CD 28 28 # call save_ahl_to_tx_offset L0E8A: CD 39 0E # ret L0E8D: C9 # 1: L0E8E: 21 00 00 # ld hl, (0) % 65536 ; ld a, (0) / 65536 L0E91: 3E 00 # call save_ahl_to_tx_offset L0E93: CD 39 0E # ret L0E96: C9 # # toggle_rptr_or_insert_A: L0E97: 3A 86 C5 # ld a, [digidx] L0E9A: B7 # or a # jp z, toggle_rptr L0E9B: CA A3 0E # ld a, 0xA L0E9E: 3E 0A # jp insdig L0EA0: C3 A0 13 # # toggle_rptr: L0EA3: 2A FE C1 L0EA6: 3A 00 C2 # ld hl, [tx_offset] ; ld a, [(tx_offset) + 2] ! current offset L0EA9: B4 # or h L0EAA: B5 # or l L0EAB: 21 00 00 # ld hl, (0) % 65536 ; ld a, (0) / 65536 ! assume back to simplex L0EAE: 3E 00 # jr nz, 1f L0EB0: 20 09 L0EB2: 2A 1C C2 L0EB5: 3A 1E C2 # ld hl, [rptr_sub] ; ld a, [(rptr_sub) + 2] # call freq2div L0EB8: CD 28 28 # 1: # call save_ahl_to_tx_offset L0EBB: CD 39 0E # ret L0EBE: C9 # # command: # call scanner_stop L0EBF: CD 23 09 # call 1f L0EC2: CD C9 0E # call save_nvdata L0EC5: CD AC 2B # ret L0EC8: C9 # 1: L0EC9: 3A 86 C5 # ld a, [digidx] L0ECC: B7 # or a # jr nz, 1f L0ECD: 20 10 L0ECF: 3A A3 C5 # ld a, [dpymode] L0ED2: B7 # or a L0ED3: C8 # ret z L0ED4: 3C # inc a # cp NUM_INFOS L0ED5: FE 0C # jr c, 2f L0ED7: 38 02 # ld a, 1 L0ED9: 3E 01 # 2: L0EDB: 32 A3 C5 # ld [dpymode], a ! Plain #, next dpy mode # ret L0EDE: C9 # 1: # cp 1 L0EDF: FE 01 # jr nz, 2f L0EE1: 20 43 # call a2i ! 1 digit then # L0EE3: CD 3C 27 L0EE6: 7D # ld a, l # cp 8 L0EE7: FE 08 # jp z, set_all_defaults L0EE9: CA A1 0F # cp 9 L0EEC: FE 09 # jr nz, 1f L0EEE: 20 06 # ld a, 1 L0EF0: 3E 01 L0EF2: 32 A3 C5 # ld [dpymode], a # ret L0EF5: C9 # 1: # cp 7 L0EF6: FE 07 # jr nz, 1f L0EF8: 20 15 L0EFA: 3A 1F C2 # ld a, [plus_duplex] # xor 1 L0EFD: EE 01 L0EFF: 32 1F C2 # ld [plus_duplex], a L0F02: 2A 1C C2 L0F05: 3A 1E C2 # ld hl, [rptr_sub] ; ld a, [(rptr_sub) + 2] # call freq2div L0F08: CD 28 28 # call save_ahl_to_tx_offset L0F0B: CD 39 0E # ret L0F0E: C9 # 1: # cp 4 L0F0F: FE 04 L0F11: D0 # ret nc ! 4# or 5# or 6# # # and 3 ! 0 1 2 3 L0F12: E6 03 L0F14: CB 27 # sla a ! 0 2 4 6 L0F16: CB 27 # sla a ! 0 4 8 C L0F18: CB 27 # sla a ! 0 8 10 18 L0F1A: CB 27 # sla a ! 0 10 20 30 L0F1C: CB 27 # sla a ! 0 20 40 60 L0F1E: CB 27 # sla a ! 0 40 80 C0 # or 0x3F ! 3F 7F BF FF L0F20: F6 3F L0F22: 32 F9 C1 # ld [txpwr], a # ret L0F25: C9 # 2: # cp 2 L0F26: FE 02 # jr nz, 3f L0F28: 20 0E # call a2i ! txpwr 00..99 # L0F2A: CD 3C 27 L0F2D: 7D # ld a, l L0F2E: CB 3F # srl a L0F30: 85 # add l L0F31: 85 # add l # add 8 ! 2.5 * x + 8 L0F32: C6 08 L0F34: 32 F9 C1 # ld [txpwr], a ! 8, 10, 13, 15 ... 250, 253, 255 # ret L0F37: C9 # 3: L0F38: 3A A3 C5 # ld a, [dpymode] ! 3 or more digits then # # cp SETTING_ID L0F3B: FE 07 # jr z, 1f L0F3D: 28 0E # cp SETTING_RFC L0F3F: FE 01 # jr z, 2f L0F41: 28 33 # cp SETTING_STEP L0F43: FE 08 # jr z, 3f L0F45: 28 40 # cp SETTING_DIFF L0F47: FE 04 # jr z, 4f L0F49: 28 46 # jr 5f L0F4B: 18 25 # 1: L0F4D: 3A 86 C5 # ld a, [digidx] # cp 5 L0F50: FE 05 # jr nz, 5f L0F52: 20 1E L0F54: 3A 87 C5 L0F57: 32 14 C2 # ld a, [digbuf + 0]; ld [mycall + 0], a L0F5A: 3A 88 C5 L0F5D: 32 15 C2 # ld a, [digbuf + 1]; ld [mycall + 1], a L0F60: 3A 89 C5 L0F63: 32 16 C2 # ld a, [digbuf + 2]; ld [mycall + 2], a L0F66: 3A 8A C5 L0F69: 32 17 C2 # ld a, [digbuf + 3]; ld [mycall + 3], a L0F6C: 3A 8B C5 L0F6F: 32 18 C2 # ld a, [digbuf + 4]; ld [mycall + 4], a # 5: # call clear_buffer L0F72: CD 97 16 # ret L0F75: C9 # 2: # call a2i L0F76: CD 3C 27 L0F79: B4 # or h ! AH nonzero ? # jp nz, go_mhz ! HL L0F7A: C2 0A 10 L0F7D: 7D # ld a, l L0F7E: 32 2B C2 # ld [rfc], a L0F81: D3 30 # out [0x30], a # call save_rfc L0F83: CD 54 2B # ret L0F86: C9 # 3: # call a2i L0F87: CD 3C 27 L0F8A: 22 7E C5 # ld [bstep_R], hl # call reset_synth L0F8D: CD 0B 21 # ret L0F90: C9 # 4: # call a2i L0F91: CD 3C 27 L0F94: 22 1C C2 L0F97: 32 1E C2 # ld [rptr_sub], hl ; ld [(rptr_sub) + 2], a # call freq2div L0F9A: CD 28 28 # call save_ahl_to_tx_offset ! set repeater diff. L0F9D: CD 39 0E # ret L0FA0: C9 # # set_all_defaults: # call def_sqlv L0FA1: CD 5C 14 # call def_vola L0FA4: CD 19 15 # call def_memo L0FA7: CD 7F 12 # ret L0FAA: C9 # # execute: L0FAB: 3A 19 C2 # ld a, [scan_mode] L0FAE: B7 # or a # jp nz, scanner_stop ! Just stop it, nothing else L0FAF: C2 23 09 # call 1f L0FB2: CD B9 0F # call save_nvdata L0FB5: CD AC 2B # ret L0FB8: C9 # 1: # L0FB9: 3A A3 C5 # ld a, [dpymode] L0FBC: B7 # or a # jr z, 1f L0FBD: 28 06 # ld a, 0 L0FBF: 3E 00 L0FC1: 32 A3 C5 # ld [dpymode], a # ret L0FC4: C9 # 1: L0FC5: 3A 86 C5 # ld a, [digidx] # cp 3 L0FC8: FE 03 # jp c, gomem ! 1...2 digits L0FCA: DA 2B 13 # cp 5 L0FCD: FE 05 # jr nc, gofreq ! 5... digits L0FCF: 30 1A # # cp 3 L0FD1: FE 03 # jr z, 1f L0FD3: 28 0A # call a2i L0FD5: CD 3C 27 # ld de, 430000 % 65536 L0FD8: 11 B0 8F # ld b, 430000 / 65536 L0FDB: 06 06 # jr 2f L0FDD: 18 08 # 1: # go_freq_3_digits: # call a2i L0FDF: CD 3C 27 # ld de, 433000 % 65536 L0FE2: 11 68 9B # ld b, 433000 / 65536 L0FE5: 06 06 # 2: L0FE7: 19 # add hl, de L0FE8: 88 # adc b # jr 2f L0FE9: 18 03 # # gofreq: # call a2i L0FEB: CD 3C 27 # 2: L0FEE: 22 FB C1 L0FF1: 32 FD C1 # ld [currfreq], hl ; ld [(currfreq) + 2], a # call freq2div L0FF4: CD 28 28 L0FF7: 22 04 C2 L0FFA: 32 06 C2 # ld [tx_divisor], hl ; ld [(tx_divisor) + 2], a # call default_rptr L0FFD: CD 61 0E # call lookup_rfc L1000: CD 45 2B # call change_rxsynth L1003: CD 00 22 # # call remember_vip L1006: CD 20 10 # ret L1009: C9 # # go_mhz: L100A: 54 # ld d, h L100B: 5D # ld e, l # ld hl, 0 L100C: 21 00 00 # ld a, 0 ! HL has MHz, AHL gets freq L100F: 3E 00 # ld c, 10 L1011: 0E 0A # 3: # ld b, 100 L1013: 06 64 # 1: L1015: 19 # add hl, de ! AHL * 1000 # adc 0 L1016: CE 00 # djnz 1b L1018: 10 FB L101A: 0D # dec c # jr nz, 3b L101B: 20 F6 # # jp 2b L101D: C3 EE 0F # # ! # ! Push current memory/frequency # ! into vip_list, forgetting oldest record. # ! Duplicates raise into head of list. # ! # remember_vip: # # L1020: ED 4B FA C1 # ld bc, [currmem + 0] L1024: ED 5B FC C1 # ld de, [currmem + 2] # L1028: C5 L1029: DD E1 L102B: D5 L102C: FD E1 L102E: ED 4B A8 C5 L1032: ED 5B AA C5 L1036: DD 22 A8 C5 L103A: FD 22 AA C5 L103E: 2A FA C1 L1041: A7 L1042: ED 42 L1044: 20 09 L1046: 2A FC C1 L1049: A7 L104A: ED 52 L104C: 20 01 L104E: C9 L104F: C5 L1050: DD E1 L1052: D5 L1053: FD E1 L1055: ED 4B AC C5 L1059: ED 5B AE C5 L105D: DD 22 AC C5 L1061: FD 22 AE C5 L1065: 2A FA C1 L1068: A7 L1069: ED 42 L106B: 20 09 L106D: 2A FC C1 L1070: A7 L1071: ED 52 L1073: 20 01 L1075: C9 # push bc; pop ix; push de; pop iy; ld bc, [vip_list + 4 * 0 + 0]; ld de, [vip_list + 4 * 0 + 2]; ld [vip_list + 4 * 0 + 0], ix; ld [vip_list + 4 * 0 + 2], iy; ld hl, [currmem + 0]; and a; sbc hl, bc; jr nz, 1f; ld hl, [currmem + 2]; and a; sbc hl, de; jr nz, 1f; ret; 1: push bc; pop ix; push de; pop iy; ld bc, [vip_list + 4 * 1 + 0]; ld de, [vip_list + 4 * 1 + 2]; ld [vip_list + 4 * 1 + 0], ix; ld [vip_list + 4 * 1 + 2], iy; ld hl, [currmem + 0]; and a; sbc hl, bc; jr nz, 1f; ld hl, [currmem + 2]; and a; sbc hl, de; jr nz, 1f; ret; 1: L1076: C5 L1077: DD E1 L1079: D5 L107A: FD E1 L107C: ED 4B B0 C5 L1080: ED 5B B2 C5 L1084: DD 22 B0 C5 L1088: FD 22 B2 C5 L108C: 2A FA C1 L108F: A7 L1090: ED 42 L1092: 20 09 L1094: 2A FC C1 L1097: A7 L1098: ED 52 L109A: 20 01 L109C: C9 L109D: C5 L109E: DD E1 L10A0: D5 L10A1: FD E1 L10A3: ED 4B B4 C5 L10A7: ED 5B B6 C5 L10AB: DD 22 B4 C5 L10AF: FD 22 B6 C5 L10B3: 2A FA C1 L10B6: A7 L10B7: ED 42 L10B9: 20 09 L10BB: 2A FC C1 L10BE: A7 L10BF: ED 52 L10C1: 20 01 L10C3: C9 L10C4: C5 L10C5: DD E1 L10C7: D5 L10C8: FD E1 L10CA: ED 4B B8 C5 L10CE: ED 5B BA C5 L10D2: DD 22 B8 C5 L10D6: FD 22 BA C5 L10DA: 2A FA C1 L10DD: A7 L10DE: ED 42 L10E0: 20 09 L10E2: 2A FC C1 L10E5: A7 L10E6: ED 52 L10E8: 20 01 L10EA: C9 # push bc; pop ix; push de; pop iy; ld bc, [vip_list + 4 * 2 + 0]; ld de, [vip_list + 4 * 2 + 2]; ld [vip_list + 4 * 2 + 0], ix; ld [vip_list + 4 * 2 + 2], iy; ld hl, [currmem + 0]; and a; sbc hl, bc; jr nz, 1f; ld hl, [currmem + 2]; and a; sbc hl, de; jr nz, 1f; ret; 1: push bc; pop ix; push de; pop iy; ld bc, [vip_list + 4 * 3 + 0]; ld de, [vip_list + 4 * 3 + 2]; ld [vip_list + 4 * 3 + 0], ix; ld [vip_list + 4 * 3 + 2], iy; ld hl, [currmem + 0]; and a; sbc hl, bc; jr nz, 1f; ld hl, [currmem + 2]; and a; sbc hl, de; jr nz, 1f; ret; 1: push bc; pop ix; push de; pop iy; ld bc, [vip_list + 4 * 4 + 0]; ld de, [vip_list + 4 * 4 + 2]; ld [vip_list + 4 * 4 + 0], ix; ld [vip_list + 4 * 4 + 2], iy; ld hl, [currmem + 0]; and a; sbc hl, bc; jr nz, 1f; ld hl, [currmem + 2]; and a; sbc hl, de; jr nz, 1f; ret; 1: L10EB: C5 L10EC: DD E1 L10EE: D5 L10EF: FD E1 L10F1: ED 4B BC C5 L10F5: ED 5B BE C5 L10F9: DD 22 BC C5 L10FD: FD 22 BE C5 L1101: 2A FA C1 L1104: A7 L1105: ED 42 L1107: 20 09 L1109: 2A FC C1 L110C: A7 L110D: ED 52 L110F: 20 01 L1111: C9 L1112: C5 L1113: DD E1 L1115: D5 L1116: FD E1 L1118: ED 4B C0 C5 L111C: ED 5B C2 C5 L1120: DD 22 C0 C5 L1124: FD 22 C2 C5 L1128: 2A FA C1 L112B: A7 L112C: ED 42 L112E: 20 09 L1130: 2A FC C1 L1133: A7 L1134: ED 52 L1136: 20 01 L1138: C9 # push bc; pop ix; push de; pop iy; ld bc, [vip_list + 4 * 5 + 0]; ld de, [vip_list + 4 * 5 + 2]; ld [vip_list + 4 * 5 + 0], ix; ld [vip_list + 4 * 5 + 2], iy; ld hl, [currmem + 0]; and a; sbc hl, bc; jr nz, 1f; ld hl, [currmem + 2]; and a; sbc hl, de; jr nz, 1f; ret; 1: push bc; pop ix; push de; pop iy; ld bc, [vip_list + 4 * 6 + 0]; ld de, [vip_list + 4 * 6 + 2]; ld [vip_list + 4 * 6 + 0], ix; ld [vip_list + 4 * 6 + 2], iy; ld hl, [currmem + 0]; and a; sbc hl, bc; jr nz, 1f; ld hl, [currmem + 2]; and a; sbc hl, de; jr nz, 1f; ret; 1: L1139: C5 L113A: DD E1 L113C: D5 L113D: FD E1 L113F: ED 4B C4 C5 L1143: ED 5B C6 C5 L1147: DD 22 C4 C5 L114B: FD 22 C6 C5 L114F: 2A FA C1 L1152: A7 L1153: ED 42 L1155: 20 09 L1157: 2A FC C1 L115A: A7 L115B: ED 52 L115D: 20 01 L115F: C9 L1160: C5 L1161: DD E1 L1163: D5 L1164: FD E1 L1166: ED 4B C8 C5 L116A: ED 5B CA C5 L116E: DD 22 C8 C5 L1172: FD 22 CA C5 L1176: 2A FA C1 L1179: A7 L117A: ED 42 L117C: 20 09 L117E: 2A FC C1 L1181: A7 L1182: ED 52 L1184: 20 01 L1186: C9 L1187: C5 L1188: DD E1 L118A: D5 L118B: FD E1 L118D: ED 4B CC C5 L1191: ED 5B CE C5 L1195: DD 22 CC C5 L1199: FD 22 CE C5 L119D: 2A FA C1 L11A0: A7 L11A1: ED 42 L11A3: 20 09 L11A5: 2A FC C1 L11A8: A7 L11A9: ED 52 L11AB: 20 01 L11AD: C9 # push bc; pop ix; push de; pop iy; ld bc, [vip_list + 4 * 7 + 0]; ld de, [vip_list + 4 * 7 + 2]; ld [vip_list + 4 * 7 + 0], ix; ld [vip_list + 4 * 7 + 2], iy; ld hl, [currmem + 0]; and a; sbc hl, bc; jr nz, 1f; ld hl, [currmem + 2]; and a; sbc hl, de; jr nz, 1f; ret; 1: push bc; pop ix; push de; pop iy; ld bc, [vip_list + 4 * 8 + 0]; ld de, [vip_list + 4 * 8 + 2]; ld [vip_list + 4 * 8 + 0], ix; ld [vip_list + 4 * 8 + 2], iy; ld hl, [currmem + 0]; and a; sbc hl, bc; jr nz, 1f; ld hl, [currmem + 2]; and a; sbc hl, de; jr nz, 1f; ret; 1: push bc; pop ix; push de; pop iy; ld bc, [vip_list + 4 * 9 + 0]; ld de, [vip_list + 4 * 9 + 2]; ld [vip_list + 4 * 9 + 0], ix; ld [vip_list + 4 * 9 + 2], iy; ld hl, [currmem + 0]; and a; sbc hl, bc; jr nz, 1f; ld hl, [currmem + 2]; and a; sbc hl, de; jr nz, 1f; ret; 1: # ASSERT(VIP_COUNT == 10) # # ret L11AE: C9 # # next_vip: # L11AF: 3A A7 C5 # ld a, [vip_idx] L11B2: 4F # ld c, a L11B3: 3C # inc a # cp VIP_COUNT L11B4: FE 0A # jr c, 1f L11B6: 38 02 # ld a, 0 L11B8: 3E 00 # 1: L11BA: 32 A7 C5 # ld [vip_idx], a # # ld hl, vip_list L11BD: 21 A8 C5 # ld b, 0 L11C0: 06 00 L11C2: 09 # add hl, bc L11C3: 09 # add hl, bc L11C4: 09 # add hl, bc L11C5: 09 # add hl, bc # L11C6: E5 # push hl L11C7: DD E1 # pop ix # L11C9: DD 7E 01 # ld a, [ix + 1] L11CC: DD B6 02 # or [ix + 2] L11CF: DD B6 03 # or [ix + 3] L11D2: C8 # ret z ! Do not accept empty records in viplist # L11D3: DD 7E 00 # ld a, [ix + 0] L11D6: 32 FA C1 # ld [currmem], a # L11D9: DD 6E 01 # ld l, [ix + 1] L11DC: DD 66 02 # ld h, [ix + 2] L11DF: DD 7E 03 # ld a, [ix + 3] # L11E2: 22 FB C1 L11E5: 32 FD C1 # ld [currfreq], hl ; ld [(currfreq) + 2], a # call freq2div L11E8: CD 28 28 L11EB: 22 04 C2 L11EE: 32 06 C2 # ld [tx_divisor], hl ; ld [(tx_divisor) + 2], a # call default_rptr L11F1: CD 61 0E # call lookup_rfc L11F4: CD 45 2B # call change_rxsynth L11F7: CD 00 22 # # ret L11FA: C9 # # save: L11FB: 3A 86 C5 # ld a, [digidx] L11FE: B7 # or a # jr nz, 1f L11FF: 20 05 L1201: 3A FA C1 # ld a, [currmem] # jr 2f L1204: 18 04 # 1: # call a2i L1206: CD 3C 27 L1209: 7D # ld a, l # 2: # cp 100 L120A: FE 64 # jr c, 1f L120C: 38 02 # ld a, 0 L120E: 3E 00 # 1: # L1210: 32 FA C1 # ld [currmem], a # ld b, 0 L1213: 06 00 # L1215: 2A FE C1 L1218: 3A 00 C2 # ld hl, [tx_offset] ; ld a, [(tx_offset) + 2] L121B: B4 # or h L121C: B5 # or l # jr z, 1f L121D: 28 02 L121F: CB C0 # set BIT_RPTR, b # 1: L1221: 78 # ld a, b L1222: 32 79 C5 # ld [memflags], a # call redraw L1225: CD A1 1B # 7: L1228: 3A 79 C5 # ld a, [memflags] L122B: 47 # ld b, a L122C: 3A 78 C5 # ld a, [key_time] # cp 2 L122F: FE 02 # jr c, 1f L1231: 38 02 L1233: CB D0 # set BIT_NOSCAN, b # 1: L1235: 3A 78 C5 # ld a, [key_time] # cp 3 L1238: FE 03 # jr c, 1f L123A: 38 02 L123C: CB F8 # set BIT_EMPTY, b # 1: L123E: 3A 79 C5 # ld a, [memflags] L1241: B8 # cp b # jr z, 1f L1242: 28 07 L1244: 78 # ld a, b L1245: 32 79 C5 # ld [memflags], a # call redraw L1248: CD A1 1B # 1: L124B: 3A 85 C5 # ld a, [keydown] L124E: B7 # or a # jr nz, 7b L124F: 20 D7 # ld a, -1 L1251: 3E FF L1253: 32 82 C5 # ld [key], a # L1256: 3A FA C1 # ld a, [currmem] # ld b, 0 L1259: 06 00 L125B: 4F # ld c, a # ld hl, memories L125C: 21 00 C0 L125F: 09 # add hl, bc L1260: 09 # add hl, bc L1261: 09 # add hl, bc L1262: 09 # add hl, bc L1263: E5 # push hl L1264: DD E1 # pop ix # L1266: 3A 79 C5 # ld a, [memflags] L1269: DD 77 00 # ld [ix + 0], a # L126C: 2A FB C1 L126F: 3A FD C1 # ld hl, [currfreq] ; ld a, [(currfreq) + 2] L1272: DD 75 01 # ld [ix + 1], l L1275: DD 74 02 # ld [ix + 2], h L1278: DD 77 03 # ld [ix + 3], a # # call save_nvdata L127B: CD AC 2B # ret L127E: C9 # # def_memo: # call clear_buffer L127F: CD 97 16 # call scanner_stop L1282: CD 23 09 # # ld a, 3 L1285: 3E 03 L1287: 32 77 C5 # ld [adj_feedback], a # call redraw L128A: CD A1 1B # 1: L128D: 3A 78 C5 # ld a, [key_time] # cp 2 L1290: FE 02 # jr nc, 1f ! set default L1292: 30 16 L1294: 3A 85 C5 # ld a, [keydown] L1297: B7 # or a # jr nz, 1b L1298: 20 F3 # ld a, -1 L129A: 3E FF L129C: 32 82 C5 # ld [key], a # # ld a, 0 L129F: 3E 00 L12A1: 32 77 C5 # ld [adj_feedback], a # L12A4: 3A 0E C2 # ld a, [defmem] # jp gomem_a L12A7: C3 56 13 # 1: L12AA: 3A FA C1 # ld a, [currmem] L12AD: 32 0E C2 # ld [defmem], a # ld a, 4 L12B0: 3E 04 L12B2: 32 77 C5 # ld [adj_feedback], a # call redraw L12B5: CD A1 1B # 1: L12B8: 3A 85 C5 # ld a, [keydown] L12BB: B7 # or a # jr nz, 1b L12BC: 20 FA # ld a, 0 L12BE: 3E 00 L12C0: 32 77 C5 # ld [adj_feedback], a # ret L12C3: C9 # # up_memo: # call clear_buffer L12C4: CD 97 16 # call scanner_stop L12C7: CD 23 09 # ld e, 102 L12CA: 1E 66 # 2: L12CC: 1D # dec e # jr z, 8f L12CD: 28 1A L12CF: 3A FA C1 # ld a, [currmem] L12D2: 3C # inc a # cp 100 L12D3: FE 64 # jr c, 1f L12D5: 38 02 # ld a, 0 L12D7: 3E 00 # 1: L12D9: 32 FA C1 # ld [currmem], a # call getmemflags L12DC: CD 1A 13 # and MEM_EMPTY L12DF: E6 80 # jr nz, 2b L12E1: 20 E9 # L12E3: 3A FA C1 # ld a, [currmem] # jp gomem_a L12E6: C3 56 13 # 8: # ld a, -1 L12E9: 3E FF L12EB: 32 FA C1 # ld [currmem], a # ret L12EE: C9 # # dn_memo: # call clear_buffer L12EF: CD 97 16 # call scanner_stop L12F2: CD 23 09 # ld e, 102 L12F5: 1E 66 # 2: L12F7: 1D # dec e # jr z, 8f L12F8: 28 1A L12FA: 3A FA C1 # ld a, [currmem] L12FD: 3D # dec a # cp 100 L12FE: FE 64 # jr c, 1f L1300: 38 02 # ld a, 99 L1302: 3E 63 # 1: L1304: 32 FA C1 # ld [currmem], a # call getmemflags L1307: CD 1A 13 # and MEM_EMPTY L130A: E6 80 # jr nz, 2b L130C: 20 E9 # L130E: 3A FA C1 # ld a, [currmem] # jp gomem_a L1311: C3 56 13 # 8: # ld a, -1 L1314: 3E FF L1316: 32 FA C1 # ld [currmem], a # ret L1319: C9 # # getmemflags: # ld b, 0 L131A: 06 00 L131C: 4F # ld c, a # ld hl, memories L131D: 21 00 C0 L1320: 09 # add hl, bc L1321: 09 # add hl, bc L1322: 09 # add hl, bc L1323: 09 # add hl, bc ! 4 bytes per memory L1324: E5 # push hl L1325: DD E1 # pop ix # # ! # ! First byte misc info # ! Next 3 bytes frequency in binary Hz # ! L1327: DD 7E 00 # ld a, [ix + 0] # ret L132A: C9 # # gomem: # 1: L132B: 3A 78 C5 # ld a, [key_time] L132E: B7 # or a # jp nz, save L132F: C2 FB 11 # L1332: 3A 85 C5 # ld a, [keydown] L1335: B7 # or a # jr nz, 1b L1336: 20 F3 # ld a, -1 L1338: 3E FF L133A: 32 82 C5 # ld [key], a # L133D: 3A 86 C5 # ld a, [digidx] # cp 0 L1340: FE 00 # jp z, next_vip L1342: CA AF 11 # # call a2i L1345: CD 3C 27 L1348: 7D # ld a, l # cp 100 L1349: FE 64 # jr c, 1f L134B: 38 02 # ld a, 0 L134D: 3E 00 # 1: # call gomem_a L134F: CD 56 13 # call remember_vip L1352: CD 20 10 # ret L1355: C9 # # gomem_a: # L1356: 32 FA C1 # ld [currmem], a # ld b, 0 L1359: 06 00 L135B: 4F # ld c, a # ld hl, memories L135C: 21 00 C0 L135F: 09 # add hl, bc L1360: 09 # add hl, bc L1361: 09 # add hl, bc L1362: 09 # add hl, bc ! 4 bytes per memory L1363: E5 # push hl L1364: DD E1 # pop ix # # ! # ! First byte misc info # ! L1366: DD 7E 00 # ld a, [ix + 0] L1369: 32 79 C5 # ld [memflags], a # # and MEM_RPTR L136C: E6 01 L136E: 21 00 00 # ld hl, (0) % 65536 ; ld a, (0) / 65536 L1371: 3E 00 # jr z, 1f L1373: 28 09 L1375: 2A 1C C2 L1378: 3A 1E C2 # ld hl, [rptr_sub] ; ld a, [(rptr_sub) + 2] # call freq2div L137B: CD 28 28 # 1: # call save_ahl_to_tx_offset L137E: CD 39 0E # # ! # ! Next 3 bytes frequency in binary Hz # ! L1381: DD 6E 01 # ld l, [ix + 1] L1384: DD 66 02 # ld h, [ix + 2] L1387: DD 7E 03 # ld a, [ix + 3] # L138A: 22 FB C1 L138D: 32 FD C1 # ld [currfreq], hl ; ld [(currfreq) + 2], a # call freq2div L1390: CD 28 28 L1393: 22 04 C2 L1396: 32 06 C2 # ld [tx_divisor], hl ; ld [(tx_divisor) + 2], a # # call lookup_rfc L1399: CD 45 2B # call change_rxsynth L139C: CD 00 22 # # ret L139F: C9 # # insdig: L13A0: 5F # ld e, a # L13A1: 3A 86 C5 # ld a, [digidx] # cp 16 L13A4: FE 10 # jr nc, 1f L13A6: 30 0C # ld hl, digbuf L13A8: 21 87 C5 # ld b, 0 L13AB: 06 00 L13AD: 4F # ld c, a L13AE: 09 # add hl, bc L13AF: 3C # inc a L13B0: 73 # ld [hl], e L13B1: 32 86 C5 # ld [digidx], a # 1: # call scanner_stop L13B4: CD 23 09 # ret L13B7: C9 # # backspace: # ld a, 0 L13B8: 3E 00 L13BA: 32 A7 C5 # ld [vip_idx], a # # call scanner_stop L13BD: CD 23 09 # L13C0: 3A 86 C5 # ld a, [digidx] L13C3: B7 # or a # jr z, 1f L13C4: 28 06 # # # # # ld a, 0 ! Brute force clear all L13C6: 3E 00 # L13C8: 32 86 C5 # ld [digidx], a # ret L13CB: C9 # 1: L13CC: 3A A3 C5 # ld a, [dpymode] L13CF: B7 # or a # jp nz, clear_setting L13D0: C2 60 28 # # ret L13D3: C9 # # monitor_audio: # L13D4: 3A 9A C5 # ld a, [squelch_forced] # xor 1 L13D7: EE 01 L13D9: 32 9A C5 # ld [squelch_forced], a # L13DC: 3A F0 C5 # ld a, [cu_is_alfa] L13DF: B7 # or a # jr nz, 1f L13E0: 20 10 L13E2: 3A 9A C5 # ld a, [squelch_forced] # and 1 L13E5: E6 01 # ld hl, segments + (0x6b / 8) L13E7: 21 0D C5 # jr z, 2f L13EA: 28 04 L13EC: CB DE # set 0x6b % 8, [hl] # jr 1f L13EE: 18 02 # 2: L13F0: CB 9E # res 0x6b % 8, [hl] # 1: # L13F2: 2A FE C1 L13F5: 3A 00 C2 # ld hl, [tx_offset] ; ld a, [(tx_offset) + 2] L13F8: B4 # or h L13F9: B5 # or l # jr z, 1f ! Simplex. No channel change L13FA: 28 1C L13FC: ED 4B FE C1 L1400: 3A 00 C2 # ld bc, [tx_offset] ; ld a, [(tx_offset) + 2] L1403: 5F # ld e, a L1404: 2A 04 C2 L1407: 3A 06 C2 # ld hl, [tx_divisor] ; ld a, [(tx_divisor) + 2] L140A: 09 # add hl, bc L140B: 8B # adc e L140C: 22 04 C2 L140F: 32 06 C2 # ld [tx_divisor], hl ; ld [(tx_divisor) + 2], a # call lookup_rfc L1412: CD 45 2B # call change_rxsynth ! Duplex, peek repeater input L1415: CD 00 22 # 1: # call redraw L1418: CD A1 1B L141B: 3A 85 C5 # ld a, [keydown] L141E: B7 # or a # jr nz, 1b L141F: 20 F7 # ld a, -1 L1421: 3E FF L1423: 32 82 C5 # ld [key], a # L1426: 2A FE C1 L1429: 3A 00 C2 # ld hl, [tx_offset] ; ld a, [(tx_offset) + 2] L142C: B4 # or h L142D: B5 # or l # jr z, 1f ! Back to repeater output ? L142E: 28 21 L1430: ED 4B FE C1 L1434: 3A 00 C2 # ld bc, [tx_offset] ; ld a, [(tx_offset) + 2] L1437: 5F # ld e, a L1438: 2A 04 C2 L143B: 3A 06 C2 # ld hl, [tx_divisor] ; ld a, [(tx_divisor) + 2] L143E: A7 # and a L143F: ED 42 # sbc hl, bc L1441: 9B # sbc e L1442: 22 04 C2 L1445: 32 06 C2 # ld [tx_divisor], hl ; ld [(tx_divisor) + 2], a # call lookup_rfc L1448: CD 45 2B # call change_rxsynth L144B: CD 00 22 # call redraw L144E: CD A1 1B # 1: # ret L1451: C9 # # restart_prom: # 1: L1452: 3A 85 C5 # ld a, [keydown] L1455: B7 # or a # jp nz, 1b ! wait release L1456: C2 52 14 # # jp 0x0000 L1459: C3 00 00 # # def_sqlv: # call clear_buffer L145C: CD 97 16 # ld a, 3 L145F: 3E 03 L1461: 32 77 C5 # ld [adj_feedback], a # call redraw L1464: CD A1 1B # 1: L1467: 3A 78 C5 # ld a, [key_time] # cp 2 L146A: FE 02 # jr nc, 1f ! set default L146C: 30 30 L146E: 3A 85 C5 # ld a, [keydown] L1471: B7 # or a # jr nz, 1b L1472: 20 F3 # ld a, -1 L1474: 3E FF L1476: 32 82 C5 # ld [key], a # L1479: 3A 0F C2 # ld a, [defsq] L147C: 32 08 C2 # ld [squelch_limit_open], a # sub 8 L147F: D6 08 # jr nc, 2f L1481: 30 02 # ld a, 0 L1483: 3E 00 # 2: L1485: 32 07 C2 # ld [squelch_limit_close], a # # ld a, 0 L1488: 3E 00 L148A: 32 77 C5 # ld [adj_feedback], a # # ld a, 0 L148D: 3E 00 L148F: 32 9A C5 # ld [squelch_forced], a ! Adjusting opened sq removes hard open. # L1492: 3A F0 C5 # ld a, [cu_is_alfa] L1495: B7 # or a # jr nz, 2f L1496: 20 05 # ld hl, segments + (0x6b / 8) L1498: 21 0D C5 L149B: CB 9E # res 0x6b % 8, [hl] # 2: # ret L149D: C9 # 1: L149E: 3A 08 C2 # ld a, [squelch_limit_open] L14A1: 32 0F C2 # ld [defsq], a # ld a, 4 L14A4: 3E 04 L14A6: 32 77 C5 # ld [adj_feedback], a # call redraw L14A9: CD A1 1B # 1: L14AC: 3A 85 C5 # ld a, [keydown] L14AF: B7 # or a # jr nz, 1b L14B0: 20 FA # ld a, 0 L14B2: 3E 00 L14B4: 32 77 C5 # ld [adj_feedback], a # ret L14B7: C9 # # up_sqlv: # call clear_buffer L14B8: CD 97 16 # L14BB: 3A 08 C2 # ld a, [squelch_limit_open] # add 1 L14BE: C6 01 # jp nc, 1f L14C0: D2 CD 14 L14C3: 3A 1B C2 # ld a, [squelch_dir] # xor 1 L14C6: EE 01 L14C8: 32 1B C2 # ld [squelch_dir], a ! direction reversed, overflow of level. # ld a, 0 L14CB: 3E 00 # 1: L14CD: 32 08 C2 # ld [squelch_limit_open], a # sub 8 L14D0: D6 08 L14D2: 32 07 C2 # ld [squelch_limit_close], a # jr 2f L14D5: 18 22 # # dn_sqlv: # call clear_buffer L14D7: CD 97 16 # L14DA: 3A 08 C2 # ld a, [squelch_limit_open] # sub 1 L14DD: D6 01 # jp nc, 1f L14DF: D2 EC 14 L14E2: 3A 1B C2 # ld a, [squelch_dir] # xor 1 L14E5: EE 01 L14E7: 32 1B C2 # ld [squelch_dir], a ! direction reversed, underflow of level. # ld a, 0xFF L14EA: 3E FF # 1: L14EC: 32 08 C2 # ld [squelch_limit_open], a # sub 8 L14EF: D6 08 # jp nc, 1f L14F1: D2 F6 14 # ld a, 0 L14F4: 3E 00 # 1: L14F6: 32 07 C2 # ld [squelch_limit_close], a # 2: # ld a, 0 L14F9: 3E 00 L14FB: 32 9A C5 # ld [squelch_forced], a ! Adjusting opened sq removes hard open. # L14FE: 3A F0 C5 # ld a, [cu_is_alfa] L1501: B7 # or a # jr nz, 1f L1502: 20 05 # ld hl, segments + (0x6b / 8) L1504: 21 0D C5 L1507: CB 9E # res 0x6b % 8, [hl] # 1: # ret L1509: C9 # # up_rfc: # ld a, 1 L150A: 3E 01 # jr 1f L150C: 18 02 # dn_rfc: # ld a, -1 L150E: 3E FF # 1: # ld hl, rfc L1510: 21 2B C2 L1513: 86 # add [hl] L1514: 77 # ld [hl], a # call save_rfc L1515: CD 54 2B # ret L1518: C9 # # def_vola: # call clear_buffer L1519: CD 97 16 # ld a, 3 L151C: 3E 03 L151E: 32 77 C5 # ld [adj_feedback], a # call redraw L1521: CD A1 1B # 1: L1524: 3A 78 C5 # ld a, [key_time] # cp 2 L1527: FE 02 # jr nc, 1f ! set default L1529: 30 16 L152B: 3A 85 C5 # ld a, [keydown] L152E: B7 # or a # jr nz, 1b L152F: 20 F3 # ld a, -1 L1531: 3E FF L1533: 32 82 C5 # ld [key], a # # ld a, 0 L1536: 3E 00 L1538: 32 77 C5 # ld [adj_feedback], a # L153B: 3A 10 C2 # ld a, [defvola] # jp set_vola_default L153E: C3 79 15 # 1: L1541: 3A F8 C1 # ld a, [volume] L1544: 32 10 C2 # ld [defvola], a # ld a, 4 L1547: 3E 04 L1549: 32 77 C5 # ld [adj_feedback], a # call redraw L154C: CD A1 1B # 1: L154F: 3A 85 C5 # ld a, [keydown] L1552: B7 # or a # jr nz, 1b L1553: 20 FA # ld a, 0 L1555: 3E 00 L1557: 32 77 C5 # ld [adj_feedback], a # ret L155A: C9 # # set_vola: # ld a, 0 L155B: 3E 00 # jr 1f L155D: 18 16 # up_vola: L155F: 3A A3 C5 # ld a, [dpymode] # cp 1 L1562: FE 01 # jp z, up_rfc L1564: CA 0A 15 # ld a, 1 L1567: 3E 01 # jr 1f L1569: 18 0A # dn_vola: L156B: 3A A3 C5 # ld a, [dpymode] # cp 1 L156E: FE 01 # jp z, dn_rfc L1570: CA 0E 15 # ld a, -1 L1573: 3E FF # 1: # ld hl, volume L1575: 21 F8 C1 L1578: 86 # add [hl] # # set_vola_default: # cp 10 L1579: FE 0A # jr z, 1f ! 9 -> 10 L157B: 28 06 # jr c, 2f ! 0 -> -1 L157D: 38 06 # ld a, 0 L157F: 3E 00 # jr 2f L1581: 18 02 # 1: # ld a, 9 L1583: 3E 09 # 2: L1585: 32 F8 C1 # ld [volume], a # cp 0 L1588: FE 00 # jr z, 1f L158A: 28 1E # cp 1 L158C: FE 01 # jr z, 2f L158E: 28 2E # sub 2 ! 9 - 2 -> 7 L1590: D6 02 # and 7 L1592: E6 07 L1594: 47 # ld b, a L1595: F3 # di L1596: 3A 29 C2 # ld a, [output_0] # and ~0x07 L1599: E6 F8 # and ~0x08 L159B: E6 F7 L159D: B0 # or b L159E: 32 29 C2 # ld [output_0], a L15A1: D3 60 # out [0x60], a # ld hl, sir L15A3: 21 7A C5 L15A6: CB D6 # set DTMFSIR, [hl] L15A8: FB # ei # ret L15A9: C9 # 1: L15AA: F3 # di L15AB: 3A 29 C2 # ld a, [output_0] # and ~0x07 L15AE: E6 F8 # or 0x08 L15B0: F6 08 L15B2: 32 29 C2 # ld [output_0], a L15B5: D3 60 # out [0x60], a # ld hl, sir L15B7: 21 7A C5 L15BA: CB D6 # set DTMFSIR, [hl] L15BC: FB # ei # ret L15BD: C9 # 2: L15BE: F3 # di L15BF: 3A 29 C2 # ld a, [output_0] # and ~0x07 L15C2: E6 F8 # and ~0x08 L15C4: E6 F7 L15C6: 32 29 C2 # ld [output_0], a L15C9: D3 60 # out [0x60], a # ld hl, sir L15CB: 21 7A C5 L15CE: CB D6 # set DTMFSIR, [hl] L15D0: FB # ei # ret L15D1: C9 # # def_freq: # call clear_buffer L15D2: CD 97 16 # call scanner_stop L15D5: CD 23 09 # ld a, 3 L15D8: 3E 03 L15DA: 32 77 C5 # ld [adj_feedback], a # call redraw L15DD: CD A1 1B # 1: L15E0: 3A 78 C5 # ld a, [key_time] # cp 2 L15E3: FE 02 # jr nc, 1f ! set default L15E5: 30 34 L15E7: 3A 85 C5 # ld a, [keydown] L15EA: B7 # or a # jr nz, 1b L15EB: 20 F3 # ld a, -1 L15ED: 3E FF L15EF: 32 82 C5 # ld [key], a # # ld a, 0 L15F2: 3E 00 L15F4: 32 77 C5 # ld [adj_feedback], a # # ld a, -1 L15F7: 3E FF L15F9: 32 FA C1 # ld [currmem], a # L15FC: 2A 0B C2 L15FF: 3A 0D C2 # ld hl, [deffreq] ; ld a, [(deffreq) + 2] L1602: 22 FB C1 L1605: 32 FD C1 # ld [currfreq], hl ; ld [(currfreq) + 2], a # call freq2div L1608: CD 28 28 L160B: 22 04 C2 L160E: 32 06 C2 # ld [tx_divisor], hl ; ld [(tx_divisor) + 2], a # call default_rptr L1611: CD 61 0E # call lookup_rfc L1614: CD 45 2B # call change_rxsynth L1617: CD 00 22 # ret L161A: C9 # 1: L161B: 2A FB C1 L161E: 3A FD C1 # ld hl, [currfreq] ; ld a, [(currfreq) + 2] L1621: 22 0B C2 L1624: 32 0D C2 # ld [deffreq], hl ; ld [(deffreq) + 2], a # ld a, 4 L1627: 3E 04 L1629: 32 77 C5 # ld [adj_feedback], a # call redraw L162C: CD A1 1B # 1: L162F: 3A 85 C5 # ld a, [keydown] L1632: B7 # or a # jr nz, 1b L1633: 20 FA # ld a, 0 L1635: 3E 00 L1637: 32 77 C5 # ld [adj_feedback], a # ret L163A: C9 # # up_freq: # call clear_buffer L163B: CD 97 16 # call scanner_stop L163E: CD 23 09 # ld bc, 1 L1641: 01 01 00 # up_freq_bc: L1644: 2A 04 C2 L1647: 3A 06 C2 # ld hl, [tx_divisor] ; ld a, [(tx_divisor) + 2] L164A: 09 # add hl, bc # adc 0 L164B: CE 00 # and 1 ! only 17-bit divisor L164D: E6 01 L164F: 22 04 C2 L1652: 32 06 C2 # ld [tx_divisor], hl ; ld [(tx_divisor) + 2], a # call div2freq L1655: CD 2F 2B L1658: 22 FB C1 L165B: 32 FD C1 # ld [currfreq], hl ; ld [(currfreq) + 2], a # call default_rptr L165E: CD 61 0E # call lookup_rfc L1661: CD 45 2B # call change_rxsynth L1664: CD 00 22 # ret L1667: C9 # # dn_freq: # call clear_buffer L1668: CD 97 16 # call scanner_stop L166B: CD 23 09 L166E: 2A 04 C2 L1671: 3A 06 C2 # ld hl, [tx_divisor] ; ld a, [(tx_divisor) + 2] # ld bc, 0 L1674: 01 00 00 L1677: 37 # scf L1678: ED 42 # sbc hl, bc # sbc 0 L167A: DE 00 # and 1 ! only 17-bit divisor L167C: E6 01 L167E: 22 04 C2 L1681: 32 06 C2 # ld [tx_divisor], hl ; ld [(tx_divisor) + 2], a # call div2freq L1684: CD 2F 2B L1687: 22 FB C1 L168A: 32 FD C1 # ld [currfreq], hl ; ld [(currfreq) + 2], a # call default_rptr L168D: CD 61 0E # call lookup_rfc L1690: CD 45 2B # call change_rxsynth L1693: CD 00 22 # ret L1696: C9 # # clear_buffer: # ld a, 0 L1697: 3E 00 L1699: 32 86 C5 # ld [digidx], a # ret L169C: C9 # # pttcheck: L169D: 3A 84 C5 # ld a, [pttdn] L16A0: B7 # or a L16A1: C8 # ret z # # call cu_call_off L16A2: CD 3A 2C # # ld a, 0 L16A5: 3E 00 L16A7: 32 A4 C5 # ld [call_dpyed], a # # call tx_on L16AA: CD 6A 26 # jp c, tx_error L16AD: DA 1C 0E # L16B0: 3A 86 C5 # ld a, [digidx] ! CCIR if digits, then /PTT down L16B3: B7 # or a # jp z, 2f L16B4: CA 43 17 # call redraw L16B7: CD A1 1B # L16BA: F3 # di # ld a, 4 L16BB: 3E 04 L16BD: D3 21 # out [0x20 + 1], a # ld a, 0 L16BF: 3E 00 L16C1: D3 21 # out [0x20 + 1], a L16C3: 3A 29 C2 # ld a, [output_0] L16C6: F5 # push af # and ~0x07 L16C7: E6 F8 # or 0x80 L16C9: F6 80 L16CB: 32 29 C2 # ld [output_0], a L16CE: D3 60 # out [0x60], a # ld a, 20 ! 10 ms systicks, 200 ms silence before ccir L16D0: 3E 14 L16D2: 32 50 C5 # ld [ccir_tx_timer], a L16D5: FB # ei # 3: L16D6: 3A 50 C5 # ld a, [ccir_tx_timer] L16D9: B7 # or a # jr nz, 3b L16DA: 20 FA L16DC: F3 # di L16DD: 3A 29 C2 # ld a, [output_0] # or 0x20 | 0x40 | 0x10 L16E0: F6 70 L16E2: 32 29 C2 # ld [output_0], a L16E5: D3 60 # out [0x60], a L16E7: FB # ei # # ld ix, digbuf ! Start of digits L16E8: DD 21 87 C5 L16EC: 3A 86 C5 # ld a, [digidx] L16EF: 47 # ld b, a ! Digit count # ld c, -1 ! Prev digit L16F0: 0E FF # ld d, 0 ! MSB of hl offset L16F2: 16 00 # 1: L16F4: DD 7E 00 # ld a, [ix] ! Pick a digit L16F7: DD 23 # inc ix L16F9: B9 # cp c # jr nz, 3f L16FA: 20 02 # ld a, 0xE L16FC: 3E 0E # 3: L16FE: 4F # ld c, a L16FF: 5F # ld e, a L1700: CB 23 # sla e ! two bytes per record in table # ld hl, ccirtbl L1702: 21 00 2F L1705: 19 # add hl, de L1706: F3 # di L1707: 7E # ld a, [hl] L1708: 23 # inc hl L1709: D3 21 # out [0x20 + 1], a L170B: 7E # ld a, [hl] L170C: D3 21 # out [0x20 + 1], a # ld a, 10 ! 10 ms systicks L170E: 3E 0A L1710: 32 50 C5 # ld [ccir_tx_timer], a L1713: FB # ei # 3: L1714: 3A 50 C5 # ld a, [ccir_tx_timer] L1717: B7 # or a # jr nz, 3b L1718: 20 FA # # djnz 1b ! foreach digit L171A: 10 D8 # L171C: F3 # di L171D: 3A 29 C2 # ld a, [output_0] # and ~(0x20 | 0x40 | 0x10) L1720: E6 8F L1722: 32 29 C2 # ld [output_0], a L1725: D3 60 # out [0x60], a # ld a, 4 L1727: 3E 04 L1729: D3 21 # out [0x20 + 1], a # ld a, 0 L172B: 3E 00 L172D: D3 21 # out [0x20 + 1], a # ld a, 10 L172F: 3E 0A L1731: 32 50 C5 # ld [ccir_tx_timer], a L1734: FB # ei # 3: L1735: 3A 50 C5 # ld a, [ccir_tx_timer] L1738: B7 # or a # jr nz, 3b ! add one 100msec of silence for sure L1739: 20 FA # L173B: F3 # di L173C: F1 # pop af L173D: 32 29 C2 # ld [output_0], a L1740: D3 60 # out [0x60], a L1742: FB # ei ! restored port 0 # 2: # L1743: F3 # di L1744: 3A 29 C2 # ld a, [output_0] # and ~(0x20 | 0x80) ! No tones, no mic mute L1747: E6 5F L1749: 32 29 C2 # ld [output_0], a L174C: D3 60 # out [0x60], a # ld a, 4 L174E: 3E 04 L1750: D3 21 # out [0x20 + 1], a # ld a, 0 L1752: 3E 00 L1754: D3 21 # out [0x20 + 1], a L1756: FB # ei # # call battcheck L1757: CD 5E 07 # call redraw L175A: CD A1 1B L175D: 3A 2F C2 # ld a, [ad_batt] L1760: 5F # ld e, a # 1: L1761: 3A 2F C2 # ld a, [ad_batt] L1764: 93 # sub e # jr z, 2f L1765: 28 12 # cp 1 L1767: FE 01 # jr z, 2f L1769: 28 0E # cp -1 L176B: FE FF # jr z, 2f L176D: 28 0A # call battcheck L176F: CD 5E 07 # call redraw L1772: CD A1 1B L1775: 3A 2F C2 # ld a, [ad_batt] L1778: 5F # ld e, a # 2: L1779: 3A 82 C5 # ld a, [key] ! DTMF if key pressed after /PTT down # cp -1 L177C: FE FF # jr z, 3f L177E: 28 07 L1780: D5 # push de # call handle_key_during_tx L1781: CD C3 17 L1784: D1 # pop de # jr 2f L1785: 18 1B # 3: L1787: 3A 85 C5 # ld a, [keydown] L178A: B7 # or a # jr nz, 2f ! if key still down L178B: 20 15 # ld a, -1 L178D: 3E FF L178F: 32 82 C5 # ld [key], a L1792: 3A ED C5 # ld a, [dtmf_code] L1795: B7 # or a # jr z, 2f ! if no tone on L1796: 28 0A # ld a, 0 L1798: 3E 00 L179A: 32 ED C5 # ld [dtmf_code], a # ld hl, sir L179D: 21 7A C5 L17A0: CB D6 # set DTMFSIR, [hl] # 2: L17A2: 3A 84 C5 # ld a, [pttdn] L17A5: B7 # or a # jp nz, 1b L17A6: C2 61 17 # L17A9: 3A ED C5 # ld a, [dtmf_code] L17AC: B7 # or a # jr z, 1f L17AD: 28 0A # ld a, 0 L17AF: 3E 00 L17B1: 32 ED C5 # ld [dtmf_code], a # ld hl, sir L17B4: 21 7A C5 L17B7: CB D6 # set DTMFSIR, [hl] # 1: # call tx_off L17B9: CD FB 26 # call redraw L17BC: CD A1 1B # # call remember_vip L17BF: CD 20 10 # ret L17C2: C9 # # handle_key_during_tx: # L17C3: 4F # ld c, a # ld a, -1 L17C4: 3E FF L17C6: 32 82 C5 # ld [key], a L17C9: 79 # ld a, c # # cp '+' L17CA: FE 2B # jr nz, 1f L17CC: 20 0F L17CE: 3A F9 C1 # ld a, [txpwr] # add 1 L17D1: C6 01 # sbc 0 L17D3: DE 00 L17D5: 32 F9 C1 # ld [txpwr], a L17D8: D3 40 # out [0x40], a # jp redraw L17DA: C3 A1 1B # 1: # cp '-' L17DD: FE 2D # jr nz, 1f L17DF: 20 0F L17E1: 3A F9 C1 # ld a, [txpwr] # sub 1 L17E4: D6 01 # adc 0 L17E6: CE 00 L17E8: 32 F9 C1 # ld [txpwr], a L17EB: D3 40 # out [0x40], a # jp redraw L17ED: C3 A1 1B # 1: # ! # ! Else assume DTMF is wanted. # ! XXX Divert now if not cu_is_alfa. # ! L17F0: 3A F0 C5 # ld a, [cu_is_alfa] L17F3: B7 # or a L17F4: 79 # ld a, c # jp z, dtmf_bang_tone L17F5: CA 26 33 # # cp 'R' L17F8: FE 52 # jr z, do_dtmf_1760 L17FA: 28 0B # cp '*' L17FC: FE 2A # jr z, do_dtmf_star L17FE: 28 0B # cp '#' L1800: FE 23 # jr z, do_dtmf_hash L1802: 28 0B # # jp do_dtmf_digit L1804: C3 13 18 # # ! Codes for PCF3312 # # do_dtmf_1760: # ld a, 0x3F L1807: 3E 3F # jr 1f L1809: 18 0C # do_dtmf_star: # ld a, 0x1E L180B: 3E 1E # jr 1f L180D: 18 08 # do_dtmf_hash: # ld a, 0x1F L180F: 3E 1F # jr 1f L1811: 18 04 # # do_dtmf_digit: # and 0x0F L1813: E6 0F # or 0x10 L1815: F6 10 # 1: L1817: 32 ED C5 # ld [dtmf_code], a # ld hl, sir L181A: 21 7A C5 L181D: CB D6 # set DTMFSIR, [hl] # ret L181F: C9 # # !---------------------------------------------------------------------- # ! # ! Powerdown # ! # powerdown: L1820: F3 # di # ld a, 0x80 L1821: 3E 80 L1823: D3 70 # out [0x70], a # ld a, 0x80 L1825: 3E 80 L1827: D3 01 # out [0x00+1], a L1829: 76 # halt # jp powerdown L182A: C3 20 18 # # !---------------------------------------------------------------------- # ! # ! MBUS putchar, character in c # ! # # putchar: # ld hl, mbustx_cnt L182D: 21 41 C5 # putchar_1: L1830: 7E # ld a, [hl] L1831: 3C # inc a # jr z, putchar_1 ! wait until not full L1832: 28 FC L1834: F3 # di L1835: 7E # ld a, [hl] L1836: 34 # inc [hl] L1837: B7 # or a # jr z, putchar_start ! tx not active, go start it L1838: 28 0A L183A: 2A 27 C2 # ld hl, [mbustx_wp] L183D: 71 # ld [hl], c L183E: 2C # inc l L183F: 22 27 C2 # ld [mbustx_wp], hl L1842: FB # ei # ret L1843: C9 # putchar_start: L1844: 79 # ld a, c L1845: D3 11 # out [0x10+1], a # ld a, 25 L1847: 3E 19 L1849: 32 43 C5 # ld [mbus_timer], a # putchar_out: L184C: FB # ei # ret L184D: C9 # # iputc: L184E: F5 # push af L184F: 3A 41 C5 # ld a, [mbustx_cnt] L1852: 3C # inc a # jr z, 1f ! full L1853: 28 12 L1855: 32 41 C5 # ld [mbustx_cnt], a L1858: 3D # dec a # jr z, 2f ! tx not active, go start it L1859: 28 0E L185B: F1 # pop af L185C: E5 # push hl L185D: 2A 27 C2 # ld hl, [mbustx_wp] L1860: 77 # ld [hl], a L1861: 2C # inc l L1862: 22 27 C2 # ld [mbustx_wp], hl L1865: E1 # pop hl # ret L1866: C9 # 1: L1867: F1 # pop af # ret L1868: C9 # 2: L1869: F1 # pop af L186A: D3 11 # out [0x10+1], a # ld a, 25 L186C: 3E 19 L186E: 32 43 C5 # ld [mbus_timer], a # ret L1871: C9 # # # getchar: # ld hl, mbusrx_cnt L1872: 21 42 C5 L1875: 7E # ld a, [hl] L1876: B7 # or a # jr z, getchar L1877: 28 F9 L1879: F3 # di L187A: 35 # dec [hl] L187B: 2A 21 C2 # ld hl, [mbusrx_rp] L187E: 7E # ld a, [hl] L187F: 2C # inc l L1880: 22 21 C2 # ld [mbusrx_rp], hl L1883: FB # ei # ret L1884: C9 # # .align 8 L1885: 00 [ 7B ] # # keytbl_cu53an: L1900: 5A L1901: 5A L1902: 5A L1903: 5A L1904: 5A L1905: 5A L1906: 5A # .byte 'Z','Z','Z','Z','Z','Z','Z','Z' L1907: 5A L1908: 5A L1909: 5A L190A: 5A L190B: 5A L190C: 2B L190D: 2D L190E: 3F # .byte 'Z','Z','Z','Z','+','-','?','B' L190F: 42 L1910: 45 L1911: 2A L1912: 00 L1913: 23 L1914: 52 L1915: 07 L1916: 08 # .byte 'E','*', 0 ,'#','R', 7 , 8 , 9 L1917: 09 L1918: 53 L1919: 04 L191A: 05 L191B: 06 L191C: 43 L191D: 01 L191E: 02 # .byte 'S', 4 , 5 , 6 ,'C', 1 , 2 , 3 L191F: 03 # # keytbl_cu58af: L1920: 5A L1921: 5A L1922: 42 L1923: 04 L1924: 02 L1925: 01 L1926: 05 # .byte 'Z','Z','B', 4 , 2 , 1 , 5 , 6 L1927: 06 L1928: 03 L1929: 07 L192A: 08 L192B: 09 L192C: 2A L192D: 00 L192E: 45 # .byte 3 , 7 , 8 , 9 ,'*', 0 ,'E','-' L192F: 2D L1930: 43 L1931: 23 L1932: 2B L1933: 53 L1934: 52 L1935: 5A L1936: 5A # .byte 'C','#','+','S','R','Z','Z','Z' L1937: 5A L1938: 5A L1939: 5A L193A: 5A L193B: 5A L193C: 5A L193D: 5A L193E: 5A # .byte 'Z','Z','Z','Z','Z','Z','Z','Z' L193F: 5A L1940: 5A L1941: 5A L1942: 5A L1943: 5A L1944: 5A L1945: 5A L1946: 5A # .byte 'Z','Z','Z','Z','Z','Z','Z','Z' L1947: 5A # # cu_manipulated: # ld a, 0 L1948: 3E 00 L194A: 32 A4 C5 # ld [call_dpyed], a # L194D: 3A EF C5 # ld a, [portable] L1950: B7 # or a # jr z, 1f L1951: 28 06 # ld hl, 100 * 5 L1953: 21 F4 01 L1956: 22 4B C5 # ld [light_ltimer], hl # 1: # call cu_lights_on L1959: CD C9 2B # call cu_call_off L195C: CD 3A 2C # ret L195F: C9 # # keypad: # L1960: 3A F0 C5 # ld a, [cu_is_alfa] L1963: B7 # or a # jp z, 1f L1964: CA 7E 19 # # call keypad_cu58af L1967: CD 9A 1E L196A: C8 # ret z # L196B: F5 # push af # ld a, 0 L196C: 3E 00 L196E: 32 46 C5 # ld [key_timer], a L1971: 32 78 C5 # ld [key_time], a # call cu_manipulated L1974: CD 48 19 # call blip L1977: CD 69 1A L197A: F1 # pop af # # jp 2f L197B: C3 BD 19 # 1: # # ld a, 0 ! CU53AN then L197E: 3E 00 L1980: 32 46 C5 # ld [key_timer], a L1983: 32 78 C5 # ld [key_time], a # # call cu_manipulated L1986: CD 48 19 # call blip L1989: CD 69 1A # # ! # ! strobe the data into shifter # ! # ld a, (0x08 | 0) L198C: 3E 08 L198E: D3 80 # out [0x80], a # ld a, (0x08 | 0) | 0x40 L1990: 3E 48 L1992: D3 80 # out [0x80], a # ld a, (0x08 | 0) L1994: 3E 08 L1996: D3 80 # out [0x80], a # ld a, (0x08 | 0x20) L1998: 3E 28 L199A: D3 80 # out [0x80], a # L199C: DB 01 # in a, [0x00+1] ! from LDR # and 0x08 L199E: E6 08 L19A0: 32 83 C5 # ld [dark], a # # ! # ! shift 5 keycode bits to l # ! # ld l, 0 ! collect bits here L19A3: 2E 00 # ld h, 5 ! this many L19A5: 26 05 # 1: # ld a, (0x08 | 0x20) | 0x40 L19A7: 3E 68 L19A9: D3 80 # out [0x80], a # ld a, (0x08 | 0x20) L19AB: 3E 28 L19AD: D3 80 # out [0x80], a L19AF: DB 01 # in a, [0x00+1] # and 0x08 L19B1: E6 08 # sub 1 L19B3: D6 01 L19B5: CB 15 # rl l # L19B7: 25 # dec h # jr nz, 1b L19B8: 20 ED # # ld h, HI(keytbl_cu53an) L19BA: 26 19 L19BC: 7E # ld a, [hl] ! map code to character # # 2: # L19BD: 32 81 C5 # ld [lastkey], a # # cp 'B' L19C0: FE 42 # jr z, 1f L19C2: 28 0A # cp '*' L19C4: FE 2A # jr z, 1f L19C6: 28 06 # cp '#' L19C8: FE 23 # jr z, 1f L19CA: 28 02 # jr 2f L19CC: 18 04 # 1: L19CE: 32 82 C5 # ld [key], a ! little button, * and # dont repeat # ret L19D1: C9 # 2: # cp 10 ! digit ? L19D2: FE 0A # jr nc, 1f L19D4: 30 54 # ! Yes, downtime determines 0..9 or function. L19D6: 32 80 C5 # ld [lastdigit], a # L19D9: 3A 2A C2 # ld a, [txon] L19DC: B7 # or a L19DD: 3A 80 C5 # ld a, [lastdigit] # jr nz, 1b ! TX on, digits are DTMF. No repeat L19E0: 20 EC # # cp 1 L19E2: FE 01 # jr z, 2f L19E4: 28 34 # cp 4 L19E6: FE 04 # jr z, 2f L19E8: 28 30 # # cp 7 L19EA: FE 07 # jr z, 3f L19EC: 28 1C # cp 8 L19EE: FE 08 # jr z, 3f L19F0: 28 18 # cp 9 L19F2: FE 09 # jr z, 3f L19F4: 28 14 # cp 0 L19F6: FE 00 # jr z, 3f L19F8: 28 10 # # ld a, 255 ! 2356 memory/freq adjust L19FA: 3E FF L19FC: 32 48 C5 # ld [key_blips], a # ld a, 50 L19FF: 3E 32 L1A01: 32 46 C5 # ld [key_timer], a # ld a, 33 L1A04: 3E 21 L1A06: 32 47 C5 # ld [key_speed], a # ret L1A09: C9 # 3: # ld a, 2 ! 7890 default buttons L1A0A: 3E 02 L1A0C: 32 48 C5 # ld [key_blips], a # ld a, 50 L1A0F: 3E 32 L1A11: 32 46 C5 # ld [key_timer], a # ld a, 100 L1A14: 3E 64 L1A16: 32 47 C5 # ld [key_speed], a # ret L1A19: C9 # 2: # ld a, 8 ! 14 squelch adjust L1A1A: 3E 08 L1A1C: 32 47 C5 # ld [key_speed], a # ld a, 50 L1A1F: 3E 32 L1A21: 32 46 C5 # ld [key_timer], a # ld a, 1 L1A24: 3E 01 L1A26: 32 48 C5 # ld [key_blips], a # ret L1A29: C9 # 1: L1A2A: 32 82 C5 # ld [key], a # # cp '+' L1A2D: FE 2B # jr z, 1f L1A2F: 28 28 # cp '-' L1A31: FE 2D # jr z, 1f L1A33: 28 24 # cp 'S' L1A35: FE 53 # jr z, 2f L1A37: 28 10 # # ld a, 100 L1A39: 3E 64 L1A3B: 32 46 C5 # ld [key_timer], a # ld a, 100 L1A3E: 3E 64 L1A40: 32 47 C5 # ld [key_speed], a # ld a, 4 L1A43: 3E 04 L1A45: 32 48 C5 # ld [key_blips], a # ret ! Not digit nor +/- L1A48: C9 # 2: # ld a, 100 L1A49: 3E 64 L1A4B: 32 46 C5 # ld [key_timer], a # ld a, 100 L1A4E: 3E 64 L1A50: 32 47 C5 # ld [key_speed], a # ld a, 2 L1A53: 3E 02 L1A55: 32 48 C5 # ld [key_blips], a # ret L1A58: C9 # 1: # ld a, 50 L1A59: 3E 32 L1A5B: 32 46 C5 # ld [key_timer], a # ld a, 20 L1A5E: 3E 14 L1A60: 32 47 C5 # ld [key_speed], a # ld a, 255 L1A63: 3E FF L1A65: 32 48 C5 # ld [key_blips], a # # ret L1A68: C9 # # blip: L1A69: E5 # push hl # ld hl, MT_600HZ L1A6A: 21 40 1A # ld d, 3 L1A6D: 16 03 # call start_marker_tone L1A6F: CD D0 1A # L1A72: E1 # pop hl # ret L1A73: C9 # # bleep: L1A74: E5 # push hl # ld hl, MT_300HZ L1A75: 21 80 34 # ld d, 100 L1A78: 16 64 # call start_marker_tone L1A7A: CD D0 1A # L1A7D: E1 # pop hl # ret L1A7E: C9 # # ding: # L1A7F: C5 # push bc # L1A80: F3 # di # call stop_marker_tone L1A81: CD E5 1A L1A84: 3A 29 C2 # ld a, [output_0] L1A87: F5 # push af # and ~0x10 L1A88: E6 EF L1A8A: D3 60 # out [0x60], a # and ~0x08 L1A8C: E6 F7 L1A8E: D3 60 # out [0x60], a # or 0x07 L1A90: F6 07 L1A92: D3 60 # out [0x60], a L1A94: 32 29 C2 # ld [output_0], a # ld a, 1 L1A97: 3E 01 L1A99: 32 9B C5 # ld [mton], a L1A9C: FB # ei # # ld b, 5 L1A9D: 06 05 # 2: L1A9F: E5 # push hl # ld hl, MT_1200HZ L1AA0: 21 20 0D # ld d, 5 L1AA3: 16 05 # call start_marker_tone L1AA5: CD D0 1A L1AA8: E1 # pop hl # 1: L1AA9: 3A 45 C5 # ld a, [mt_timer] L1AAC: B7 # or a # jr nz, 1b L1AAD: 20 FA # L1AAF: E5 # push hl # ld hl, MT_1400HZ L1AB0: 21 40 0B # ld d, 5 L1AB3: 16 05 # call start_marker_tone L1AB5: CD D0 1A L1AB8: E1 # pop hl # 1: L1AB9: 3A 45 C5 # ld a, [mt_timer] L1ABC: B7 # or a # jr nz, 1b L1ABD: 20 FA # # djnz 2b L1ABF: 10 DE # L1AC1: F3 # di L1AC2: F1 # pop af L1AC3: 32 29 C2 # ld [output_0], a L1AC6: D3 60 # out [0x60], a # ld a, 0 L1AC8: 3E 00 L1ACA: 32 9B C5 # ld [mton], a L1ACD: FB # ei # L1ACE: C1 # pop bc # ret L1ACF: C9 # # ! # ! Duration in 10ms in d, pitch in hl # ! # start_marker_tone: # # ld a, 0 L1AD0: 3E 00 L1AD2: 32 45 C5 # ld [mt_timer], a # L1AD5: 7D # ld a, l L1AD6: D3 21 # out [0x20 + 1], a L1AD8: 7C # ld a, h L1AD9: D3 21 # out [0x20 + 1], a ! pitch # # ld hl, output_0 L1ADB: 21 29 C2 L1ADE: CB F6 # set 6, [hl] # L1AE0: 7A # ld a, d L1AE1: 32 45 C5 # ld [mt_timer], a ! duration in 10ms units # # ret L1AE4: C9 # # stop_marker_tone: # # ld a, 0 L1AE5: 3E 00 L1AE7: 32 45 C5 # ld [mt_timer], a # L1AEA: 3A 29 C2 # ld a, [output_0] # and ~0x40 L1AED: E6 BF L1AEF: 32 29 C2 # ld [output_0], a L1AF2: D3 60 # out [0x60], a ! Cut tone from local audio # # ld a, 0x04 L1AF4: 3E 04 L1AF6: D3 21 # out [0x20 + 1], a ! But it leaks anyway, highest possible # ld a, 0x00 L1AF8: 3E 00 L1AFA: D3 21 # out [0x20 + 1], a ! tone causes the least harm... brrh. # # ret L1AFC: C9 # # ! 0 -> 8 -> 0 # ! 1 -> 9 -> 0 # ! 2 -> 10 -> 0 # ! 7 -> 15 -> 0 # ! 8 -> 16 -> 1 # ! 9 -> 17 -> 1 # # dpysig: # add 8 L1AFD: C6 08 # jr nc, 1f L1AFF: 30 02 # ld a, 0xff L1B01: 3E FF # 1: L1B03: CB 3F L1B05: CB 3F L1B07: CB 3F L1B09: CB 3F # srl a ; srl a ; srl a ; srl a # jp dpydig L1B0B: C3 16 26 # # dpyval255: L1B0E: C5 # push bc # # ld b, -1 L1B0F: 06 FF # 1: L1B11: 04 # inc b ! hundreds # sub 100 L1B12: D6 64 # jr nc, 1b L1B14: 30 FB # add 100 L1B16: C6 64 # # ld c, -1 L1B18: 0E FF # 1: L1B1A: 0C # inc c # sub 10 ! tens L1B1B: D6 0A # jr nc, 1b L1B1D: 30 FB # add 10 + '0' L1B1F: C6 3A # L1B21: F5 # push af ! ones # # ld a, 0 L1B22: 3E 00 L1B24: B0 # or b # jr nz, 1f L1B25: 20 07 # ld b, ' ' L1B27: 06 20 L1B29: B1 # or c # jr nz, 1f L1B2A: 20 02 # ld c, ' ' L1B2C: 0E 20 # 1: L1B2E: 78 # ld a, b # call dpydig L1B2F: CD 16 26 L1B32: 79 # ld a, c # call dpydig L1B33: CD 16 26 L1B36: F1 # pop af # call dpydig L1B37: CD 16 26 # L1B3A: C1 # pop bc # ret L1B3B: C9 # # dpyval99: # # ld c, -1 L1B3C: 0E FF # 1: L1B3E: 0C # inc c # sub 10 L1B3F: D6 0A # jr nc, 1b L1B41: 30 FB # add 10 L1B43: C6 0A L1B45: F5 # push af # L1B46: 79 # ld a, c L1B47: B7 # or a # jr nz, 1f L1B48: 20 02 # ld a, ' ' L1B4A: 3E 20 # 1: # call dpydig L1B4C: CD 16 26 L1B4F: F1 # pop af # call dpydig L1B50: CD 16 26 # ret L1B53: C9 # # dpyval99nzb: # # ld c, -1 L1B54: 0E FF # 1: L1B56: 0C # inc c # sub 10 L1B57: D6 0A # jr nc, 1b L1B59: 30 FB # add 10 L1B5B: C6 0A L1B5D: F5 # push af # L1B5E: 79 # ld a, c # call dpydig L1B5F: CD 16 26 L1B62: F1 # pop af # call dpydig L1B63: CD 16 26 # ret L1B66: C9 # # dpyhex: L1B67: F5 # push af L1B68: CB 3F L1B6A: CB 3F L1B6C: CB 3F L1B6E: CB 3F # srl a ; srl a ; srl a ; srl a # call 1f L1B70: CD 74 1B L1B73: F1 # pop af # 1: # and 0xf L1B74: E6 0F # cp 10 L1B76: FE 0A # jr c, 1f L1B78: 38 02 # add 'A' - 10 ! - '0' ! account for add '0' L1B7A: C6 37 # 1: # # # # call dpydig L1B7C: CD 16 26 # ret L1B7F: C9 # # dpyhex_blankF: L1B80: F5 # push af L1B81: CB 3F L1B83: CB 3F L1B85: CB 3F L1B87: CB 3F # srl a ; srl a ; srl a ; srl a # call 1f L1B89: CD 8D 1B L1B8C: F1 # pop af # 1: # and 0xf L1B8D: E6 0F # cp 0xf L1B8F: FE 0F # jr nz, 1f L1B91: 20 05 # ld a, ' ' L1B93: 3E 20 # jp dpydig L1B95: C3 16 26 # 1: # cp 10 L1B98: FE 0A # jr c, 1f L1B9A: 38 02 # add 'A' - 10 ! - '0' ! account for add '0' L1B9C: C6 37 # 1: # # # # jp dpydig L1B9E: C3 16 26 # # !---------------------------------------------------------------------- # ! # ! Build up display buffer # ! # # ! PVQQSS # ! MM_-FFFFFF # ! # ! PV_QQ_SS # ! MM-FFFFFF # # redraw: # # ! Icons, repeater, power, battery # L1BA1: 2A FE C1 L1BA4: 3A 00 C2 # ld hl, [tx_offset] ; ld a, [(tx_offset) + 2] L1BA7: B4 # or h L1BA8: B5 # or l # sub 1 L1BA9: D6 01 L1BAB: 3F # ccf # ld a, 0x5f L1BAC: 3E 5F L1BAE: F5 # push af L1BAF: 3A F0 C5 # ld a, [cu_is_alfa] L1BB2: B7 # or a # jr nz, 1f L1BB3: 20 06 L1BB5: F1 # pop af # call segment_onoff L1BB6: CD 84 20 # jr 2f L1BB9: 18 0C # 1: # ld hl, segments + ((24 + 4) / 8) L1BBB: 21 03 C5 L1BBE: F1 # pop af # jr c, 1f L1BBF: 38 04 L1BC1: CB A6 # res (24 + 4) % 8, [hl] # jr 2f L1BC3: 18 02 # 1: L1BC5: CB E6 # set (24 + 4) % 8, [hl] # 2: # # ld de, (segments + 2 * 2) L1BC7: 11 04 C5 L1BCA: 3A F0 C5 # ld a, [cu_is_alfa] L1BCD: B7 # or a # jr nz, 1f L1BCE: 20 03 # ld de, CU53AN_segs_u_digit_5 L1BD0: 11 41 01 # 1: L1BD3: 3A F9 C1 # ld a, [txpwr] # call dpydiv9 L1BD6: CD 07 26 # # ! Upper row, volume squelch srssi # L1BD9: 3A F8 C1 # ld a, [volume] # call dpydig ! volume L1BDC: CD 16 26 # # ! # ! Audio whereto # ! L1BDF: 3A F0 C5 # ld a, [cu_is_alfa] L1BE2: B7 # or a # jr z, 2f L1BE3: 28 15 L1BE5: 3A 1A C2 # ld a, [audio_dst] # cp 1 L1BE8: FE 01 # ld l, '>' L1BEA: 2E 3E # jr z, 1f L1BEC: 28 08 # cp 2 L1BEE: FE 02 # ld l, '<' L1BF0: 2E 3C # jr z, 1f L1BF2: 28 02 # ld l, ' ' L1BF4: 2E 20 # 1: L1BF6: 7D # ld a, l # call dpydig L1BF7: CD 16 26 # 2: # L1BFA: 3A 08 C2 # ld a, [squelch_limit_open] # call dpydiv99 ! squelch setting L1BFD: CD 00 26 # # ! # ! Blank or star before squelch level # ! L1C00: 3A F0 C5 # ld a, [cu_is_alfa] L1C03: B7 # or a # jr z, 2f L1C04: 28 0D L1C06: 3A 9A C5 # ld a, [squelch_forced] L1C09: B7 # or a # ld a, ' ' L1C0A: 3E 20 # jr z, 1f L1C0C: 28 02 # ld a, '*' L1C0E: 3E 2A # 1: # call dpydig L1C10: CD 16 26 # 2: # # L1C13: 3A 2A C2 # ld a, [txon] L1C16: B7 # or a L1C17: 3A 2C C2 # ld a, [srssi] # jr z, 1f L1C1A: 28 03 L1C1C: 3A F9 C1 # ld a, [txpwr] # 1: # call dpydiv99 ! srssi or txpwr L1C1F: CD 00 26 # # ! Lower left, 2 digits, lower right, 8 digits # # ld de, CU53AN_segs_bottom_row L1C22: 11 FB 00 L1C25: 3A F0 C5 # ld a, [cu_is_alfa] L1C28: B7 # or a # jr z, 1f L1C29: 28 03 # ld de, (segments + 2 * 11) L1C2B: 11 16 C5 # 1: # # ! Cursor at lower left # L1C2E: 3A A4 C5 # ld a, [call_dpyed] L1C31: B7 # or a # jp nz, call2dpy L1C32: C2 02 1D # L1C35: 3A 86 C5 # ld a, [digidx] ! how many digits L1C38: B7 # or a # jp nz, 9f L1C39: C2 D3 1C # L1C3C: 3A A3 C5 # ld a, [dpymode] L1C3F: B7 # or a # jr z, 1f L1C40: 28 06 # call stat2dpy ! show stuff L1C42: CD 70 29 # jp 8f L1C45: C3 FC 1C # 1: # ! Cursor still at lower left, now memory number # L1C48: 3A FA C1 # ld a, [currmem] # cp 100 L1C4B: FE 64 # jr c, 1f L1C4D: 38 0E # ld a, ' ' L1C4F: 3E 20 # call dpydig L1C51: CD 16 26 # ld a, ' ' L1C54: 3E 20 # call dpydig L1C56: CD 16 26 # ld b, ' ' L1C59: 06 20 # jr 2f L1C5B: 18 17 # 1: # ! Active memory exists # # call dpyval99 L1C5D: CD 3C 1B # ld b, '=' L1C60: 06 3D L1C62: 3A 79 C5 # ld a, [memflags] # and MEM_EMPTY L1C65: E6 80 # jr nz, 2f L1C67: 20 0B # ld b, '-' L1C69: 06 2D L1C6B: 3A 79 C5 # ld a, [memflags] # and MEM_NOSCAN L1C6E: E6 04 # jr nz, 2f L1C70: 20 02 # ld b, ' ' L1C72: 06 20 # 2: L1C74: 3A F0 C5 # ld a, [cu_is_alfa] L1C77: B7 # or a # jr nz, 1f L1C78: 20 04 L1C7A: 78 # ld a, b # call dpydig ! Memory status, CU53AN L1C7B: CD 16 26 # 1: L1C7E: 3A 77 C5 # ld a, [adj_feedback] L1C81: B7 # or a # jr nz, 2f L1C82: 20 0F # L1C84: 3A F0 C5 # ld a, [cu_is_alfa] L1C87: B7 # or a # jr z, 1f L1C88: 28 04 L1C8A: 78 # ld a, b # call dpydig ! Memory status, CU58AF L1C8B: CD 16 26 # 1: # call div2dpy ! show frequency L1C8E: CD 79 2A # jr 8f L1C91: 18 69 # 2: # cp 1 L1C93: FE 01 # jr nz, 2f L1C95: 20 0D L1C97: CD 53 28 L1C9A: 20 72 45 4A 45 43 74 00 # call sput ; .asciz " rEJECt" # jr 8f L1CA2: 18 58 # 2: # cp 2 L1CA4: FE 02 # jr nz, 2f L1CA6: 20 0D L1CA8: CD 53 28 L1CAB: 43 4C 45 41 72 45 64 00 # call sput ; .asciz "CLEArEd" # jr 8f L1CB3: 18 47 # 2: # cp 3 L1CB5: FE 03 # jr nz, 2f L1CB7: 20 0D L1CB9: CD 53 28 L1CBC: 64 45 46 41 55 4C 74 00 # call sput ; .asciz "dEFAULt" # jr 8f L1CC4: 18 36 # 2: # ! 4 L1CC6: CD 53 28 L1CC9: 20 53 74 6F 72 45 64 00 # call sput ; .asciz " StorEd" # jr 8f L1CD1: 18 29 # 9: # ld ix, digbuf L1CD3: DD 21 87 C5 L1CD7: 3A 86 C5 # ld a, [digidx] # cp 10 ! positions max L1CDA: FE 0A # jr c, 1f L1CDC: 38 02 # ld a, 10 L1CDE: 3E 0A # 1: L1CE0: 47 # ld b, a ! to show L1CE1: ED 44 # neg # add 10 L1CE3: C6 0A L1CE5: 4F # ld c, a ! to blank # 1: L1CE6: DD 7E 00 # ld a, [ix] L1CE9: DD 23 # inc ix # call dpydig L1CEB: CD 16 26 # djnz 1b L1CEE: 10 F6 L1CF0: 79 # ld a, c L1CF1: B7 # or a # jr z, 8f L1CF2: 28 08 L1CF4: 47 # ld b, a # 1: # ld a, ' ' L1CF5: 3E 20 # call dpydig L1CF7: CD 16 26 # djnz 1b L1CFA: 10 F9 # 8: # # ld hl, sir L1CFC: 21 7A C5 L1CFF: CB CE # set DPYSIR, [hl] # # ret L1D01: C9 # # call2dpy: # L1D02: 3A F0 C5 # ld a, [cu_is_alfa] L1D05: B7 # or a # jr z, 1f L1D06: 28 0A L1D08: CD 53 28 L1D0B: 43 41 4C 4C 00 # call sput ; .asciz "CALL" # jr 2f L1D10: 18 09 # 1: L1D12: CD 53 28 L1D15: 43 41 4C 4C 20 00 # call sput ; .asciz "CALL " # 2: L1D1B: 3A E0 C5 L1D1E: E6 0F # ld a, [packet_good + 0]; and 0xF; call dpydig L1D20: CD 16 26 L1D23: 3A E1 C5 L1D26: CB 3F L1D28: CB 3F L1D2A: CB 3F L1D2C: CB 3F # ld a, [packet_good + 1]; srl a ; srl a ; srl a ; srl a; call dpydig L1D2E: CD 16 26 L1D31: 3A E1 C5 L1D34: E6 0F # ld a, [packet_good + 1]; and 0xF; call dpydig L1D36: CD 16 26 L1D39: 3A E2 C5 L1D3C: CB 3F L1D3E: CB 3F L1D40: CB 3F L1D42: CB 3F # ld a, [packet_good + 2]; srl a ; srl a ; srl a ; srl a; call dpydig L1D44: CD 16 26 L1D47: 3A E2 C5 L1D4A: E6 0F # ld a, [packet_good + 2]; and 0xF; call dpydig L1D4C: CD 16 26 # jp 8b L1D4F: C3 FC 1C # # display: # L1D52: 3A F0 C5 # ld a, [cu_is_alfa] L1D55: B7 # or a # jp nz, display_cu58af L1D56: C2 66 1F # # display_cu53an: # # ld hl, segments L1D59: 21 00 C5 # # ld a, (0x08 | 0x20 | 0x10) L1D5C: 3E 38 L1D5E: D3 80 # out [0x80], a # # ld a, (0x08 | 0x20) ! start 1st half of LCD1 L1D60: 3E 28 # call display_group L1D62: CD 93 1D # call display_bit_zero L1D65: CD B5 1D # # ld a, (0x08 | 0x20 | 0x10) ! start 1st half of LCD2 L1D68: 3E 38 # call display_group L1D6A: CD 93 1D # call display_bit_zero L1D6D: CD B5 1D # # ld a, (0x08 | 0x20) ! start 2nd half of LCD1 L1D70: 3E 28 # call display_group L1D72: CD 93 1D # call display_bit_one L1D75: CD B3 1D # # ld a, (0x08 | 0x20 | 0x10) ! start 2nd half of LCD2 L1D78: 3E 38 # call display_group L1D7A: CD 93 1D # call display_bit_one L1D7D: CD B3 1D # # ld a, (0x08 | 0x20) ! unselect LATCH L1D80: 3E 28 L1D82: D3 80 # out [0x80], a # # ld hl, indicators L1D84: 21 40 C5 # call display_byte L1D87: CD A5 1D # # ld a, (0x08 | 0x10) ! select LATCH L1D8A: 3E 18 L1D8C: D3 80 # out [0x80], a # ld a, (0x08 | 0x20) ! unselect LATCH L1D8E: 3E 28 L1D90: D3 80 # out [0x80], a # # ret L1D92: C9 # # display_group: L1D93: D3 80 # out [0x80], a # # call display_bit_zero L1D95: CD B5 1D # call display_byte L1D98: CD A5 1D # call display_byte L1D9B: CD A5 1D # call display_byte L1D9E: CD A5 1D # call display_byte L1DA1: CD A5 1D # ret L1DA4: C9 # # ! # ! 4032000 Hz pclk # ! 0.24 us T-state # ! # display_byte: L1DA5: 4E # ld c, [hl] L1DA6: 23 # inc hl # ld b, 8 L1DA7: 06 08 # 1: L1DA9: CB 39 # srl c # call display_bit L1DAB: CD B1 1D # djnz 1b L1DAE: 10 F9 # ret L1DB0: C9 # # display_bit: # jr nc, display_bit_zero L1DB1: 30 02 # display_bit_one: # or 0x80 L1DB3: F6 80 # display_bit_zero: # or 0x40 L1DB5: F6 40 L1DB7: D3 80 # out [0x80], a ! data & clock set 11 T 2.7 us # and ~0x40 L1DB9: E6 BF L1DBB: D3 80 # out [0x80], a ! clock edge 2.7 us # and ~0x80 L1DBD: E6 7F L1DBF: D3 80 # out [0x80], a ! clear data 2.7 us # # ret L1DC1: C9 # # !---------------------------------------------------------------------- # ! # ! CU58AF things # ! # # i2c_dtmf_tone: # # ld a, 0b00000100 | 0b00010000 | 0b00100000 | 0b00000010 L1DC2: 3E 36 # ld c, 0b01111100 L1DC4: 0E 7C # call i2c_send_a L1DC6: CD 3D 20 # L1DC9: 3A ED C5 # ld a, [dtmf_code] # ld c, 0b01001000 L1DCC: 0E 48 # call i2c_send_a L1DCE: CD 3D 20 # # ret L1DD1: C9 # # i2c_dtmf: # L1DD2: 3A ED C5 # ld a, [dtmf_code] L1DD5: B7 # or a # jr nz, i2c_dtmf_tone L1DD6: 20 EA # # ld a, 0 ! End tone L1DD8: 3E 00 # ld c, 0b01001000 L1DDA: 0E 48 # call i2c_send_a L1DDC: CD 3D 20 # # ASSERT(0b11100000 == 0xE0) # L1DDF: 3A F8 C1 # ld a, [volume] ! 0..9 # cp 0 L1DE2: FE 00 # jr z, 2f ! no at all L1DE4: 28 4A # sub 1 ! 0..8 L1DE6: D6 01 # cp 7 L1DE8: FE 07 # jr c, 1f L1DEA: 38 02 # ld a, 7 ! 0..7 L1DEC: 3E 07 # 1: # and 7 ! -----210 L1DEE: E6 07 L1DF0: CB 0F # rrc a ! 0-----21 L1DF2: CB 0F # rrc a ! 10-----2 L1DF4: CB 0F # rrc a ! 210----- # L1DF6: 47 # ld b, a ! volume bits in position # L1DF7: 3A 1A C2 # ld a, [audio_dst] # cp 1 L1DFA: FE 01 # jr nz, 1f L1DFC: 20 10 L1DFE: F3 # di L1DFF: 3A 29 C2 # ld a, [output_0] # or 0x08 L1E02: F6 08 L1E04: 32 29 C2 # ld [output_0], a L1E07: D3 60 # out [0x60], a L1E09: FB # ei # ld a, 0b00000001 L1E0A: 3E 01 # jr 2f L1E0C: 18 22 # 1: # cp 2 L1E0E: FE 02 # jr nz, 1f L1E10: 20 10 L1E12: F3 # di L1E13: 3A 29 C2 # ld a, [output_0] # or 0x08 L1E16: F6 08 L1E18: 32 29 C2 # ld [output_0], a L1E1B: D3 60 # out [0x60], a L1E1D: FB # ei # ld a, 0b00010000 L1E1E: 3E 10 # jr 2f L1E20: 18 0E # 1: L1E22: F3 # di L1E23: 3A 29 C2 # ld a, [output_0] # and ~0x08 L1E26: E6 F7 L1E28: 32 29 C2 # ld [output_0], a L1E2B: D3 60 # out [0x60], a L1E2D: FB # ei # ld a, 0 L1E2E: 3E 00 # 2: # xor 0b00000001 L1E30: EE 01 # or 0b00000100 | 0b00001000 L1E32: F6 0C L1E34: B0 # or b # ld c, 0b01111100 L1E35: 0E 7C # call i2c_send_a L1E37: CD 3D 20 # # ret L1E3A: C9 # # ! # ! before 'ei' # ! # cu58af_init: # # ld c, 0b01000100 L1E3B: 0E 44 # ld b, 0b00000100 | 0b00100000 | 0b01000000 L1E3D: 06 64 # call i2c_send L1E3F: CD 3E 20 # # ld a, 0 L1E42: 3E 00 L1E44: 32 ED C5 # ld [dtmf_code], a # call i2c_dtmf L1E47: CD D2 1D # # ld c, 0b01000000 L1E4A: 0E 40 # ld b, 0xFF ! All inputs L1E4C: 06 FF # call i2c_send L1E4E: CD 3E 20 # # ld c, 0b01001100 L1E51: 0E 4C # ld b, 0 L1E53: 06 00 # call i2c_send L1E55: CD 3E 20 # # ! # ! LCD needs more attention # ! # call i2c_start L1E58: CD 23 20 # # ld c, 0b01110000 ! /WR as required. L1E5B: 0E 70 # call i2c_wrbyte L1E5D: CD E0 1F # ld c, 0b11001100 ! C, normal mode, enabled, 1/2 bias, 4 backplanes L1E60: 0E CC # call i2c_wrbyte L1E62: CD E0 1F # ld c, 0b10000000 ! C, data pointer rewind L1E65: 0E 80 # call i2c_wrbyte L1E67: CD E0 1F # ld c, 0b11100000 ! C, device select 0 L1E6A: 0E E0 # call i2c_wrbyte L1E6C: CD E0 1F # ld c, 0b11111000 ! C, bank select 0 L1E6F: 0E F8 # call i2c_wrbyte L1E71: CD E0 1F # ld c, 0b01110000 ! /C, blink off L1E74: 0E 70 # call i2c_wrbyte L1E76: CD E0 1F # # ld b, 40 L1E79: 06 28 # 1: # ld c, 0xFF L1E7B: 0E FF # call i2c_wrbyte L1E7D: CD E0 1F # djnz 1b L1E80: 10 F9 # # call i2c_stop L1E82: CD 30 20 # # ld c, 0b01000000 L1E85: 0E 40 # call i2c_recv L1E87: CD 4E 20 # ld c, 0b01001100 L1E8A: 0E 4C # call i2c_recv ! Flush /int L1E8C: CD 4E 20 # ld c, 0b01000000 L1E8F: 0E 40 # call i2c_recv L1E91: CD 4E 20 # ld c, 0b01001100 L1E94: 0E 4C # call i2c_recv ! Flush /int L1E96: CD 4E 20 # # ret L1E99: C9 # # keypad_cu58af: # # ! Read columns (and buttons) # # ld c, 0b01000000 L1E9A: 0E 40 # call i2c_recv L1E9C: CD 4E 20 # L1E9F: 4F # ld c, a ! buttons.. # # and 0b00100000 L1EA0: E6 20 # jr z, 2f ! Not pressed (anymore) L1EA2: 28 0D L1EA4: 3A EE C5 # ld a, [spkrbtn] L1EA7: B7 # or a # jr nz, 3f ! Was already pressed L1EA8: 20 0A # ld a, 'K' L1EAA: 3E 4B L1EAC: 32 82 C5 # ld [key], a # ld a, 1 ! Mark as down L1EAF: 3E 01 # 2: L1EB1: 32 EE C5 # ld [spkrbtn], a # 3: # # ld hl, pttdn L1EB4: 21 84 C5 L1EB7: 79 # ld a, c # and 0b01000000 L1EB8: E6 40 # jr z, 1f L1EBA: 28 04 L1EBC: CB CE # set 1, [hl] # jr 2f L1EBE: 18 02 # 1: L1EC0: CB 8E # res 1, [hl] # 2: # # ASSERT(0b00000111 == 7) # # ld b, 0 L1EC2: 06 00 # L1EC4: 79 # ld a, c L1EC5: CB 1F # rr a # jr c, 1f ! column 0 L1EC7: 38 2D L1EC9: 04 # inc b L1ECA: CB 1F # rr a # jr c, 1f ! column 1 L1ECC: 38 28 L1ECE: 04 # inc b L1ECF: CB 1F # rr a # jr c, 1f ! column 2 L1ED1: 38 23 # L1ED3: F3 # di # ld a, 0 L1ED4: 3E 00 L1ED6: 32 46 C5 # ld [key_timer], a L1ED9: 32 85 C5 # ld [keydown], a L1EDC: 32 EC C5 # ld [last_columns], a L1EDF: 3A 80 C5 # ld a, [lastdigit] # cp -1 L1EE2: FE FF # jr z, 2f L1EE4: 28 0B L1EE6: 3A 80 C5 # ld a, [lastdigit] L1EE9: 32 82 C5 # ld [key], a ! Quick press of digit. # ld a, -1 L1EEC: 3E FF L1EEE: 32 80 C5 # ld [lastdigit], a # 2: L1EF1: FB # ei # ld a, 0 ! NOKEY L1EF2: 3E 00 L1EF4: B7 # or a # ret L1EF5: C9 # 1: L1EF6: 3A EC C5 # ld a, [last_columns] L1EF9: A9 # xor c # and 0b00000111 L1EFA: E6 07 L1EFC: 79 # ld a, c L1EFD: 32 EC C5 # ld [last_columns], a L1F00: C8 # ret z # L1F01: C5 # push bc # # ! rows to inputs # # ld c, 0b01001100 L1F02: 0E 4C # ld b, 0xFF L1F04: 06 FF # call i2c_send L1F06: CD 3E 20 # # ! columns to outputs (low) # # ld c, 0b01000000 L1F09: 0E 40 # ld b, ~0b00000111 L1F0B: 06 F8 # call i2c_send L1F0D: CD 3E 20 # # ! Read rows (8 lines) # # ld c, 0b01001100 L1F10: 0E 4C # call i2c_recv L1F12: CD 4E 20 # # ASSERT(0b00000111 == 7) ! 3 keys (columns) per row # ! 0x7F row bits # # ld b, 0 ! 0 L1F15: 06 00 L1F17: CB 1F # rr a # jr c, 1f L1F19: 38 28 # # ld b, 3 ! 1 L1F1B: 06 03 L1F1D: CB 1F # rr a # jr c, 1f L1F1F: 38 22 # # ld b, 6 ! 2 L1F21: 06 06 L1F23: CB 1F # rr a # jr c, 1f L1F25: 38 1C # # ld b, 9 ! 3 L1F27: 06 09 L1F29: CB 1F # rr a # jr c, 1f L1F2B: 38 16 # # ld b, 12 ! 4 L1F2D: 06 0C L1F2F: CB 1F # rr a # jr c, 1f L1F31: 38 10 # # ld b, 15 ! 5 L1F33: 06 0F L1F35: CB 1F # rr a # jr c, 1f L1F37: 38 0A # # ld b, 18 ! 6 L1F39: 06 12 L1F3B: CB 1F # rr a # jr c, 1f L1F3D: 38 04 # L1F3F: C1 # pop bc # ld b, 0 ! NOKEY L1F40: 06 00 L1F42: C5 # push bc # 1: # L1F43: C5 # push bc # # ! columns back to inputs (high) # # ld c, 0b01000000 L1F44: 0E 40 # ld b, 0xFF L1F46: 06 FF # call i2c_send L1F48: CD 3E 20 # # ! rows back to outputs (low) # # ld c, 0b01001100 L1F4B: 0E 4C # ld b, 0 L1F4D: 06 00 # call i2c_send L1F4F: CD 3E 20 # # ld c, 0b01000000 L1F52: 0E 40 # call i2c_recv ! Flush int from changes L1F54: CD 4E 20 # L1F57: C1 # pop bc L1F58: 78 # ld a, b L1F59: C1 # pop bc L1F5A: 80 # add b # # ld hl, keytbl_cu58af L1F5B: 21 20 19 # ld b, 0 L1F5E: 06 00 L1F60: 4F # ld c, a L1F61: 09 # add hl, bc L1F62: 7E # ld a, [hl] ! map code to character # cp 'Z' L1F63: FE 5A # ret L1F65: C9 # # ! # ! Update LCD and LEDs # ! # display_cu58af: # # ld hl, indicators L1F66: 21 40 C5 # ld c, 0b01000100 L1F69: 0E 44 L1F6B: 46 # ld b, [hl] # call i2c_send L1F6C: CD 3E 20 # # call i2c_start L1F6F: CD 23 20 # # ld c, 0b01110000 ! /WR as required. L1F72: 0E 70 # call i2c_wrbyte L1F74: CD E0 1F # ld c, 0b10000000 ! C, data pointer rewind L1F77: 0E 80 # call i2c_wrbyte L1F79: CD E0 1F # ld c, 0b01100000 ! /C, device select 0 L1F7C: 0E 60 # call i2c_wrbyte L1F7E: CD E0 1F # # ld hl, segments L1F81: 21 00 C5 # ld b, 40 L1F84: 06 28 # 1: L1F86: 4E # ld c, [hl] L1F87: 23 # inc hl # call i2c_wrbyte L1F88: CD E0 1F # djnz 1b L1F8B: 10 F9 # # call i2c_stop L1F8D: CD 30 20 # # ret L1F90: C9 # # ! # ! SDA into carry # ! # # i2c_getbit: L1F91: DB 01 # in a, [0x00+1] # and 0x08 L1F93: E6 08 # sub 1 L1F95: D6 01 # jp i2c_delay L1F97: C3 C1 1F # # ! # ! Pull or release SDA wrt carry. NOT INTERRUPT PROTECTED. # ! # # i2c_putbit: # jp c, i2c_sda_high L1F9A: DA A8 1F # # # # i2c_sda_low: # ld a, 0xCF ! operating mode 3 L1F9D: 3E CF L1F9F: D3 03 # out [0x00+3], a # ld a, 0x36 ! SDA pin is output, data low, thus driven low. L1FA1: 3E 36 L1FA3: D3 03 # out [0x00+3], a # jp i2c_delay L1FA5: C3 C1 1F # # i2c_sda_high: # ld a, 0xCF ! operating mode 3 L1FA8: 3E CF L1FAA: D3 03 # out [0x00+3], a # ld a, 0x3E ! SDA pin is input, pullup L1FAC: 3E 3E L1FAE: D3 03 # out [0x00+3], a # jp i2c_delay L1FB0: C3 C1 1F # # i2c_scl_low: # ld a, 0x08 L1FB3: 3E 08 L1FB5: D3 80 # out [0x80], a # jp i2c_delay L1FB7: C3 C1 1F # # i2c_scl_high: # ld a, 0x08 | 0x40 L1FBA: 3E 48 L1FBC: D3 80 # out [0x80], a # jp i2c_delay L1FBE: C3 C1 1F # # ! # ! Call/return implicit delay should be enough... # ! # i2c_delay: # L1FC1: D3 90 # out [0x90], a L1FC3: D3 90 # out [0x90], a L1FC5: D3 90 # out [0x90], a ! some delay anyway... # # # # # # # # # ret L1FC7: C9 # # i2c_sendbit: L1FC8: CB 21 # sla c ! MSB of C (reg) into C (carry). Hmpfth... # call i2c_putbit L1FCA: CD 9A 1F # call i2c_scl_high L1FCD: CD BA 1F # call i2c_scl_low L1FD0: CD B3 1F # ret L1FD3: C9 # # i2c_recvbit: # call i2c_scl_high L1FD4: CD BA 1F # call i2c_getbit L1FD7: CD 91 1F L1FDA: CB 11 # rl c # call i2c_scl_low L1FDC: CD B3 1F # ret L1FDF: C9 # # ! # ! I2C byte write from reg c # ! # i2c_wrbyte: # # call i2c_sendbit L1FE0: CD C8 1F # call i2c_sendbit L1FE3: CD C8 1F # call i2c_sendbit L1FE6: CD C8 1F # call i2c_sendbit L1FE9: CD C8 1F # # call i2c_sendbit L1FEC: CD C8 1F # call i2c_sendbit L1FEF: CD C8 1F # call i2c_sendbit L1FF2: CD C8 1F # call i2c_sendbit L1FF5: CD C8 1F # # call i2c_sda_high L1FF8: CD A8 1F # call i2c_scl_high L1FFB: CD BA 1F # call i2c_getbit ! ack ? L1FFE: CD 91 1F L2001: F5 # push af # call i2c_scl_low L2002: CD B3 1F L2005: F1 # pop af ! Return carry clear if acknowledged. # ret L2006: C9 # # ! # ! I2C byte read to reg c. One and only one byte at a time. # ! # i2c_rdbyte: # # call i2c_sda_high L2007: CD A8 1F # # call i2c_recvbit L200A: CD D4 1F # call i2c_recvbit L200D: CD D4 1F # call i2c_recvbit L2010: CD D4 1F # call i2c_recvbit L2013: CD D4 1F # # call i2c_recvbit L2016: CD D4 1F # call i2c_recvbit L2019: CD D4 1F # call i2c_recvbit L201C: CD D4 1F # call i2c_recvbit L201F: CD D4 1F # # ret L2022: C9 # # i2c_start: # # call i2c_sda_high L2023: CD A8 1F # call i2c_scl_high L2026: CD BA 1F # # call i2c_sda_low ! start ... L2029: CD 9D 1F # call i2c_scl_low ! ... condition. L202C: CD B3 1F # # ret L202F: C9 # # i2c_stop: # # call i2c_scl_low L2030: CD B3 1F # call i2c_sda_low L2033: CD 9D 1F # # call i2c_scl_high ! stop ... L2036: CD BA 1F # call i2c_sda_high ! ... condition. L2039: CD A8 1F # # ret L203C: C9 # # i2c_send_a: L203D: 47 # ld b, a # # i2c_send: # L203E: CB 81 # res 0, c ! /WR # # call i2c_start L2040: CD 23 20 # # call i2c_wrbyte ! Send address from C L2043: CD E0 1F L2046: 48 # ld c, b # call i2c_wrbyte ! Send data from B L2047: CD E0 1F # # call i2c_stop L204A: CD 30 20 # # ret L204D: C9 # # i2c_recv: # L204E: CB C1 # set 0, c ! RD # # call i2c_start L2050: CD 23 20 # # call i2c_wrbyte ! Send address from C L2053: CD E0 1F # call i2c_rdbyte ! Get data to C L2056: CD 07 20 # # call i2c_stop L2059: CD 30 20 # L205C: 79 # ld a, c ! Return in A # ret L205D: C9 # # !---------------------------------------------------------------------- # # puthex: L205E: C5 # push bc L205F: 79 # ld a, c L2060: CB 3F L2062: CB 3F L2064: CB 3F L2066: CB 3F # srl a ; srl a ; srl a ; srl a # call 1f L2068: CD 6D 20 L206B: C1 # pop bc L206C: 79 # ld a, c # 1: # and 0xf L206D: E6 0F # cp 10 L206F: FE 0A # jr c, 1f L2071: 38 02 # add 'A' - 10 - '0' L2073: C6 07 # 1: # add '0' L2075: C6 30 L2077: 4F # ld c, a # call putchar L2078: CD 2D 18 # ret L207B: C9 # # bitmasks: L207C: 01 L207D: 02 L207E: 04 L207F: 08 L2080: 10 L2081: 20 L2082: 40 # .byte 1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80 L2083: 80 # # segment_onoff: # jr nc, segment_off L2084: 30 3F # # segment_on: # L2086: 26 C5 # ld h, HI(segments) ; ASSERT(LO(segments) == 0) L2088: 6F # ld l, a L2089: CB 3D # srl l L208B: CB 3D # srl l L208D: CB 3D # srl l ! byte ptr ok # # ! Uhhuh. Maybe not so bad as it looks :) # # and 7 ! bit number L208F: E6 07 # L2091: FE 04 # cp 4; jr nc, 4f ! >= 4 L2093: 30 18 L2095: FE 02 # cp 2; jr nc, 2f ! >= 2, < 4 L2097: 30 0A L2099: FE 01 # cp 1; jr nc, 1f ! >= 1, < 2 L209B: 30 03 L209D: CB C6 # set 0, [hl] ; ret L209F: C9 L20A0: CB CE # 1: set 1, [hl] ; ret L20A2: C9 L20A3: FE 03 # 2: cp 3; jr nc, 3f ! >= 3, < 4 L20A5: 30 03 L20A7: CB D6 # set 2, [hl] ; ret L20A9: C9 L20AA: CB DE # 3: set 3, [hl] ; ret L20AC: C9 L20AD: FE 06 # 4: cp 6; jr nc, 6f ! >= 6 L20AF: 30 0A L20B1: FE 05 # cp 5; jr nc, 5f ! >= 5, < 6 L20B3: 30 03 L20B5: CB E6 # set 4, [hl] ; ret L20B7: C9 L20B8: CB EE # 5: set 5, [hl] ; ret L20BA: C9 L20BB: FE 07 # 6: cp 7; jr nc, 7f ! >= 7 L20BD: 30 03 L20BF: CB F6 # set 6, [hl] ; ret L20C1: C9 L20C2: CB FE # 7: set 7, [hl] ; ret L20C4: C9 # # segment_off: # L20C5: 26 C5 # ld h, HI(segments) ; ASSERT(LO(segments) == 0) L20C7: 6F # ld l, a L20C8: CB 3D # srl l L20CA: CB 3D # srl l L20CC: CB 3D # srl l ! byte ptr ok # # ! Uhhuh. Maybe not so bad as it looks :) # # and 7 ! bit number L20CE: E6 07 # L20D0: FE 04 # cp 4; jr nc, 4f ! >= 4 L20D2: 30 18 L20D4: FE 02 # cp 2; jr nc, 2f ! >= 2, < 4 L20D6: 30 0A L20D8: FE 01 # cp 1; jr nc, 1f ! >= 1, < 2 L20DA: 30 03 L20DC: CB 86 # res 0, [hl] ; ret L20DE: C9 L20DF: CB 8E # 1: res 1, [hl] ; ret L20E1: C9 L20E2: FE 03 # 2: cp 3; jr nc, 3f ! >= 3, < 4 L20E4: 30 03 L20E6: CB 96 # res 2, [hl] ; ret L20E8: C9 L20E9: CB 9E # 3: res 3, [hl] ; ret L20EB: C9 L20EC: FE 06 # 4: cp 6; jr nc, 6f ! >= 6 L20EE: 30 0A L20F0: FE 05 # cp 5; jr nc, 5f ! >= 5, < 6 L20F2: 30 03 L20F4: CB A6 # res 4, [hl] ; ret L20F6: C9 L20F7: CB AE # 5: res 5, [hl] ; ret L20F9: C9 L20FA: FE 07 # 6: cp 7; jr nc, 7f ! >= 7 L20FC: 30 03 L20FE: CB B6 # res 6, [hl] ; ret L2100: C9 L2101: CB BE # 7: res 7, [hl] ; ret L2103: C9 # # ! # ! Calculate R and misc stuff # ! # ! 25 kHz # ! 512, 12800 / 512 quot 25 rem 0, /= 25 shift 0 # ! # ! 12.5 kHz # ! 1024, 12800 / 1024 quot 12 rem 512 # ! 12800 / 512 quot 25 rem 0, /= 25 shift 1 # ! # ! 6.25 kHz # ! 2048, 12800 / 2048 quot 6 rem 512 # ! 12800 / 1024 quot 12 rem 512 # ! 12800 / 512 quot 25 rem 0, /= 25 shift 2 # ! # ! 3.125 kHz # ! 4096, 12800 / 4096 quot 3 rem 512 # ! 12800 / 2048 quot 6 rem 512 # ! 12800 / 1024 quot 12 rem 512 # ! 12800 / 512 quot 25 rem 0, /= 25 shift 3 # ! # ! 10 kHz # ! 1280, 12800 / 1280 quot 10 rem 0, /= 10 shift 0 # ! # ! 5 kHz # ! 2560, 12800 / 2560 quot 5 rem 0, 5 too small, use /= 10 shift 1 # ! # ! # # reset_synth_oops: # # ld de, 1024 L2104: 11 00 04 L2107: ED 53 7E C5 # ld [bstep_R], de # # reset_synth: # L210B: ED 5B 7E C5 # ld de, [bstep_R] # ld b, 0 ! try with no shift, will be 0..7 L210F: 06 00 # 2: # ld hl, 12800 ! Reference XO frequency L2111: 21 00 32 # ld c, 0 L2114: 0E 00 # 1: L2116: 0C # inc c ! increment x2y-divider, will be from 1.. # jr z, reset_synth_oops L2117: 28 EB L2119: A7 # and a L211A: ED 52 # sbc hl, de # jr z, 1f ! exact ! L211C: 28 0F # jr nc, 1b ! division not complete L211E: 30 F6 # L2120: 04 # inc b ! try with more shift. # jr z, reset_synth_oops L2121: 28 E1 L2123: CB 3A # srl d L2125: CB 1B # rr e ! try divide with smaller value L2127: 7B # ld a, e L2128: B2 # or d # jr z, reset_synth_oops L2129: 28 D9 # jr 2b L212B: 18 E4 # 1: L212D: 79 # ld a, c # cp 10 L212E: FE 0A # jr nc, 2f L2130: 30 08 L2132: 04 # inc b ! hack in 5kHz on 70cm by changing 5/0 to 10/1 L2133: CB 21 # sla c # jr nz, 1b L2135: 20 F6 # jp reset_synth_oops L2137: C3 04 21 # 2: L213A: ED 43 7C C5 # ld [bstep_cfg], bc # L213E: 2A FB C1 L2141: 3A FD C1 # ld hl, [currfreq] ; ld a, [(currfreq) + 2] # call freq2div L2144: CD 28 28 L2147: 22 04 C2 L214A: 32 06 C2 # ld [tx_divisor], hl ; ld [(tx_divisor) + 2], a # L214D: 21 B0 8F # ld hl, (430000) % 65536 ; ld a, (430000) / 65536 L2150: 3E 06 # call freq2div L2152: CD 28 28 L2155: 22 9C C5 L2158: 32 9E C5 # ld [tx_divisor_lo], hl ; ld [(tx_divisor_lo) + 2], a # L215B: 21 D0 DD # ld hl, (450000) % 65536 ; ld a, (450000) / 65536 L215E: 3E 06 # call freq2div L2160: CD 28 28 L2163: 22 9F C5 L2166: 32 A1 C5 # ld [tx_divisor_hi], hl ; ld [(tx_divisor_hi) + 2], a # L2169: 21 F0 51 # ld hl, (86512) % 65536 ; ld a, (86512) / 65536 L216C: 3E 01 # call freq2div L216E: CD 28 28 L2171: 22 01 C2 L2174: 32 03 C2 # ld [rx_sub], hl ; ld [(rx_sub) + 2], a # L2177: 2A FE C1 L217A: 3A 00 C2 # ld hl, [tx_offset] ; ld a, [(tx_offset) + 2] ! current offset L217D: B4 # or h L217E: B5 # or l L217F: 21 00 00 # ld hl, (0) % 65536 ; ld a, (0) / 65536 ! assume was simplex L2182: 3E 00 # jr z, 1f L2184: 28 09 L2186: 2A 1C C2 L2189: 3A 1E C2 # ld hl, [rptr_sub] ; ld a, [(rptr_sub) + 2] ! no, calc changed NA offset # call freq2div L218C: CD 28 28 # 1: # call save_ahl_to_tx_offset L218F: CD 39 0E # # call setup_synth L2192: CD 9C 21 # # call lookup_rfc L2195: CD 45 2B # call change_rxsynth L2198: CD 00 22 # # ret L219B: C9 # # ! # ! Configure RX and TX synths # ! # # setup_synth: # # ld a, 0x80 L219C: 3E 80 L219E: D3 70 # out [0x70], a # L21A0: 2A 7E C5 # ld hl, [bstep_R] ! channel spacing L21A3: 4C # ld c, h # ld b, 8 ! has excess bits... they overflow ok L21A4: 06 08 # call send_to_synth L21A6: CD 62 22 L21A9: 4D # ld c, l # ld b, 8 L21AA: 06 08 # call send_to_synth L21AC: CD 62 22 # # call one_to_synth ! single "1" bit - to R register L21AF: CD 7F 22 # # or 0x01 | 0x04 L21B2: F6 05 # call strobe_to_synth ! both R same L21B4: CD 5B 22 # # ret L21B7: C9 # # change_txsynth: # # ld c, 0xf8 | 3 ! Max deviation (b7..b4), TX synth operational (b3,b2) L21B8: 0E FB # L21BA: 2A FB C1 L21BD: 3A FD C1 # ld hl, [currfreq] ; ld a, [(currfreq) + 2] L21C0: 11 D0 DD L21C3: A7 L21C4: ED 52 # ld de, (450000) % 65536 ; and a ; sbc hl, de ; sbc (450000) / 65536 L21C6: DE 06 # jr c, 1f L21C8: 38 04 L21CA: CB 81 # res 0, c L21CC: CB 89 # res 1, c # 1: # ld a, 0x80 L21CE: 3E 80 L21D0: D3 70 # out [0x70], a # # ld b, 8 L21D2: 06 08 # call send_to_synth L21D4: CD 62 22 # # or 0x02 L21D7: F6 02 # call strobe_to_synth L21D9: CD 5B 22 # L21DC: 2A 7E C5 # ld hl, [bstep_R] ! channel spacing L21DF: 4C # ld c, h # ld b, 8 ! has excess bits... they overflow ok L21E0: 06 08 # call send_to_synth L21E2: CD 62 22 L21E5: 4D # ld c, l # ld b, 8 L21E6: 06 08 # call send_to_synth L21E8: CD 62 22 # # call one_to_synth ! single "1" bit - to R register L21EB: CD 7F 22 # # or 0x04 L21EE: F6 04 # call strobe_to_synth L21F0: CD 5B 22 # L21F3: 2A 04 C2 L21F6: 3A 06 C2 # ld hl, [tx_divisor] ; ld a, [(tx_divisor) + 2] L21F9: 5F # ld e, a # # ld d, 0x04 L21FA: 16 04 # call send_NA_to_synth L21FC: CD 3B 22 # # ret L21FF: C9 # # # change_rxsynth: # L2200: 2A 04 C2 L2203: 3A 06 C2 # ld hl, [tx_divisor] ; ld a, [(tx_divisor) + 2] L2206: 5F # ld e, a L2207: ED 4B 01 C2 L220B: 3A 03 C2 # ld bc, [rx_sub] ; ld a, [(rx_sub) + 2] L220E: 09 # add hl, bc L220F: 8B # adc e ! EHL + ABC -> EHL L2210: 5F # ld e, a # # ld d, 0x01 L2211: 16 01 # call send_NA_to_synth L2213: CD 3B 22 # # ld c, 0xf4 | 3 ! Max deviation (b7..b4), TX synth OFF (b3,b2) L2216: 0E F7 # L2218: 2A FB C1 L221B: 3A FD C1 # ld hl, [currfreq] ; ld a, [(currfreq) + 2] L221E: 11 D0 DD L2221: A7 L2222: ED 52 # ld de, (450000) % 65536 ; and a ; sbc hl, de ; sbc (450000) / 65536 L2224: DE 06 # jr c, 1f L2226: 38 04 L2228: CB 81 # res 0, c L222A: CB 89 # res 1, c # 1: # ld a, 0x80 L222C: 3E 80 L222E: D3 70 # out [0x70], a # # ld b, 8 L2230: 06 08 # call send_to_synth L2232: CD 62 22 # # or 0x02 L2235: F6 02 # call strobe_to_synth L2237: CD 5B 22 # # ret L223A: C9 # # ! # ! 10 bits of N, 7 bits of A, single zerobit to selector # ! # ! 1 NNNNNNNNNNAAAAAAA # ! GFEDCBA9876543210 effective bit numbers # ! EHHHHHHHHLLLLLLLL # ! # ! RB58S # ! RC58 NNNNNNNNNN0AAAAAA # ! FEDCBA9876 543210 effective bit numbers # ! HHHHHHHHLL LLLLLL # ! # ! NA in EHL register triple # # send_NA_to_synth: # # ld a, 0x80 L223B: 3E 80 L223D: D3 70 # out [0x70], a # # L223F: 4B # ld c, e L2240: CB 09 # rrc c ! Align lowest bit for MSb first shifting just 1 bit # ld b, 1 L2242: 06 01 # call send_to_synth ! send MSb (lowest of e) L2244: CD 62 22 # # L2247: 4C # ld c, h # ld b, 8 L2248: 06 08 # call send_to_synth L224A: CD 62 22 L224D: 4D # ld c, l # # ld b, 8 L224E: 06 08 # call send_to_synth L2250: CD 62 22 # # # # # # # # # call zero_to_synth ! single "0" bit - to A/N registers L2253: CD 72 22 # L2256: B2 # or d # call strobe_to_synth ! which synth L2257: CD 5B 22 # # ret L225A: C9 # # strobe_to_synth: # L225B: D3 70 # out [0x70], a # and ~(0x02 | 0x04 | 0x01 | 0x10) L225D: E6 E8 L225F: D3 70 # out [0x70], a # ret L2261: C9 # # send_to_synth: # 2: L2262: CB 11 # rl c # jr c, 1f L2264: 38 06 # call zero_to_synth L2266: CD 72 22 # djnz 2b L2269: 10 F7 # ret L226B: C9 # 1: # call one_to_synth L226C: CD 7F 22 # djnz 2b L226F: 10 F1 # ret L2271: C9 # # zero_to_synth: # # and ~0x10 L2272: E6 EF L2274: D3 70 # out [0x70], a # or 0x08 L2276: F6 08 L2278: D3 70 # out [0x70], a # and ~(0x08) L227A: E6 F7 L227C: D3 70 # out [0x70], a # # ret L227E: C9 # # one_to_synth: # # or 0x10 L227F: F6 10 L2281: D3 70 # out [0x70], a # or 0x08 L2283: F6 08 L2285: D3 70 # out [0x70], a # and ~(0x08) L2287: E6 F7 L2289: D3 70 # out [0x70], a # # ret L228B: C9 # # ! # ! ----- 3 # ! |\|/| 6 2 E F B # ! -- -- 5 A # ! |/|\| 4 0 1 D 9 # ! ----- C # # .align 8 L228C: 00 [ 74 ] # # cu58af_font: # # ! FEDCBA9876543210 # .word 0b1001101001011001 ! 0 L2300: 59 9A # .word 0b0100000000000010 ! 1 L2302: 02 40 # .word 0b0001110000111000 ! 2 L2304: 38 1C # .word 0b0001111000101000 ! 3 L2306: 28 1E # .word 0b0000111001100000 ! 4 L2308: 60 0E # .word 0b0001011001101000 ! 5 L230A: 68 16 # .word 0b0001011001111000 ! 6 L230C: 78 16 # .word 0b0000101000001000 ! 7 L230E: 08 0A # .word 0b0001111001111000 ! 8 L2310: 78 1E # .word 0b0001111001101000 ! 9 L2312: 68 1E # .word 0b0000111001111000 ! A L2314: 78 0E # .word 0b1011000001111000 ! B L2316: 78 B0 # .word 0b0001000001011000 ! C L2318: 58 10 # .word 0b0101101000001010 ! D L231A: 0A 5A # .word 0b0001010001111000 ! E L231C: 78 14 # .word 0b0000010001111000 ! F L231E: 78 04 # ! FEDCBA9876543210 # # .word 0b0001011001011000 ! G L2320: 58 16 # ! FEDCBA9876543210 # # .org cu58af_font + 2*' ' # # ! FEDCBA9876543210 # .word 0b0000000000000000 ! - - - - - - - L2340: 00 00 # .word 0b1001000110001100 ! ! - - 2 3 - - - L2342: 8C 91 # .word 0b0100000111000000 ! " 0 - - 3 - - - L2344: C0 41 # .word 0b0001011110110000 ! # - 1 2 - - 5 6 L2346: B0 17 # .word 0b0101011111101010 ! $ 0 - 2 - - 5 - L2348: EA 57 # .word 0b1000001111000001 ! % 0 - 2 - - - - L234A: C1 83 # .word 0b1011000110001101 ! & - 1 - 3 - 5 6 L234C: 8D B1 # .word 0b0000000111000000 ! ' - - - 3 - - - L234E: C0 01 # .word 0b1010000110000000 ! ( - - 2 3 - - - L2350: 80 A1 # .word 0b0000000110000101 ! ) 0 1 - - - - - L2352: 85 01 # .word 0b1110010110100111 ! * - - - - 4 5 6 L2354: A7 E5 # .word 0b0100010110100010 ! + 0 1 - - - 5 - L2356: A2 45 # .word 0b0000000110000001 ! , - 1 - - - - - L2358: 81 01 # .word 0b0000010110100000 ! - - - - - - 5 - L235A: A0 05 # .word 0b0000000110010000 ! . - 1 - - - - - L235C: 90 01 # .word 0b1000000110000001 ! / - 1 - 3 - 5 - L235E: 81 81 # .word 0b1001101001011001 ! 0 L2360: 59 9A # .word 0b0100000000000010 ! 1 L2362: 02 40 # .word 0b0001110000111000 ! 2 L2364: 38 1C # .word 0b0001111000101000 ! 3 L2366: 28 1E # .word 0b0000111001100000 ! 4 L2368: 60 0E # .word 0b0001011001101000 ! 5 L236A: 68 16 # .word 0b0001011001111000 ! 6 L236C: 78 16 # .word 0b0000101000001000 ! 7 L236E: 08 0A # .word 0b0001111001111000 ! 8 L2370: 78 1E # .word 0b0001111001101000 ! 9 L2372: 68 1E # .word 0b0000000111010000 ! : - - - - 4 - 6 L2374: D0 01 # .word 0b0100000110000001 ! ; - - - 3 - - 6 L2376: 81 41 # .word 0b1010000110000000 ! < - - 2 3 - 5 - L2378: 80 A1 # .word 0b0001010110100000 ! = - - - - - 5 6 L237A: A0 15 # .word 0b0000000110000101 ! > 0 1 - - - 5 - L237C: 85 01 # .word 0b1000000110001010 ! ? - 1 - 3 4 5 - L237E: 8A 81 # .word 0b0101110111011000 ! @ - 1 2 3 4 5 6 L2380: D8 5D # ! FEDCBA9876543210 # .word 0b0000111001111000 ! A L2382: 78 0E # .word 0b1011000001111000 ! B L2384: 78 B0 # .word 0b0001000001011000 ! C L2386: 58 10 # .word 0b0101101000001010 ! D L2388: 0A 5A # .word 0b0001010001111000 ! E L238A: 78 14 # .word 0b0000010001111000 ! F L238C: 78 04 # .word 0b0001011001011000 ! G L238E: 58 16 # .word 0b0000111111110000 ! H 0 1 2 3 - 5 - L2390: F0 0F # .word 0b0101000110001010 ! I - - 2 3 - - - L2392: 8A 51 # .word 0b0001101110010000 ! J - 1 2 3 - - 6 L2394: 90 1B # .word 0b1010000111110000 ! K - 1 2 3 - - 6 L2396: F0 A1 # .word 0b0001000111010000 ! L 0 1 - - - - 6 L2398: D0 11 # .word 0b1000101111010100 ! M 0 1 2 3 4 - - L239A: D4 8B # .word 0b0010101111010100 ! N - 1 2 - - 5 - L239C: D4 2B # .word 0b0001101111011000 ! O 0 1 2 3 4 - 6 L239E: D8 1B # .word 0b0000110111111000 ! P 0 1 - 3 4 5 - L23A0: F8 0D # .word 0b0011101111011000 ! Q 0 - 2 3 4 5 - L23A2: D8 3B # .word 0b0010110111111000 ! R 0 1 - 3 4 - - L23A4: F8 2D # .word 0b0011000110001100 ! S 0 - 2 - 4 5 6 L23A6: 8C 31 # .word 0b0100000110001010 ! T 0 1 - - 4 - - L23A8: 8A 41 # .word 0b0001101111010000 ! U 0 1 2 3 - - 6 L23AA: D0 1B # .word 0b1000000111010001 ! V 0 1 2 3 - - 6 L23AC: D1 81 # .word 0b0010101111010001 ! W 0 1 2 3 - - 6 L23AE: D1 2B # .word 0b1010000110000101 ! X - - - - 4 5 6 L23B0: 85 A1 # .word 0b1000000110000110 ! Y 0 - 2 3 - 5 6 L23B2: 86 81 # .word 0b1001000110001001 ! Z - 1 - 3 4 5 6 L23B4: 89 91 # .word 0b0000000110000000 ! [ 0 1 - - 4 - 6 L23B6: 80 01 # ! FEDCBA9876543210 # .word 0b0010000110000100 ! \ 0 - 2 - - 5 - L23B8: 84 21 # .word 0b0000000110000000 ! ] - - 2 3 4 - 6 L23BA: 80 01 # .word 0b0000000110000000 ! ^ - - - - 4 - - L23BC: 80 01 # .word 0b0001000110000000 ! _ - - - - - - 6 L23BE: 80 11 # .word 0b0000000110000100 ! ` 0 - - - - - - L23C0: 84 01 # # .word 0b0000111001111000 ! a L23C2: 78 0E # .word 0b1011000001111000 ! b L23C4: 78 B0 # .word 0b0001000001011000 ! c L23C6: 58 10 # .word 0b0101101000001010 ! D L23C8: 0A 5A # .word 0b0001010001111000 ! E L23CA: 78 14 # .word 0b0000010001111000 ! F L23CC: 78 04 # .word 0b0001011001011000 ! G L23CE: 58 16 # .word 0b0000111111110000 ! H 0 1 2 3 - 5 - L23D0: F0 0F # .word 0b0101000110001010 ! I - - 2 3 - - - L23D2: 8A 51 # .word 0b0001101110010000 ! J - 1 2 3 - - 6 L23D4: 90 1B # .word 0b1010000111110000 ! K - 1 2 3 - - 6 L23D6: F0 A1 # .word 0b0001000111010000 ! L 0 1 - - - - 6 L23D8: D0 11 # .word 0b1000101111010100 ! M 0 1 2 3 4 - - L23DA: D4 8B # .word 0b0010101111010100 ! N - 1 2 - - 5 - L23DC: D4 2B # .word 0b0001101111011000 ! O 0 1 2 3 4 - 6 L23DE: D8 1B # .word 0b0000110111111000 ! P 0 1 - 3 4 5 - L23E0: F8 0D # .word 0b0011101111011000 ! Q 0 - 2 3 4 5 - L23E2: D8 3B # .word 0b0010110111111000 ! R 0 1 - 3 4 - - L23E4: F8 2D # .word 0b0011000110001100 ! S 0 - 2 - 4 5 6 L23E6: 8C 31 # .word 0b0100000110001010 ! T 0 1 - - 4 - - L23E8: 8A 41 # .word 0b0001101111010000 ! U 0 1 2 3 - - 6 L23EA: D0 1B # .word 0b1000000111010001 ! V 0 1 2 3 - - 6 L23EC: D1 81 # .word 0b0010101111010001 ! W 0 1 2 3 - - 6 L23EE: D1 2B # .word 0b1010000110000101 ! X - - - - 4 5 6 L23F0: 85 A1 # .word 0b1000000110000110 ! Y 0 - 2 3 - 5 6 L23F2: 86 81 # .word 0b1001000110001001 ! Z - 1 - 3 4 5 6 L23F4: 89 91 # # .word 0b0000000110000000 ! { - 1 - - - 5 6 L23F6: 80 01 # .word 0b0100000110000010 ! | - 1 - - - - - L23F8: 82 41 # .word 0b0000000110000000 ! } - - 2 - - 5 6 L23FA: 80 01 # .word 0b0000000110001000 ! ~ - - - - 4 - - L23FC: 88 01 # .word 0b0000000110000000 ! ^? - 1 - 3 4 5 6 L23FE: 80 01 # # cu58af_font_size = . - cu58af_font # # .align 8 # # cu53an_font: # # .byte 0x5f ! 0 0 1 2 3 4 - 6 L2400: 5F # .byte 0x0c ! 1 - - 2 3 - - - L2401: 0C # .byte 0x7a ! 2 - 1 - 3 4 5 6 L2402: 7A # .byte 0x7c ! 3 - - 2 3 4 5 6 L2403: 7C # .byte 0x2d ! 4 0 - 2 3 - 5 - L2404: 2D # .byte 0x75 ! 5 0 - 2 - 4 5 6 L2405: 75 # .byte 0x77 ! 6 0 1 2 - 4 5 6 L2406: 77 # .byte 0x1c ! 7 - - 2 3 4 - - L2407: 1C # .byte 0x7f ! 8 0 1 2 3 4 5 6 L2408: 7F # .byte 0x7d ! 9 0 - 2 3 4 5 6 L2409: 7D # .byte 0x3f ! A 0 1 2 3 4 5 - L240A: 3F # .byte 0x67 ! b 0 1 2 - - 5 6 L240B: 67 # .byte 0x53 ! C 0 1 - - 4 - 6 L240C: 53 # .byte 0x6e ! d - 1 2 3 - 5 6 L240D: 6E # .byte 0x73 ! E 0 1 - - 4 5 6 L240E: 73 # .byte 0x33 ! F 0 1 - - 4 5 - L240F: 33 # # .byte 0x57 ! G 0 1 2 - 4 - 6 L2410: 57 # # .org cu53an_font + ' ' # # .byte 0x00 ! - - - - - - - L2420: 00 # .byte 0x0c ! ! - - 2 3 - - - L2421: 0C # .byte 0x09 ! " 0 - - 3 - - - L2422: 09 # .byte 0x66 ! # - 1 2 - - 5 6 L2423: 66 # .byte 0x25 ! $ 0 - 2 - - 5 - L2424: 25 # .byte 0x05 ! % 0 - 2 - - - - L2425: 05 # .byte 0x6a ! & - 1 - 3 - 5 6 L2426: 6A # .byte 0x08 ! ' - - - 3 - - - L2427: 08 # .byte 0x0c ! ( - - 2 3 - - - L2428: 0C # .byte 0x03 ! ) 0 1 - - - - - L2429: 03 # .byte 0x70 ! * - - - - 4 5 6 L242A: 70 # .byte 0x23 ! + 0 1 - - - 5 - L242B: 23 # .byte 0x02 ! , - 1 - - - - - L242C: 02 # .byte 0x20 ! - - - - - - 5 - L242D: 20 # .byte 0x02 ! . - 1 - - - - - L242E: 02 # .byte 0x2a ! / - 1 - 3 - 5 - L242F: 2A # .byte 0x5f ! 0 0 1 2 3 4 - 6 L2430: 5F # .byte 0x0c ! 1 - - 2 3 - - - L2431: 0C # .byte 0x7a ! 2 - 1 - 3 4 5 6 L2432: 7A # .byte 0x7c ! 3 - - 2 3 4 5 6 L2433: 7C # .byte 0x2d ! 4 0 - 2 3 - 5 - L2434: 2D # .byte 0x75 ! 5 0 - 2 - 4 5 6 L2435: 75 # .byte 0x77 ! 6 0 1 2 - 4 5 6 L2436: 77 # .byte 0x1c ! 7 - - 2 3 4 - - L2437: 1C # .byte 0x7f ! 8 0 1 2 3 4 5 6 L2438: 7F # .byte 0x7d ! 9 0 - 2 3 4 5 6 L2439: 7D # .byte 0x50 ! : - - - - 4 - 6 L243A: 50 # .byte 0x48 ! ; - - - 3 - - 6 L243B: 48 # .byte 0x2c ! < - - 2 3 - 5 - L243C: 2C # .byte 0x60 ! = - - - - - 5 6 L243D: 60 # .byte 0x23 ! > 0 1 - - - 5 - L243E: 23 # .byte 0x3a ! ? - 1 - 3 4 5 - L243F: 3A # .byte 0x7e ! @ - 1 2 3 4 5 6 L2440: 7E # .byte 0x3f ! A 0 1 2 3 4 5 - L2441: 3F # .byte 0x67 ! b 0 1 2 - - 5 6 L2442: 67 # .byte 0x53 ! C 0 1 - - 4 - 6 L2443: 53 # .byte 0x6e ! d - 1 2 3 - 5 6 L2444: 6E # .byte 0x73 ! E 0 1 - - 4 5 6 L2445: 73 # .byte 0x33 ! F 0 1 - - 4 5 - L2446: 33 # .byte 0x57 ! G 0 1 2 - 4 - 6 L2447: 57 # .byte 0x2f ! H 0 1 2 3 - 5 - L2448: 2F # .byte 0x0c ! I - - 2 3 - - - L2449: 0C # .byte 0x4e ! J - 1 2 3 - - 6 L244A: 4E # .byte 0x2f ! K - 1 2 3 - - 6 L244B: 2F # .byte 0x43 ! L 0 1 - - - - 6 L244C: 43 # .byte 0x1f ! M 0 1 2 3 4 - - L244D: 1F # .byte 0x26 ! N - 1 2 - - 5 - L244E: 26 # .byte 0x5f ! O 0 1 2 3 4 - 6 L244F: 5F # .byte 0x3b ! P 0 1 - 3 4 5 - L2450: 3B # .byte 0x3d ! Q 0 - 2 3 4 5 - L2451: 3D # .byte 0x1b ! R 0 1 - 3 4 - - L2452: 1B # .byte 0x75 ! S 0 - 2 - 4 5 6 L2453: 75 # .byte 0x13 ! T 0 1 - - 4 - - L2454: 13 # .byte 0x4f ! U 0 1 2 3 - - 6 L2455: 4F # .byte 0x4f ! V 0 1 2 3 - - 6 L2456: 4F # .byte 0x4f ! W 0 1 2 3 - - 6 L2457: 4F # .byte 0x70 ! X - - - - 4 5 6 L2458: 70 # .byte 0x6d ! Y 0 - 2 3 - 5 6 L2459: 6D # .byte 0x7a ! Z - 1 - 3 4 5 6 L245A: 7A # .byte 0x53 ! [ 0 1 - - 4 - 6 L245B: 53 # .byte 0x25 ! \ 0 - 2 - - 5 - L245C: 25 # .byte 0x5c ! ] - - 2 3 4 - 6 L245D: 5C # .byte 0x10 ! ^ - - - - 4 - - L245E: 10 # .byte 0x40 ! _ - - - - - - 6 L245F: 40 # .byte 0x01 ! ` 0 - - - - - - L2460: 01 # .byte 0x26 ! a - 1 2 - - 5 - L2461: 26 # .byte 0x67 ! b 0 1 2 - - 5 6 L2462: 67 # .byte 0x62 ! c - 1 - - - 5 6 L2463: 62 # .byte 0x6e ! d - 1 2 3 - 5 6 L2464: 6E # .byte 0x62 ! e - 1 - - - 5 6 L2465: 62 # .byte 0x33 ! f 0 1 - - 4 5 - L2466: 33 # .byte 0x7d ! g 0 - 2 3 4 5 6 L2467: 7D # .byte 0x27 ! h 0 1 2 - - 5 - L2468: 27 # .byte 0x04 ! i - - 2 - - - - L2469: 04 # .byte 0x44 ! j - - 2 - - - 6 L246A: 44 # .byte 0x27 ! k L246B: 27 # .byte 0x42 ! l - 1 - - - - 6 L246C: 42 # .byte 0x26 ! m - 1 2 - - 5 - L246D: 26 # .byte 0x26 ! n - 1 2 - - 5 - L246E: 26 # .byte 0x66 ! o - 1 2 - - 5 6 L246F: 66 # .byte 0x3b ! p 0 1 - 3 4 5 - L2470: 3B # .byte 0x3d ! q 0 - 2 3 4 5 - L2471: 3D # .byte 0x22 ! r - 1 - - - 5 - L2472: 22 # .byte 0x75 ! s 0 - 2 - 4 5 6 L2473: 75 # .byte 0x63 ! t 0 1 - - - 5 6 L2474: 63 # .byte 0x46 ! u - 1 2 - - - 6 L2475: 46 # .byte 0x46 ! v - 1 2 - - - 6 L2476: 46 # .byte 0x46 ! w - 1 2 - - - 6 L2477: 46 # .byte 0x06 ! x - 1 2 - - - - L2478: 06 # .byte 0x2d ! y 0 - 2 3 - 5 - L2479: 2D # .byte 0x60 ! z - - - - - 5 6 L247A: 60 # .byte 0x62 ! { - 1 - - - 5 6 L247B: 62 # .byte 0x02 ! | - 1 - - - - - L247C: 02 # .byte 0x64 ! } - - 2 - - 5 6 L247D: 64 # .byte 0x10 ! ~ - - - - 4 - - L247E: 10 # .byte 0x00 ! ^? - 1 - 3 4 5 6 L247F: 00 # # cu53an_font_size = . - cu53an_font # # .align 8 L2480: 00 [ 80 ] # # div99tbl: L2500: 00 L2501: 00 L2502: 01 L2503: 01 L2504: 02 L2505: 02 L2506: 02 L2507: 03 L2508: 03 # .byte 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04 L2509: 04 L250A: 04 L250B: 04 L250C: 05 L250D: 05 L250E: 05 L250F: 06 L2510: 06 L2511: 07 L2512: 07 # .byte 0x04, 0x04, 0x05, 0x05, 0x05, 0x06, 0x06, 0x07, 0x07, 0x07 L2513: 07 L2514: 08 L2515: 08 L2516: 09 L2517: 09 L2518: 09 L2519: 10 L251A: 10 L251B: 11 L251C: 11 # .byte 0x08, 0x08, 0x09, 0x09, 0x09, 0x10, 0x10, 0x11, 0x11, 0x11 L251D: 11 L251E: 12 L251F: 12 L2520: 12 L2521: 13 L2522: 13 L2523: 14 L2524: 14 L2525: 14 L2526: 15 # .byte 0x12, 0x12, 0x12, 0x13, 0x13, 0x14, 0x14, 0x14, 0x15, 0x15 L2527: 15 L2528: 16 L2529: 16 L252A: 16 L252B: 17 L252C: 17 L252D: 18 L252E: 18 L252F: 18 L2530: 19 # .byte 0x16, 0x16, 0x16, 0x17, 0x17, 0x18, 0x18, 0x18, 0x19, 0x19 L2531: 19 L2532: 20 L2533: 20 L2534: 20 L2535: 21 L2536: 21 L2537: 21 L2538: 22 L2539: 22 L253A: 23 # .byte 0x20, 0x20, 0x20, 0x21, 0x21, 0x21, 0x22, 0x22, 0x23, 0x23 L253B: 23 L253C: 23 L253D: 24 L253E: 24 L253F: 25 L2540: 25 L2541: 25 L2542: 26 L2543: 26 L2544: 27 # .byte 0x23, 0x24, 0x24, 0x25, 0x25, 0x25, 0x26, 0x26, 0x27, 0x27 L2545: 27 L2546: 27 L2547: 28 L2548: 28 L2549: 29 L254A: 29 L254B: 29 L254C: 30 L254D: 30 L254E: 30 # .byte 0x27, 0x28, 0x28, 0x29, 0x29, 0x29, 0x30, 0x30, 0x30, 0x31 L254F: 31 L2550: 31 L2551: 32 L2552: 32 L2553: 32 L2554: 33 L2555: 33 L2556: 34 L2557: 34 L2558: 34 # .byte 0x31, 0x32, 0x32, 0x32, 0x33, 0x33, 0x34, 0x34, 0x34, 0x35 L2559: 35 L255A: 35 L255B: 36 L255C: 36 L255D: 36 L255E: 37 L255F: 37 L2560: 37 L2561: 38 L2562: 38 # .byte 0x35, 0x36, 0x36, 0x36, 0x37, 0x37, 0x37, 0x38, 0x38, 0x39 L2563: 39 L2564: 39 L2565: 39 L2566: 40 L2567: 40 L2568: 41 L2569: 41 L256A: 41 L256B: 42 L256C: 42 # .byte 0x39, 0x39, 0x40, 0x40, 0x41, 0x41, 0x41, 0x42, 0x42, 0x43 L256D: 43 L256E: 43 L256F: 43 L2570: 44 L2571: 44 L2572: 45 L2573: 45 L2574: 45 L2575: 46 L2576: 46 # .byte 0x43, 0x43, 0x44, 0x44, 0x45, 0x45, 0x45, 0x46, 0x46, 0x46 L2577: 46 L2578: 47 L2579: 47 L257A: 48 L257B: 48 L257C: 48 L257D: 49 L257E: 49 L257F: 50 L2580: 50 # .byte 0x47, 0x47, 0x48, 0x48, 0x48, 0x49, 0x49, 0x50, 0x50, 0x50 L2581: 50 L2582: 51 L2583: 51 L2584: 52 L2585: 52 L2586: 52 L2587: 53 L2588: 53 L2589: 54 L258A: 54 # .byte 0x51, 0x51, 0x52, 0x52, 0x52, 0x53, 0x53, 0x54, 0x54, 0x54 L258B: 54 L258C: 55 L258D: 55 L258E: 55 L258F: 56 L2590: 56 L2591: 57 L2592: 57 L2593: 57 L2594: 58 # .byte 0x55, 0x55, 0x55, 0x56, 0x56, 0x57, 0x57, 0x57, 0x58, 0x58 L2595: 58 L2596: 59 L2597: 59 L2598: 59 L2599: 60 L259A: 60 L259B: 61 L259C: 61 L259D: 61 L259E: 62 # .byte 0x59, 0x59, 0x59, 0x60, 0x60, 0x61, 0x61, 0x61, 0x62, 0x62 L259F: 62 L25A0: 62 L25A1: 63 L25A2: 63 L25A3: 64 L25A4: 64 L25A5: 64 L25A6: 65 L25A7: 65 L25A8: 66 # .byte 0x62, 0x63, 0x63, 0x64, 0x64, 0x64, 0x65, 0x65, 0x66, 0x66 L25A9: 66 L25AA: 66 L25AB: 67 L25AC: 67 L25AD: 68 L25AE: 68 L25AF: 68 L25B0: 69 L25B1: 69 L25B2: 70 # .byte 0x66, 0x67, 0x67, 0x68, 0x68, 0x68, 0x69, 0x69, 0x70, 0x70 L25B3: 70 L25B4: 70 L25B5: 71 L25B6: 71 L25B7: 71 L25B8: 72 L25B9: 72 L25BA: 73 L25BB: 73 L25BC: 73 # .byte 0x70, 0x71, 0x71, 0x71, 0x72, 0x72, 0x73, 0x73, 0x73, 0x74 L25BD: 74 L25BE: 74 L25BF: 75 L25C0: 75 L25C1: 75 L25C2: 76 L25C3: 76 L25C4: 77 L25C5: 77 L25C6: 77 # .byte 0x74, 0x75, 0x75, 0x75, 0x76, 0x76, 0x77, 0x77, 0x77, 0x78 L25C7: 78 L25C8: 78 L25C9: 79 L25CA: 79 L25CB: 79 L25CC: 80 L25CD: 80 L25CE: 80 L25CF: 81 L25D0: 81 # .byte 0x78, 0x79, 0x79, 0x79, 0x80, 0x80, 0x80, 0x81, 0x81, 0x82 L25D1: 82 L25D2: 82 L25D3: 82 L25D4: 83 L25D5: 83 L25D6: 84 L25D7: 84 L25D8: 84 L25D9: 85 L25DA: 85 # .byte 0x82, 0x82, 0x83, 0x83, 0x84, 0x84, 0x84, 0x85, 0x85, 0x86 L25DB: 86 L25DC: 86 L25DD: 86 L25DE: 87 L25DF: 87 L25E0: 87 L25E1: 88 L25E2: 88 L25E3: 89 L25E4: 89 # .byte 0x86, 0x86, 0x87, 0x87, 0x87, 0x88, 0x88, 0x89, 0x89, 0x89 L25E5: 89 L25E6: 90 L25E7: 90 L25E8: 91 L25E9: 91 L25EA: 91 L25EB: 92 L25EC: 92 L25ED: 93 L25EE: 93 # .byte 0x90, 0x90, 0x91, 0x91, 0x91, 0x92, 0x92, 0x93, 0x93, 0x93 L25EF: 93 L25F0: 94 L25F1: 94 L25F2: 95 L25F3: 95 L25F4: 95 L25F5: 96 L25F6: 96 L25F7: 96 L25F8: 97 # .byte 0x94, 0x94, 0x95, 0x95, 0x95, 0x96, 0x96, 0x96, 0x97, 0x97 L25F9: 97 L25FA: 98 L25FB: 98 L25FC: 98 L25FD: 99 L25FE: 99 # .byte 0x98, 0x98, 0x98, 0x99, 0x99, 0x99 L25FF: 99 # # dpydiv99: L2600: 26 25 # ld h, HI(div99tbl) ; ASSERT(LO(div99tbl) == 0) L2602: 6F # ld l, a L2603: 7E # ld a, [hl] # jp dpyhex L2604: C3 67 1B # # dpydiv9: L2607: 26 25 # ld h, HI(div99tbl) ; ASSERT(LO(div99tbl) == 0) L2609: 6F # ld l, a L260A: 7E # ld a, [hl] L260B: CB 3F # srl a L260D: CB 3F # srl a L260F: CB 3F # srl a L2611: CB 3F # srl a # jp dpydig L2613: C3 16 26 # # ! digit or character in a # ! location table in de # ! de incremented to next position, # ! hl & a destroyed # # dpydig: L2616: F5 # push af L2617: 3A F0 C5 # ld a, [cu_is_alfa] L261A: B7 # or a # jr z, 1f L261B: 28 14 L261D: F1 # pop af # L261E: C5 # push bc # ld hl, cu58af_font L261F: 21 00 23 # ld b, 0 L2622: 06 00 L2624: 4F # ld c, a L2625: 09 # add hl, bc L2626: ED 4A # adc hl, bc L2628: 7E # ld a, [hl] L2629: 12 # ld [de], a L262A: 13 # inc de L262B: 23 # inc hl L262C: 7E # ld a, [hl] L262D: 12 # ld [de], a L262E: 13 # inc de L262F: C1 # pop bc # ret L2630: C9 # 1: L2631: F1 # pop af L2632: C5 # push bc L2633: 26 24 # ld h, HI(cu53an_font) ; ASSERT(LO(cu53an_font) == 0) L2635: 6F # ld l, a L2636: 4E # ld c, [hl] ! what segments (0..6) are lit, what are dim # L2637: 1A L2638: 13 L2639: CB 19 # ld a, [de]; inc de; rr c; call segment_onoff L263B: CD 84 20 L263E: 1A L263F: 13 L2640: CB 19 # ld a, [de]; inc de; rr c; call segment_onoff L2642: CD 84 20 L2645: 1A L2646: 13 L2647: CB 19 # ld a, [de]; inc de; rr c; call segment_onoff L2649: CD 84 20 L264C: 1A L264D: 13 L264E: CB 19 # ld a, [de]; inc de; rr c; call segment_onoff L2650: CD 84 20 # L2653: 1A L2654: 13 L2655: CB 19 # ld a, [de]; inc de; rr c; call segment_onoff L2657: CD 84 20 L265A: 1A L265B: 13 L265C: CB 19 # ld a, [de]; inc de; rr c; call segment_onoff L265E: CD 84 20 L2661: 1A L2662: 13 L2663: CB 19 # ld a, [de]; inc de; rr c; call segment_onoff L2665: CD 84 20 # L2668: C1 # pop bc # ret L2669: C9 # # tx_on: # call scanner_stop L266A: CD 23 09 # L266D: 3A F1 C5 # ld a, [local_mode] L2670: B7 # or a # jr nz, 1f ! Local mode, no tx limits L2671: 20 2C # L2673: ED 4B FE C1 L2677: 3A 00 C2 # ld bc, [tx_offset] ; ld a, [(tx_offset) + 2] L267A: 5F # ld e, a L267B: 2A 04 C2 L267E: 3A 06 C2 # ld hl, [tx_divisor] ; ld a, [(tx_divisor) + 2] L2681: 09 # add hl, bc L2682: 8B # adc e # L2683: E5 # push hl L2684: 57 # ld d, a # L2685: ED 4B 9C C5 L2689: 3A 9E C5 # ld bc, [tx_divisor_lo] ; ld a, [(tx_divisor_lo) + 2] L268C: 5F # ld e, a L268D: 7A # ld a, d L268E: A7 # and a L268F: ED 42 # sbc hl, bc L2691: 9B # sbc e ! tx-freq - low-limit L2692: C1 # pop bc ! DBC has now tx-freq # L2693: D8 # ret c ! if below limit # L2694: 2A 9F C5 L2697: 3A A1 C5 # ld hl, [tx_divisor_hi] ; ld a, [(tx_divisor_hi) + 2] L269A: A7 # and a L269B: ED 42 # sbc hl, bc L269D: 9A # sbc d ! high-limit - tx-freq # L269E: D8 # ret c ! if above limit # 1: L269F: F3 # di # # ld a, 1 L26A0: 3E 01 L26A2: 32 2A C2 # ld [txon], a # ld a, 100 L26A5: 3E 64 L26A7: 32 4F C5 # ld [txtail_timer], a ! shall count 1 second after tx ends # # call stop_marker_tone L26AA: CD E5 1A L26AD: 3A 29 C2 # ld a, [output_0] # and ~ 0x10 L26B0: E6 EF # and ~ 0x20 L26B2: E6 DF L26B4: 32 29 C2 # ld [output_0], a L26B7: D3 60 # out [0x60], a L26B9: FB # ei # L26BA: ED 4B FE C1 L26BE: 3A 00 C2 # ld bc, [tx_offset] ; ld a, [(tx_offset) + 2] L26C1: 5F # ld e, a L26C2: 2A 04 C2 L26C5: 3A 06 C2 # ld hl, [tx_divisor] ; ld a, [(tx_divisor) + 2] L26C8: 09 # add hl, bc L26C9: 8B # adc e L26CA: 22 04 C2 L26CD: 32 06 C2 # ld [tx_divisor], hl ; ld [(tx_divisor) + 2], a # # ld a, 0x80 L26D0: 3E 80 L26D2: D3 70 # out [0x70], a # ld a, 0 L26D4: 3E 00 L26D6: D3 40 # out [0x40], a # call change_txsynth L26D8: CD B8 21 # # ld a, 0 L26DB: 3E 00 L26DD: D3 70 # out [0x70], a # L26DF: 3A F9 C1 # ld a, [txpwr] L26E2: D3 40 # out [0x40], a # # ld hl, 1 L26E4: 21 01 00 L26E7: 22 A5 C5 # ld [energy_unit_per_second], hl # # ld hl, indicators L26EA: 21 40 C5 L26ED: 3A F0 C5 # ld a, [cu_is_alfa] L26F0: B7 # or a # jr z, 1f L26F1: 28 04 L26F3: CB DE # set 3, [hl] # jr 2f L26F5: 18 02 # 1: L26F7: CB D6 # set 2, [hl] # 2: L26F9: A7 # and a ! return carry clear # ret L26FA: C9 # # # tx_off: # ld a, 0x80 L26FB: 3E 80 L26FD: D3 70 # out [0x70], a # ld a, 0 L26FF: 3E 00 L2701: D3 40 # out [0x40], a # # ld hl, 1 L2703: 21 01 00 L2706: 22 A5 C5 # ld [energy_unit_per_second], hl # # L2709: ED 4B FE C1 L270D: 3A 00 C2 # ld bc, [tx_offset] ; ld a, [(tx_offset) + 2] L2710: 5F # ld e, a L2711: 2A 04 C2 L2714: 3A 06 C2 # ld hl, [tx_divisor] ; ld a, [(tx_divisor) + 2] L2717: A7 # and a L2718: ED 42 # sbc hl, bc L271A: 9B # sbc e L271B: 22 04 C2 L271E: 32 06 C2 # ld [tx_divisor], hl ; ld [(tx_divisor) + 2], a # # # call lookup_rfc L2721: CD 45 2B # call change_rxsynth L2724: CD 00 22 # # ld a, 0 L2727: 3E 00 L2729: 32 2A C2 # ld [txon], a # # # # # # # ld hl, indicators L272C: 21 40 C5 L272F: 3A F0 C5 # ld a, [cu_is_alfa] L2732: B7 # or a # jr z, 1f L2733: 28 04 L2735: CB 9E # res 3, [hl] # jr 2f L2737: 18 02 # 1: L2739: CB 96 # res 2, [hl] # 2: # # ret L273B: C9 # # ! # ! Calculate binary value from unpacked string # ! Return in CY AHL # ! # a2i: L273C: DD E5 # push ix L273E: C5 # push bc L273F: D5 # push de # # ld ix, digbuf L2740: DD 21 87 C5 L2744: 3A 86 C5 # ld a, [digidx] L2747: 4F # ld c, a # # ld a, 0 ! AHL starts from 0x000000 L2748: 3E 00 L274A: 67 # ld h, a L274B: 6F # ld l, a L274C: 32 86 C5 # ld [digidx], a # L274F: 0D # dec c # jp z, a2i1 L2750: CA E8 27 L2753: 0D # dec c # jp z, a2i2 L2754: CA D5 27 L2757: 0D # dec c # jp z, a2i3 L2758: CA C2 27 L275B: 0D # dec c # jp z, a2i4 L275C: CA AF 27 L275F: 0D # dec c # jp z, a2i5 L2760: CA 9C 27 L2763: 0D # dec c # jp z, a2i6 L2764: CA 89 27 L2767: 0D # dec c # jp z, a2i7 L2768: CA 76 27 # # jp a2i0 ! more than 7, give 0 L276B: C3 FB 27 # # a2iOV: L276E: 21 FF FF # ld hl, (0xFFFFFF) % 65536 ; ld a, (0xFFFFFF) / 65536 L2771: 3E FF # jp a2i0 L2773: C3 FB 27 # # a2i7: # ld de, 0x4240 L2776: 11 40 42 L2779: DD 46 00 # ld b, [ix] ! x 000 000 L277C: DD 23 # inc ix L277E: 04 # inc b # jr 1f L277F: 18 06 # 2: L2781: 19 # add hl, de # adc 0x0F ! 1 000 000 equals 0x 0F 4240 L2782: CE 0F # jp c, a2iOV L2784: DA 6E 27 # 1: # djnz 2b L2787: 10 F8 # a2i6: # ld de, 0x86a0 ! 100 000 equals 0x186a0, thus the adc 1... L2789: 11 A0 86 L278C: DD 46 00 # ld b, [ix] ! 0 x00 000 L278F: DD 23 # inc ix L2791: 04 # inc b # jr 1f L2792: 18 06 # 2: L2794: 19 # add hl, de # adc 1 L2795: CE 01 # jp c, a2iOV L2797: DA 6E 27 # 1: # djnz 2b L279A: 10 F8 # a2i5: # ld de, 10000 L279C: 11 10 27 L279F: DD 46 00 # ld b, [ix] ! 0x0 000 L27A2: DD 23 # inc ix L27A4: 04 # inc b # jr 1f L27A5: 18 06 # 2: L27A7: 19 # add hl, de # adc 0 L27A8: CE 00 # jp c, a2iOV L27AA: DA 6E 27 # 1: # djnz 2b L27AD: 10 F8 # a2i4: # ld de, 1000 L27AF: 11 E8 03 L27B2: DD 46 00 # ld b, [ix] ! 00x 000 L27B5: DD 23 # inc ix L27B7: 04 # inc b # jr 1f L27B8: 18 06 # 2: L27BA: 19 # add hl, de # adc 0 L27BB: CE 00 # jp c, a2iOV L27BD: DA 6E 27 # 1: # djnz 2b L27C0: 10 F8 # a2i3: # ld de, 100 L27C2: 11 64 00 L27C5: DD 46 00 # ld b, [ix] ! 000 x00 L27C8: DD 23 # inc ix L27CA: 04 # inc b # jr 1f L27CB: 18 06 # 2: L27CD: 19 # add hl, de # adc 0 L27CE: CE 00 # jp c, a2iOV L27D0: DA 6E 27 # 1: # djnz 2b L27D3: 10 F8 # a2i2: # ld de, 10 L27D5: 11 0A 00 L27D8: DD 46 00 # ld b, [ix] ! 000 0x0 L27DB: DD 23 # inc ix L27DD: 04 # inc b # jr 1f L27DE: 18 06 # 2: L27E0: 19 # add hl, de # adc 0 L27E1: CE 00 # jp c, a2iOV L27E3: DA 6E 27 # 1: # djnz 2b L27E6: 10 F8 # a2i1: # ld de, 1 L27E8: 11 01 00 L27EB: DD 46 00 # ld b, [ix] ! 000 00x L27EE: DD 23 # inc ix L27F0: 04 # inc b # jr 1f L27F1: 18 06 # 2: L27F3: 19 # add hl, de # adc 0 L27F4: CE 00 # jp c, a2iOV L27F6: DA 6E 27 # 1: # djnz 2b L27F9: 10 F8 # a2i0: L27FB: D1 # pop de L27FC: C1 # pop bc L27FD: DD E1 # pop ix # # ret ! AHL contains frequency in binary L27FF: C9 # # # ! Multiply AHL by C, 1.. # ! Result to CY AHL # # mul248: # L2800: C5 # push bc L2801: D5 # push de # L2802: 5D # ld e, l L2803: 54 # ld d, h L2804: 47 # ld b, a L2805: A7 # and a ! clear carry # 1: L2806: 0D # dec c # jr z, 1f L2807: 28 0A L2809: ED 5A # adc hl, de L280B: 88 # adc b # jr nc, 1b L280C: 30 F8 L280E: 21 FF FF # ld hl, (0xFFFFFF) % 65536 ; ld a, (0xFFFFFF) / 65536 L2811: 3E FF # 1: L2813: D1 # pop de L2814: C1 # pop bc # # ret L2815: C9 # # !---------------------------------------------------------------------- # ! # ! Divide AHL by C, result left in HL, remainder in A. # ! # ! Origin: Trash-80 Assembly Language Subroutines, William Barden 1982. # ! # # div248: # L2816: C5 # push bc # # ld b, 16 ! do this 16 times. L2817: 06 10 # 2: L2819: 29 # add hl, hl ! rotate AHL one bit L281A: 8F # adc a ! position to the left. L281B: 91 # sub c # jr c, 1f L281C: 38 05 L281E: 23 # inc hl ! set lsb of hl, a bit into quotient. # djnz 2b L281F: 10 F8 # jr 3f L2821: 18 03 # 1: L2823: 81 # add c ! oops, should not have subtracted. # djnz 2b L2824: 10 F3 # 3: L2826: C1 # pop bc # # ret L2827: C9 # # ! # ! freq / 25 * 2 = xxx # ! AHL has freq in Hz # ! # # freq2div: # L2828: C5 # push bc L2829: D5 # push de # L282A: ED 4B 7C C5 # ld bc, [bstep_cfg] # call div248 L282E: CD 16 28 # ld e, 0 ! MSb L2831: 1E 00 L2833: 04 # inc b # jr 2f L2834: 18 0E # 1: L2836: 37 # scf ! remainder * 2 + 1 L2837: CB 17 # rl a ! L2839: B9 # cp c ! compare with divider # jr c, 3f L283A: 38 01 L283C: 91 # sub c # 3: L283D: 3F # ccf L283E: CB 15 # rl l ! and shift in L2840: CB 14 # rl h L2842: CB 13 # rl e # 2: # djnz 1b L2844: 10 F0 # L2846: 7B # ld a, e # cp (0x1FFFF / 65536) + 1 ! 0 or 1 only possible L2847: FE 02 # jr c, 1f L2849: 38 05 L284B: 21 FF FF # ld hl, (0x1FFFF) % 65536 ; ld a, (0x1FFFF) / 65536 L284E: 3E 01 # 1: # L2850: D1 # pop de L2851: C1 # pop bc # # ret L2852: C9 # # sput: # 1: L2853: E1 # pop hl L2854: 7E # ld a, [hl] L2855: 23 # inc hl L2856: E5 # push hl L2857: B7 # or a # jr z, 1f L2858: 28 05 # call dpydig L285A: CD 16 26 # jr 1b L285D: 18 F4 # 1: # ret L285F: C9 # # clear_setting: L2860: 3A A3 C5 # ld a, [dpymode] # ld b, 0 L2863: 06 00 L2865: 4F # ld c, a L2866: CB 21 L2868: CB 10 # sla c; rl b ! 2 L286A: CB 21 L286C: CB 10 # sla c; rl b ! 4 L286E: CB 21 L2870: CB 10 # sla c; rl b ! 8 L2872: CB 21 L2874: CB 10 # sla c; rl b ! 16 # ld ix, settings L2876: DD 21 B0 28 L287A: DD 09 # add ix, bc # # 1: L287C: DD 7E 00 # ld a, [ix] L287F: DD 23 # inc ix L2881: B7 # or a # jr nz, 1b L2882: 20 F8 # L2884: DD 6E 02 # ld l, [ix + 2] L2887: DD 66 03 # ld h, [ix + 3] # ld a, 0 L288A: 3E 00 L288C: 77 # ld [hl], a L288D: 7C # ld a, h # cp HI(hours) L288E: FE C1 # jr nz, 1f L2890: 20 15 L2892: 7D # ld a, l # cp LO(hours) L2893: FE F4 # jr nz, 1f L2895: 20 10 # ld a, 0 L2897: 3E 00 L2899: F3 # di L289A: 32 F4 C1 # ld [hours], a L289D: 32 F5 C1 # ld [minutes], a L28A0: 32 F6 C1 # ld [seconds], a L28A3: 32 F7 C1 # ld [sec100], a L28A6: FB # ei # 1: # call save_nvdata L28A7: CD AC 2B # ret L28AA: C9 # # ret L28AB: C9 # # ! # ! rfc rssi batt # ! 123456 78 # SETTING_RFC = 1 # SETTING_DIFF = 4 # SETTING_ID = 7 # SETTING_STEP = 8 L28AC: 00 [ 04 ] # .align 4; L28B0: 3F 3F 3F 3F 20 20 20 00 L28B8: 00 00 # settings: .asciz "???? " ; .word 0, 0 L28BA: 00 00 L28BC: 00 [ 04 ] L28C0: 72 46 63 00 L28C4: B7 29 # .align 4; .asciz "rFc" ; .word do_tunedpy, 0 L28C6: 00 00 L28C8: 00 [ 08 ] L28D0: 74 50 63 20 20 20 20 00 L28D8: 0B 2A # .align 4; .asciz "tPc " ; .word do_bytedpy, txpwr L28DA: F9 C1 L28DC: 00 [ 04 ] L28E0: 53 71 4C 20 20 20 20 00 L28E8: 0B 2A # .align 4; .asciz "SqL " ; .word do_bytedpy, ad_sql L28EA: 2E C2 L28EC: 00 [ 04 ] L28F0: 20 00 L28F2: DC 29 # .align 4; .asciz " " ; .word do_diffdpy, 0 L28F4: 00 00 L28F6: 00 [ 0A ] L2900: 62 41 74 74 20 20 20 00 L2908: 0B 2A # .align 4; .asciz "bAtt " ; .word do_bytedpy, ad_batt L290A: 2F C2 L290C: 00 [ 04 ] L2910: 41 47 45 20 00 L2915: 5C 2A # .align 4; .asciz "AGE " ; .word do_timedpy, hours L2917: F4 C1 L2919: 00 [ 07 ] L2920: 69 64 20 20 20 00 L2926: 38 2A # .align 4; .asciz "id " ; .word do_iddpy, mycall L2928: 14 C2 L292A: 00 [ 06 ] L2930: 53 74 45 50 20 20 20 00 L2938: C9 29 # .align 4; .asciz "StEP " ; .word do_stepdpy, 0 L293A: 00 00 L293C: 00 [ 04 ] L2940: 53 6F 46 74 20 20 20 20 00 L2949: 2B 2A # .align 4; .asciz "SoFt "; .word do_verdpy, 0 L294B: 00 00 L294D: 00 [ 03 ] L2950: 50 68 20 20 00 L2955: 15 2A # .align 4; .asciz "Ph " ; .word do_pktdpy, packet_good L2957: E0 C5 L2959: 00 [ 07 ] L2960: 50 74 20 20 00 L2965: 15 2A # .align 4; .asciz "Pt " ; .word do_pktdpy, packet_good + 3 L2967: E3 C5 L2969: 00 [ 07 ] # .align 4; # # NUM_INFOS = (. - settings) / 16 # # stat2dpy: # L2970: 3A A3 C5 # ld a, [dpymode] # ld b, 0 L2973: 06 00 L2975: 4F # ld c, a L2976: CB 21 L2978: CB 10 # sla c; rl b ! 2 L297A: CB 21 L297C: CB 10 # sla c; rl b ! 4 L297E: CB 21 L2980: CB 10 # sla c; rl b ! 8 L2982: CB 21 L2984: CB 10 # sla c; rl b ! 16 # ld ix, settings L2986: DD 21 B0 28 L298A: DD 09 # add ix, bc # # 1: L298C: 3A F0 C5 # ld a, [cu_is_alfa] L298F: B7 # or a # jr z, 3f L2990: 28 06 L2992: DD 7E 01 # ld a, [ix + 1] L2995: B7 # or a # jr z, 2f ! Only 9 positions... L2996: 28 0D # 3: L2998: DD 7E 00 # ld a, [ix] L299B: DD 23 # inc ix L299D: B7 # or a # jr z, 1f L299E: 28 09 # call dpydig ! [de+] L29A0: CD 16 26 # jr 1b L29A3: 18 E7 # 2: L29A5: DD 23 # inc ix ! over 0 L29A7: DD 23 # inc ix ! over jmp addr # 1: L29A9: DD 6E 00 # ld l, [ix + 0] L29AC: DD 66 01 # ld h, [ix + 1] L29AF: E5 # push hl ! jump destination L29B0: DD 6E 02 # ld l, [ix + 2] L29B3: DD 66 03 # ld h, [ix + 3] # ret ! jump, arg in hl L29B6: C9 # # ! 9876543210 # ! rFc 84 121 # # do_tunedpy: L29B7: 3A 2B C2 # ld a, [rfc] # call dpyval255 L29BA: CD 0E 1B # ld a, ' ' L29BD: 3E 20 # call dpydig L29BF: CD 16 26 L29C2: 3A 2D C2 # ld a, [ad_rssi] # call dpyval255 L29C5: CD 0E 1B # ret L29C8: C9 # # do_stepdpy: L29C9: ED 4B 7C C5 # ld bc, [bstep_cfg] ! b shift, c div L29CD: 78 # ld a, b # 1: # cp 0 L29CE: FE 00 # jr z, 1f L29D0: 28 05 L29D2: CB 39 # srl c L29D4: 3D # dec a # jr 1b L29D5: 18 F7 # 1: L29D7: 79 # ld a, c # call dpyval255 L29D8: CD 0E 1B # ret L29DB: C9 # # ! 9876543210 # ! POS 123456 # ! NEG 123456 ! BARF... CLEAN ALL THIS AND DO IT SOON. # # do_diffdpy: # ld de, CU53AN_segs_bottom_row L29DC: 11 FB 00 L29DF: 3A F0 C5 # ld a, [cu_is_alfa] L29E2: B7 # or a # jr z, 1f L29E3: 28 03 # ld de, (segments + 2 * 11) L29E5: 11 16 C5 # 1: L29E8: 3A 1F C2 # ld a, [plus_duplex] # and 1 L29EB: E6 01 # jr nz, 1f L29ED: 20 09 L29EF: CD 53 28 L29F2: 4E 45 47 00 # call sput ; .asciz "NEG" # jr 2f L29F6: 18 07 # 1: L29F8: CD 53 28 L29FB: 50 4F 53 00 # call sput ; .asciz "POS" # 2: # L29FF: 2A 1C C2 L2A02: 3A 1E C2 # ld hl, [rptr_sub] ; ld a, [(rptr_sub) + 2] # call freq2div L2A05: CD 28 28 # jp ahl_div2dpy L2A08: C3 6D 2A # # do_bytedpy: L2A0B: 7E # ld a, [hl] # call dpyval255 L2A0C: CD 0E 1B # ret L2A0F: C9 # # do_hexdpy: L2A10: 7E # ld a, [hl] # call dpyhex L2A11: CD 67 1B # ret L2A14: C9 # # do_pktdpy: L2A15: 7E L2A16: 23 L2A17: E5 L2A18: CD 80 1B L2A1B: E1 # ld a, [hl]; inc hl; push hl; call dpyhex_blankF; pop hl L2A1C: 7E L2A1D: 23 L2A1E: E5 L2A1F: CD 80 1B L2A22: E1 # ld a, [hl]; inc hl; push hl; call dpyhex_blankF; pop hl L2A23: 7E L2A24: 23 L2A25: E5 L2A26: CD 80 1B L2A29: E1 # ld a, [hl]; inc hl; push hl; call dpyhex_blankF; pop hl # ret L2A2A: C9 # # do_verdpy: L2A2B: 3A A8 00 # ld a, [version + 0]; call dpydig L2A2E: CD 16 26 L2A31: 3A AA 00 # ld a, [version + 2]; call dpydig L2A34: CD 16 26 # ret L2A37: C9 # # do_iddpy: L2A38: 7E L2A39: 23 L2A3A: E5 L2A3B: CD 16 26 L2A3E: E1 # ld a, [hl]; inc hl; push hl; call dpydig; pop hl L2A3F: 7E L2A40: 23 L2A41: E5 L2A42: CD 16 26 L2A45: E1 # ld a, [hl]; inc hl; push hl; call dpydig; pop hl L2A46: 7E L2A47: 23 L2A48: E5 L2A49: CD 16 26 L2A4C: E1 # ld a, [hl]; inc hl; push hl; call dpydig; pop hl L2A4D: 7E L2A4E: 23 L2A4F: E5 L2A50: CD 16 26 L2A53: E1 # ld a, [hl]; inc hl; push hl; call dpydig; pop hl L2A54: 7E L2A55: 23 L2A56: E5 L2A57: CD 16 26 L2A5A: E1 # ld a, [hl]; inc hl; push hl; call dpydig; pop hl # ret L2A5B: C9 # # do_timedpy: L2A5C: 7E # ld a, [hl] L2A5D: 23 # inc hl L2A5E: E5 # push hl # call dpyval255 L2A5F: CD 0E 1B # ld a, 'h' L2A62: 3E 68 # call dpydig L2A64: CD 16 26 L2A67: E1 # pop hl L2A68: 7E # ld a, [hl] # call dpyval99nzb ! 11h32 L2A69: CD 54 1B # ret L2A6C: C9 # # ! Print tx_divisor as Hz, 7 digits, at de # ! # ! xxx * 25 / 2 = freq # ! # ahl_div2dpy: # L2A6D: C5 # push bc L2A6E: D5 # push de L2A6F: F5 # push af # # ld a, ' ' L2A70: 3E 20 L2A72: 32 97 C5 # ld [zeroblank], a # L2A75: F1 # pop af # jp 1f L2A76: C3 86 2A # # div2dpy: # L2A79: C5 # push bc L2A7A: D5 # push de # # ld a, ' ' L2A7B: 3E 20 L2A7D: 32 97 C5 # ld [zeroblank], a # L2A80: 2A 04 C2 L2A83: 3A 06 C2 # ld hl, [tx_divisor] ; ld a, [(tx_divisor) + 2] # 1: L2A86: ED 4B 7C C5 # ld bc, [bstep_cfg] # call mul248 L2A8A: CD 00 28 L2A8D: 04 # inc b # jr 2f L2A8E: 18 07 # 1: L2A90: CB 1F # rr a L2A92: CB 1C # rr h L2A94: CB 1D # rr l L2A96: A7 # and a # 2: # djnz 1b L2A97: 10 F7 # # ld de, 10000 L2A99: 11 10 27 # call divide ! result to c L2A9C: CD 07 2B # L2A9F: D1 # pop de ! get cursor # L2AA0: F5 # push af # L2AA1: 79 # ld a, c ! 10 MHz and up digits # # ld c, -1 L2AA2: 0E FF # 1: L2AA4: 0C # inc c ! count GHz digit # sub 100 L2AA5: D6 64 # jr nc, 1b L2AA7: 30 FB # add 100 L2AA9: C6 64 # L2AAB: F5 # push af L2AAC: 3A F0 C5 # ld a, [cu_is_alfa] L2AAF: B7 # or a # jr z, 1f ! If room for 7 digits L2AB0: 28 14 L2AB2: 79 # ld a, c L2AB3: B7 # or a # jr z, 2f ! Only 6 digits, skip printing L2AB4: 28 0D L2AB6: 3A 1B C5 # ld a, [segments + 2 * 13 + 1] L2AB9: CB CF # set 1, a L2ABB: 32 1B C5 # ld [segments + 2 * 13 + 1], a # ld a, 0 L2ABE: 3E 00 L2AC0: 32 97 C5 # ld [zeroblank], a # 2: L2AC3: F1 # pop af # jr 2f L2AC4: 18 04 # 1: L2AC6: F1 # pop af # call nextdig ! insert GHz L2AC7: CD 15 2B # 2: # ld c, -1 L2ACA: 0E FF # 1: L2ACC: 0C # inc c ! count 100 MHz digit # sub 10 L2ACD: D6 0A # jr nc, 1b L2ACF: 30 FB # add 10 L2AD1: C6 0A # call nextdig ! insert 100 MHz L2AD3: CD 15 2B # L2AD6: 4F # ld c, a # call nextdig ! insert 10 MHz L2AD7: CD 15 2B # L2ADA: F1 # pop af # L2ADB: D5 # push de ! display cursor # # ld de, 1000 L2ADC: 11 E8 03 # call divide L2ADF: CD 07 2B # L2AE2: D1 # pop de # call nextdig L2AE3: CD 15 2B L2AE6: D5 # push de # # ld de, 100 L2AE7: 11 64 00 # call divide L2AEA: CD 07 2B # L2AED: D1 # pop de # call nextdig L2AEE: CD 15 2B L2AF1: D5 # push de # # ld de, 10 L2AF2: 11 0A 00 # call divide L2AF5: CD 07 2B # L2AF8: D1 # pop de # call nextdig L2AF9: CD 15 2B # # ld a, 0 L2AFC: 3E 00 L2AFE: 32 97 C5 # ld [zeroblank], a # L2B01: 4D # ld c, l # call nextdig L2B02: CD 15 2B # L2B05: C1 # pop bc # # ret L2B06: C9 # # divide: # ld c, -1 L2B07: 0E FF # 1: L2B09: 0C # inc c L2B0A: A7 # and a L2B0B: ED 52 # sbc hl, de # sbc 0 L2B0D: DE 00 # jr nc, 1b L2B0F: 30 F8 L2B11: 19 # add hl, de # adc 0 L2B12: CE 00 # ret L2B14: C9 # # nextdig: L2B15: E5 # push hl L2B16: F5 # push af L2B17: 79 # ld a, c L2B18: B7 # or a # jr z, 1f L2B19: 28 0B # call dpydig L2B1B: CD 16 26 # ld a, 0 L2B1E: 3E 00 L2B20: 32 97 C5 # ld [zeroblank], a L2B23: F1 # pop af L2B24: E1 # pop hl # ret L2B25: C9 # 1: L2B26: 3A 97 C5 # ld a, [zeroblank] # call dpydig L2B29: CD 16 26 L2B2C: F1 # pop af L2B2D: E1 # pop hl # ret L2B2E: C9 # # div2freq: # L2B2F: C5 # push bc # L2B30: ED 4B 7C C5 # ld bc, [bstep_cfg] # call mul248 L2B34: CD 00 28 L2B37: 04 # inc b # jr 2f L2B38: 18 07 # 1: L2B3A: CB 1F # rr a L2B3C: CB 1C # rr h L2B3E: CB 1D # rr l L2B40: A7 # and a # 2: # djnz 1b L2B41: 10 F7 # L2B43: C1 # pop bc # # ret L2B44: C9 # # lookup_rfc: # call get_rfc_hl L2B45: CD 61 2B L2B48: 7E # ld a, [hl] L2B49: B7 # or a # jr nz, 1f L2B4A: 20 02 # ld a, 85 L2B4C: 3E 55 # 1: L2B4E: 32 2B C2 # ld [rfc], a L2B51: D3 30 # out [0x30], a # ret L2B53: C9 # # save_rfc: # call get_rfc_hl L2B54: CD 61 2B L2B57: 3A 2B C2 # ld a, [rfc] L2B5A: 77 # ld [hl], a L2B5B: D3 30 # out [0x30], a # call save_nvdata L2B5D: CD AC 2B # ret L2B60: C9 # # get_rfc_hl: L2B61: 2A FB C1 L2B64: 3A FD C1 # ld hl, [currfreq] ; ld a, [(currfreq) + 2] # L2B67: 11 80 1A L2B6A: A7 L2B6B: ED 52 # ld de, (400000) % 65536 ; and a ; sbc hl, de ; sbc (400000) / 65536 L2B6D: DE 06 # jr nc, 1f L2B6F: 30 04 # ld hl, rfctab L2B71: 21 90 C1 # ret ! below 400000 L2B74: C9 # 1: # ld de, 1000 L2B75: 11 E8 03 # ld c, 0 L2B78: 0E 00 # 1: L2B7A: A7 # and a L2B7B: ED 52 # sbc hl, de # sbc 0 L2B7D: DE 00 # jr c, 1f L2B7F: 38 07 L2B81: 0C # inc c # jr nz, 1b L2B82: 20 F6 # # ld hl, rfctab + 255 ! above 499999 L2B84: 21 8F C2 # ret L2B87: C9 # 1: # # ld hl, rfctab L2B88: 21 90 C1 # ld b, 0 L2B8B: 06 00 L2B8D: 09 # add hl, bc # ret L2B8E: C9 # # load_nvdata: # # # ld hl, nvstart L2B8F: 21 00 C0 # ld d, (0x08 | 0x20) & ~0x08 L2B92: 16 20 # ld e, (0x08 | 0x20) L2B94: 1E 28 # ld c, 0x80 L2B96: 0E 80 # 1: L2B98: D3 90 # out [0x90], a L2B9A: ED 51 # out [c], d L2B9C: 7E # ld a, [hl] L2B9D: ED 59 # out [c], e L2B9F: 77 # ld [hl], a L2BA0: 23 # inc hl L2BA1: 7C # ld a, h # cp HI(nvend) L2BA2: FE C2 # jr nz, 1b L2BA4: 20 F2 L2BA6: 7D # ld a, l # cp LO(nvend) L2BA7: FE 20 # jr nz, 1b L2BA9: 20 ED # # # ret L2BAB: C9 # # save_nvdata: # # # ld hl, nvstart L2BAC: 21 00 C0 # ld d, (0x08 | 0x20) & ~0x08 L2BAF: 16 20 # ld e, (0x08 | 0x20) L2BB1: 1E 28 # ld c, 0x80 L2BB3: 0E 80 # 1: L2BB5: 7E # ld a, [hl] L2BB6: F3 # di L2BB7: ED 51 # out [c], d L2BB9: 77 # ld [hl], a L2BBA: ED 59 # out [c], e L2BBC: FB # ei L2BBD: 23 # inc hl L2BBE: 7C # ld a, h # cp HI(nvend) L2BBF: FE C2 # jr nz, 1b L2BC1: 20 F2 L2BC3: 7D # ld a, l # cp LO(nvend) L2BC4: FE 20 # jr nz, 1b L2BC6: 20 ED # # # ret L2BC8: C9 # # cu_lights_on: L2BC9: F5 # push af L2BCA: E5 # push hl # ld hl, indicators L2BCB: 21 40 C5 L2BCE: 3A F0 C5 # ld a, [cu_is_alfa] L2BD1: B7 # or a # jr z, 1f L2BD2: 28 07 L2BD4: CB F6 # set 6, [hl] ! lit the lights. L2BD6: CB EE # set 5, [hl] L2BD8: E1 # pop hl L2BD9: F1 # pop af # ret L2BDA: C9 # 1: L2BDB: CB F6 # set 6, [hl] ! lit the lights. L2BDD: CB DE # set 3, [hl] L2BDF: E1 # pop hl L2BE0: F1 # pop af # ret L2BE1: C9 # # cu_lights_off: L2BE2: F5 # push af L2BE3: E5 # push hl # ld hl, indicators L2BE4: 21 40 C5 L2BE7: 3A F0 C5 # ld a, [cu_is_alfa] L2BEA: B7 # or a # jr z, 1f L2BEB: 28 07 L2BED: CB B6 # res 6, [hl] ! lit the lights. L2BEF: CB AE # res 5, [hl] L2BF1: E1 # pop hl L2BF2: F1 # pop af # ret L2BF3: C9 # 1: L2BF4: CB B6 # res 6, [hl] ! lit the lights. L2BF6: CB 9E # res 3, [hl] L2BF8: E1 # pop hl L2BF9: F1 # pop af # ret L2BFA: C9 # # cu_serv_on: L2BFB: F5 # push af L2BFC: E5 # push hl # ld hl, indicators L2BFD: 21 40 C5 L2C00: 3A F0 C5 # ld a, [cu_is_alfa] L2C03: B7 # or a # jr z, 1f L2C04: 28 05 L2C06: CB C6 # set 0, [hl] L2C08: E1 # pop hl L2C09: F1 # pop af # ret L2C0A: C9 # 1: L2C0B: CB E6 # set 4, [hl] L2C0D: E1 # pop hl L2C0E: F1 # pop af # ret L2C0F: C9 # # cu_serv_off: L2C10: F5 # push af L2C11: E5 # push hl # ld hl, indicators L2C12: 21 40 C5 L2C15: 3A F0 C5 # ld a, [cu_is_alfa] L2C18: B7 # or a # jr z, 1f L2C19: 28 05 L2C1B: CB 86 # res 0, [hl] L2C1D: E1 # pop hl L2C1E: F1 # pop af # ret L2C1F: C9 # 1: L2C20: CB A6 # res 4, [hl] L2C22: E1 # pop hl L2C23: F1 # pop af # ret L2C24: C9 # # cu_call_on: L2C25: F5 # push af L2C26: E5 # push hl # ld hl, indicators L2C27: 21 40 C5 L2C2A: 3A F0 C5 # ld a, [cu_is_alfa] L2C2D: B7 # or a # jr z, 1f L2C2E: 28 05 L2C30: CB CE # set 1, [hl] L2C32: E1 # pop hl L2C33: F1 # pop af # ret L2C34: C9 # 1: L2C35: CB CE # set 1, [hl] L2C37: E1 # pop hl L2C38: F1 # pop af # ret L2C39: C9 # # cu_call_off: L2C3A: F5 # push af L2C3B: E5 # push hl # ld hl, indicators L2C3C: 21 40 C5 L2C3F: 3A F0 C5 # ld a, [cu_is_alfa] L2C42: B7 # or a # jr z, 1f L2C43: 28 05 L2C45: CB 8E # res 1, [hl] L2C47: E1 # pop hl L2C48: F1 # pop af # ret L2C49: C9 # 1: L2C4A: CB 8E # res 1, [hl] L2C4C: E1 # pop hl L2C4D: F1 # pop af # ret L2C4E: C9 # # step_audio_dst: # L2C4F: 3A 1A C2 # ld a, [audio_dst] L2C52: 3C # inc a # cp 3 L2C53: FE 03 # jr c, 1f L2C55: 38 02 # ld a, 0 ! 0, 1 and 2 possible L2C57: 3E 00 # 1: L2C59: 32 1A C2 # ld [audio_dst], a # # call set_vola L2C5C: CD 5B 15 # # call redraw L2C5F: CD A1 1B # ret L2C62: C9 # # !====================================================================== # # .align 8 ! Necessary L2C63: 00 [ 9D ] # crctbls: # crctbl_hi: # .byte HI(0) L2D00: 00 # .byte HI(4489) L2D01: 11 # .byte HI(8978) L2D02: 23 # .byte HI(12955) L2D03: 32 # .byte HI(17956) L2D04: 46 # .byte HI(22445) L2D05: 57 # .byte HI(25910) L2D06: 65 # .byte HI(29887) L2D07: 74 # .byte HI(35912) L2D08: 8C # .byte HI(40385) L2D09: 9D # .byte HI(44890) L2D0A: AF # .byte HI(48851) L2D0B: BE # .byte HI(51820) L2D0C: CA # .byte HI(56293) L2D0D: DB # .byte HI(59774) L2D0E: E9 # .byte HI(63735) L2D0F: F8 # .byte HI(4225) L2D10: 10 # .byte HI(264) L2D11: 01 # .byte HI(13203) L2D12: 33 # .byte HI(8730) L2D13: 22 # .byte HI(22181) L2D14: 56 # .byte HI(18220) L2D15: 47 # .byte HI(30135) L2D16: 75 # .byte HI(25662) L2D17: 64 # .byte HI(40137) L2D18: 9C # .byte HI(36160) L2D19: 8D # .byte HI(49115) L2D1A: BF # .byte HI(44626) L2D1B: AE # .byte HI(56045) L2D1C: DA # .byte HI(52068) L2D1D: CB # .byte HI(63999) L2D1E: F9 # .byte HI(59510) L2D1F: E8 # .byte HI(8450) L2D20: 21 # .byte HI(12427) L2D21: 30 # .byte HI(528) L2D22: 02 # .byte HI(5017) L2D23: 13 # .byte HI(26406) L2D24: 67 # .byte HI(30383) L2D25: 76 # .byte HI(17460) L2D26: 44 # .byte HI(21949) L2D27: 55 # .byte HI(44362) L2D28: AD # .byte HI(48323) L2D29: BC # .byte HI(36440) L2D2A: 8E # .byte HI(40913) L2D2B: 9F # .byte HI(60270) L2D2C: EB # .byte HI(64231) L2D2D: FA # .byte HI(51324) L2D2E: C8 # .byte HI(55797) L2D2F: D9 # .byte HI(12675) L2D30: 31 # .byte HI(8202) L2D31: 20 # .byte HI(4753) L2D32: 12 # .byte HI(792) L2D33: 03 # .byte HI(30631) L2D34: 77 # .byte HI(26158) L2D35: 66 # .byte HI(21685) L2D36: 54 # .byte HI(17724) L2D37: 45 # .byte HI(48587) L2D38: BD # .byte HI(44098) L2D39: AC # .byte HI(40665) L2D3A: 9E # .byte HI(36688) L2D3B: 8F # .byte HI(64495) L2D3C: FB # .byte HI(60006) L2D3D: EA # .byte HI(55549) L2D3E: D8 # .byte HI(51572) L2D3F: C9 # .byte HI(16900) L2D40: 42 # .byte HI(21389) L2D41: 53 # .byte HI(24854) L2D42: 61 # .byte HI(28831) L2D43: 70 # .byte HI(1056) L2D44: 04 # .byte HI(5545) L2D45: 15 # .byte HI(10034) L2D46: 27 # .byte HI(14011) L2D47: 36 # .byte HI(52812) L2D48: CE # .byte HI(57285) L2D49: DF # .byte HI(60766) L2D4A: ED # .byte HI(64727) L2D4B: FC # .byte HI(34920) L2D4C: 88 # .byte HI(39393) L2D4D: 99 # .byte HI(43898) L2D4E: AB # .byte HI(47859) L2D4F: BA # .byte HI(21125) L2D50: 52 # .byte HI(17164) L2D51: 43 # .byte HI(29079) L2D52: 71 # .byte HI(24606) L2D53: 60 # .byte HI(5281) L2D54: 14 # .byte HI(1320) L2D55: 05 # .byte HI(14259) L2D56: 37 # .byte HI(9786) L2D57: 26 # .byte HI(57037) L2D58: DE # .byte HI(53060) L2D59: CF # .byte HI(64991) L2D5A: FD # .byte HI(60502) L2D5B: EC # .byte HI(39145) L2D5C: 98 # .byte HI(35168) L2D5D: 89 # .byte HI(48123) L2D5E: BB # .byte HI(43634) L2D5F: AA # .byte HI(25350) L2D60: 63 # .byte HI(29327) L2D61: 72 # .byte HI(16404) L2D62: 40 # .byte HI(20893) L2D63: 51 # .byte HI(9506) L2D64: 25 # .byte HI(13483) L2D65: 34 # .byte HI(1584) L2D66: 06 # .byte HI(6073) L2D67: 17 # .byte HI(61262) L2D68: EF # .byte HI(65223) L2D69: FE # .byte HI(52316) L2D6A: CC # .byte HI(56789) L2D6B: DD # .byte HI(43370) L2D6C: A9 # .byte HI(47331) L2D6D: B8 # .byte HI(35448) L2D6E: 8A # .byte HI(39921) L2D6F: 9B # .byte HI(29575) L2D70: 73 # .byte HI(25102) L2D71: 62 # .byte HI(20629) L2D72: 50 # .byte HI(16668) L2D73: 41 # .byte HI(13731) L2D74: 35 # .byte HI(9258) L2D75: 24 # .byte HI(5809) L2D76: 16 # .byte HI(1848) L2D77: 07 # .byte HI(65487) L2D78: FF # .byte HI(60998) L2D79: EE # .byte HI(56541) L2D7A: DC # .byte HI(52564) L2D7B: CD # .byte HI(47595) L2D7C: B9 # .byte HI(43106) L2D7D: A8 # .byte HI(39673) L2D7E: 9A # .byte HI(35696) L2D7F: 8B # .byte HI(33800) L2D80: 84 # .byte HI(38273) L2D81: 95 # .byte HI(42778) L2D82: A7 # .byte HI(46739) L2D83: B6 # .byte HI(49708) L2D84: C2 # .byte HI(54181) L2D85: D3 # .byte HI(57662) L2D86: E1 # .byte HI(61623) L2D87: F0 # .byte HI(2112) L2D88: 08 # .byte HI(6601) L2D89: 19 # .byte HI(11090) L2D8A: 2B # .byte HI(15067) L2D8B: 3A # .byte HI(20068) L2D8C: 4E # .byte HI(24557) L2D8D: 5F # .byte HI(28022) L2D8E: 6D # .byte HI(31999) L2D8F: 7C # .byte HI(38025) L2D90: 94 # .byte HI(34048) L2D91: 85 # .byte HI(47003) L2D92: B7 # .byte HI(42514) L2D93: A6 # .byte HI(53933) L2D94: D2 # .byte HI(49956) L2D95: C3 # .byte HI(61887) L2D96: F1 # .byte HI(57398) L2D97: E0 # .byte HI(6337) L2D98: 18 # .byte HI(2376) L2D99: 09 # .byte HI(15315) L2D9A: 3B # .byte HI(10842) L2D9B: 2A # .byte HI(24293) L2D9C: 5E # .byte HI(20332) L2D9D: 4F # .byte HI(32247) L2D9E: 7D # .byte HI(27774) L2D9F: 6C # .byte HI(42250) L2DA0: A5 # .byte HI(46211) L2DA1: B4 # .byte HI(34328) L2DA2: 86 # .byte HI(38801) L2DA3: 97 # .byte HI(58158) L2DA4: E3 # .byte HI(62119) L2DA5: F2 # .byte HI(49212) L2DA6: C0 # .byte HI(53685) L2DA7: D1 # .byte HI(10562) L2DA8: 29 # .byte HI(14539) L2DA9: 38 # .byte HI(2640) L2DAA: 0A # .byte HI(7129) L2DAB: 1B # .byte HI(28518) L2DAC: 6F # .byte HI(32495) L2DAD: 7E # .byte HI(19572) L2DAE: 4C # .byte HI(24061) L2DAF: 5D # .byte HI(46475) L2DB0: B5 # .byte HI(41986) L2DB1: A4 # .byte HI(38553) L2DB2: 96 # .byte HI(34576) L2DB3: 87 # .byte HI(62383) L2DB4: F3 # .byte HI(57894) L2DB5: E2 # .byte HI(53437) L2DB6: D0 # .byte HI(49460) L2DB7: C1 # .byte HI(14787) L2DB8: 39 # .byte HI(10314) L2DB9: 28 # .byte HI(6865) L2DBA: 1A # .byte HI(2904) L2DBB: 0B # .byte HI(32743) L2DBC: 7F # .byte HI(28270) L2DBD: 6E # .byte HI(23797) L2DBE: 5C # .byte HI(19836) L2DBF: 4D # .byte HI(50700) L2DC0: C6 # .byte HI(55173) L2DC1: D7 # .byte HI(58654) L2DC2: E5 # .byte HI(62615) L2DC3: F4 # .byte HI(32808) L2DC4: 80 # .byte HI(37281) L2DC5: 91 # .byte HI(41786) L2DC6: A3 # .byte HI(45747) L2DC7: B2 # .byte HI(19012) L2DC8: 4A # .byte HI(23501) L2DC9: 5B # .byte HI(26966) L2DCA: 69 # .byte HI(30943) L2DCB: 78 # .byte HI(3168) L2DCC: 0C # .byte HI(7657) L2DCD: 1D # .byte HI(12146) L2DCE: 2F # .byte HI(16123) L2DCF: 3E # .byte HI(54925) L2DD0: D6 # .byte HI(50948) L2DD1: C7 # .byte HI(62879) L2DD2: F5 # .byte HI(58390) L2DD3: E4 # .byte HI(37033) L2DD4: 90 # .byte HI(33056) L2DD5: 81 # .byte HI(46011) L2DD6: B3 # .byte HI(41522) L2DD7: A2 # .byte HI(23237) L2DD8: 5A # .byte HI(19276) L2DD9: 4B # .byte HI(31191) L2DDA: 79 # .byte HI(26718) L2DDB: 68 # .byte HI(7393) L2DDC: 1C # .byte HI(3432) L2DDD: 0D # .byte HI(16371) L2DDE: 3F # .byte HI(11898) L2DDF: 2E # .byte HI(59150) L2DE0: E7 # .byte HI(63111) L2DE1: F6 # .byte HI(50204) L2DE2: C4 # .byte HI(54677) L2DE3: D5 # .byte HI(41258) L2DE4: A1 # .byte HI(45219) L2DE5: B0 # .byte HI(33336) L2DE6: 82 # .byte HI(37809) L2DE7: 93 # .byte HI(27462) L2DE8: 6B # .byte HI(31439) L2DE9: 7A # .byte HI(18516) L2DEA: 48 # .byte HI(23005) L2DEB: 59 # .byte HI(11618) L2DEC: 2D # .byte HI(15595) L2DED: 3C # .byte HI(3696) L2DEE: 0E # .byte HI(8185) L2DEF: 1F # .byte HI(63375) L2DF0: F7 # .byte HI(58886) L2DF1: E6 # .byte HI(54429) L2DF2: D4 # .byte HI(50452) L2DF3: C5 # .byte HI(45483) L2DF4: B1 # .byte HI(40994) L2DF5: A0 # .byte HI(37561) L2DF6: 92 # .byte HI(33584) L2DF7: 83 # .byte HI(31687) L2DF8: 7B # .byte HI(27214) L2DF9: 6A # .byte HI(22741) L2DFA: 58 # .byte HI(18780) L2DFB: 49 # .byte HI(15843) L2DFC: 3D # .byte HI(11370) L2DFD: 2C # .byte HI(7921) L2DFE: 1E # .byte HI(3960) L2DFF: 0F # crctbl_lo: # .byte LO( 0) L2E00: 00 # .byte LO( 4489) L2E01: 89 # .byte LO( 8978) L2E02: 12 # .byte LO( 12955) L2E03: 9B # .byte LO( 17956) L2E04: 24 # .byte LO( 22445) L2E05: AD # .byte LO( 25910) L2E06: 36 # .byte LO( 29887) L2E07: BF # .byte LO( 35912) L2E08: 48 # .byte LO( 40385) L2E09: C1 # .byte LO( 44890) L2E0A: 5A # .byte LO( 48851) L2E0B: D3 # .byte LO( 51820) L2E0C: 6C # .byte LO( 56293) L2E0D: E5 # .byte LO( 59774) L2E0E: 7E # .byte LO( 63735) L2E0F: F7 # .byte LO( 4225) L2E10: 81 # .byte LO( 264) L2E11: 08 # .byte LO( 13203) L2E12: 93 # .byte LO( 8730) L2E13: 1A # .byte LO( 22181) L2E14: A5 # .byte LO( 18220) L2E15: 2C # .byte LO( 30135) L2E16: B7 # .byte LO( 25662) L2E17: 3E # .byte LO( 40137) L2E18: C9 # .byte LO( 36160) L2E19: 40 # .byte LO( 49115) L2E1A: DB # .byte LO( 44626) L2E1B: 52 # .byte LO( 56045) L2E1C: ED # .byte LO( 52068) L2E1D: 64 # .byte LO( 63999) L2E1E: FF # .byte LO( 59510) L2E1F: 76 # .byte LO( 8450) L2E20: 02 # .byte LO( 12427) L2E21: 8B # .byte LO( 528) L2E22: 10 # .byte LO( 5017) L2E23: 99 # .byte LO( 26406) L2E24: 26 # .byte LO( 30383) L2E25: AF # .byte LO( 17460) L2E26: 34 # .byte LO( 21949) L2E27: BD # .byte LO( 44362) L2E28: 4A # .byte LO( 48323) L2E29: C3 # .byte LO( 36440) L2E2A: 58 # .byte LO( 40913) L2E2B: D1 # .byte LO( 60270) L2E2C: 6E # .byte LO( 64231) L2E2D: E7 # .byte LO( 51324) L2E2E: 7C # .byte LO( 55797) L2E2F: F5 # .byte LO( 12675) L2E30: 83 # .byte LO( 8202) L2E31: 0A # .byte LO( 4753) L2E32: 91 # .byte LO( 792) L2E33: 18 # .byte LO( 30631) L2E34: A7 # .byte LO( 26158) L2E35: 2E # .byte LO( 21685) L2E36: B5 # .byte LO( 17724) L2E37: 3C # .byte LO( 48587) L2E38: CB # .byte LO( 44098) L2E39: 42 # .byte LO( 40665) L2E3A: D9 # .byte LO( 36688) L2E3B: 50 # .byte LO( 64495) L2E3C: EF # .byte LO( 60006) L2E3D: 66 # .byte LO( 55549) L2E3E: FD # .byte LO( 51572) L2E3F: 74 # .byte LO( 16900) L2E40: 04 # .byte LO( 21389) L2E41: 8D # .byte LO( 24854) L2E42: 16 # .byte LO( 28831) L2E43: 9F # .byte LO( 1056) L2E44: 20 # .byte LO( 5545) L2E45: A9 # .byte LO( 10034) L2E46: 32 # .byte LO( 14011) L2E47: BB # .byte LO( 52812) L2E48: 4C # .byte LO( 57285) L2E49: C5 # .byte LO( 60766) L2E4A: 5E # .byte LO( 64727) L2E4B: D7 # .byte LO( 34920) L2E4C: 68 # .byte LO( 39393) L2E4D: E1 # .byte LO( 43898) L2E4E: 7A # .byte LO( 47859) L2E4F: F3 # .byte LO( 21125) L2E50: 85 # .byte LO( 17164) L2E51: 0C # .byte LO( 29079) L2E52: 97 # .byte LO( 24606) L2E53: 1E # .byte LO( 5281) L2E54: A1 # .byte LO( 1320) L2E55: 28 # .byte LO( 14259) L2E56: B3 # .byte LO( 9786) L2E57: 3A # .byte LO( 57037) L2E58: CD # .byte LO( 53060) L2E59: 44 # .byte LO( 64991) L2E5A: DF # .byte LO( 60502) L2E5B: 56 # .byte LO( 39145) L2E5C: E9 # .byte LO( 35168) L2E5D: 60 # .byte LO( 48123) L2E5E: FB # .byte LO( 43634) L2E5F: 72 # .byte LO( 25350) L2E60: 06 # .byte LO( 29327) L2E61: 8F # .byte LO( 16404) L2E62: 14 # .byte LO( 20893) L2E63: 9D # .byte LO( 9506) L2E64: 22 # .byte LO( 13483) L2E65: AB # .byte LO( 1584) L2E66: 30 # .byte LO( 6073) L2E67: B9 # .byte LO( 61262) L2E68: 4E # .byte LO( 65223) L2E69: C7 # .byte LO( 52316) L2E6A: 5C # .byte LO( 56789) L2E6B: D5 # .byte LO( 43370) L2E6C: 6A # .byte LO( 47331) L2E6D: E3 # .byte LO( 35448) L2E6E: 78 # .byte LO( 39921) L2E6F: F1 # .byte LO( 29575) L2E70: 87 # .byte LO( 25102) L2E71: 0E # .byte LO( 20629) L2E72: 95 # .byte LO( 16668) L2E73: 1C # .byte LO( 13731) L2E74: A3 # .byte LO( 9258) L2E75: 2A # .byte LO( 5809) L2E76: B1 # .byte LO( 1848) L2E77: 38 # .byte LO( 65487) L2E78: CF # .byte LO( 60998) L2E79: 46 # .byte LO( 56541) L2E7A: DD # .byte LO( 52564) L2E7B: 54 # .byte LO( 47595) L2E7C: EB # .byte LO( 43106) L2E7D: 62 # .byte LO( 39673) L2E7E: F9 # .byte LO( 35696) L2E7F: 70 # .byte LO( 33800) L2E80: 08 # .byte LO( 38273) L2E81: 81 # .byte LO( 42778) L2E82: 1A # .byte LO( 46739) L2E83: 93 # .byte LO( 49708) L2E84: 2C # .byte LO( 54181) L2E85: A5 # .byte LO( 57662) L2E86: 3E # .byte LO( 61623) L2E87: B7 # .byte LO( 2112) L2E88: 40 # .byte LO( 6601) L2E89: C9 # .byte LO( 11090) L2E8A: 52 # .byte LO( 15067) L2E8B: DB # .byte LO( 20068) L2E8C: 64 # .byte LO( 24557) L2E8D: ED # .byte LO( 28022) L2E8E: 76 # .byte LO( 31999) L2E8F: FF # .byte LO( 38025) L2E90: 89 # .byte LO( 34048) L2E91: 00 # .byte LO( 47003) L2E92: 9B # .byte LO( 42514) L2E93: 12 # .byte LO( 53933) L2E94: AD # .byte LO( 49956) L2E95: 24 # .byte LO( 61887) L2E96: BF # .byte LO( 57398) L2E97: 36 # .byte LO( 6337) L2E98: C1 # .byte LO( 2376) L2E99: 48 # .byte LO( 15315) L2E9A: D3 # .byte LO( 10842) L2E9B: 5A # .byte LO( 24293) L2E9C: E5 # .byte LO( 20332) L2E9D: 6C # .byte LO( 32247) L2E9E: F7 # .byte LO( 27774) L2E9F: 7E # .byte LO( 42250) L2EA0: 0A # .byte LO( 46211) L2EA1: 83 # .byte LO( 34328) L2EA2: 18 # .byte LO( 38801) L2EA3: 91 # .byte LO( 58158) L2EA4: 2E # .byte LO( 62119) L2EA5: A7 # .byte LO( 49212) L2EA6: 3C # .byte LO( 53685) L2EA7: B5 # .byte LO( 10562) L2EA8: 42 # .byte LO( 14539) L2EA9: CB # .byte LO( 2640) L2EAA: 50 # .byte LO( 7129) L2EAB: D9 # .byte LO( 28518) L2EAC: 66 # .byte LO( 32495) L2EAD: EF # .byte LO( 19572) L2EAE: 74 # .byte LO( 24061) L2EAF: FD # .byte LO( 46475) L2EB0: 8B # .byte LO( 41986) L2EB1: 02 # .byte LO( 38553) L2EB2: 99 # .byte LO( 34576) L2EB3: 10 # .byte LO( 62383) L2EB4: AF # .byte LO( 57894) L2EB5: 26 # .byte LO( 53437) L2EB6: BD # .byte LO( 49460) L2EB7: 34 # .byte LO( 14787) L2EB8: C3 # .byte LO( 10314) L2EB9: 4A # .byte LO( 6865) L2EBA: D1 # .byte LO( 2904) L2EBB: 58 # .byte LO( 32743) L2EBC: E7 # .byte LO( 28270) L2EBD: 6E # .byte LO( 23797) L2EBE: F5 # .byte LO( 19836) L2EBF: 7C # .byte LO( 50700) L2EC0: 0C # .byte LO( 55173) L2EC1: 85 # .byte LO( 58654) L2EC2: 1E # .byte LO( 62615) L2EC3: 97 # .byte LO( 32808) L2EC4: 28 # .byte LO( 37281) L2EC5: A1 # .byte LO( 41786) L2EC6: 3A # .byte LO( 45747) L2EC7: B3 # .byte LO( 19012) L2EC8: 44 # .byte LO( 23501) L2EC9: CD # .byte LO( 26966) L2ECA: 56 # .byte LO( 30943) L2ECB: DF # .byte LO( 3168) L2ECC: 60 # .byte LO( 7657) L2ECD: E9 # .byte LO( 12146) L2ECE: 72 # .byte LO( 16123) L2ECF: FB # .byte LO( 54925) L2ED0: 8D # .byte LO( 50948) L2ED1: 04 # .byte LO( 62879) L2ED2: 9F # .byte LO( 58390) L2ED3: 16 # .byte LO( 37033) L2ED4: A9 # .byte LO( 33056) L2ED5: 20 # .byte LO( 46011) L2ED6: BB # .byte LO( 41522) L2ED7: 32 # .byte LO( 23237) L2ED8: C5 # .byte LO( 19276) L2ED9: 4C # .byte LO( 31191) L2EDA: D7 # .byte LO( 26718) L2EDB: 5E # .byte LO( 7393) L2EDC: E1 # .byte LO( 3432) L2EDD: 68 # .byte LO( 16371) L2EDE: F3 # .byte LO( 11898) L2EDF: 7A # .byte LO( 59150) L2EE0: 0E # .byte LO( 63111) L2EE1: 87 # .byte LO( 50204) L2EE2: 1C # .byte LO( 54677) L2EE3: 95 # .byte LO( 41258) L2EE4: 2A # .byte LO( 45219) L2EE5: A3 # .byte LO( 33336) L2EE6: 38 # .byte LO( 37809) L2EE7: B1 # .byte LO( 27462) L2EE8: 46 # .byte LO( 31439) L2EE9: CF # .byte LO( 18516) L2EEA: 54 # .byte LO( 23005) L2EEB: DD # .byte LO( 11618) L2EEC: 62 # .byte LO( 15595) L2EED: EB # .byte LO( 3696) L2EEE: 70 # .byte LO( 8185) L2EEF: F9 # .byte LO( 63375) L2EF0: 8F # .byte LO( 58886) L2EF1: 06 # .byte LO( 54429) L2EF2: 9D # .byte LO( 50452) L2EF3: 14 # .byte LO( 45483) L2EF4: AB # .byte LO( 40994) L2EF5: 22 # .byte LO( 37561) L2EF6: B9 # .byte LO( 33584) L2EF7: 30 # .byte LO( 31687) L2EF8: C7 # .byte LO( 27214) L2EF9: 4E # .byte LO( 22741) L2EFA: D5 # .byte LO( 18780) L2EFB: 5C # .byte LO( 15843) L2EFC: E3 # .byte LO( 11370) L2EFD: 6A # .byte LO( 7921) L2EFE: F1 # .byte LO( 3960) L2EFF: 78 # # !====================================================================== # # ccirtbl: # .word (4032000 / (1981)) ! 0 L2F00: F3 07 # .word (4032000 / (1124)) ! 1 L2F02: 03 0E # .word (4032000 / (1197)) ! 2 L2F04: 28 0D # .word (4032000 / (1275)) ! 3 L2F06: 5A 0C # .word (4032000 / (1358)) ! 4 L2F08: 99 0B # .word (4032000 / (1446)) ! 5 L2F0A: E4 0A # .word (4032000 / (1540)) ! 6 L2F0C: 3A 0A # .word (4032000 / (1640)) ! 7 L2F0E: 9A 09 # .word (4032000 / (1747)) ! 8 L2F10: 03 09 # .word (4032000 / (1860)) ! 9 L2F12: 77 08 # .word (4032000 / (2400)) ! A L2F14: 90 06 # .word (4032000 / ( 930)) ! B L2F16: EF 10 # .word (4032000 / (2247)) ! C L2F18: 02 07 # .word (4032000 / ( 991)) ! D L2F1A: E4 0F # .word (4032000 / (2110)) ! E L2F1C: 76 07 # .word 4 ! F L2F1E: 04 00 # # !====================================================================== # # # # !======================================================================== # ! # ! Bitbang DTMF out from 8254 timer 1 (the CCIR/MARKER pin). # ! # ! Z80 clock 4.032 MHz ~248 nsec cycle # ! 8254 clock 1 4.032 MHz ~248 nsec cycle # # ! A fixed time (interrupts disabled) program loop is used to create # ! a time cell of 88T times (21.83 nsec). # ! The 8254 timer is temporarily reprogrammed for mode0 # ! ("interrupt on terminal count") and LSB-only r/w operations. # ! The loop has a constant execution time, no inner branches at all. # ! # ! The loop calculates sin(low)+sin(high) from below tables, # ! tables are scaled from 2...38 that result range is 4...76 inclusive. # ! Tables take a lot of memory, each sample value is tailed by the # ! next index, makes looping the values simple. # ! Silly, but helps to create the tightest loop without jitter. # ! # ! Using timer mode 0; the output goes low when the count is written. # ! after the count decrements to 0 the output rises. # ! The loop takes 88T times, slightly longer than any written count. # ! # ! This creates about 46 kHz PWM output. # ! # ! Step 1. # ! Create the tightest loop to walk the tables, sum up values, # ! trickle watchdog and load counter. # ! Count the T times and determine loop execution time. # ! This will be the PWM cell time. # ! # ! Step 2. # ! Divide tone periods by the execution time, determine # ! number of divisions each tone period has. # ! Round up divisions to integer. # ! # ! Step 3. # ! Recalculate to tone period and frequency. # ! Check resulting errors. # ! If there are excessive errors (over 1% or so), # ! tweak program loop and try again. # ! # ! Step 4. # ! Build tables (see mkdtmfseq.c). For each single tone # ! the full cycle is divided into PWM cell times. # ! Values must be scaled so that the lowest sum (as the count) # ! keeps the timer output almost totally high, # ! and the highest sum keeps it mostly low. # ! T-time (from Z80 CLK) isn't the same as timer period # ! (from 8254 clock 1) (although they just happen to be here). # ! # ! Step 5: # ! Remember the . Argh. # ! # ! So: # ! 4.032 MHz gives 1T time of ~248 nsec. # ! 88T times is 21.83 usec gives 46 kHz PWM. # ! Std 1633 Hz has 32 cells of 88T, results in real 1636 Hz tone. # ! # # .align 8, 0xFF L2F20: FF [ E0 ] # 1: # dtmf_cycle_1633_Hz: L3000: 14 L3001: 02 L3002: 18 L3003: 04 L3004: 1C L3005: 06 L3006: 1F L3007: 08 L3008: 22 L3009: 0A L300A: 24 L300B: 0C L300C: 26 L300D: 0E L300E: 26 # .byte 20,2, 24,4, 28,6, 31,8, 34,10, 36,12, 38,14, 38,16 L300F: 10 L3010: 26 L3011: 12 L3012: 24 L3013: 14 L3014: 22 L3015: 16 L3016: 1F L3017: 18 L3018: 1C L3019: 1A L301A: 18 L301B: 1C L301C: 14 L301D: 1E L301E: 10 # .byte 38,18, 36,20, 34,22, 31,24, 28,26, 24,28, 20,30, 16,32 L301F: 20 L3020: 0C L3021: 22 L3022: 09 L3023: 24 L3024: 06 L3025: 26 L3026: 04 L3027: 28 L3028: 02 L3029: 2A L302A: 02 L302B: 2C L302C: 02 L302D: 2E L302E: 04 # .byte 12,34, 9,36, 6,38, 4,40, 2,42, 2,44, 2,46, 4,48 L302F: 30 L3030: 06 L3031: 32 L3032: 09 L3033: 34 L3034: 0C L3035: 36 L3036: 10 # .byte 6,50, 9,52, 12,54, 16,0 L3037: 00 # ASSERT((. - 1b) == 56); ASSERT(HI(. - 1) == HI(1b)) # # 1: # dtmf_cycle_1477_Hz: L3038: 14 L3039: 02 L303A: 18 L303B: 04 L303C: 1B L303D: 06 L303E: 1E L303F: 08 L3040: 21 L3041: 0A L3042: 23 L3043: 0C L3044: 25 L3045: 0E L3046: 26 # .byte 20,2, 24,4, 27,6, 30,8, 33,10, 35,12, 37,14, 38,16 L3047: 10 L3048: 26 L3049: 12 L304A: 25 L304B: 14 L304C: 24 L304D: 16 L304E: 22 L304F: 18 L3050: 20 L3051: 1A L3052: 1D L3053: 1C L3054: 19 L3055: 1E L3056: 16 # .byte 38,18, 37,20, 36,22, 34,24, 32,26, 29,28, 25,30, 22,32 L3057: 20 L3058: 12 L3059: 22 L305A: 0F L305B: 24 L305C: 0B L305D: 26 L305E: 08 L305F: 28 L3060: 06 L3061: 2A L3062: 04 L3063: 2C L3064: 03 L3065: 2E L3066: 02 # .byte 18,34, 15,36, 11,38, 8,40, 6,42, 4,44, 3,46, 2,48 L3067: 30 L3068: 02 L3069: 32 L306A: 03 L306B: 34 L306C: 05 L306D: 36 L306E: 07 L306F: 38 L3070: 0A L3071: 3A L3072: 0D L3073: 3C L3074: 10 # .byte 2,50, 3,52, 5,54, 7,56, 10,58, 13,60, 16,0 L3075: 00 # ASSERT((. - 1b) == 62); ASSERT(HI(. - 1) == HI(1b)) # # 1: # dtmf_cycle_770_Hz: L3076: 14 L3077: 02 L3078: 16 L3079: 04 L307A: 18 L307B: 06 L307C: 1A L307D: 08 L307E: 1B L307F: 0A L3080: 1D L3081: 0C L3082: 1F L3083: 0E L3084: 20 # .byte 20,2, 22,4, 24,6, 26,8, 27,10, 29,12, 31,14, 32,16 L3085: 10 L3086: 22 L3087: 12 L3088: 23 L3089: 14 L308A: 24 L308B: 16 L308C: 25 L308D: 18 L308E: 25 L308F: 1A L3090: 26 L3091: 1C L3092: 26 L3093: 1E L3094: 26 # .byte 34,18, 35,20, 36,22, 37,24, 37,26, 38,28, 38,30, 38,32 L3095: 20 L3096: 26 L3097: 22 L3098: 25 L3099: 24 L309A: 25 L309B: 26 L309C: 24 L309D: 28 L309E: 23 L309F: 2A L30A0: 22 L30A1: 2C L30A2: 21 L30A3: 2E L30A4: 1F # .byte 38,34, 37,36, 37,38, 36,40, 35,42, 34,44, 33,46, 31,48 L30A5: 30 L30A6: 1E L30A7: 32 L30A8: 1C L30A9: 34 L30AA: 1B L30AB: 36 L30AC: 19 L30AD: 38 L30AE: 17 L30AF: 3A L30B0: 15 L30B1: 3C L30B2: 13 L30B3: 3E L30B4: 11 # .byte 30,50, 28,52, 27,54, 25,56, 23,58, 21,60, 19,62, 17,64 L30B5: 40 L30B6: 0F L30B7: 42 L30B8: 0D L30B9: 44 L30BA: 0C L30BB: 46 L30BC: 0A L30BD: 48 L30BE: 09 L30BF: 4A L30C0: 07 L30C1: 4C L30C2: 06 L30C3: 4E L30C4: 05 # .byte 15,66, 13,68, 12,70, 10,72, 9,74, 7,76, 6,78, 5,80 L30C5: 50 L30C6: 04 L30C7: 52 L30C8: 03 L30C9: 54 L30CA: 03 L30CB: 56 L30CC: 02 L30CD: 58 L30CE: 02 L30CF: 5A L30D0: 02 L30D1: 5C L30D2: 02 L30D3: 5E L30D4: 03 # .byte 4,82, 3,84, 3,86, 2,88, 2,90, 2,92, 2,94, 3,96 L30D5: 60 L30D6: 03 L30D7: 62 L30D8: 04 L30D9: 64 L30DA: 05 L30DB: 66 L30DC: 06 L30DD: 68 L30DE: 08 L30DF: 6A L30E0: 09 L30E1: 6C L30E2: 0B L30E3: 6E L30E4: 0D # .byte 3,98, 4,100, 5,102, 6,104, 8,106, 9,108, 11,110, 13,112 L30E5: 70 L30E6: 0E L30E7: 72 L30E8: 10 L30E9: 74 L30EA: 12 # .byte 14,114, 16,116, 18,0 L30EB: 00 # ASSERT((. - 1b) == 118); ASSERT(HI(. - 1) == HI(1b)) # # .align 8, 0xFF L30EC: FF [ 14 ] # 1: # dtmf_cycle_1336_Hz: L3100: 14 L3101: 02 L3102: 17 L3103: 04 L3104: 1B L3105: 06 L3106: 1D L3107: 08 L3108: 20 L3109: 0A L310A: 22 L310B: 0C L310C: 24 L310D: 0E L310E: 25 # .byte 20,2, 23,4, 27,6, 29,8, 32,10, 34,12, 36,14, 37,16 L310F: 10 L3110: 26 L3111: 12 L3112: 26 L3113: 14 L3114: 25 L3115: 16 L3116: 24 L3117: 18 L3118: 22 L3119: 1A L311A: 20 L311B: 1C L311C: 1D L311D: 1E L311E: 1B # .byte 38,18, 38,20, 37,22, 36,24, 34,26, 32,28, 29,30, 27,32 L311F: 20 L3120: 17 L3121: 22 L3122: 14 L3123: 24 L3124: 11 L3125: 26 L3126: 0D L3127: 28 L3128: 0B L3129: 2A L312A: 08 L312B: 2C L312C: 06 L312D: 2E L312E: 04 # .byte 23,34, 20,36, 17,38, 13,40, 11,42, 8,44, 6,46, 4,48 L312F: 30 L3130: 03 L3131: 32 L3132: 02 L3133: 34 L3134: 02 L3135: 36 L3136: 03 L3137: 38 L3138: 04 L3139: 3A L313A: 06 L313B: 3C L313C: 08 L313D: 3E L313E: 0B # .byte 3,50, 2,52, 2,54, 3,56, 4,58, 6,60, 8,62, 11,64 L313F: 40 L3140: 0D L3141: 42 L3142: 11 # .byte 13,66, 17,0 L3143: 00 # ASSERT((. - 1b) == 68); ASSERT(HI(. - 1) == HI(1b)) # # 1: # dtmf_cycle_852_Hz: L3144: 14 L3145: 02 L3146: 16 L3147: 04 L3148: 18 L3149: 06 L314A: 1A L314B: 08 L314C: 1C L314D: 0A L314E: 1E L314F: 0C L3150: 20 L3151: 0E L3152: 21 # .byte 20,2, 22,4, 24,6, 26,8, 28,10, 30,12, 32,14, 33,16 L3153: 10 L3154: 22 L3155: 12 L3156: 24 L3157: 14 L3158: 25 L3159: 16 L315A: 25 L315B: 18 L315C: 26 L315D: 1A L315E: 26 L315F: 1C L3160: 26 L3161: 1E L3162: 26 # .byte 34,18, 36,20, 37,22, 37,24, 38,26, 38,28, 38,30, 38,32 L3163: 20 L3164: 25 L3165: 22 L3166: 25 L3167: 24 L3168: 24 L3169: 26 L316A: 22 L316B: 28 L316C: 21 L316D: 2A L316E: 20 L316F: 2C L3170: 1E L3171: 2E L3172: 1C # .byte 37,34, 37,36, 36,38, 34,40, 33,42, 32,44, 30,46, 28,48 L3173: 30 L3174: 1A L3175: 32 L3176: 18 L3177: 34 L3178: 16 L3179: 36 L317A: 14 L317B: 38 L317C: 12 L317D: 3A L317E: 10 L317F: 3C L3180: 0E L3181: 3E L3182: 0C # .byte 26,50, 24,52, 22,54, 20,56, 18,58, 16,60, 14,62, 12,64 L3183: 40 L3184: 0A L3185: 42 L3186: 08 L3187: 44 L3188: 07 L3189: 46 L318A: 06 L318B: 48 L318C: 04 L318D: 4A L318E: 03 L318F: 4C L3190: 03 L3191: 4E L3192: 02 # .byte 10,66, 8,68, 7,70, 6,72, 4,74, 3,76, 3,78, 2,80 L3193: 50 L3194: 02 L3195: 52 L3196: 02 L3197: 54 L3198: 02 L3199: 56 L319A: 03 L319B: 58 L319C: 03 L319D: 5A L319E: 04 L319F: 5C L31A0: 06 L31A1: 5E L31A2: 07 # .byte 2,82, 2,84, 2,86, 3,88, 3,90, 4,92, 6,94, 7,96 L31A3: 60 L31A4: 08 L31A5: 62 L31A6: 0A L31A7: 64 L31A8: 0C L31A9: 66 L31AA: 0E L31AB: 68 L31AC: 10 L31AD: 6A L31AE: 12 # .byte 8,98, 10,100, 12,102, 14,104, 16,106, 18,0 L31AF: 00 # ASSERT((. - 1b) == 108); ASSERT(HI(. - 1) == HI(1b)) # # 1: # dtmf_cycle_1209_Hz: L31B0: 14 L31B1: 02 L31B2: 17 L31B3: 04 L31B4: 1A L31B5: 06 L31B6: 1D L31B7: 08 L31B8: 1F L31B9: 0A L31BA: 21 L31BB: 0C L31BC: 23 L31BD: 0E L31BE: 24 # .byte 20,2, 23,4, 26,6, 29,8, 31,10, 33,12, 35,14, 36,16 L31BF: 10 L31C0: 25 L31C1: 12 L31C2: 26 L31C3: 14 L31C4: 26 L31C5: 16 L31C6: 25 L31C7: 18 L31C8: 24 L31C9: 1A L31CA: 23 L31CB: 1C L31CC: 21 L31CD: 1E L31CE: 1F # .byte 37,18, 38,20, 38,22, 37,24, 36,26, 35,28, 33,30, 31,32 L31CF: 20 L31D0: 1D L31D1: 22 L31D2: 1A L31D3: 24 L31D4: 17 L31D5: 26 L31D6: 14 L31D7: 28 L31D8: 11 L31D9: 2A L31DA: 0E L31DB: 2C L31DC: 0B L31DD: 2E L31DE: 09 # .byte 29,34, 26,36, 23,38, 20,40, 17,42, 14,44, 11,46, 9,48 L31DF: 30 L31E0: 07 L31E1: 32 L31E2: 05 L31E3: 34 L31E4: 04 L31E5: 36 L31E6: 03 L31E7: 38 L31E8: 02 L31E9: 3A L31EA: 02 L31EB: 3C L31EC: 03 L31ED: 3E L31EE: 04 # .byte 7,50, 5,52, 4,54, 3,56, 2,58, 2,60, 3,62, 4,64 L31EF: 40 L31F0: 05 L31F1: 42 L31F2: 07 L31F3: 44 L31F4: 09 L31F5: 46 L31F6: 0B L31F7: 48 L31F8: 0E L31F9: 4A L31FA: 11 # .byte 5,66, 7,68, 9,70, 11,72, 14,74, 17,0 L31FB: 00 # ASSERT((. - 1b) == 76); ASSERT(HI(. - 1) == HI(1b)) # # .align 8, 0xFF L31FC: FF [ 04 ] # 1: # dtmf_cycle_941_Hz: L3200: 14 L3201: 02 L3202: 16 L3203: 04 L3204: 19 L3205: 06 L3206: 1B L3207: 08 L3208: 1D L3209: 0A L320A: 1F L320B: 0C L320C: 21 L320D: 0E L320E: 22 # .byte 20,2, 22,4, 25,6, 27,8, 29,10, 31,12, 33,14, 34,16 L320F: 10 L3210: 23 L3211: 12 L3212: 24 L3213: 14 L3214: 25 L3215: 16 L3216: 26 L3217: 18 L3218: 26 L3219: 1A L321A: 26 L321B: 1C L321C: 26 L321D: 1E L321E: 25 # .byte 35,18, 36,20, 37,22, 38,24, 38,26, 38,28, 38,30, 37,32 L321F: 20 L3220: 24 L3221: 22 L3222: 23 L3223: 24 L3224: 21 L3225: 26 L3226: 20 L3227: 28 L3228: 1E L3229: 2A L322A: 1C L322B: 2C L322C: 1A L322D: 2E L322E: 17 # .byte 36,34, 35,36, 33,38, 32,40, 30,42, 28,44, 26,46, 23,48 L322F: 30 L3230: 15 L3231: 32 L3232: 13 L3233: 34 L3234: 11 L3235: 36 L3236: 0E L3237: 38 L3238: 0C L3239: 3A L323A: 0A L323B: 3C L323C: 08 L323D: 3E L323E: 07 # .byte 21,50, 19,52, 17,54, 14,56, 12,58, 10,60, 8,62, 7,64 L323F: 40 L3240: 05 L3241: 42 L3242: 04 L3243: 44 L3244: 03 L3245: 46 L3246: 02 L3247: 48 L3248: 02 L3249: 4A L324A: 02 L324B: 4C L324C: 02 L324D: 4E L324E: 03 # .byte 5,66, 4,68, 3,70, 2,72, 2,74, 2,76, 2,78, 3,80 L324F: 50 L3250: 04 L3251: 52 L3252: 05 L3253: 54 L3254: 06 L3255: 56 L3256: 07 L3257: 58 L3258: 09 L3259: 5A L325A: 0B L325B: 5C L325C: 0D L325D: 5E L325E: 0F # .byte 4,82, 5,84, 6,86, 7,88, 9,90, 11,92, 13,94, 15,96 L325F: 60 L3260: 12 # .byte 18,0 L3261: 00 # ASSERT((. - 1b) == 98); ASSERT(HI(. - 1) == HI(1b)) # # 1: # dtmf_cycle_697_Hz: L3262: 14 L3263: 02 L3264: 16 L3265: 04 L3266: 17 L3267: 06 L3268: 19 L3269: 08 L326A: 1B L326B: 0A L326C: 1C L326D: 0C L326E: 1E L326F: 0E L3270: 1F # .byte 20,2, 22,4, 23,6, 25,8, 27,10, 28,12, 30,14, 31,16 L3271: 10 L3272: 20 L3273: 12 L3274: 22 L3275: 14 L3276: 23 L3277: 16 L3278: 24 L3279: 18 L327A: 24 L327B: 1A L327C: 25 L327D: 1C L327E: 25 L327F: 1E L3280: 26 # .byte 32,18, 34,20, 35,22, 36,24, 36,26, 37,28, 37,30, 38,32 L3281: 20 L3282: 26 L3283: 22 L3284: 26 L3285: 24 L3286: 26 L3287: 26 L3288: 25 L3289: 28 L328A: 25 L328B: 2A L328C: 24 L328D: 2C L328E: 24 L328F: 2E L3290: 23 # .byte 38,34, 38,36, 38,38, 37,40, 37,42, 36,44, 36,46, 35,48 L3291: 30 L3292: 22 L3293: 32 L3294: 20 L3295: 34 L3296: 1F L3297: 36 L3298: 1E L3299: 38 L329A: 1C L329B: 3A L329C: 1B L329D: 3C L329E: 19 L329F: 3E L32A0: 17 # .byte 34,50, 32,52, 31,54, 30,56, 28,58, 27,60, 25,62, 23,64 L32A1: 40 L32A2: 16 L32A3: 42 L32A4: 14 L32A5: 44 L32A6: 12 L32A7: 46 L32A8: 11 L32A9: 48 L32AA: 0F L32AB: 4A L32AC: 0D L32AD: 4C L32AE: 0C L32AF: 4E L32B0: 0A # .byte 22,66, 20,68, 18,70, 17,72, 15,74, 13,76, 12,78, 10,80 L32B1: 50 L32B2: 09 L32B3: 52 L32B4: 08 L32B5: 54 L32B6: 06 L32B7: 56 L32B8: 05 L32B9: 58 L32BA: 04 L32BB: 5A L32BC: 04 L32BD: 5C L32BE: 03 L32BF: 5E L32C0: 03 # .byte 9,82, 8,84, 6,86, 5,88, 4,90, 4,92, 3,94, 3,96 L32C1: 60 L32C2: 02 L32C3: 62 L32C4: 02 L32C5: 64 L32C6: 02 L32C7: 66 L32C8: 02 L32C9: 68 L32CA: 03 L32CB: 6A L32CC: 03 L32CD: 6C L32CE: 04 L32CF: 6E L32D0: 04 # .byte 2,98, 2,100, 2,102, 2,104, 3,106, 3,108, 4,110, 4,112 L32D1: 70 L32D2: 05 L32D3: 72 L32D4: 06 L32D5: 74 L32D6: 08 L32D7: 76 L32D8: 09 L32D9: 78 L32DA: 0A L32DB: 7A L32DC: 0C L32DD: 7C L32DE: 0D L32DF: 7E L32E0: 0F # .byte 5,114, 6,116, 8,118, 9,120, 10,122, 12,124, 13,126, 15,128 L32E1: 80 L32E2: 11 L32E3: 82 L32E4: 12 # .byte 17,130, 18,0 L32E5: 00 # ASSERT((. - 1b) == 132); ASSERT(HI(. - 1) == HI(1b)) # # dtmf_rowcol_table: # L32E6: 00 32 # .word dtmf_cycle_941_Hz, dtmf_cycle_1209_Hz ! 0 L32E8: B0 31 L32EA: 62 32 # .word dtmf_cycle_697_Hz, dtmf_cycle_1209_Hz ! 1 L32EC: B0 31 L32EE: 62 32 # .word dtmf_cycle_697_Hz, dtmf_cycle_1336_Hz ! 2 L32F0: 00 31 L32F2: 62 32 # .word dtmf_cycle_697_Hz, dtmf_cycle_1477_Hz ! 3 L32F4: 38 30 L32F6: 76 30 # .word dtmf_cycle_770_Hz, dtmf_cycle_1209_Hz ! 4 L32F8: B0 31 L32FA: 76 30 # .word dtmf_cycle_770_Hz, dtmf_cycle_1336_Hz ! 5 L32FC: 00 31 L32FE: 76 30 # .word dtmf_cycle_770_Hz, dtmf_cycle_1477_Hz ! 6 L3300: 38 30 L3302: 44 31 # .word dtmf_cycle_852_Hz, dtmf_cycle_1209_Hz ! 7 L3304: B0 31 L3306: 44 31 # .word dtmf_cycle_852_Hz, dtmf_cycle_1336_Hz ! 8 L3308: 00 31 L330A: 44 31 # .word dtmf_cycle_852_Hz, dtmf_cycle_1477_Hz ! 9 L330C: 38 30 L330E: 62 32 # .word dtmf_cycle_697_Hz, dtmf_cycle_1633_Hz ! A L3310: 00 30 L3312: 76 30 # .word dtmf_cycle_770_Hz, dtmf_cycle_1633_Hz ! B L3314: 00 30 L3316: 44 31 # .word dtmf_cycle_852_Hz, dtmf_cycle_1633_Hz ! C L3318: 00 30 L331A: 00 32 # .word dtmf_cycle_941_Hz, dtmf_cycle_1633_Hz ! D L331C: 00 30 L331E: 00 32 # .word dtmf_cycle_941_Hz, dtmf_cycle_1336_Hz ! * (E) L3320: 00 31 L3322: 00 32 # .word dtmf_cycle_941_Hz, dtmf_cycle_1477_Hz ! # (F) L3324: 38 30 # # dtmf_bang_tone: # # cp '*' L3326: FE 2A # jr nz, 1f L3328: 20 02 # ld a, 0xE L332A: 3E 0E # 1: # cp '#' L332C: FE 23 # jr nz, 1f L332E: 20 02 # ld a, 0xF L3330: 3E 0F # 1: L3332: CB 27 # sla a L3334: CB 27 # sla a ! index into byte offset (4 byte records) L3336: 5F # ld e, a # ld d, 0 L3337: 16 00 # ld ix, dtmf_rowcol_table ! table[0] L3339: DD 21 E6 32 L333D: DD 19 # add ix, de # L333F: DD 5E 00 # ld e, [ix+0] L3342: DD 56 01 # ld d, [ix+1] L3345: DD 6E 02 # ld l, [ix+2] L3348: DD 66 03 # ld h, [ix+3] # # ld bc, 11452 ! 250 msec total: one loop is 21.83 usec L334B: 01 BC 2C # L334E: F3 # di # # ! temporary mode change # L334F: 3A 29 C2 # ld a, [output_0] L3352: F5 # push af # or 0x20 | 0x80 ! Pass tones, cut mic L3353: F6 A0 L3355: D3 60 # out [0x60], a # # ld a, 0x40 | 0x10 | 0x00 L3357: 3E 50 L3359: D3 23 # out [0x20 + 3], a # L335B: 3A F2 C5 # ld a, [cpu_is_P8E] L335E: B7 # or a # jp nz, 5f L335F: C2 75 33 # ! # ! loop # ! # 1: L3362: D3 90 # out [0x90], a ! 11T L3364: 1A # ld a, [de] ! 7T L3365: 86 # add [hl] ! 7T L3366: D3 21 # out [0x20 + 1], a ! 11T L3368: 2C # inc l ! 4T L3369: 6E # ld l, [hl] ! 7T L336A: 1C # inc e ! 4T L336B: 1A # ld a, [de] ! 7T L336C: 5F # ld e, a ! 4T L336D: 0B # dec bc ! 6T L336E: 78 # ld a, b ! 4T L336F: B1 # or c ! 4T # jr nz, 1b ! 12T (when jumping, last one wont matter) L3370: 20 F0 # !---------- # ! 88T total, 21.83 usec with 4.032 MHz CLK # jp 9f L3372: C3 92 33 # 5: # ! # ! loop, each opcode causes one extra T # ! Want to have the same time anyway (same tables for same timer hw), # ! so 88 * (1/4032000) / (1/8064000) = 176 T-times. # ! # 1: L3375: D3 90 # out [0x90], a ! 12T L3377: 1A # ld a, [de] ! 8T L3378: 86 # add [hl] ! 8T L3379: D3 21 # out [0x20 + 1], a ! 12T L337B: 2C # inc l ! 5T L337C: 6E # ld l, [hl] ! 8T L337D: 1C # inc e ! 5T L337E: 1A # ld a, [de] ! 8T L337F: 5F # ld e, a ! 5T # L3380: D3 90 # out [0x90], a L3382: D3 90 # out [0x90], a L3384: D3 90 # out [0x90], a L3386: D3 90 # out [0x90], a L3388: D3 90 # out [0x90], a ! 5*12=60T L338A: 78 # ld a, b L338B: 78 # ld a, b L338C: 78 # ld a, b ! 3*5=15T # L338D: 0B # dec bc ! 7T L338E: 78 # ld a, b ! 5T L338F: B1 # or c ! 5T # jr nz, 1b ! 13T (when jumping, last one wont matter) L3390: 20 E3 # !---------- # ! 176T total, 21.83 usec with 8.064 MHz CLK # 9: # # ! restore timer back to normal # # ld a, 0x40 | 0x30 | 0x06 L3392: 3E 76 L3394: D3 23 # out [0x20 + 3], a # # ld a, 0x04 L3396: 3E 04 L3398: D3 21 # out [0x20 + 1], a ! Very high tone ... # ld a, 0x00 L339A: 3E 00 L339C: D3 21 # out [0x20 + 1], a ! causes the least leaking. barf. # L339E: F1 # pop af L339F: D3 60 # out [0x60], a ! Restore output switches # L33A1: FB # ei # ret L33A2: C9 # # !======================================================================== # # !====================================================================== # L33A3: 54 68 65 45 6E 64 # .ascii "TheEnd" # .byte .cksum(0, .) L33A9: 52 # # 1: # .data # # # .org 0xC000 ! start of RAM # # # # # !====================================================================== # ! # ! Variables # ! # # nvstart: !------------------------------------------ # ! # ! 4 bytes per memory # ! First one byte for misc info, # ! then 3 bytes for frequency # ! # MEM_RPTR = 0x01 ! 0 # MEM_NOSCAN = 0x04 ! 2 # MEM_EMPTY = 0x80 ! 7 # # BIT_RPTR = 0 # BIT_NOSCAN = 2 # BIT_EMPTY = 7 # # memories: .rs 100 * 4 # rfctab: .rs 100 # # nvmisc: !------------------------------------------ # # hours : .rs 1 ! Uptime # minutes : .rs 1 # seconds : .rs 1 # sec100 : .rs 1 # # volume : .rs 1 # txpwr : .rs 1 # # currmem : .rs 1 # currfreq : .rs 3 ! current frequency in kHz. THESE TWO ADJACENT ! # # tx_offset : .rs 3 ! repeater difference as NA, 0xFFFFFF for -1 # rx_sub : .rs 3 ! for the 1st IF as NA # tx_divisor : .rs 3 ! 17 bits NA # # squelch_limit_close : .rs 1 # squelch_limit_open : .rs 1 # # energy : .rs 2 # # deffreq : .rs 3 ! 17 bits NA # defmem : .rs 1 # defsq : .rs 1 # defvola : .rs 1 # defscan : .rs 1 # def_xxx1 : .rs 1 # def_xxx2 : .rs 1 # # mycall : .rs 5 # # scan_mode : .rs 1 # # audio_dst : .rs 1 # # squelch_dir : .rs 1 ! ascending or descending sql # # rptr_sub : .rs 3 # plus_duplex : .rs 1 ! if bit0 = 1, TX above # # # nvend: !------------------------------------------ # # output_1 : .rs 1 # # mbusrx_rp : .rs 2 # mbusrx_wp : .rs 2 # # mbustx_rp : .rs 2 # mbustx_wp : .rs 2 # # output_0 : .rs 1 # # txon : .rs 1 # rfc : .rs 1 # srssi : .rs 1 # # ad_rssi : .rs 1 # ad_sql : .rs 1 # ad_batt : .rs 1 # # !====================================================================== # # .align 8 ! zeroed variables LC230: 00 [ D0 ] # # ASSERT(LO(.) == 0) # # _bss: # # mbusrx_buf : .rs 256 ! page aligned # mbustx_buf : .rs 256 ! page aligned # # segments : .rs 64 ! page aligned, space for either AN or AF cu. # # indicators : .rs 1 ! LEDs. # # mbustx_cnt : .rs 1 # mbusrx_cnt : .rs 1 # # mbus_timer : .rs 1 ! timer for MBUS transmit # # rssi_timer : .rs 1 # mt_timer : .rs 1 # key_timer : .rs 1 # key_speed : .rs 1 # key_blips : .rs 1 # # alert_ltimer : .rs 2 # light_ltimer : .rs 2 ! Only if portable # # txmax_ltimer : .rs 2 ! Catch stuck PTT XXX # # txtail_timer : .rs 1 ! to delay squelch pop after tx and # ! battery check wrt voltage drop on tx # # ccir_tx_timer : .rs 1 ! for 100ms tone (10 ticks) # # scan_timer : .rs 1 # scan_ltimer : .rs 2 # # scan_mute : .rs 1 ! NZ if scanner unstable # scanner_state : .rs 2 # scan_oops : .rs 1 # # rejects : .rs 3 * 10 # reject_idx : .rs 1 # adj_feedback : .rs 1 # # key_time : .rs 1 # memflags : .rs 1 # # sir : .rs 1 # KEYSIR = 0 # DPYSIR = 1 # DTMFSIR = 2 # INSIR = 7 # nosir : .rs 1 ! Mainline needs full attention # # bstep_cfg : .rs 2 ! 2 and 25 # # bstep_R : .rs 2 ! 1024 # # lastdigit : .rs 1 # lastkey : .rs 1 # key : .rs 1 # dark : .rs 1 # # pttdn : .rs 1 # keydown : .rs 1 # # digidx : .rs 1 # digbuf : .rs 16 # # zeroblank : .rs 1 # # ad_select : .rs 1 # # squelch_open : .rs 1 # squelch_forced : .rs 1 # # mton : .rs 1 # # tx_divisor_lo : .rs 3 ! TX limits # tx_divisor_hi : .rs 3 ! as NA # # redraw_req : .rs 1 # dpymode : .rs 1 # call_dpyed : .rs 1 # # energy_unit_per_second : .rs 2 # # vip_idx : .rs 1 # # vip_list : .rs 4 * VIP_COUNT # # outpacket : .rs 8 # # packet : .rs 8 # packet_good : .rs 8 # packet_rdy : .rs 1 # pkt_ptr : .rs 2 # # pioa_data : .rs 1 # last_columns : .rs 1 # dtmf_code : .rs 1 # spkrbtn : .rs 1 # # portable : .rs 1 ! NZ if /POR in CU-connector # cu_is_alfa : .rs 1 # local_mode : .rs 1 # # cpu_is_P8E : .rs 1 # junk : .rs 1 # # _end: # # Symbols: # BASE a 0x0000 0 0 # VIP_COUNT a 0x000A 10 -10 # start l 0x016B 363 0 # nvend l 0xC220 49696 0 # nvmisc l 0xC1F4 49652 0 # banner l 0x0086 134 0 # version l 0x00A8 168 0 # intvec l 0x00C0 192 0 # sio_base l 0x00C0 192 0 # siob_tbe l 0x02F1 753 0 # siob_esc l 0x033D 829 0 # siob_rca l 0x031E 798 0 # siob_src l 0x0357 855 0 # sioa_tbe l 0x0364 868 0 # sioa_esc l 0x0372 882 0 # sioa_rca l 0x036C 876 0 # sioa_src l 0x03F7 1015 0 # pioa_base l 0x00D0 208 0 # pioa_int l 0x0405 1029 0 # piob_base l 0x00D2 210 0 # piob_int l 0x0401 1025 0 # init_chips l 0x00D4 212 0 # PIOA_INIT a 0x0005 5 212 # PIOB_INIT a 0x0005 5 217 # SIOA_INIT a 0x0009 9 222 # SIOB_INIT a 0x000B 11 231 # LP_3600HZ a 0x000B 11 231 # MT_300HZ a 0x3480 13440 -13198 # MT_600HZ a 0x1A40 6720 -6478 # MT_1000HZ a 0x0FC0 4032 -3790 # MT_1200HZ a 0x0D20 3360 -3118 # MT_1400HZ a 0x0B40 2880 -2638 # MT_1750HZ a 0x0900 2304 -2062 # TMR_INIT a 0x0003 3 242 # CU53AN_segs_bottom_row l 0x00FB 251 0 # CU53AN_segs_d_digit_9 l 0x00FB 251 7 # CU53AN_segs_d_digit_8 l 0x0102 258 7 # CU53AN_segs_d_digit_7 l 0x0109 265 7 # CU53AN_segs_d_digit_6 l 0x0110 272 7 # CU53AN_segs_d_digit_5 l 0x0117 279 7 # CU53AN_segs_d_digit_4 l 0x011E 286 7 # CU53AN_segs_d_digit_3 l 0x0125 293 7 # CU53AN_segs_d_digit_2 l 0x012C 300 7 # CU53AN_segs_d_digit_1 l 0x0133 307 7 # CU53AN_segs_d_digit_0 l 0x013A 314 7 # CU53AN_segs_u_digit_5 l 0x0141 321 7 # CU53AN_segs_u_digit_4 l 0x0148 328 7 # CU53AN_segs_u_digit_3 l 0x014F 335 7 # CU53AN_segs_u_digit_2 l 0x0156 342 7 # CU53AN_segs_u_digit_1 l 0x015D 349 7 # CU53AN_segs_u_digit_0 l 0x0164 356 7 # output_0 l 0xC229 49705 1 # output_1 l 0xC220 49696 1 # txon l 0xC22A 49706 1 # powerdown l 0x1820 6176 0 # cu58af_init l 0x1E3B 7739 0 # mbusrx_buf l 0xC300 49920 256 # mbusrx_rp l 0xC221 49697 2 # mbusrx_wp l 0xC223 49699 2 # mbustx_buf l 0xC400 50176 256 # mbustx_rp l 0xC225 49701 2 # mbustx_wp l 0xC227 49703 2 # packet l 0xC5D8 50648 8 # pkt_ptr l 0xC5E9 50665 2 # blip l 0x1A69 6761 0 # load_nvdata l 0x2B8F 11151 0 # sec100 l 0xC1F7 49655 1 # seconds l 0xC1F6 49654 1 # minutes l 0xC1F5 49653 1 # hours l 0xC1F4 49652 1 # energy_unit_per_second l 0xC5A5 50597 2 # key l 0xC582 50562 1 # lastkey l 0xC581 50561 1 # lastdigit l 0xC580 50560 1 # local_mode l 0xC5F1 50673 1 # cu_is_alfa l 0xC5F0 50672 1 # segments l 0xC500 50432 64 # indicators l 0xC540 50496 1 # portable l 0xC5EF 50671 1 # cu_lights_on l 0x2BC9 11209 0 # currmem l 0xC1FA 49658 1 # getmemflags l 0x131A 4890 0 # memflags l 0xC579 50553 1 # vip_list l 0xC5A8 50600 40 # main l 0x0671 1649 0 # doreti l 0x02ED 749 0 # mbustx_cnt l 0xC541 50497 1 # siob_tbe_close l 0x030F 783 0 # mbus_timer l 0xC543 50499 1 # siob_rca_drop l 0x0316 790 0 # bleep l 0x1A74 6772 0 # siob_rca_ignore l 0x0319 793 0 # mbusrx_cnt l 0xC542 50498 1 # pttdn l 0xC584 50564 1 # keydown l 0xC585 50565 1 # key_timer l 0xC546 50502 1 # check_packet l 0x0CF9 3321 0 # systick l 0x0456 1110 0 # ad_select l 0xC598 50584 1 # ad_batt l 0xC22F 49711 1 # squelch_dir l 0xC21B 49691 1 # ad_sql l 0xC22E 49710 1 # ad_rssi l 0xC22D 49709 1 # pioa_data l 0xC5EB 50667 1 # light_ltimer l 0xC54B 50507 2 # sir l 0xC57A 50554 1 # DPYSIR a 0x0001 1 50554 # scan_mode l 0xC219 49689 1 # scan_timer l 0xC551 50513 1 # scan_ltimer l 0xC552 50514 2 # mt_timer l 0xC545 50501 1 # stop_marker_tone l 0x1AE5 6885 0 # cu_lights_off l 0x2BE2 11234 0 # alert_ltimer l 0xC549 50505 2 # ccir_tx_timer l 0xC550 50512 1 # txtail_timer l 0xC54F 50511 1 # KEYSIR a 0x0000 0 50555 # mton l 0xC59B 50587 1 # squelch_limit_open l 0xC208 49672 1 # squelch_open l 0xC599 50585 1 # scan_mute l 0xC554 50516 1 # cu_serv_on l 0x2BFB 11259 0 # squelch_limit_close l 0xC207 49671 1 # squelch_forced l 0xC59A 50586 1 # cu_serv_off l 0x2C10 11280 0 # srssi l 0xC22C 49708 1 # rssi_timer l 0xC544 50500 1 # redraw_req l 0xC5A2 50594 1 # key_speed l 0xC547 50503 1 # key_time l 0xC578 50552 1 # key_blips l 0xC548 50504 1 # energy l 0xC209 49673 2 # nosir l 0xC57B 50555 1 # INSIR a 0x0007 7 50548 # dosir l 0x0648 1608 0 # keypad l 0x1960 6496 0 # display l 0x1D52 7506 0 # DTMFSIR a 0x0002 2 50553 # i2c_dtmf l 0x1DD2 7634 0 # bstep_R l 0xC57E 50558 2 # dark l 0xC583 50563 1 # set_vola l 0x155B 5467 0 # reset_synth l 0x210B 8459 0 # lookup_rfc l 0x2B45 11077 0 # change_rxsynth l 0x2200 8704 0 # redraw l 0x1BA1 7073 0 # defscan l 0xC211 49681 1 # scanner_start l 0x08BD 2237 0 # mainloop l 0x06CD 1741 0 # battcheck l 0x075E 1886 0 # pttcheck l 0x169D 5789 0 # keycheck l 0x07B7 1975 0 # redrawcheck l 0x07CB 1995 0 # packet_rdy l 0xC5E8 50664 1 # packet_for_whom l 0x06F9 1785 0 # scanner_state l 0xC555 50517 2 # scanner_ret l 0x06F2 1778 0 # packet_good l 0xC5E0 50656 8 # mycall l 0xC214 49684 5 # cu_call_on l 0x2C25 11301 0 # ding l 0x1A7F 6783 0 # call_dpyed l 0xC5A4 50596 1 # start_marker_tone l 0x1AD0 6864 0 # dokey l 0x07DA 2010 0 # insdig l 0x13A0 5024 0 # backspace l 0x13B8 5048 0 # execute l 0x0FAB 4011 0 # command l 0x0EBF 3775 0 # beep1750 l 0x0DD1 3537 0 # up_vola l 0x155F 5471 0 # dn_vola l 0x156B 5483 0 # monitor_audio l 0x13D4 5076 0 # up_sqlv l 0x14B8 5304 0 # dn_sqlv l 0x14D7 5335 0 # def_sqlv l 0x145C 5212 0 # up_memo l 0x12C4 4804 0 # dn_memo l 0x12EF 4847 0 # def_memo l 0x127F 4735 0 # up_freq l 0x163B 5691 0 # dn_freq l 0x1668 5736 0 # def_freq l 0x15D2 5586 0 # def_vola l 0x1519 5401 0 # toggle_rptr_or_insert_A l 0x0E97 3735 0 # step_audio_dst l 0x2C4F 11343 0 # clear_rejects l 0x0844 2116 0 # adj_feedback l 0xC577 50551 1 # rejects l 0xC558 50520 30 # add_reject l 0x0869 2153 0 # reject_idx l 0xC576 50550 1 # currfreq l 0xC1FB 49659 3 # scan_do_step l 0x0951 2385 0 # digidx l 0xC586 50566 1 # a2i l 0x273C 10044 0 # scanner_stop l 0x0923 2339 0 # vip_idx l 0xC5A7 50599 1 # next_vip l 0x11AF 4527 0 # scan_bad l 0x094B 2379 0 # scan_oops l 0xC557 50519 1 # scan_do_step_again l 0x0956 2390 0 # scan_next_simplex l 0x09F3 2547 0 # scan_next_rptr l 0x0A1D 2589 0 # scan_next_memory l 0x0B36 2870 0 # scan_next_everything l 0x0AC7 2759 0 # scan_next_everything_down l 0x0A9B 2715 0 # scan_next_9xmemory l 0x0B11 2833 0 # scan_next_nmt l 0x0A71 2673 0 # scan_next_nmt_mobile l 0x0A47 2631 0 # scan_next_fm l 0x0993 2451 0 # scan_currfreq l 0x0AF1 2801 0 # freq2div l 0x2828 10280 0 # tx_divisor l 0xC204 49668 3 # default_rptr l 0x0E61 3681 0 # scan_do_wait l 0x0B55 2901 0 # MEM_EMPTY a 0x0080 128 49024 # gomem_a l 0x1356 4950 0 # MEM_NOSCAN a 0x0004 4 49148 # remember_vip l 0x1020 4128 0 # send_call_packet l 0x0BFF 3071 0 # tx_on l 0x266A 9834 0 # tx_error l 0x0E1C 3612 0 # build_packet_buffer l 0x0C3E 3134 0 # append_packet_crc l 0x0CAB 3243 0 # send_packet_buffer l 0x0D74 3444 0 # mdm_delay l 0x0DB7 3511 0 # tx_off l 0x26FB 9979 0 # clear_buffer l 0x1697 5783 0 # digbuf l 0xC587 50567 16 # outpacket l 0xC5D0 50640 8 # crctbls l 0x2D00 11520 0 # packet_header l 0x0DA0 3488 0 # packet_header_size a 0x0007 7 3488 # send_some_data l 0x0DA7 3495 0 # save_ahl_to_tx_offset l 0x0E39 3641 0 # tx_offset l 0xC1FE 49662 3 # plus_duplex l 0xC21F 49695 1 # rptr_sub l 0xC21C 49692 3 # toggle_rptr l 0x0EA3 3747 0 # save_nvdata l 0x2BAC 11180 0 # dpymode l 0xC5A3 50595 1 # NUM_INFOS a 0x000C 12 10596 # set_all_defaults l 0x0FA1 4001 0 # txpwr l 0xC1F9 49657 1 # SETTING_ID a 0x0007 7 10405 # SETTING_RFC a 0x0001 1 10411 # SETTING_STEP a 0x0008 8 10404 # SETTING_DIFF a 0x0004 4 10408 # go_mhz l 0x100A 4106 0 # rfc l 0xC22B 49707 1 # save_rfc l 0x2B54 11092 0 # gomem l 0x132B 4907 0 # gofreq l 0x0FEB 4075 0 # go_freq_3_digits l 0x0FDF 4063 0 # save l 0x11FB 4603 0 # BIT_RPTR a 0x0000 0 49152 # BIT_NOSCAN a 0x0002 2 49150 # BIT_EMPTY a 0x0007 7 49145 # memories l 0xC000 49152 400 # defmem l 0xC20E 49678 1 # MEM_RPTR a 0x0001 1 49151 # clear_setting l 0x2860 10336 0 # restart_prom l 0x1452 5202 0 # defsq l 0xC20F 49679 1 # up_rfc l 0x150A 5386 0 # dn_rfc l 0x150E 5390 0 # defvola l 0xC210 49680 1 # set_vola_default l 0x1579 5497 0 # volume l 0xC1F8 49656 1 # deffreq l 0xC20B 49675 3 # up_freq_bc l 0x1644 5700 0 # div2freq l 0x2B2F 11055 0 # cu_call_off l 0x2C3A 11322 0 # ccirtbl l 0x2F00 12032 0 # handle_key_during_tx l 0x17C3 6083 0 # dtmf_code l 0xC5ED 50669 1 # dtmf_bang_tone l 0x3326 13094 0 # do_dtmf_1760 l 0x1807 6151 0 # do_dtmf_star l 0x180B 6155 0 # do_dtmf_hash l 0x180F 6159 0 # do_dtmf_digit l 0x1813 6163 0 # putchar l 0x182D 6189 0 # putchar_1 l 0x1830 6192 0 # putchar_start l 0x1844 6212 0 # putchar_out l 0x184C 6220 0 # iputc l 0x184E 6222 0 # getchar l 0x1872 6258 0 # keytbl_cu53an l 0x1900 6400 0 # keytbl_cu58af l 0x1920 6432 0 # cu_manipulated l 0x1948 6472 0 # keypad_cu58af l 0x1E9A 7834 0 # dpysig l 0x1AFD 6909 0 # dpydig l 0x2616 9750 0 # dpyval255 l 0x1B0E 6926 0 # dpyval99 l 0x1B3C 6972 0 # dpyval99nzb l 0x1B54 6996 0 # dpyhex l 0x1B67 7015 0 # dpyhex_blankF l 0x1B80 7040 0 # segment_onoff l 0x2084 8324 0 # dpydiv9 l 0x2607 9735 0 # audio_dst l 0xC21A 49690 1 # dpydiv99 l 0x2600 9728 0 # call2dpy l 0x1D02 7426 0 # stat2dpy l 0x2970 10608 0 # div2dpy l 0x2A79 10873 0 # sput l 0x2853 10323 0 # display_cu58af l 0x1F66 8038 0 # display_cu53an l 0x1D59 7513 0 # display_group l 0x1D93 7571 0 # display_bit_zero l 0x1DB5 7605 0 # display_bit_one l 0x1DB3 7603 0 # display_byte l 0x1DA5 7589 0 # display_bit l 0x1DB1 7601 0 # i2c_dtmf_tone l 0x1DC2 7618 0 # i2c_send_a l 0x203D 8253 0 # i2c_send l 0x203E 8254 0 # i2c_start l 0x2023 8227 0 # i2c_wrbyte l 0x1FE0 8160 0 # i2c_stop l 0x2030 8240 0 # i2c_recv l 0x204E 8270 0 # spkrbtn l 0xC5EE 50670 1 # last_columns l 0xC5EC 50668 1 # i2c_getbit l 0x1F91 8081 0 # i2c_delay l 0x1FC1 8129 0 # i2c_putbit l 0x1F9A 8090 0 # i2c_sda_high l 0x1FA8 8104 0 # i2c_sda_low l 0x1F9D 8093 0 # i2c_scl_low l 0x1FB3 8115 0 # i2c_scl_high l 0x1FBA 8122 0 # i2c_sendbit l 0x1FC8 8136 0 # i2c_recvbit l 0x1FD4 8148 0 # i2c_rdbyte l 0x2007 8199 0 # puthex l 0x205E 8286 0 # bitmasks l 0x207C 8316 0 # segment_off l 0x20C5 8389 0 # segment_on l 0x2086 8326 0 # reset_synth_oops l 0x2104 8452 0 # bstep_cfg l 0xC57C 50556 2 # tx_divisor_lo l 0xC59C 50588 3 # tx_divisor_hi l 0xC59F 50591 3 # rx_sub l 0xC201 49665 3 # setup_synth l 0x219C 8604 0 # send_to_synth l 0x2262 8802 0 # one_to_synth l 0x227F 8831 0 # strobe_to_synth l 0x225B 8795 0 # change_txsynth l 0x21B8 8632 0 # send_NA_to_synth l 0x223B 8763 0 # zero_to_synth l 0x2272 8818 0 # cu58af_font l 0x2300 8960 0 # cu58af_font_size a 0x0100 256 8960 # cu53an_font l 0x2400 9216 0 # cu53an_font_size a 0x0080 128 9216 # div99tbl l 0x2500 9472 0 # a2i1 l 0x27E8 10216 0 # a2i2 l 0x27D5 10197 0 # a2i3 l 0x27C2 10178 0 # a2i4 l 0x27AF 10159 0 # a2i5 l 0x279C 10140 0 # a2i6 l 0x2789 10121 0 # a2i7 l 0x2776 10102 0 # a2i0 l 0x27FB 10235 0 # a2iOV l 0x276E 10094 0 # mul248 l 0x2800 10240 0 # div248 l 0x2816 10262 0 # settings l 0x28B0 10416 8 # do_tunedpy l 0x29B7 10679 0 # do_bytedpy l 0x2A0B 10763 0 # do_diffdpy l 0x29DC 10716 0 # do_timedpy l 0x2A5C 10844 0 # do_iddpy l 0x2A38 10808 0 # do_stepdpy l 0x29C9 10697 0 # do_verdpy l 0x2A2B 10795 0 # do_pktdpy l 0x2A15 10773 0 # ahl_div2dpy l 0x2A6D 10861 0 # do_hexdpy l 0x2A10 10768 0 # zeroblank l 0xC597 50583 1 # divide l 0x2B07 11015 0 # nextdig l 0x2B15 11029 0 # get_rfc_hl l 0x2B61 11105 0 # rfctab l 0xC190 49552 100 # nvstart l 0xC000 49152 0 # crctbl_hi l 0x2D00 11520 0 # crctbl_lo l 0x2E00 11776 0 # dtmf_cycle_1633_Hz l 0x3000 12288 0 # dtmf_cycle_1477_Hz l 0x3038 12344 0 # dtmf_cycle_770_Hz l 0x3076 12406 0 # dtmf_cycle_1336_Hz l 0x3100 12544 0 # dtmf_cycle_852_Hz l 0x3144 12612 0 # dtmf_cycle_1209_Hz l 0x31B0 12720 0 # dtmf_cycle_941_Hz l 0x3200 12800 0 # dtmf_cycle_697_Hz l 0x3262 12898 0 # dtmf_rowcol_table l 0x32E6 13030 0 # cpu_is_P8E l 0xC5F2 50674 1 # def_xxx1 l 0xC212 49682 1 # def_xxx2 l 0xC213 49683 1 # txmax_ltimer l 0xC54D 50509 2 # junk l 0xC5F3 50675 1 # _text a 0x0000 0 13226 # _etext a 0x33AA 13226 # _data a 0xC000 49152 1524 # _edata a 0xC5F4 50676