     M6809 DIS-ASSEMBLER    chromhex    Tue Jul 25 07:40:32 2000

C000 C101                              KEY_ALG_00_00       FDB  $C101              Keyboard Alg = 0 (Polyphonic) - Attack Handler
C002 C14D                              KEY_ALG_00_01       FDB  $C14D              Release Handler
C004 C1A9                              KEY_ALG_00_02       FDB  $C1A9              FSW 1 Deassert Handler Address
C006 C18E                              KEY_ALG_00_03       FDB  $C18E              FSW 1 Assert Handler Address 
C008 C1DC                              KEY_ALG_00_04       FDB  $C1DC              FSW 2 Deassert Handler Address 
C00A C1C2                              KEY_ALG_00_05       FDB  $C1C2              FSW 2 Assert Handler Address
C00C C100                              KEY_ALG_00_06       FDB  $C100              (Unused Kybd Alg 0 Vector - jump to C100)
C00E C100                              KEY_ALG_00_07       FDB  $C100              (Unused Kybd Alg 0 Vector - jump to C100)
C010 C207                              KEY_ALG_01_00       FDB  $C207              Keyboard Alg = 1 (Pitch Ordered) - Attack Handler
C012 C21D                              KEY_ALG_01_01       FDB  $C21D              Release Handler
C014 C1A9                              KEY_ALG_01_02       FDB  $C1A9              FSW 1 Deassert Handler Address
C016 C18E                              KEY_ALG_01_03       FDB  $C18E              FSW 1 Assert Handler Address 
C018 C307                              KEY_ALG_01_04       FDB  $C307              FSW 2 Deassert Handler Address 
C01A C30B                              KEY_ALG_01_05       FDB  $C30B              FSW 2 Assert Handler Address
C01C C100                              KEY_ALG_01_06       FDB  $C100              (Unused Kybd Alg 1 Vector - jump to C100)
C01E C100                              KEY_ALG_01_07       FDB  $C100              (Unused Kybd Alg 1 Vector - jump to C100)
C020 C30F                              KEY_ALG_02_00       FDB  $C30F              Keyboard Alg = 2 (Chord Buffer) - Attack Handler
C022 C32E                              KEY_ALG_02_01       FDB  $C32E              Release Handler
C024 C354                              KEY_ALG_02_02       FDB  $C354              FSW 1 Deassert Handler Address
C026 C339                              KEY_ALG_02_03       FDB  $C339              FSW 1 Assert Handler Address 
C028 C3B0                              KEY_ALG_02_04       FDB  $C3B0              FSW 2 Deassert Handler Address 
C02A C36D                              KEY_ALG_02_05       FDB  $C36D              FSW 2 Assert Handler Address
C02C C100                              KEY_ALG_02_06       FDB  $C100              (Unused Kybd Alg 2 Vector - jump to C100)
C02E C100                              KEY_ALG_02_07       FDB  $C100              (Unused Kybd Alg 2 Vector - jump to C100)
C030 C3D4                              KEY_ALG_03_00       FDB  $C3D4              Keyboard Alg = 3 (All Chan - Poly) - Attack Handler
C032 C3F0                              KEY_ALG_03_01       FDB  $C3F0              Release Handler
C034 C1A9                              KEY_ALG_03_02       FDB  $C1A9              FSW 1 Deassert Handler Address
C036 C18E                              KEY_ALG_03_03       FDB  $C18E              FSW 1 Assert Handler Address 
C038 C51B                              KEY_ALG_03_04       FDB  $C51B              FSW 2 Deassert Handler Address 
C03A C4F3                              KEY_ALG_03_05       FDB  $C4F3              FSW 2 Assert Handler Address
C03C C100                              KEY_ALG_03_06       FDB  $C100              (Unused Kybd Alg 3 Vector - jump to C100)
C03E C100                              KEY_ALG_03_07       FDB  $C100              (Unused Kybd Alg 3 Vector - jump to C100)
C040 C531                              KEY_ALG_04_00       FDB  $C531              Keyboard Alg = 4 (All Chan - Mono) - Attack Handler
C042 C55C                              KEY_ALG_04_01       FDB  $C55C              Release Handler
C044 C1A9                              KEY_ALG_04_02       FDB  $C1A9              FSW 1 Deassert Handler Address
C046 C18E                              KEY_ALG_04_03       FDB  $C18E              FSW 1 Assert Handler Address 
C048 C1DC                              KEY_ALG_04_04       FDB  $C1DC              FSW 2 Deassert Handler Address 
C04A C1C2                              KEY_ALG_04_05       FDB  $C1C2              FSW 2 Assert Handler Address
C04C C100                              KEY_ALG_04_06       FDB  $C100              (Unused Kybd Alg 4 Vector - jump to C100)
C04E C100                              KEY_ALG_04_07       FDB  $C100              (Unused Kybd Alg 4 Vector - jump to C100)
C050 C587                              KEY_ALG_05_00       FDB  $C587              Keyboard Alg = 5 (Last Note, ST) - Attack Handler
C052 C5E3                              KEY_ALG_05_01       FDB  $C5E3              Release Handler
C054 C626                              KEY_ALG_05_02       FDB  $C626              FSW 1 Deassert Handler Address
C056 C60F                              KEY_ALG_05_03       FDB  $C60F              FSW 1 Assert Handler Address 
C058 C64E                              KEY_ALG_05_04       FDB  $C64E              FSW 2 Deassert Handler Address 
C05A C63D                              KEY_ALG_05_05       FDB  $C63D              FSW 2 Assert Handler Address
C05C C100                              KEY_ALG_05_06       FDB  $C100              (Unused Kybd Alg 5 Vector - jump to C100)
C05E C100                              KEY_ALG_05_07       FDB  $C100              (Unused Kybd Alg 5 Vector - jump to C100)
C060 C5B7                              KEY_ALG_06_00       FDB  $C5B7              Keyboard Alg = 6 (Last Note, MT) - Attack Handler
C062 C5E3                              KEY_ALG_06_01       FDB  $C5E3              Release Handler
C064 C626                              KEY_ALG_06_02       FDB  $C626              FSW 1 Deassert Handler Address
C066 C60F                              KEY_ALG_06_03       FDB  $C60F              FSW 1 Assert Handler Address 
C068 C64E                              KEY_ALG_06_04       FDB  $C64E              FSW 2 Deassert Handler Address 
C06A C63D                              KEY_ALG_06_05       FDB  $C63D              FSW 2 Assert Handler Address
C06C C100                              KEY_ALG_06_06       FDB  $C100              (Unused Kybd Alg 6 Vector - jump to C100)
C06E C100                              KEY_ALG_06_07       FDB  $C100              (Unused Kybd Alg 6 Vector - jump to C100)
C070 C667                              KEY_ALG_07_00       FDB  $C667              Keyboard Alg = 7 (First Note) - Attack Handler
C072 C677                              KEY_ALG_07_01       FDB  $C677              Release Handler
C074 C626                              KEY_ALG_07_02       FDB  $C626              FSW 1 Deassert Handler Address
C076 C60F                              KEY_ALG_07_03       FDB  $C60F              FSW 1 Assert Handler Address 
C078 C64E                              KEY_ALG_07_04       FDB  $C64E              FSW 2 Deassert Handler Address 
C07A C63D                              KEY_ALG_07_05       FDB  $C63D              FSW 2 Assert Handler Address
C07C C100                              KEY_ALG_07_06       FDB  $C100              (Unused Kybd Alg 7 Vector - jump to C100)
C07E C100                              KEY_ALG_07_07       FDB  $C100              (Unused Kybd Alg 7 Vector - jump to C100)
C080 C684                              KEY_ALG_08_00       FDB  $C684              Keyboard Alg = 8 (Bottom Note) - Attack Handler
C082 C6B7                              KEY_ALG_08_01       FDB  $C6B7              Release Handler
C084 C626                              KEY_ALG_08_02       FDB  $C626              FSW 1 Deassert Handler Address
C086 C60F                              KEY_ALG_08_03       FDB  $C60F              FSW 1 Assert Handler Address 
C088 C64E                              KEY_ALG_08_04       FDB  $C64E              FSW 2 Deassert Handler Address 
C08A C6BD                              KEY_ALG_08_05       FDB  $C6BD              FSW 2 Assert Handler Address
C08C C100                              KEY_ALG_08_06       FDB  $C100              (Unused Kybd Alg 8 Vector - jump to C100)
C08E C100                              KEY_ALG_08_07       FDB  $C100              (Unused Kybd Alg 8 Vector - jump to C100)
C090 C691                              KEY_ALG_09_00       FDB  $C691              Keyboard Alg = 9 (Top Note) - Attack Handler
C092 C6B7                              KEY_ALG_09_01       FDB  $C6B7              Release Handler
C094 C626                              KEY_ALG_09_02       FDB  $C626              FSW 1 Deassert Handler Address
C096 C60F                              KEY_ALG_09_03       FDB  $C60F              FSW 1 Assert Handler Address 
C098 C64E                              KEY_ALG_09_04       FDB  $C64E              FSW 2 Deassert Handler Address 
C09A C6BD                              KEY_ALG_09_05       FDB  $C6BD              FSW 2 Assert Handler Address
C09C C100                              KEY_ALG_09_06       FDB  $C100              (Unused Kybd Alg 9 Vector - jump to C100)
C09E C100                              KEY_ALG_09_07       FDB  $C100              (Unused Kybd Alg 9 Vector - jump to C100)
C0A0 C737                              KEY_ALG_10_00       FDB  $C737              Keyboard Alg = 10 (Arp Up) - Attack Handler
C0A2 C76E                              KEY_ALG_10_01       FDB  $C76E              Release Handler
C0A4 C7DD                              KEY_ALG_10_02       FDB  $C7DD              FSW 1 Deassert Handler Address
C0A6 C7D9                              KEY_ALG_10_03       FDB  $C7D9              FSW 1 Assert Handler Address 
C0A8 C805                              KEY_ALG_10_04       FDB  $C805              FSW 2 Deassert Handler Address 
C0AA C30B                              KEY_ALG_10_05       FDB  $C30B              FSW 2 Assert Handler Address
C0AC C79D                              KEY_ALG_10_06       FDB  $C79D              Kybd Alg 10, 11, 14 (Single Direction) Arpeg. Handler 
C0AE C7CC                              KEY_ALG_10_07       FDB  $C7CC              Common Arpeg. (Alg 10-15) Handler
C0B0 C73C                              KEY_ALG_11_00       FDB  $C73C              Keyboard Alg = 11 (Arp Down) - Attack Handler
C0B2 C76E                              KEY_ALG_11_01       FDB  $C76E              Release Handler
C0B4 C7DD                              KEY_ALG_11_02       FDB  $C7DD              FSW 1 Deassert Handler Address
C0B6 C7D9                              KEY_ALG_11_03       FDB  $C7D9              FSW 1 Assert Handler Address 
C0B8 C805                              KEY_ALG_11_04       FDB  $C805              FSW 2 Deassert Handler Address 
C0BA C30B                              KEY_ALG_11_05       FDB  $C30B              FSW 2 Assert Handler Address
C0BC C79D                              KEY_ALG_11_06       FDB  $C79D              Kybd Alg 10, 11, 14 (Single Direction) Arpeg. Handler
C0BE C7CC                              KEY_ALG_11_07       FDB  $C7CC              Common Arpeg. (Alg 10-15) Handler
C0C0 C737                              KEY_ALG_12_00       FDB  $C737              Keyboard Alg = 12 (Arp Up Down) - Attack Handler
C0C2 C76E                              KEY_ALG_12_01       FDB  $C76E              Release Handler
C0C4 C7DD                              KEY_ALG_12_02       FDB  $C7DD              FSW 1 Deassert Handler Address
C0C6 C7D9                              KEY_ALG_12_03       FDB  $C7D9              FSW 1 Assert Handler Address 
C0C8 C805                              KEY_ALG_12_04       FDB  $C805              FSW 2 Deassert Handler Address 
C0CA C30B                              KEY_ALG_12_05       FDB  $C30B              FSW 2 Assert Handler Address
C0CC C7A2                              KEY_ALG_12_06       FDB  $C7A2              Kybd Alg 12, 13 (Dual Direction) Arpeg. Handler
C0CE C7CC                              KEY_ALG_12_07       FDB  $C7CC              Common Arpeg. (Alg 10-15) Handler
C0D0 C73C                              KEY_ALG_13_00       FDB  $C73C              Keyboard Alg = 13 (Arp Down Up) - Attack Handler
C0D2 C76E                              KEY_ALG_13_01       FDB  $C76E              Release Handler
C0D4 C7DD                              KEY_ALG_13_02       FDB  $C7DD              FSW 1 Deassert Handler Address
C0D6 C7D9                              KEY_ALG_13_03       FDB  $C7D9              FSW 1 Assert Handler Address 
C0D8 C805                              KEY_ALG_13_04       FDB  $C805              FSW 2 Deassert Handler Address 
C0DA C30B                              KEY_ALG_13_05       FDB  $C30B              FSW 2 Assert Handler Address
C0DC C7A2                              KEY_ALG_13_06       FDB  $C7A2              Kybd Alg 12, 13 (Dual Direction) Arpeg. Handler
C0DE C7CC                              KEY_ALG_13_07       FDB  $C7CC              Common Arpeg. (Alg 10-15) Handler
C0E0 C741                              KEY_ALG_14_00       FDB  $C741              Keyboard Alg = 14 (Sequencer) - Attack Handler
C0E2 C76E                              KEY_ALG_14_01       FDB  $C76E              Release Handler
C0E4 C7DD                              KEY_ALG_14_02       FDB  $C7DD              FSW 1 Deassert Handler Address
C0E6 C7D9                              KEY_ALG_14_03       FDB  $C7D9              FSW 1 Assert Handler Address 
C0E8 C805                              KEY_ALG_14_04       FDB  $C805              FSW 2 Deassert Handler Address 
C0EA C30B                              KEY_ALG_14_05       FDB  $C30B              FSW 2 Assert Handler Address
C0EC C79D                              KEY_ALG_14_06       FDB  $C79D              Kybd Alg 10, 11, 14 (Single Direction) Arpeg. Handler
C0EE C7CC                              KEY_ALG_14_07       FDB  $C7CC              Common Arpeg. (Alg 10-15) Handler
C0F0 C741                              KEY_ALG_15_00       FDB  $C741              Keyboard Alg = 15 (Random) - Attack Handler
C0F2 C76E                              KEY_ALG_15_01       FDB  $C76E              Release Handler
C0F4 C7DD                              KEY_ALG_15_02       FDB  $C7DD              FSW 1 Deassert Handler Address
C0F6 C7D9                              KEY_ALG_15_03       FDB  $C7D9              FSW 1 Assert Handler Address 
C0F8 C805                              KEY_ALG_15_04       FDB  $C805              FSW 2 Deassert Handler Address 
C0FA C30B                              KEY_ALG_15_05       FDB  $C30B              FSW 2 Assert Handler Address
C0FC C7A7                              KEY_ALG_15_06       FDB  $C7A7              Kybd Alg 15 (Random) Arpeg. Handler
C0FE C7CC                              KEY_ALG_15_07       FDB  $C7CC              Common Arpeg. (Alg 10-15) Handler

C100 39                                                    RTS  

C101 BDE241                                                JSR  CHK_NGATE          Kybd Alg 0 (Polyphonic) Attack Hander (Least Recently Used)
C104 3470                                                  PSHS U,Y,X
C106 A6A85F                                                LDA  $5F,Y              A = 0 if 8 channel mode, else 16 channel mode
C109 970D                                                  STA  16_CHNL_MODE       Store 'instrument' channel mode to 'system' channel mode param.
C10B 33A4                                                  LEAU 0,Y                U = Start Addr. of Instrument
C10D AEC4                              ALG0_CHK_CHAN       LDX  0,U                X = Addr. of Chan. last played using current Inst.
C10F 2712                                                  BEQ  NO_CHNL_LST_PLAYD  If X=0, no channel board last played/assigned - branch & assign channel
C111 A606                                                  LDA  $6,X               else, board was assigned - see if channel sounding or silent
C113 2E0E                                                  BGT  NO_CHNL_LST_PLAYD  If channel not sounding, jump
C115 2708                                                  BEQ  ALG0_NEXT_CHAN     else, if board is sounding (=0) - branch
C117 A608                                                  LDA  $8,X               Else, board not sounding, A = Note assg'n to channel
C119 915C                                                  CMPA CORR_NOTE          Compare assigned note w/played note
C11B 2602                                                  BNE  ALG0_NEXT_CHAN     If a different note was assigned, branch 
C11D 31C4                                                  LEAY 0,U                Else same note assigned, Y = base address of instrument
C11F 3384                              ALG0_NEXT_CHAN      LEAU 0,X                U = address of instrument assigned to channel X
C121 20EA                                                  BRA  ALG0_CHK_CHAN

C123 3420                              NO_CHNL_LST_PLAYD   PSHS Y
C125 11A3E1                                                CMPU ,S++               Compare U (start addr. of inst) with Y (current inst. addr)
C128 2721                                                  BEQ  ALG_0_ATK_EXIT     If they're the same, branch (exit)
C12A AEA4                                                  LDX  0,Y                else, X = address of channel
C12C 6F06                                                  CLR  $6,X               Make channel play (i.e., set variable to 0)
C12E BDDFA0                                                JSR  CALC_VEL_PRES
C131 A608                                                  LDA  $8,X               A = Note played by & stored in channel
C133 915C                                                  CMPA CORR_NOTE          See if channel is already playing struck note
C135 2605                                                  BNE  NEW_NOTE_ALG_0     Branch if it is a new note
C137 BDE0AD                                                JSR  RESTRT_NOTE_ENV    else, same note has played - refire envelope
C13A 2003                                                  BRA  ENV_STARTED        At this point envelope start/restart will have done - continue w/work 

C13C BDE0C5                            NEW_NOTE_ALG_0      JSR  START_NOTE_ENV     Configure ENV parameters in Channel for new key hit
C13F BDE034                            ENV_STARTED         JSR  STORE_NOTE2CHAN    Define note-specific values and put in channel def'n
C142 BDE057                                                JSR  DO_SWEEP_SETUP     Put specific sweep params to channel def'n 
C145 BDE1E1                                                JSR  PUT_S_H_TO_BRD     Put S&H values to board
C148 BDE2BC                                                JSR  SET_NXT_LAST_DAT   Assign next/last instrument data, & next/last channel data
C14B 35F0                              ALG_0_ATK_EXIT      PULS X,Y,U,PC           New Note is now sounding - done with attack handler (exit)

C14D 3470                                                  PSHS U,Y,X              Kybd Alg 0 (Polyphonic) Release Handler
C14F A6A85F                                                LDA  $5F,Y              A = 0 if 8 channel mode, else 16 channel mode
C152 970D                                                  STA  16_CHNL_MODE       Store 'instrument' setting of 16-channel mode to system
C154 BDE254                                                JSR  MASK_FSW           A = FSW Byte (with "disables" taken into account)
C157 970C                                                  STA  SWEEP_INDEX        Store FSW status to 'SWEEP_INDEX' variable
C159 AEA4                              ALG_0_NEXT_CHAN     LDX  0,Y                X = Addr of chan first played by this inst, later "next" chan
C15B 272F                                                  BEQ  ALG_0_REL_EXIT     If no channel assigned, exit
C15D A606                                                  LDA  $6,X               A = indication if note is depressed (0 = depressed, $FF = up)
C15F 2E2B                                                  BGT  ALG_0_REL_EXIT
C161 2704                                                  BEQ  REL_CUR_CHAN       If A = 0, then note is still held down (should be sounding, branch)
C163 3184                                                  LEAY 0,X                else, board isn't playing anyway - Y = address of this channel
C165 20F2                                                  BRA  ALG_0_NEXT_CHAN

C167 33A4                              REL_CUR_CHAN        LEAU 0,Y                U = Base address of instrument
C169 A608                              L2                  LDA  $8,X               A = Note played by & stored in channel
C16B 915C                                                  CMPA CORR_NOTE          Compare "channel" note to current note
C16D 2613                                                  BNE  REL_DIFF_NOTE      If the current note is differnt from the channel note, branch
C16F 6A06                                                  DEC  $6,X               else, the current note = chan. note. - turn note off 
C171 BDE1B2                                                JSR  CHK_REL_THRSH      Take care of Release Threshold settings
C174 960C                                                  LDA  SWEEP_INDEX        Check Pedal image
C176 2B03                                                  BMI  SKIP_REL           is Pedal Image < 1 (i.e., "sustain" active), jump
C178 BDE1C4                                                JSR  ACTIVATE_REL       else, pedal image >= 1 (sustain not active)
C17B BDE2C4                            SKIP_REL            JSR  L1
C17E 3084                                                  LEAX 0,X                X = base address of 'current' channel
C180 2004                                                  BRA  CHK_NXT_CHAN

C182 3184                              REL_DIFF_NOTE       LEAY 0,X                Y = Base Addr. of cur. channel 
C184 AE84                                                  LDX  0,X                X = address of 'next channel' assigned to instrument
C186 2704                              CHK_NXT_CHAN        BEQ  ALG_0_REL_EXIT     If there is no 'next' channel, exit release handler (no work to do)
C188 A606                                                  LDA  $6,X               A = indication if note is depressed (0 = depressed, $FF = up)
C18A 2FDD                                                  BLE  L2                 Branch if note sounding, or only 1 note assigned to board
C18C 35F0                              ALG_0_REL_EXIT      PULS X,Y,U,PC           else, exit

C18E BDE270                                                JSR  FSW1_ASSERT_OKCHK  FSW 1 Assert Handler for Kybd Alg 0, 1, 3, 4 - Sustain On
C191 3410                                                  PSHS X                  If we're here, FSW1 was asserted and FSW1 not disabled
C193 A6A85F                                                LDA  $5F,Y              A = 0 if 8 channel mode, else 16 channel mode
C196 970D                                                  STA  16_CHNL_MODE       Save an indication as to the num channels for sel. instrument
C198 30A4                                                  LEAX 0,Y                X = Address of next/current channel played by instrument
C19A AE84                              FSW1_0_NEXT_CHAN    LDX  0,X                X = Address of Next channel assigned to instrument
C19C 2709                                                  BEQ  FSW1_1_ASRT_EXIT   If there is no next channel assigned, branch (exit)
C19E A606                                                  LDA  $6,X               else, A = indication if note is depressed (0 = depressed, $FF = up)
C1A0 2CF8                                                  BGE  FSW1_0_NEXT_CHAN   If note already sustained, go check next channel 
C1A2 BDE195                                                JSR  ACTIVATE_ATK       Take care of envelopes
C1A5 20F3                                                  BRA  FSW1_0_NEXT_CHAN   Make sure we've taken care of all channels

C1A7 3590                              FSW1_1_ASRT_EXIT    PULS X,PC

C1A9 BDE25E                                                JSR  FSW1_DESERT_OKCHK  FSW 1 Deassert Handler for Kybd Alg 0, 1, 3, 4 - Sustain Off
C1AC 3410                                                  PSHS X
C1AE A6A85F                                                LDA  $5F,Y              A = 0 if 8 channel mode, else 16 channel mode
C1B1 970D                                                  STA  16_CHNL_MODE
C1B3 30A4                                                  LEAX 0,Y                X = Base address of Inst.
C1B5 AE84                              FSW1D_0134_LOOP     LDX  0,X                X = Address of "next/current" channel assigned to instrument
C1B7 27EE                                                  BEQ  FSW1_1_ASRT_EXIT   If no channel assigned, branch (exit)
C1B9 A606                                                  LDA  $6,X               else, A = indication if note is depressed (0 = depressed, $FF = up)
C1BB 2CF8                                                  BGE  FSW1D_0134_LOOP    If note already sustained, go check next channel
C1BD BDE1C4                                                JSR  ACTIVATE_REL       Allow releases to occur (no longer sustained)
C1C0 20F3                                                  BRA  FSW1D_0134_LOOP    Make sure we've taken care of all channels

C1C2 BDE296                                                JSR  FSW2_ASSERT_OKCHK  FSW 2 Assert Handler for Kybd Alg 0, 4
C1C5 3410                                                  PSHS X                  If we're here, FSW2 was asserted and FSW2 not disabled
C1C7 A6A85F                                                LDA  $5F,Y              A = 0 if 8 channel mode, else 16 channel mode
C1CA 970D                                                  STA  16_CHNL_MODE       Save an indication as to the num channels for sel. instrument
C1CC 30A4                                                  LEAX 0,Y                X = address of instrument (base)
C1CE AE84                              FSW2A_04_LOOP       LDX  0,X                X = address of 'next/current' channel assigned to instrument
C1D0 27D5                                                  BEQ  FSW1_1_ASRT_EXIT   If no channel assigned, exit
C1D2 A606                                                  LDA  $6,X               A = indication if note is depressed (0 = depressed, $FF = up)
C1D4 2ED1                                                  BGT  FSW1_1_ASRT_EXIT
C1D6 2DF6                                                  BLT  FSW2A_04_LOOP
C1D8 6C06                                                  INC  $6,X
C1DA 20F2                                                  BRA  FSW2A_04_LOOP      Make sure we've taken care of all channels

C1DC BDE282                                                JSR  FSW2_DESERT_OKCHK  FSW 2 Deassert Handler for Kybd Alg 0, 4
C1DF 3470                                                  PSHS U,Y,X              We're here if FSW2 was deasserted and FSW2 not disabled
C1E1 A6A85F                                                LDA  $5F,Y              A = 0 if 8 channel mode, else 16 channel mode
C1E4 970D                                                  STA  16_CHNL_MODE
C1E6 33A4                                                  LEAU 0,Y                U = base address of current instrument
C1E8 AEA4                              FSW2D_04_LOOP       LDX  0,Y                X = address of channel assigned to instrument 
C1EA 2719                                                  BEQ  FSW2D_04_EXIT      If no channels assigned, exit
C1EC A606                                                  LDA  $6,X               A = indication if note is depressed (0 = depressed, $FF = up)
C1EE 2E09                                                  BGT  FSW2D_04_MULTI     If more than one note still sustained, branch
C1F0 3184                                                  LEAY 0,X                Else, Y = base address of this channel
C1F2 4D                                                    TSTA                    Check 16-channel state
C1F3 27F3                                                  BEQ  FSW2D_04_LOOP      If we're in 8-channel mode, branch (IS THIS BRANCH RIGHT?) 
C1F5 3384                                                  LEAU 0,X                U = base address of current channel
C1F7 20EF                                                  BRA  FSW2D_04_LOOP      Make sure we've taken care of all channels

C1F9 6006                              FSW2D_04_MULTI      NEG  $6,X               turn off current sustain/sounding
C1FB BDE1C4                                                JSR  ACTIVATE_REL       allow release to occur
C1FE BDE2C4                                                JSR  L1
C201 3084                                                  LEAX 0,X                X = Address of current channel
C203 26F4                                                  BNE  FSW2D_04_MULTI     If 'current' address doesn't equal zero - then branch
C205 35F0                              FSW2D_04_EXIT       PULS X,Y,U,PC           else, exit

C207 BDE241                                                JSR  CHK_NGATE          Kybd Alg 1 (Pitch Ordered) Attack Handler
C20A 3410                                                  PSHS X
C20C AEA4                                                  LDX  0,Y                X = address of current/next channel Played by Instrument
C20E 270B                                                  BEQ  ALG_1_ATCK_EXIT    If no channel defined, exit
C210 BDE316                                                JSR  ORDER_STK_DESCND   else, order note stack in a descending order
C213 2706                                                  BEQ  ALG_1_ATCK_EXIT    Branch if note insert failed
C215 8EC271                                                LDX  #$C271             else, note successfully inserted in stack 
C218 AFA862                                                STX  $62,Y              Store 'arpeg' handler in instrument
C21B 3590                              ALG_1_ATCK_EXIT     PULS X,PC               All done - exit

C21D 3470                                                  PSHS U,Y,X              Kybd Alg 1 (Pitch Ordered) Release Handler
C21F A6A85F                                                LDA  $5F,Y              A = 0 if 8 channel mode, else 16 channel mode
C222 970D                                                  STA  16_CHNL_MODE       Update system 16-channel mode setting
C224 BDE2E6                                                JSR  TOP_BOT_RELEASE    Remove current note from note stack
C227 33A4                                                  LEAU 0,Y                U = base address of instrument
C229 AEC4                              CHK_NEWCHAN_NOTE    LDX  0,U                X = address of channel assigned to instrument
C22B 2742                                                  BEQ  A1_CHN_NOT_ASGND   If no channel assigned, branch
C22D A606                                                  LDA  $6,X               A = indication if note is depressed (0 = depressed, $FF = up)
C22F 2D3A                                                  BLT  ALG1_GOTONXTCHAN   If note not sounding, branch
C231 A608                                                  LDA  $8,X               A = Note played by & stored in channel
C233 915C                                                  CMPA CORR_NOTE          Compare current note and note in channel
C235 2634                                                  BNE  ALG1_GOTONXTCHAN   If notes are different, branch
C237 6A06                                                  DEC  $6,X               Else, this channel is playing the currently released note (mute)
C239 EC84                                                  LDD  0,X                D = address of 'next' channel
C23B EDC4                                                  STD  0,U                Save 'next' channel address in U
C23D A6A85E                                                LDA  $5E,Y
C240 6CA85E                                                INC  $5E,Y
C243 3440                                                  PSHS U                  Save a copy of "U"
C245 EEA4                              ALG1_CHKNXT_CHAN    LDU  0,Y                U = base address of instrument
C247 4D                                                    TSTA                    Test value of $5E value from instrument
C248 270B                                                  BEQ  L3                 Branch if value was zero
C24A E648                                                  LDB  8,U    $8          B = Note played by 'next' channel
C24C D15C                                                  CMPB CORR_NOTE          see if next channel is also playing current note
C24E 2D05                                                  BLT  L3                 Branch if current note > 'next channel' note
C250 4A                                                    DECA                    Else A = A -1
C251 31C4                                                  LEAY 0,U                Y = base address of 'next' channel
C253 20F0                                                  BRA  ALG1_CHKNXT_CHAN

C255 EF84                              L3                  STU  0,X
C257 AFA4                                                  STX  0,Y
C259 3540                                                  PULS U
C25B 10AE62                                                LDY  $2,S
C25E BDE1B2                                                JSR  CHK_REL_THRSH
C261 BDE254                                                JSR  MASK_FSW           A = FSW Byte (with "disables" taken into account)
C264 2BC3                                                  BMI  CHK_NEWCHAN_NOTE   If Sustain active, branch
C266 BDE1C4                                                JSR  ACTIVATE_REL       else, sustain wasn't active - activate release 
C269 20BE                                                  BRA  CHK_NEWCHAN_NOTE

C26B 3384                              ALG1_GOTONXTCHAN    LEAU 0,X                If current note <> chan note, U = base of 'next' channel
C26D 20BA                                                  BRA  CHK_NEWCHAN_NOTE   Go check 'new' current channel 

C26F 3570                              A1_CHN_NOT_ASGND    PULS X,Y,U
C271 A6A85D                                                LDA  $5D,Y
C274 2606                                                  BNE  L4
C276 860A                                                  LDA  #$A
C278 A7A85D                                                STA  $5D,Y
C27B 39                                L5                  RTS  

C27C 4A                                L4                  DECA 
C27D A7A85D                                                STA  $5D,Y
C280 26F9                                                  BNE  L5
C282 3476                                                  PSHS U,Y,X,B,A
C284 A6A85F                                                LDA  $5F,Y              A = 0 if 8 channel mode, else 16 channel mode
C287 970D                                                  STA  16_CHNL_MODE
C289 CCC100                                                LDD  #$C100
C28C EDA862                                                STD  $62,Y
C28F EE22                                                  LDU  $2,Y               U = Address of where note/velocity data resides in memory
C291 2772                                                  BEQ  L6                 If no notes stored, branch
C293 BDE254                                                JSR  MASK_FSW           A = FSW Byte (with "disables" taken into account)
C296 8440                                                  ANDA #$40 '@
C298 A7E4                                                  STA  0,S
C29A AEA4                              L17                 LDX  0,Y
C29C 275A                                                  BEQ  L7
C29E ECC4                                                  LDD  0,U
C2A0 975C                                                  STA  CORR_NOTE
C2A2 D75E                                                  STB  PLAYED_VEL
C2A4 EC84                                                  LDD  0,X
C2A6 EDA4                                                  STD  0,Y
C2A8 1F20                              L8                  TFR  Y,D
C2AA 10AEA4                                                LDY  0,Y
C2AD 26F9                                                  BNE  L8
C2AF 10AF84                                                STY  0,X
C2B2 1F02                                                  TFR  D,Y
C2B4 AFA4                                                  STX  0,Y
C2B6 10AE64                                                LDY  $4,S
C2B9 6F06                                                  CLR  $6,X               Indicate channel should be sounding (note depressed)
C2BB BDDFA0                                                JSR  CALC_VEL_PRES
C2BE A6A85E                                                LDA  $5E,Y
C2C1 2614                                                  BNE  L9
C2C3 A6E4                                                  LDA  0,S
C2C5 2605                                                  BNE  L10
C2C7 BDDFE8                                                JSR  L11
C2CA 2006                                                  BRA  L12

C2CC E6A85C                            L10                 LDB  $5C,Y              B = Number of notes in current sequence of notes
C2CF BDE003                                                JSR  L13
C2D2 BDE0C5                            L12                 JSR  START_NOTE_ENV
C2D5 2017                                                  BRA  L14

C2D7 A608                              L9                  LDA  $8,X               A = Note played by & stored in channel
C2D9 A7A85C                                                STA  $5C,Y
C2DC A6E4                                                  LDA  0,S
C2DE 2605                                                  BNE  L15
C2E0 BDDFE8                                                JSR  L11
C2E3 2003                                                  BRA  L16

C2E5 BDE034                            L15                 JSR  STORE_NOTE2CHAN
C2E8 BDE0AD                            L16                 JSR  RESTRT_NOTE_ENV
C2EB 6AA85E                                                DEC  $5E,Y
C2EE BDE057                            L14                 JSR  DO_SWEEP_SETUP
C2F1 BDE1E1                                                JSR  PUT_S_H_TO_BRD
C2F4 EE42                                                  LDU  2,U    $2
C2F6 26A2                                                  BNE  L17
C2F8 EE22                              L7                  LDU  $2,Y               U = Address of where note/velocity data resides in memory 
C2FA BDD8F9                                                JSR  GETNODEFROMHEAP
C2FD CE0000                                                LDU  #$0
C300 EF22                                                  STU  $2,Y
C302 6FA85E                                                CLR  $5E,Y
C305 35F6                              L6                  PULS A,B,X,Y,U,PC

C307 BDE282                                                JSR  FSW2_DESERT_OKCHK  FSW 2 Deassert Hndlr for Kybd Alg 1 - Pitch Ordered Poly - Unlatch
C30A 39                                                    RTS  

C30B BDE296                                                JSR  FSW2_ASSERT_OKCHK  FSW 2 Assert Handler for Kybd Alg 1,10,11,12,13,14,15
C30E 39                                                    RTS  

C30F BDE241                                                JSR  CHK_NGATE          Kybd Alg 2 (Chord Buffer) Attack Handler
C312 3460                                                  PSHS U,Y                Save U and Y values
C314 A6A85C                                                LDA  $5C,Y              A = Number of notes in current sequence of notes
C317 260A                                                  BNE  L18                If there are current notes, branch
C319 EE22                                                  LDU  $2,Y               else, no current notes, U = Adr of where note/vel data in memory
C31B BDD8F9                                                JSR  GETNODEFROMHEAP    Tack on a new node to stack
C31E CE0000                                                LDU  #$0                U = $0
C321 EF22                                                  STU  $2,Y               Reset 'Note/Sequencer' address in instrument
C323 BDE316                            L18                 JSR  ORDER_STK_DESCND   Order the stack notes
C326 ABA85C                                                ADDA $5C,Y              If stack could be reorg, add one to number of notes
C329 A7A85C                                                STA  $5C,Y              Store 'new' number of notes
C32C 35E0                                                  PULS Y,U,PC             Exit

C32E BDE33E                                                JSR  L19                Kybd Alg 2 (Chord Buffer) Release Handler
C331 40                                                    NEGA 
C332 ABA85C                                                ADDA $5C,Y
C335 A7A85C                                                STA  $5C,Y
C338 39                                                    RTS  

C339 BDE270                                                JSR  FSW1_ASSERT_OKCHK  FSW 1 Assert Handler for Kybd Alg 2
C33C 3410                                                  PSHS X
C33E A6A85F                                                LDA  $5F,Y              A = 0 if 8 channel mode, else 16 channel mode
C341 970D                                                  STA  16_CHNL_MODE
C343 AEA4                                                  LDX  0,Y
C345 270B                              L21                 BEQ  L20
C347 A606                                                  LDA  $6,X               A = indication if note is depressed (0 = depressed, $FF = up)
C349 2C07                                                  BGE  L20
C34B BDE195                                                JSR  ACTIVATE_ATK
C34E AE84                                                  LDX  0,X
C350 20F3                                                  BRA  L21

C352 3590                              L20                 PULS X,PC

C354 BDE25E                                                JSR  FSW1_DESERT_OKCHK  FSW 1 Deassert Handler for Kybd Alg 2
C357 3410                                                  PSHS X
C359 A6A85F                                                LDA  $5F,Y              A = 0 if 8 channel mode, else 16 channel mode
C35C 970D                                                  STA  16_CHNL_MODE
C35E AEA4                                                  LDX  0,Y
C360 27F0                              L22                 BEQ  L20
C362 A606                                                  LDA  $6,X               A = indication if note is depressed (0 = depressed, $FF = up)
C364 2CEC                                                  BGE  L20
C366 BDE1C4                                                JSR  ACTIVATE_REL
C369 AE84                                                  LDX  0,X
C36B 20F3                                                  BRA  L22

C36D BDE296                                                JSR  FSW2_ASSERT_OKCHK  FSW 2 Assert Handler for Kybd Alg 3
C370 3450                                                  PSHS U,X
C372 A6A85F                                                LDA  $5F,Y              A = 0 if 8 channel mode, else 16 channel mode
C375 970D                                                  STA  16_CHNL_MODE
C377 EE22                                                  LDU  $2,Y
C379 2733                              L26                 BEQ  L23
C37B AEA4                                                  LDX  0,Y
C37D 272F                                                  BEQ  L23
C37F A606                                                  LDA  $6,X               A = indication if note is depressed (0 = depressed, $FF = up)
C381 2C2B                                                  BGE  L23
C383 ECC4                                                  LDD  0,U
C385 975C                                                  STA  CORR_NOTE
C387 D75E                                                  STB  PLAYED_VEL
C389 3410                              L25                 PSHS X
C38B AE84                                                  LDX  0,X
C38D 2708                                                  BEQ  L24
C38F A606                                                  LDA  $6,X               A = indication if note is depressed (0 = depressed, $FF = up)
C391 2C04                                                  BGE  L24
C393 3262                                                  LEAS $2,S
C395 20F2                                                  BRA  L25

C397 3510                              L24                 PULS X
C399 6C06                                                  INC  $6,X
C39B BDDFA0                                                JSR  CALC_VEL_PRES
C39E BDE034                                                JSR  STORE_NOTE2CHAN
C3A1 BDE057                                                JSR  DO_SWEEP_SETUP
C3A4 BDE0AD                                                JSR  RESTRT_NOTE_ENV
C3A7 BDE1E1                                                JSR  PUT_S_H_TO_BRD
C3AA EE42                                                  LDU  2,U    $2
C3AC 20CB                                                  BRA  L26

C3AE 35D0                              L23                 PULS X,U,PC

C3B0 BDE282                                                JSR  FSW2_DESERT_OKCHK  FSW 2 Deassert Handler for Kybd Alg 2
C3B3 3410                                                  PSHS X
C3B5 A6A85F                                                LDA  $5F,Y              A = 0 if 8 channel mode, else 16 channel mode
C3B8 970D                                                  STA  16_CHNL_MODE
C3BA BDE254                                                JSR  MASK_FSW           A = FSW Byte (with "disables" taken into account)
C3BD 970C                                                  STA  SWEEP_INDEX
C3BF AEA4                                                  LDX  0,Y
C3C1 278F                              L28                 BEQ  L20
C3C3 A606                                                  LDA  $6,X               A = indication if note is depressed (0 = depressed, $FF = up)
C3C5 2609                                                  BNE  L27
C3C7 6A06                                                  DEC  $6,X
C3C9 960C                                                  LDA  SWEEP_INDEX
C3CB 2B03                                                  BMI  L27
C3CD BDE1C4                                                JSR  ACTIVATE_REL
C3D0 AE84                              L27                 LDX  0,X
C3D2 20ED                                                  BRA  L28

C3D4 BDE241                                                JSR  CHK_NGATE          Kybd Alg 3 (All Chan - Poly) Attack Handler - check if note gated out
C3D7 3446                                                  PSHS U,B,A              If we're here, note not gated out
C3D9 ECA4                                                  LDD  0,Y                D = addr of current/next channel for inst. Y
C3DB 2711                                                  BEQ  KYBD_ALG3_EXIT     If no current/next channel, then no attack even (exit)
C3DD BDE254                                                JSR  MASK_FSW           A = FSW Byte (with "disables" taken into account)
C3E0 48                                                    ASLA                    Shift FSW2 result into top byte
C3E1 2B0B                                                  BMI  KYBD_ALG3_EXIT     Branch if left FSW asserted (i.e., 'latch' note)
C3E3 BDE316                                                JSR  ORDER_STK_DESCND   Else, no latch - order new note in stack
C3E6 2706                                                  BEQ  KYBD_ALG3_EXIT     Exit if note couldn't be added to stack properly
C3E8 CCC45C                                                LDD  #$C45C             else, note was added - D=$C45C (handler address)
C3EB EDA862                                                STD  $62,Y              Store 'arpeg' address to instrument
C3EE 35C6                              KYBD_ALG3_EXIT      PULS A,B,U,PC

C3F0 3476                                                  PSHS U,Y,X,B,A          Kybd Alg 3 (All Chan - Poly) Release Handler
C3F2 BDE254                                                JSR  MASK_FSW           A = FSW Byte (with "disables" taken into account)
C3F5 8540                                                  BITA #$40 '@            Check 'latch' bit
C3F7 2643                                                  BNE  ALG_3_REL_EXIT     If 'latch' active, then branch (exit)
C3F9 A7E4                                                  STA  0,S                Store a copy of MASK_FSW on the stack
C3FB A6A85F                                                LDA  $5F,Y              A = 0 if 8 channel mode, else 16 channel mode
C3FE 970D                                                  STA  16_CHNL_MODE       Update system '16-channel' setting
C400 BDE2E6                                                JSR  TOP_BOT_RELEASE    Drop note from stack
C403 AEA4                              ALG3_CHKNEWCHAN     LDX  0,Y                X = address of channel assigned to instrument
C405 2735                                                  BEQ  ALG_3_REL_EXIT     If no channel assigned, exit
C407 A606                                                  LDA  $6,X               A = indication if note is depressed (0 = depressed, $FF = up)
C409 2D31                                                  BLT  ALG_3_REL_EXIT     branch if key not pressed/sustained
C40B A608                                                  LDA  $8,X               else, A = Note played by & stored in channel
C40D 915C                                                  CMPA CORR_NOTE          compare channel note with system note
C40F 2627                                                  BNE  ALG3_GOTONXTCHAN   If channel note <> system note, branch
C411 EC84                                                  LDD  0,X                else, D = address of 'next' channel
C413 EDA4                                                  STD  0,Y                store 'next' channel in instrument as 'current/next' channel
C415 33A4                                                  LEAU 0,Y                U = base address of instrument Y
C417 ECC4                              L30                 LDD  0,U                D = address of 'current/next' channel from instrument
C419 2704                                                  BEQ  L29                If there is no 'next/current' channel, branch
C41B 1F03                                                  TFR  D,U                Else, D->U 
C41D 20F8                                                  BRA  L30

C41F ED84                              L29                 STD  0,X
C421 AFC4                                                  STX  0,U
C423 33A4                                                  LEAU 0,Y
C425 10AE64                                                LDY  $4,S
C428 BDE1B2                                                JSR  CHK_REL_THRSH
C42B A6E4                                                  LDA  0,S
C42D 2B03                                                  BMI  L31
C42F BDE1C4                                                JSR  ACTIVATE_REL
C432 31C4                              L31                 LEAY 0,U
C434 6A06                                                  DEC  $6,X
C436 20CB                                                  BRA  ALG3_CHKNEWCHAN

C438 3184                              ALG3_GOTONXTCHAN    LEAY 0,X
C43A 20C7                                                  BRA  ALG3_CHKNEWCHAN

C43C 35F6                              ALG_3_REL_EXIT      PULS A,B,X,Y,U,PC       Restore vals and RTS 

C43E ECC4                              ALG3_NOTE_NOT_DEPR  LDD  0,U
C440 975C                                                  STA  CORR_NOTE
C442 D75E                                                  STB  PLAYED_VEL
C444 EE42                                                  LDU  2,U    $2
C446 6F06                                                  CLR  $6,X
C448 A6A85F                                                LDA  $5F,Y              A = 0 if 8 channel mode, else 16 channel mode
C44B 970D                                                  STA  16_CHNL_MODE
C44D BDDFA0                                                JSR  CALC_VEL_PRES
C450 BDE034                                                JSR  STORE_NOTE2CHAN
C453 BDE057                                                JSR  DO_SWEEP_SETUP
C456 BDE0AD                                                JSR  RESTRT_NOTE_ENV
C459 7EE1E1                                                JMP  PUT_S_H_TO_BRD

C45C A6A85D                                                LDA  $5D,Y              'Arpeg' handler (offset $62) for Kybd Alg. 3 (All Chan. Poly Atk)
C45F 2606                                                  BNE  ALG3_NOTPLAYNG_YET Branch if first note not yet playing/assigned.
C461 860A                                                  LDA  #$A                Else, first note is playing/assigned, A = $A
C463 A7A85D                                                STA  $5D,Y              Update value in channel and return
C466 39                                ALG3_EXIT_2         RTS                     Indicate that channel should be sounding

C467 6AA85D                            ALG3_NOTPLAYNG_YET  DEC  $5D,Y              Subtract one from 'seq. note. assigned'
C46A 26FA                                                  BNE  ALG3_EXIT_2        If we're still not zero, jump
C46C 3476                                                  PSHS U,Y,X,B,A          Else, $5D used to equal 1, save variables
C46E CCC100                                                LDD  #$C100             Reset 'arpeg' handler to default handler
C471 EDA862                                                STD  $62,Y              Update value in channel definition
C474 EE22                                                  LDU  $2,Y               U = Address of where note/velocity data resides in memory
C476 2779                                                  BEQ  POP_EXIT           If no note data for this instrument, exit (and restore vals)
C478 AEA4                                                  LDX  0,Y                Else, there is note Data - X = channel address for this inst.
C47A 2768                                                  BEQ  ALG3_NO_CHANL_ASGN Branch if no channel assigned
C47C A606                                                  LDA  $6,X               A = indication if note is depressed (0 = depressed, $FF = up)
C47E 2710                                                  BEQ  ALG3_NOTE_DEPRSD   Branch if note is depressed
C480 8DBC                              ALG3_ARPEG_LOOP     BSR  ALG3_NOTE_NOT_DEPR Else, note is not depressed - go 'depress' note
C482 AE84                                                  LDX  0,X                X = Address of next channel assigned to instr.
C484 275E                                                  BEQ  ALG3_NO_CHANL_ASGN
C486 11830000                                              CMPU #$0                See if we still have note/stack data
C48A 26F4                                                  BNE  ALG3_ARPEG_LOOP    If we do, branch
C48C EE22                                                  LDU  $2,Y               U = Address of where note/velocity data resides in memory
C48E 20F0                                                  BRA  ALG3_ARPEG_LOOP    Go back and do loop again.

C490 6FE4                              ALG3_NOTE_DEPRSD    CLR  0,S
C492 11830000                          L38                 CMPU #$0
C496 260E                                                  BNE  L32
C498 A606                                                  LDA  $6,X               A = indication if note is depressed (0 = depressed, $FF = up)
C49A 2648                                                  BNE  ALG3_NO_CHANL_ASGN
C49C A6E4                                                  LDA  0,S
C49E 2706                                                  BEQ  L32
C4A0 EE64                                                  LDU  $4,S
C4A2 EE42                                                  LDU  2,U    $2
C4A4 6FE4                                                  CLR  0,S
C4A6 11830000                          L32                 CMPU #$0
C4AA 2724                                                  BEQ  L33
C4AC A6E4                                                  LDA  0,S
C4AE 2606                                                  BNE  L34
C4B0 A6C4                                                  LDA  0,U
C4B2 A108                                                  CMPA $8,X               A = Note played by & stored in channel
C4B4 2F1A                                                  BLE  L33
C4B6 3420                              L34                 PSHS Y
C4B8 EC84                              L36                 LDD  0,X
C4BA 2706                                                  BEQ  L35
C4BC 3184                                                  LEAY 0,X
C4BE 1F01                                                  TFR  D,X
C4C0 20F6                                                  BRA  L36

C4C2 EDA4                              L35                 STD  0,Y
C4C4 ECF4                                                  LDD  [0,S]
C4C6 ED84                                                  STD  0,X
C4C8 AFF1                                                  STX  [,S++]
C4CA 10AE64                                                LDY  $4,S
C4CD BDC43E                                                JSR  ALG3_NOTE_NOT_DEPR
C4D0 3184                              L33                 LEAY 0,X
C4D2 AE84                                                  LDX  0,X
C4D4 270E                                                  BEQ  ALG3_NO_CHANL_ASGN
C4D6 A606                                                  LDA  $6,X               A = indication if note is depressed (0 = depressed, $FF = up)
C4D8 2D06                                                  BLT  L37
C4DA A628                                                  LDA  $8,Y
C4DC A108                                                  CMPA $8,X               A = Note played by & stored in channel
C4DE 2EB2                                                  BGT  L38
C4E0 6CE4                              L37                 INC  0,S
C4E2 20AE                                                  BRA  L38

C4E4 10AE64                            ALG3_NO_CHANL_ASGN  LDY  $4,S
C4E7 EE22                                                  LDU  $2,Y               U = Address of where note/velocity data resides in memory
C4E9 BDD8F9                                                JSR  GETNODEFROMHEAP
C4EC CE0000                                                LDU  #$0
C4EF EF22                                                  STU  $2,Y
C4F1 35F6                              POP_EXIT            PULS A,B,X,Y,U,PC

C4F3 BDE296                                                JSR  FSW2_ASSERT_OKCHK
C4F6 3450                                                  PSHS U,X
C4F8 30A4                                                  LEAX 0,Y
C4FA AE84                              L40                 LDX  0,X
C4FC 2708                                                  BEQ  L39
C4FE A606                                                  LDA  $6,X               A = indication if note is depressed (0 = depressed, $FF = up)
C500 26F8                                                  BNE  L40
C502 6C06                                                  INC  $6,X
C504 20F4                                                  BRA  L40

C506 EE22                              L39                 LDU  $2,Y               U = Address of where note/velocity data resides in memory
C508 BDD8F9                                                JSR  GETNODEFROMHEAP
C50B CE0000                                                LDU  #$0
C50E EF22                                                  STU  $2,Y
C510 CEC100                                                LDU  #$C100
C513 EFA862                                                STU  $62,Y
C516 6FA85D                                                CLR  $5D,Y
C519 35D0                                                  PULS X,U,PC

C51B BDE282                                                JSR  FSW2_DESERT_OKCHK  FSW 2 Deassert Handler for Kybd Alg 3
C51E 3410                                                  PSHS X
C520 30A4                                                  LEAX 0,Y
C522 AE84                              L42                 LDX  0,X
C524 2709                                                  BEQ  L41
C526 86FF                                                  LDA  #$FF               A = $FF
C528 A706                                                  STA  $6,X               Indicate that channel should not be sounding (store $FF)
C52A BDE1C4                                                JSR  ACTIVATE_REL
C52D 20F3                                                  BRA  L42

C52F 3590                              L41                 PULS X,PC

C531 BDE241                                                JSR  CHK_NGATE          Kybd Alg 4 (All Chan - Mono) Attack Handler
C534 3410                                                  PSHS X
C536 BDE254                                                JSR  MASK_FSW           A = FSW Byte (with "disables" taken into account)
C539 48                                                    ASLA                    Shift MASK_FSW result (i.e., shift 'latch') into top bit spot 
C53A 2B1E                                                  BMI  EXIT_ALG_4_ATK     Branch if 'latch' active (i.e., no new notes can be added - exit) 
C53C AEA4                                                  LDX  0,Y                else, X = Address of 1st Channel played by Chosen Inst.
C53E 271A                                                  BEQ  EXIT_ALG_4_ATK     If No channels assigned to the instrument, exit
C540 A6A85F                                                LDA  $5F,Y              Else, A = 0 if 8 channel mode, else 16 channel mode
C543 970D                                                  STA  16_CHNL_MODE       Store Instrument channel mode to Channel Mode Variable
C545 6F06                              ALG_4_MORE_CHANS    CLR  $6,X               Indicate that channel should be sounding
C547 BDDFA0                                                JSR  CALC_VEL_PRES
C54A BDE034                                                JSR  STORE_NOTE2CHAN
C54D BDE057                                                JSR  DO_SWEEP_SETUP
C550 BDE0AD                                                JSR  RESTRT_NOTE_ENV    Start Note Envelope
C553 BDE1E1                                                JSR  PUT_S_H_TO_BRD     Put S&H Values to board
C556 AE84                                                  LDX  0,X                See if there any more channels assigned to this inst (next chan).
C558 26EB                                                  BNE  ALG_4_MORE_CHANS   If there are, branch and do them - else, exit
C55A 3590                              EXIT_ALG_4_ATK      PULS X,PC

C55C 3410                                                  PSHS X                  Kybd Alg 4 (All Chan - Mono) Release Handler
C55E BDE254                                                JSR  MASK_FSW           A = FSW Byte (with "disables" taken into account)
C561 970C                                                  STA  SWEEP_INDEX        Store copy of result of MASK_FSW operation.
C563 48                                                    ASLA                    Shift FSW 2 (latch) FSW into top bit spot
C564 2B1F                                                  BMI  EXIT_ALG_4_REL     If latch active, no action required - exit 
C566 AEA4                                                  LDX  0,Y                else, X = Address of next/current channel 
C568 271B                                                  BEQ  EXIT_ALG_4_REL     If not channels listed, exit - else work on channels
C56A A608                                                  LDA  $8,X               A = Corrected Note (being played by this channel)
C56C 915C                                                  CMPA CORR_NOTE          Compare channel's note w/currently playing system note
C56E 2615                                                  BNE  EXIT_ALG_4_REL     If they're not equal, exit (don't do anything)
C570 A6A85F                                                LDA  $5F,Y              Else, check on the channel mode (If A =0, 8 chan - else 16)
C573 970D                                                  STA  16_CHNL_MODE       Store the current channel mode to system memory
C575 BDE1B2                            ALG4_CHAN_LOOP      JSR  CHK_REL_THRSH      Set release threshhold indication in channel def'n
C578 6A06                                                  DEC  $6,X               Set 'mute' status of channel
C57A 960C                                                  LDA  SWEEP_INDEX        A = result from original MASK_FSW call
C57C 2B03                                                  BMI  ALG4_REL_NEXT_CHAN If 'sustain' was active, no work on this chan - go check next one
C57E BDE1C4                                                JSR  ACTIVATE_REL       Else, release is to occur - ctivate Env1/Env2 release handlers
C581 AE84                              ALG4_REL_NEXT_CHAN  LDX  0,X                X = Addr. of next channel/board assigned
C583 26F0                                                  BNE  ALG4_CHAN_LOOP     Branch if there is a 'next' board
C585 3590                              EXIT_ALG_4_REL      PULS X,PC

C587 BDE241                            KYBD_ALG_5_ATK      JSR  CHK_NGATE          Kybd Alg 5 (Last Note, ST) Attack Handler - check for gated notes
C58A BDE254                                                JSR  MASK_FSW           A = FSW Byte (with "disables" taken into account)
C58D 48                                                    ASLA                    Shift 'latch' bit into top of A 
C58E 2A01                                                  BPL  SNGL_TRIG          Branch if 'latch' not active
C590 39                                                    RTS                     else FSW2 (left) was asserted (i.e., 'latch') - exit

C591 3410                              SNGL_TRIG           PSHS X
C593 AEA4                                                  LDX  0,Y                X = addr. of channel assigned to instrument
C595 271E                                                  BEQ  DONT_SND_SNGL      Exit if no channel assigned
C597 A606                                                  LDA  $6,X               Check if note is down (0 = should already be sounding, $FF = up)
C599 2E1A                                                  BGT  DONT_SND_SNGL      If multiple voices sounding, exit
C59B A6A85F                                                LDA  $5F,Y              A = 0 if 8 channel mode, else 16 channel mode
C59E 970D                                                  STA  16_CHNL_MODE       Update system '16-channel' mode with channel value
C5A0 A606                                                  LDA  $6,X               A = indication if note is depressed (0 = depressed, $FF = up)
C5A2 2C08                                                  BGE  SNGL_REPRESS       Note already sounding, only update velocity
C5A4 6F06                                                  CLR  $6,X               else wasn't a note sounding - Indicate channel should be sounding
C5A6 BDE057                                                JSR  DO_SWEEP_SETUP     retrigger sweep, as appropriate
C5A9 BDE0AD                                                JSR  RESTRT_NOTE_ENV    start up note envelope
C5AC BDDFA0                            SNGL_REPRESS        JSR  CALC_VEL_PRES      set up threshholds
C5AF BDE034                                                JSR  STORE_NOTE2CHAN    cal. notes, etc. (to be played)
C5B2 BDE1E1                                                JSR  PUT_S_H_TO_BRD     put S&H data to DAC, etc. (play note)
C5B5 3590                              DONT_SND_SNGL       PULS X,PC

C5B7 BDE241                                                JSR  CHK_NGATE          Kybd Alg 6 (Last Note, MT) Attack Handler
C5BA BDE254                                                JSR  MASK_FSW           A = FSW Byte (with "disables" taken into account)
C5BD 48                                                    ASLA                    Shift 'latch' bit into top of A
C5BE 2A01                                                  BPL  MTPL_TRIG          Branch if 'latch' not active
C5C0 39                                                    RTS                     Else, latch was active (no action required in handler/exit)

C5C1 3410                              MTPL_TRIG           PSHS X
C5C3 AEA4                                                  LDX  0,Y                X = addr. of channel assigned to instrument
C5C5 271A                                                  BEQ  DONT_SND_MTPL      Exit if no channel assigned
C5C7 A606                                                  LDA  $6,X               A = indication if note is depressed (0 = depressed, $FF = up)
C5C9 2E16                                                  BGT  DONT_SND_MTPL      If multiple voices sounding, exit
C5CB A6A85F                                                LDA  $5F,Y              A = 0 if 8 channel mode, else 16 channel mode
C5CE 970D                                                  STA  16_CHNL_MODE       Update system '16-channel' mode with channel value
C5D0 6F06                                                  CLR  $6,X               Indicate that channel should be sounding
C5D2 BDE057                                                JSR  DO_SWEEP_SETUP     retrigger sweep, as appropriate
C5D5 BDE0AD                                                JSR  RESTRT_NOTE_ENV    start up/set note envelopes
C5D8 BDDFA0                                                JSR  CALC_VEL_PRES      set up threshholds
C5DB BDE034                                                JSR  STORE_NOTE2CHAN    cal. notes, etc. (to be played)
C5DE BDE1E1                                                JSR  PUT_S_H_TO_BRD     put S&H data to DAC, etc. (play note) 
C5E1 3590                              DONT_SND_MTPL       PULS X,PC

C5E3 BDE254                            LST_NOTE_REL        JSR  MASK_FSW           Kybd Alg 5 & 6 (Last Note) Release Handler
C5E6 970C                                                  STA  SWEEP_INDEX        Store result of 'MASK_FSW' function
C5E8 48                                                    ASLA                    Shift 'latch' bit into top of A
C5E9 2A01                                                  BPL  ALG_5_6_REL_MAIN   If latch _not_ active, continue with release (branch)
C5EB 39                                                    RTS                     Else, latch _was_ active (no release work required - exit)

C5EC 3410                              ALG_5_6_REL_MAIN    PSHS X                  Save current channel address
C5EE AEA4                                                  LDX  0,Y                X = address of 'next'/'current' channel assigned to instr.
C5F0 271B                                                  BEQ  ALG_5_6_REL_EXIT
C5F2 A606                                                  LDA  $6,X               A = indication if note is depressed (0 = depressed, $FF = up)
C5F4 2617                                                  BNE  ALG_5_6_REL_EXIT   Exit if channel is not sounding
C5F6 A608                                                  LDA  $8,X               A = Note played by & stored in channel
C5F8 915C                                                  CMPA CORR_NOTE          See if 'current' note is the same as note stored in the channel
C5FA 2611                                                  BNE  ALG_5_6_REL_EXIT   If notes do not match, exit
C5FC A6A85F                                                LDA  $5F,Y              else, it is the same note - continue (A = 0 if 8 chan, else 16 chan mode)
C5FF 970D                                                  STA  16_CHNL_MODE       Store channel value of '16-channel mode' to system variable
C601 6A06                                                  DEC  $6,X               Indicate that board should be muted
C603 BDE1B2                                                JSR  CHK_REL_THRSH      Set Release threshhold info on channel card
C606 960C                                                  LDA  SWEEP_INDEX        A = original MASK_FSW result
C608 2B03                                                  BMI  ALG_5_6_REL_EXIT   If 'sustain' was originally asserted, exit
C60A BDE1C4                                                JSR  ACTIVATE_REL       Else, note can be released - go do release work
C60D 3590                              ALG_5_6_REL_EXIT    PULS X,PC

C60F BDE270                                                JSR  FSW1_ASSERT_OKCHK  FSW 1 Assert Handler for Kybd Alg 5, 6, 7, 8, 9
C612 3410                                                  PSHS X                  we're here if FSW1 is 'asserted' and and FSW1 not disabled
C614 AEA4                                                  LDX  0,Y                X = address of channel assigned to instrument
C616 270C                                                  BEQ  FSW1A_56789_EXIT   If no channel assigned, exit
C618 A606                                                  LDA  $6,X               A = indication if note is depressed (0 = depressed, $FF = up) 
C61A 2C08                                                  BGE  FSW1A_56789_EXIT
C61C A6A85F                                                LDA  $5F,Y              A = 0 if 8 channel mode, else 16 channel mode
C61F 970D                                                  STA  16_CHNL_MODE       Store 'channel' 16-channel mode to system
C621 BDE195                                                JSR  ACTIVATE_ATK       Allow envelopes to start up channel (i.e., no more sustain)
C624 3590                              FSW1A_56789_EXIT    PULS X,PC

C626 BDE25E                                                JSR  FSW1_DESERT_OKCHK  FSW 1 Deassert Handler for Kybd Alg 5, 6, 7, 8, 9
C629 3410                                                  PSHS X                  we're here if FSW1 is 'deasserted' and FSW1 not disabled
C62B AEA4                                                  LDX  0,Y                X = address of channel assigned to instrument
C62D 270C                                                  BEQ  FSW1D_56789_EXIT   If no channel assigned, exit
C62F A606                                                  LDA  $6,X               A = indication if note is depressed (0 = depressed, $FF = up)
C631 2C08                                                  BGE  FSW1D_56789_EXIT
C633 A6A85F                                                LDA  $5F,Y              A = 0 if 8 channel mode, else 16 channel mode
C636 970D                                                  STA  16_CHNL_MODE       Store 'channel' 16-channel mode to system
C638 BDE1C4                                                JSR  ACTIVATE_REL       Allow releases to continue on channel (i.e., no more sustain)
C63B 3590                              FSW1D_56789_EXIT    PULS X,PC

C63D BDE296                                                JSR  FSW2_ASSERT_OKCHK  FSW 2 Assert Handler for Kybd Alg 5, 6, 7
C640 3410                              L43                 PSHS X                  w're here if FSW1 is 'asserted' and FSW2 not disabled
C642 AEA4                                                  LDX  0,Y                X = address of channel for inst. Y
C644 2706                                                  BEQ  FSW2A_567_EXIT     If no channel assigned, exit
C646 A606                                                  LDA  $6,X               Else check if note is down (A=0, depressed, =$FF  up)
C648 2602                                                  BNE  FSW2A_567_EXIT     Branch if no key depressed
C64A 6C06                                                  INC  $6,X               Tell Channel it should be sounding
C64C 3590                              FSW2A_567_EXIT      PULS X,PC               Exit

C64E BDE282                                                JSR  FSW2_DESERT_OKCHK  FSW 2 Deassert Handler for Kybd Alg 5, 6, 7, 8, 9
C651 3410                                                  PSHS X                  we're here if FSW2 is 'deasserted' and FSW2 not disabled
C653 AEA4                                                  LDX  0,Y                X = address of channel for Inst. Y
C655 270E                                                  BEQ  FSW2D_56789_EXIT   If no channel assigned, exit
C657 A606                                                  LDA  $6,X               A = indication if note is depressed (0 = depressed, $FF = up)
C659 2F0A                                                  BLE  FSW2D_56789_EXIT
C65B A6A85F                                                LDA  $5F,Y              A = 0 if 8 channel mode, else 16 channel mode
C65E 970D                                                  STA  16_CHNL_MODE
C660 6006                                                  NEG  $6,X               Indicate that channel should not be sounding
C662 BDE1C4                                                JSR  ACTIVATE_REL
C665 3590                              FSW2D_56789_EXIT    PULS X,PC

C667 BDE241                                                JSR  CHK_NGATE          Kybd Alg 7 (First Note) - Attack Handler
C66A A6A85C                                                LDA  $5C,Y              A = Number of notes in current sequence of notes
C66D 4C                                                    INCA                    Increment num of notes played by one
C66E A7A85C                                                STA  $5C,Y              Store updated number of notes to instrument
C671 4A                                                    DECA                    Restore original value of 'A'
C672 1027FF11                                              LBEQ KYBD_ALG_5_ATK     If only 1 note playing (i.e., this is first note), branch
C676 39                                                    RTS                     Else no action req'd - exit

C677 6AA85C                                                DEC  $5C,Y              Kybd Alg 7 (First Note) - Release Handler
C67A 102AFF65                                              LBPL LST_NOTE_REL       If we're more +ve, more than 1 note was down - branch
C67E 6CA85C                                                INC  $5C,Y              Else restore orig num of notes
C681 7EC5E3                                                JMP  LST_NOTE_REL       Actually do release

C684 BDE241                                                JSR  CHK_NGATE          Kybd Alg 8 (Bottom Note) - Attack Handler
C687 CCE304                                                LDD  #$E304             D=address of handler to order notes w/lowest at beginning
C68A 3406                                                  PSHS B,A
C68C CCC6DA                                                LDD  #$C6DA
C68F 200B                                                  BRA  ALG89_ATK_BODY

C691 BDE241                                                JSR  CHK_NGATE          Kybd Alg 9 (Top Note) - Attack Handler
C694 CCE316                                                LDD  #$E316             D=address of handler to order notes w/highest at beginning
C697 3406                                                  PSHS B,A
C699 CCC6DD                                                LDD  #$C6DD
C69C 3406                              ALG89_ATK_BODY      PSHS B,A
C69E BDE254                                                JSR  MASK_FSW           A = FSW Byte (with "disables" taken into account)
C6A1 8540                                                  BITA #$40 '@            Check 'latch' bit
C6A3 2703                                                  BEQ  ALG89_ATK_CONT     No FSW items to worry about - jump
C6A5 3264                                                  LEAS $4,S               Else latch active - set stack to arpeg handler
C6A7 39                                                    RTS                     Got ot arpeg handler

C6A8 3506                              ALG89_ATK_CONT      PULS A,B
C6AA 6DA85D                                                TST  $5D,Y
C6AD 2606                                                  BNE  ALG89_ATK_EXIT
C6AF EDA862                                                STD  $62,Y              Otherwise, store C6DD or C6DA to "arpeg" handler address
C6B2 ADB862                                                JSR  [$62,Y]            Jump to arpeg. handler
C6B5 6EF1                              ALG89_ATK_EXIT      JMP  [,S++]             jump and reorg. notes 

C6B7 BDE2E6                                                JSR  TOP_BOT_RELEASE    Kybd Alg 8 & 9 (Bot/Top Note) - Rel Hndlr (ret '1' if note found)
C6BA 7EC5E3                                                JMP  LST_NOTE_REL

C6BD BDE296                                                JSR  FSW2_ASSERT_OKCHK  FSW 2 Assert Handler for Kybd Alg 8, 9,
C6C0 3450                                                  PSHS U,X
C6C2 EE22                                                  LDU  $2,Y               U = Address of where note/velocity data resides in memory
C6C4 BDD8F9                                                JSR  GETNODEFROMHEAP
C6C7 CC0000                                                LDD  #$0                D = 0
C6CA ED22                                                  STD  $2,Y               Indicate to channel that there are no additional or 'next' note
C6CC A7A85D                                                STA  $5D,Y              Store "0" notes to sequencer data
C6CF CCC100                                                LDD  #$C100             Store C100 to 'Arpeg' handler
C6D2 EDA862                                                STD  $62,Y
C6D5 3550                                                  PULS X,U                Restore old values
C6D7 7EC640                                                JMP  L43

C6DA 4F                                                    CLRA                    A = 0 (jumped here for arpeg. if we had bottom note priority)
C6DB 2002                                                  BRA  L44                Always branch

C6DD 86FF                                                  LDA  #$FF               A = $FF (jumped here for arpeg. if we had top note priority)
C6DF 3402                              L44                 PSHS A                  Save a copy of "A"
C6E1 A6A85D                                                LDA  $5D,Y              New A = $5D Value (Seq/Arp Info)
C6E4 2607                                                  BNE  L45                If stored value <> 0, branch
C6E6 860A                                                  LDA  #$A                else, stored value did = 0, A = $A (10)
C6E8 A7A85D                                                STA  $5D,Y              Update new value
C6EB 3582                              L46                 PULS A,PC               Exit

C6ED 4A                                L45                 DECA                    A = A-1
C6EE A7A85D                                                STA  $5D,Y              Update 'arpeg/seq' info
C6F1 26F8                                                  BNE  L46                If we're not at 0, exit
C6F3 3502                                                  PULS A                  else, get a copy of A from stack
C6F5 3456                                                  PSHS U,X,B,A            save vals
C6F7 CCC100                                                LDD  #$C100             D = default 'return' location
C6FA EDA862                                                STD  $62,Y              Reset arpeg handler info
C6FD EE22                                                  LDU  $2,Y               U = address of where note/velocity data resides in memory
C6FF 2734                                                  BEQ  L47                If = 0, no note assigned - exit
C701 ECC4                                                  LDD  0,U                else, stored note/seq data
C703 975C                                                  STA  CORR_NOTE          Update Note info
C705 D75E                                                  STB  PLAYED_VEL
C707 BDD8F9                                                JSR  GETNODEFROMHEAP
C70A CE0000                                                LDU  #$0
C70D EF22                                                  STU  $2,Y
C70F AEA4                                                  LDX  0,Y
C711 2722                                                  BEQ  L47
C713 A606                                                  LDA  $6,X               A = indication if note is depressed (0 = depressed, $FF = up)
C715 2D08                                                  BLT  L48
C717 A608                                                  LDA  $8,X               A = Note played by & stored in channel
C719 905C                                                  SUBA CORR_NOTE
C71B A8E4                                                  EORA 0,S
C71D 2B16                                                  BMI  L47
C71F 6F06                              L48                 CLR  $6,X               Indicate that channel should be sounding
C721 A6A85F                                                LDA  $5F,Y              A = 0 if 8 channel mode, else 16 channel mode
C724 970D                                                  STA  16_CHNL_MODE
C726 BDDFA0                                                JSR  CALC_VEL_PRES
C729 BDE034                                                JSR  STORE_NOTE2CHAN
C72C BDE057                                                JSR  DO_SWEEP_SETUP
C72F BDE0AD                                                JSR  RESTRT_NOTE_ENV
C732 BDE1E1                                                JSR  PUT_S_H_TO_BRD
C735 35D6                              L47                 PULS A,B,X,U,PC

C737 CCE304                                                LDD  #$E304             Kybd Alg 10, 12 (Arp Up, Arp Up-Down) Attack Handler
C73A 2008                                                  BRA  ARP_ATTACK

C73C CCE316                                                LDD  #$E316             Kybd Alg 11, 13 (Arp Down, Arp Down-Up) Attack Handler
C73F 2003                                                  BRA  ARP_ATTACK

C741 CCE328                                                LDD  #$E328             Kybd Alg 14, 15 (Sequencer, Random) Attack Handler 
C744 BDE241                            ARP_ATTACK          JSR  CHK_NGATE
C747 3446                                                  PSHS U,B,A
C749 BDE254                                                JSR  MASK_FSW           A = FSW Byte (with "disables" taken into account)
C74C 48                                                    ASLA                    Shift FSW2 Info (latch) into sign spot (B7)
C74D 2A02                                                  BPL  PROCEED_W_ARP      If FSW2 disabled (or not asserted), branch
C74F 35C6                                                  PULS A,B,U,PC           else, latch active - no "attack" action (exit)

C751 EE22                              PROCEED_W_ARP       LDU  $2,Y               U = Addr where of note/vel data resides in memory (for this inst.)
C753 260F                                                  BNE  ADD_TO_NOTES       If U <> 0, then some notes already assigned - branch
C755 CCC82B                                                LDD  #$C82B             Else, this is the first note in the sequence D = $C82B
C758 EDA862                                                STD  $62,Y              Store handler address
C75B 6FA85D                                                CLR  $5D,Y              Put 0 to $5D in instrument (i.e., init ARP)
C75E BDC82B                                                JSR  L49
C761 6FA85C                                                CLR  $5C,Y              Reset number of notes in sequence
C764 ADF1                              ADD_TO_NOTES        JSR  [,S++]             Jump to subroutine for specific ARP mode (Ret=1 if success assigned)
C766 ABA85C                                                ADDA $5C,Y              Update number of notes in current sequence
C769 A7A85C                                                STA  $5C,Y              Store updated Number of Notes in current sequence
C76C 35C0                                                  PULS U,PC

C76E 3450                                                  PSHS U,X                Kybd Alg 10 - 15 Release Handler
C770 BDE254                                                JSR  MASK_FSW           A = FSW Byte (with "disables" taken into account)
C773 970C                                                  STA  SWEEP_INDEX
C775 48                                                    ASLA 
C776 2B23                                                  BMI  ALG10_15_EXIT
C778 BDE33E                                                JSR  L19
C77B 40                                                    NEGA 
C77C ABA85C                                                ADDA $5C,Y
C77F A7A85C                                                STA  $5C,Y
C782 2617                                                  BNE  ALG10_15_EXIT
C784 960C                                                  LDA  SWEEP_INDEX
C786 2B13                                                  BMI  ALG10_15_EXIT
C788 EE22                                                  LDU  $2,Y               U = Address of where note/velocity data resides in memory
C78A BDD8F9                                                JSR  GETNODEFROMHEAP
C78D CE0000                                                LDU  #$0
C790 EF22                                                  STU  $2,Y
C792 CCC100                                                LDD  #$C100
C795 EDA862                                                STD  $62,Y
C798 6FA85D                                                CLR  $5D,Y
C79B 35D0                              ALG10_15_EXIT       PULS X,U,PC

C79D CCC862                                                LDD  #$C862             Kybd Alg 10, 11, 14 (Single Direction) Arpeg. Handler
C7A0 2008                                                  BRA  MAIN_ARP_BODY      D = $C862 = Handler Address for 1 Direction Arp.

C7A2 CCC876                                                LDD  #$C876             Kybd Alg 12, 13 (Dual Direction) Arpeg. Handler
C7A5 2003                                                  BRA  MAIN_ARP_BODY      D = $C876 = Handler Address for 2 Direction Arp.

C7A7 CCC89B                                                LDD  #$C89B             Kybd Alg 15 (Random) Arpeg. Handler
C7AA 3446                              MAIN_ARP_BODY       PSHS U,B,A              D = $C89B = Hanlder Address for Random Arp.
C7AC ACA4                                                  CMPX 0,Y                Compare X & Y
C7AE 261A                                                  BNE  MAIN_ARP_EXIT      If they're different, exit
C7B0 EE22                                                  LDU  $2,Y               else, U = Addr of where note/vel data resides in memory
C7B2 2716                                                  BEQ  MAIN_ARP_EXIT      if no stack data, exit
C7B4 ADF4                                                  JSR  [0,S]              else, jump to subroutine defined for specific arp mode
C7B6 ECC4                                                  LDD  0,U                D = note:vel data plucked from stack 
C7B8 975C                                                  STA  CORR_NOTE          Update global/system note
C7BA D75E                                                  STB  PLAYED_VEL         Update global/system velocity
C7BC A6A85F                                                LDA  $5F,Y              A = 0 if 8 channel mode, else 16 channel mode
C7BF 970D                                                  STA  16_CHNL_MODE       Update system channel model
C7C1 BDDFA0                                                JSR  CALC_VEL_PRES
C7C4 BDE034                                                JSR  STORE_NOTE2CHAN
C7C7 BDE0AD                                                JSR  RESTRT_NOTE_ENV
C7CA 35C6                              MAIN_ARP_EXIT       PULS A,B,U,PC

C7CC ACA4                                                  CMPX 0,Y                Generic Arp Handler #2 - Use for all Arpeg. Kybd Alg's (10-15)
C7CE 2608                                                  BNE  GEN_ARP_EXIT       Branch if current channel is not same as the one assigned to inst.
C7D0 A6A85F                                                LDA  $5F,Y              A = 0 if 8 channel mode, else 16 channel mode
C7D3 970D                                                  STA  16_CHNL_MODE
C7D5 7EE1C4                                                JMP  ACTIVATE_REL

C7D8 39                                GEN_ARP_EXIT        RTS  

C7D9 BDE270                                                JSR  FSW1_ASSERT_OKCHK  FSW 1 Assert Handler for Kybd Alg 10, 11, 12, 13, 14, 15
C7DC 39                                                    RTS  

C7DD BDE25E                                                JSR  FSW1_DESERT_OKCHK  FSW 1 Deassert Handler for Kybd Alg 10, 11, 12, 13, 14, 15
C7E0 3450                                                  PSHS U,X
C7E2 BDE254                                                JSR  MASK_FSW           A = FSW Byte (with "disables" taken into account)
C7E5 48                                                    ASLA 
C7E6 2B1B                                                  BMI  L50
C7E8 A6A85C                                                LDA  $5C,Y              A = Number of notes in current sequence of notes
C7EB 2616                                                  BNE  L50
C7ED EE22                                                  LDU  $2,Y               U = Address of where note/velocity data resides in memory
C7EF BDD8F9                                                JSR  GETNODEFROMHEAP
C7F2 CE0000                                                LDU  #$0
C7F5 EF22                                                  STU  $2,Y
C7F7 AEA4                                                  LDX  0,Y
C7F9 2708                                                  BEQ  L50
C7FB A6A85F                                                LDA  $5F,Y              A = 0 if 8 channel mode, else 16 channel mode
C7FE 970D                                                  STA  16_CHNL_MODE
C800 BDE1C4                                                JSR  ACTIVATE_REL
C803 35D0                              L50                 PULS X,U,PC

C805 BDE282                                                JSR  FSW2_DESERT_OKCHK  FSW 2 Deassert Handler for Kybd Alg 10, 11, 12, 13, 14, 15
C808 3450                                                  PSHS U,X
C80A EE22                                                  LDU  $2,Y               U = Address of where note/velocity data resides in memory
C80C BDD8F9                                                JSR  GETNODEFROMHEAP
C80F CE0000                                                LDU  #$0
C812 EF22                                                  STU  $2,Y
C814 EFA85C                                                STU  $5C,Y
C817 CEC100                                                LDU  #$C100
C81A EFA862                                                STU  $62,Y
C81D AEA4                                                  LDX  0,Y
C81F 2708                                                  BEQ  L51
C821 A6A85F                                                LDA  $5F,Y              A = 0 if 8 channel mode, else 16 channel mode
C824 970D                                                  STA  16_CHNL_MODE
C826 BDE1C4                                                JSR  ACTIVATE_REL
C829 35D0                              L51                 PULS X,U,PC

C82B 3454                              L49                 PSHS U,X,B
C82D A6A85D                                                LDA  $5D,Y
C830 2613                                                  BNE  L52
C832 860A                                                  LDA  #$A                Else A = 0 (first note) - set A = $A
C834 A7A85D                                                STA  $5D,Y              Store updated value to instrument def'n
C837 AEA4                                                  LDX  0,Y                X = last channel assigned to inst. Y
C839 2725                                                  BEQ  L53                If no last channel, esit
C83B A6A85F                                                LDA  $5F,Y              else we did have a channel assigned (A=0 if 8 chan, else 16 chan)
C83E 970D                                                  STA  16_CHNL_MODE       Update system channel mode
C840 BDE1C4                                                JSR  ACTIVATE_REL       Activate/assign release handlers
C843 201B                                                  BRA  L53

C845 6AA85D                            L52                 DEC  $5D,Y
C848 2616                                                  BNE  L53
C84A CCC100                                                LDD  #$C100
C84D EDA862                                                STD  $62,Y
C850 6FA85E                                                CLR  $5E,Y
C853 AEA4                                                  LDX  0,Y
C855 2709                                                  BEQ  L53
C857 CCFFFF                                                LDD  #$FFFF
C85A ED881C                                                STD  $1C,X
C85D BDE1E1                                                JSR  PUT_S_H_TO_BRD     Put S&H to board
C860 35D4                              L53                 PULS B,X,U,PC

C862 A6A85E                                                LDA  $5E,Y              Arpeg. Handler for 1 Direction Arp. 
C865 4C                                                    INCA                    A = A + 1 (increment position of sweep)
C866 A7A85E                                                STA  $5E,Y              Store updated arp. position/index
C869 BDE355                                                JSR  L54                U = pointer to 'A'th arp entry
C86C 2607                                                  BNE  L55                If A <>0, we got to end of arp list before getting to specified item
C86E 8601                                                  LDA  #$1                A = 1 (i.e., went off end of end of arp stack) - start at beg.
C870 A7A85E                                                STA  $5E,Y              Update index value in mem 
C873 EE22                                                  LDU  $2,Y               U = Address of where note/velocity data resides in memory
C875 39                                L55                 RTS  

C876 EE22                                                  LDU  $2,Y               Arpeg. Handler for 2 Direction Arp. - U = Addr of note/vel data
C878 EC42                                                  LDD  2,U    $2          D = A:B, A = Stored Note Data, B = Stored Velocity Data
C87A 27F9                                                  BEQ  L55                If Note = 0/Vel = 0, at end of list - return
C87C A6A85E                                                LDA  $5E,Y              Else, there is a valid, stored note - A = position in stack
C87F 4C                                                    INCA                    A = A + 1 (advance stack)
C880 2602                                                  BNE  L56                If A <> 0, branch
C882 8602                                                  LDA  #$2
C884 A7A85E                            L56                 STA  $5E,Y              Store updated stack position
C887 2A01                                                  BPL  STACK_INDEX_GT_0   If stack pos > 0, branch
C889 40                                                    NEGA                    else stack index = -ve stack index
C88A BDE355                            STACK_INDEX_GT_0    JSR  L54
C88D 26E6                                                  BNE  L55
C88F 8602                                                  LDA  #$2                A = $2
C891 A0A85E                                                SUBA $5E,Y              decement store index by two
C894 A7A85E                                                STA  $5E,Y              store updated index
C897 40                                                    NEGA 
C898 7EE355                                                JMP  L54

C89B 33A4                                                  LEAU 0,Y                Arpeg. Handler for Random Arp. U = base address of instrument
C89D 5F                                                    CLRB                    B = 0
C89E EE42                              COUNT_ARP_NOTES     LDU  2,U    $2          U = Data address for stored (sequenced) note/vel data
C8A0 2703                                                  BEQ  AT_ARP_STCK_END    Branch if at end of note stack
C8A2 5C                                                    INCB                    B = B + 1
C8A3 20F9                                                  BRA  COUNT_ARP_NOTES

C8A5 CED800                            AT_ARP_STCK_END     LDU  #$D800             U = $D800
C8A8 6CA85E                                                INC  $5E,Y
C8AB A6A85E                                                LDA  $5E,Y              Else, there is stored data = count number of bytes
C8AE A6C6                                                  LDA  A,U                A = arbitrary value from codespace
C8B0 3D                                                    MUL  
C8B1 4C                                                    INCA 
C8B2 EE22                                                  LDU  $2,Y               U = Address of where note/velocity data resides in memory
C8B4 7EE355                                                JMP  L54

C8B7 BDCADB                                                JSR  TPE_LIGHTS_OUT     "Tape Space" $12 Chroma Port Handler - Init Inst's & Boards
C8BA CC0800                                                LDD  #$800              D = $0800
C8BD BDCB38                                                JSR  LONG_CASS_PAUSE    Go do cassette commands - w/timer
C8C0 2701                                                  BEQ  CASS_MOTOR_OK
C8C2 53                                                    COMB                    Flip B value (i.e., cassette was shut off)
C8C3 8612                              CASS_MOTOR_OK       LDA  #$12               Print Opcode A=$02=Opcode for "Tape Space"
C8C5 BDCD90                                                JSR  C_INF_OUT          Output Opcode
C8C8 1F98                                                  TFR  B,A                Transfer "Cassette Running Status" to A
C8CA BDCD90                                                JSR  C_INF_OUT          Output Cass. Running Status - $00 for Running, $FF for Stopped
C8CD BDCB0D                                                JSR  CANCEL_CASS_OP     Turn Cassette Motor Off
C8D0 7ECE04                                                JMP  PROCES_CHROMA_DAT  Go check for more chroma data

C8D3 BDCD4F                                                JSR  GET_A_FRM_BUF      "Save Packet" $05 Chroma Port Handler
C8D6 1F89                                                  TFR  A,B                A->B=Number of Bytes to write to cassette
C8D8 CE0140                                                LDU  #$140              U=$0140 = Base address of cassette buffer
C8DB BDCD4F                            MORE_DAT_FOR_CASS   JSR  GET_A_FRM_BUF      A=First data byte to write to cassette
C8DE A7C0                                                  STA  ,U+                Put Chroma Data Byte into Cassette Buffer
C8E0 5A                                                    DECB                    B=B-1 (decrement # of bytes left to be transferred)
C8E1 26F8                                                  BNE  MORE_DAT_FOR_CASS  If B<>0 - still data to go between chroma port & cass. buf.
C8E3 BDCADB                                                JSR  TPE_LIGHTS_OUT
C8E6 8606                                                  LDA  #$6                A=$06
C8E8 B72003                                                STA  RD_TIME_WR_TMOD    Set timer to 416 uS Mode
C8EB 1F30                                                  TFR  U,D                U=Last filled spot for Cassette Buffer
C8ED 830140                                                SUBD #$140              D=D-$140 = length of cassette data to be xfered
C8F0 BDC9B8                                                JSR  B_BYTES_2_TAPE
C8F3 2603                                                  BNE  S_PKT_OP_FAIL
C8F5 5F                                                    CLRB 
C8F6 2002                                                  BRA  S_PKT_OP_OK

C8F8 C6FF                              S_PKT_OP_FAIL       LDB  #$FF               B=$FF
C8FA 8605                              S_PKT_OP_OK         LDA  #$5                A=$05
C8FC BDCD90                                                JSR  C_INF_OUT          Output Save Packet Opcode
C8FF 1F98                                                  TFR  B,A
C901 BDCD90                                                JSR  C_INF_OUT          Output Save Packet Result Code
C904 BDCB0D                                                JSR  CANCEL_CASS_OP     Turn Cassette Motor Off
C907 7ECE04                                                JMP  PROCES_CHROMA_DAT

C90A BDCADB                                                JSR  TPE_LIGHTS_OUT     "Load Packet" $04 Chroma Port Handler
C90D 8603                                                  LDA  #$3                A = $03
C90F B72003                                                STA  RD_TIME_WR_TMOD    Timer Mode = Tape Mode
C912 BDCA8F                                                JSR  READ_TAPE_HEAD
C915 280C                                                  BVC  L57
C917 56                                                    RORB 
C918 1D                                                    SEX  
C919 43                                                    COMA 
C91A B70141                                                STA  CASS_BUF_B1
C91D CC0002                                                LDD  #$2
C920 B70140                                                STA  CASS_BUF_B0
C923 1CEF                              L57                 ANDC #$EF
C925 8604                                                  LDA  #$4                A = $04
C927 BDCD90                                                JSR  C_INF_OUT          Output Opcode for "Load Packet"
C92A 1F98                                                  TFR  B,A                A = number of data bytes in packet
C92C BDCD90                                                JSR  C_INF_OUT          Output # of data bytes
C92F CE0140                                                LDU  #$140              U=$140=Base address of cassette buffer
C932 A6C0                              OUT_NXT_CASS_BYTE   LDA  ,U+                A=Data at cassette buffer
C934 BDCD90                                                JSR  C_INF_OUT
C937 5A                                                    DECB                    B=B-1 (number of bytes left)
C938 26F8                                                  BNE  OUT_NXT_CASS_BYTE  If we haven't output all data, output next byte
C93A BDCB0D                                                JSR  CANCEL_CASS_OP
C93D 7ECE04                                                JMP  PROCES_CHROMA_DAT

C940 CC0301                                                LDD  #$301              Set Split 14 (Stop Packet Cass Save) Handler
C943 2010                                                  BRA  DO_STOP_PKT        A = $03, B = $01

C945 4F                                                    CLRA                    Set Split 11 (Prog. 0 Packet Cass Save) Handler
C946 2007                                                  BRA  SAVE_PKT_A         A = 0

C948 8601                                                  LDA  #$1                Set Split 12 (Prog. 1 Packet Cass Save) Handler
C94A 2003                                                  BRA  SAVE_PKT_A         A = $1

C94C B61FF2                                                LDA  CURR_PROG_NUM      Set Split 13 (Prog. n Packet Cass Save) Handler
C94F B70141                            SAVE_PKT_A          STA  CASS_BUF_B1        Store program number
C952 CC0202                                                LDD  #$202              D = AxB : A = $02, B=$02
C955 B70140                            DO_STOP_PKT         STA  CASS_BUF_B0        Store "Cass Info Type"
C958 3404                                                  PSHS B                  Save a copy of B
C95A BDCADB                                                JSR  TPE_LIGHTS_OUT     Tape Lights Out - Update Boards per Inst.
C95D 8606                                                  LDA  #$6                A = $06
C95F B72003                                                STA  RD_TIME_WR_TMOD    Set Timer Mode to "416 uS Mode"
C962 8610                                                  LDA  #$10               A = $10
C964 BDCB38                                                JSR  LONG_CASS_PAUSE
C967 3504                                                  PULS B
C969 102601A0                                              LBNE CANCEL_CASS_OP     If B<>0, branch and restore panel
C96D BDC9B8                                                JSR  B_BYTES_2_TAPE
C970 7ECB0D                                                JMP  CANCEL_CASS_OP

C973 3406                              CASS_DATA_OUT       PSHS B,A
C975 D62F                                                  LDB  WR_MSCO_IMG        B = MSCO Image
C977 4D                                                    TSTA                    See if A=0 or not
C978 2702                                                  BEQ  TAPE_OUT_0         If A=0 want to output a zero
C97A C808                                                  EORB #$8                else want to output a one (toggle output, 1 full 1200 Hz cycle) 
C97C D72F                              TAPE_OUT_0          STB  WR_MSCO_IMG        Update MSCO Image
C97E 8608                                                  LDA  #$8                A = $08
C980 B52001                            TIMER_NOT_RDY       BITA RD_MSCI_WR_MSCO    Check TRDY Bit
C983 26FB                                                  BNE  TIMER_NOT_RDY      Loop here until we get the -TRDY signal.  
C985 F72001                                                STB  RD_MSCI_WR_MSCO    Update H/W value of WR_MSCO (do actual bit toggle)
C988 F62003                                                LDB  RD_TIME_WR_TMOD    Reset -TRDY 
C98B 3586                                                  PULS A,B,PC

C98D 3402                              A_BIT_OUT_CASS      PSHS A                  Save A
C98F 8401                                                  ANDA #$1                Only look at Bit0 of A
C991 8DE0                                                  BSR  CASS_DATA_OUT
C993 4C                                                    INCA                    A = A + 1
C994 8DDD                                                  BSR  CASS_DATA_OUT
C996 3582                                                  PULS A,PC               Exit

C998 3406                              SAVE_CASS_WORD_A    PSHS B,A
C99A 9B68                                                  ADDA CASS_CHK_SUM       checksum = checksum + 1
C99C 9768                                                  STA  CASS_CHK_SUM       Update checksum in memory
C99E 4F                                                    CLRA                    A = 0 
C99F 8DEC                                                  BSR  A_BIT_OUT_CASS     Put 'A' to cass (start bit = 0)
C9A1 A6E4                                                  LDA  0,S                A = Orig A (= length of data)
C9A3 C608                                                  LDB  #$8                B = $8 = word length (8 bits to a byte)
C9A5 8DE6                              SHIFT_NEXT_BIT      BSR  A_BIT_OUT_CASS     Output lowest bit
C9A7 44                                                    LSRA                    A = A/2 (shift bits so we have new lowest bit)
C9A8 5A                                                    DECB                    B = B - 1
C9A9 26FA                                                  BNE  SHIFT_NEXT_BIT     If B <> 0, then not all 8 bits output
C9AB 962F                                                  LDA  WR_MSCO_IMG        A = MSCO Img (used in parity calculation)
C9AD 44                                                    LSRA 
C9AE 44                                                    LSRA 
C9AF 44                                                    LSRA                    "Tape Out" bit now in LSB 
C9B0 8DDB                                                  BSR  A_BIT_OUT_CASS     Output tape bit (parity of byte)
C9B2 8601                                                  LDA  #$1                A = $1
C9B4 8DD7                                                  BSR  A_BIT_OUT_CASS     Output Stop bit
C9B6 3586                                                  PULS A,B,PC

C9B8 3446                              B_BYTES_2_TAPE      PSHS U,B,A              A="number of packets", B="size of ea. pkt", U=end addr. of data in buff
C9BA CC0000                                                LDD  #$0                D = $0 (A = $0, B = $0)
C9BD 8DCE                              START_GAP           BSR  A_BIT_OUT_CASS     Check to see if recorder is going to run
C9BF 5A                                                    DECB                    B=B-1 (B = $FF)
C9C0 26FB                                                  BNE  START_GAP          Repeat loop until B=0 (ouput 255 "0"'s)
C9C2 4C                                                    INCA                    A=A+1 (A = 1)
C9C3 8DC8                                                  BSR  A_BIT_OUT_CASS     Output a "1" as data (stop)
C9C5 0F68                                                  CLR  CASS_CHK_SUM       Clear cassette checksum (checksum = 0)
C9C7 A661                                                  LDA  $1,S               A = orig. value of B (size of packet)
C9C9 8DCD                                                  BSR  SAVE_CASS_WORD_A   Output 1 byte (w/start & stop) to cassette
C9CB CE0140                                                LDU  #$140              U=$140 = start address of cassette buffer
C9CE CCFFFF                                                LDD  #$FFFF             D=$FFFF
C9D1 FD2006                                                STD  RD_NOTE_WR_LED     Turn all LEDs on
C9D4 E661                                                  LDB  $1,S               B = orig. value of B (size of packet)
C9D6 A6C0                              CASS_SAVE_LOOP      LDA  ,U+                A = Byte from outgoing buffer
C9D8 8DBE                                                  BSR  SAVE_CASS_WORD_A
C9DA 8D10                                                  BSR  CHK_CASS_CMD       Confirm no user cancel/cassette cmd still valid
C9DC 5A                                                    DECB                    B=B-1
C9DD 26F7                                                  BNE  CASS_SAVE_LOOP     Continue to loop to send all cass. data out
C9DF 4F                                                    CLRA                    A=0
C9E0 FD2006                                                STD  RD_NOTE_WR_LED     Turn off LEDs
C9E3 9668                                                  LDA  CASS_CHK_SUM       Cassette checksum value 
C9E5 40                                                    NEGA                    -Neg of checksum
C9E6 8DB0                                                  BSR  SAVE_CASS_WORD_A   Store 'checksum' to cassette
C9E8 9669                                                  LDA  CASS_MOT_INFO
C9EA 35C6                                                  PULS A,B,U,PC           Done Save - return

C9EC 3416                              CHK_CASS_CMD        PSHS X,B,A
C9EE 8E0014                                                LDX  #$14               X = $0014
C9F1 8603                                                  LDA  #$3                A = $03
C9F3 B72005                            C_NXT_ROW           STA  RD_SWB_WR_SDS      Write to Small Display #3
C9F6 3402                                                  PSHS A                  Save A
C9F8 B62005                                                LDA  RD_SWB_WR_SDS      A = Value of Switches
C9FB 1F89                                                  TFR  A,B                A -> B
C9FD 53                                                    COMB                    -B -> B (A "1" where the switch was set)
C9FE E482                                                  ANDB ,-X                and B w/RAM[$0013] = And W/ STB4 value
CA00 A784                                                  STA  0,X                A = Direct Value of Switch at RAM[$0013] -> $0010
CA02 3502                                                  PULS A                  A = $03, 02, 01, 00
CA04 C420                                                  ANDB #$20               Check to see if 5th bit set
CA06 260D                                                  BNE  NO_CASS_OP         If bit 5 clear we don't have a tape op., exit
CA08 4A                                                    DECA                    A = A - 1
CA09 2AE8                                                  BPL  C_NXT_ROW          If A > -1, branch - check next row of switch data
CA0B F62001                                                LDB  RD_MSCI_WR_MSCO    Get MISC I/O Data
CA0E F41FF1                                                ANDB CASS_TYPE          set bit if motor control supported and MOT_IN = 1
CA11 C404                                                  ANDB #$4                If B <> 0, Motor Cntrl Enabled. (B = 0 if mtr cntrl not supported) 
CA13 2004                                                  BRA  CASS_OP_CONT

CA15 A79F1FF4                          NO_CASS_OP          STA  [$1FF4]            Fire Tapper
CA19 DA69                              CASS_OP_CONT        ORB  CASS_MOT_INFO      Update B per last Cassette Motor Info
CA1B D769                                                  STB  CASS_MOT_INFO      B -> RAM[$0069] (Cassette Control)
CA1D 3596                                                  PULS A,B,X,PC

CA1F 3410                              CHK_CASS_ERR        PSHS X
CA21 8608                                                  LDA  #$8                A = $08
CA23 8DC7                              CASS_ABRT_LOOP      BSR  CHK_CASS_CMD
CA25 2704                                                  BEQ  CASS_CMD_0
CA27 86FF                                                  LDA  #$FF               A = $FF
CA29 3590                                                  PULS X,PC               Exit

CA2B B52001                            CASS_CMD_0          BITA RD_MSCI_WR_MSCO    Check -TRDY bit
CA2E 26F3                                                  BNE  CASS_ABRT_LOOP     Do cass_cmd check as long as timer not ready
CA30 BE2003                                                LDX  RD_TIME_WR_TMOD    else, timer ready, X=timer from system timer
CA33 4F                                                    CLRA                    A=0
CA34 8C01A0                                                CMPX #$1A0              Compare X w/$1A0 (Worked too fast - invalid data)
CA37 250E                                                  BCS  TIMER_LT_416       If X < 416, branch
CA39 8C0820                                                CMPX #$820              Compare X w/$820 (Worked too slow - invalid data)
CA3C 2409                                                  BCC  TIMER_LT_416       If carry clear, timer > 2080uS, branch
CA3E 4C                                                    INCA                    A=A+1
CA3F 8C04E0                                                CMPX #$4E0              Compare X w/$4E0 (1248 uS)
CA42 2503                                                  BCS  TIMER_LT_416       If X < 1248 uS, branch
CA44 4C                                                    INCA                    A=A+1
CA45 3590                                                  PULS X,PC

CA47 4D                                TIMER_LT_416        TSTA                    Check A (i.e., count)
CA48 3590                                                  PULS X,PC               Jump out and Leave

CA4A 3402                              READ_TAPE_BIT       PSHS A
CA4C 8DD1                                                  BSR  CHK_CASS_ERR
CA4E 2F0A                                                  BLE  CASS_OFF_ERR       If A <= 0, branch (error or overflow)
CA50 44                                                    LSRA                    Else A > 0 : A = A/2
CA51 240B                                                  BCC  DATA_OK            If carry clear, then A was even (branch)
CA53 8DCA                                                  BSR  CHK_CASS_ERR       else, A was odd - branch (go look again)
CA55 2F03                                                  BLE  CASS_OFF_ERR       If A <= 0, branch
CA57 44                                                    LSRA                    else A > 0 ; A = A/2
CA58 2504                                                  BCS  DATA_OK            if carry set, then A was odd (branch)
CA5A 8080                              CASS_OFF_ERR        SUBA #$80
CA5C 1A02                                                  ORCC #$2                Set Overflow bit (V) in Condition Code Register
CA5E 3582                              DATA_OK             PULS A,PC

CA60 3404                              READ_CASS_WORD_A    PSHS B
CA62 8DE6                              NEXT_BIT            BSR  READ_TAPE_BIT      Read in 
CA64 2927                                                  BVS  ERROR_EXIT         If overflow set, then we had a freq. or cass. error - exit
CA66 25FA                                                  BCS  NEXT_BIT           else, data OK -> if carry set, go get more
CA68 0F03                                                  CLR  MEM_03
CA6A C609                                                  LDB  #$9                B = $09
CA6C 8DDC                              L59                 BSR  READ_TAPE_BIT
CA6E 291D                                                  BVS  ERROR_EXIT
CA70 2402                                                  BCC  L58
CA72 0C03                                                  INC  MEM_03             Count
CA74 46                                L58                 RORA 
CA75 5A                                                    DECB                    B = B - 1
CA76 26F4                                                  BNE  L59                If B <> 0, branch
CA78 49                                                    ROLA                    Else B = 0
CA79 0403                                                  LSR  MEM_03
CA7B 250E                                                  BCS  CASS_DATA_ERR
CA7D 8DCB                                                  BSR  READ_TAPE_BIT
CA7F 290C                                                  BVS  ERROR_EXIT
CA81 2408                                                  BCC  CASS_DATA_ERR
CA83 1F89                                                  TFR  A,B
CA85 DB68                                                  ADDB CASS_CHK_SUM
CA87 D768                                                  STB  CASS_CHK_SUM
CA89 3584                                                  PULS B,PC

CA8B 1A03                              CASS_DATA_ERR       ORCC #$3                Set Overflow (V) and Carry (C) bits in Condition Code Register
CA8D 3584                              ERROR_EXIT          PULS B,PC

CA8F 3446                              READ_TAPE_HEAD      PSHS U,B,A              Read Packet Handler (Body)
CA91 8DB7                              READ_START          BSR  READ_TAPE_BIT      WOKA
CA93 25FC                                                  BCS  READ_START
CA95 293B                                                  BVS  READ_CASS_ERR
CA97 C609                                                  LDB  #$9
CA99 8DAF                              READ_SNGL_BYTE      BSR  READ_TAPE_BIT
CA9B 25F4                                                  BCS  READ_START
CA9D 2933                                                  BVS  READ_CASS_ERR
CA9F 5A                                                    DECB 
CAA0 26F7                                                  BNE  READ_SNGL_BYTE
CAA2 8DA6                              READ_STOP           BSR  READ_TAPE_BIT
CAA4 2804                                                  BVC  READ_TAPE_BODY
CAA6 25E9                                                  BCS  READ_START
CAA8 2028                                                  BRA  READ_CASS_ERR

CAAA 24F6                              READ_TAPE_BODY      BCC  READ_STOP
CAAC CCFFFF                                                LDD  #$FFFF
CAAF FD2006                                                STD  RD_NOTE_WR_LED
CAB2 0F68                                                  CLR  CASS_CHK_SUM
CAB4 8DAA                                                  BSR  READ_CASS_WORD_A   Read Byte from Tape (Size of Data/Number of Bytes)
CAB6 291A                                                  BVS  READ_CASS_ERR
CAB8 A761                                                  STA  $1,S               Store size of data stream to come
CABA CE0140                                                LDU  #$140              U = Start Adress of Cassette Buffer
CABD E661                                                  LDB  $1,S               B = number of packets
CABF 8D9F                              CASS_READ_LOOP      BSR  READ_CASS_WORD_A
CAC1 290F                                                  BVS  READ_CASS_ERR
CAC3 A7C0                                                  STA  ,U+
CAC5 5A                                                    DECB 
CAC6 26F7                                                  BNE  CASS_READ_LOOP
CAC8 8D96                                                  BSR  READ_CASS_WORD_A   A = Checksum value (stored on
CACA 2906                                                  BVS  READ_CASS_ERR
CACC 9668                                                  LDA  CASS_CHK_SUM
CACE 2702                                                  BEQ  READ_CASS_ERR
CAD0 1A03                                                  ORCC #$3                Set Overflow (V) and Carry (C) bits in Condition Code Register
CAD2 3401                              READ_CASS_ERR       PSHS CC
CAD4 4F                                                    CLRA 
CAD5 5F                                                    CLRB 
CAD6 FD2006                                                STD  RD_NOTE_WR_LED
CAD9 35C7                                                  PULS CC,A,B,U,PC

CADB 7F2004                            TPE_LIGHTS_OUT      CLR  RD_TIME1WR_SEGS    Clear LED value
CADE 7F2006                                                CLR  RD_NOTE_WR_LED     Turn off flashing LEDs
CAE1 7F2007                                                CLR  RD_VEL_WR_LEDS1    Turn off non-flashing LEDs
CAE4 0F69                                                  CLR  CASS_MOT_INFO      Reset Cass. Motor info (no mtr volt or not mtr controlled).
CAE6 1A50                                                  ORCC #$50 'P            Disable FIRQ and IRQ 
CAE8 962F                                                  LDA  WR_MSCO_IMG        A = WR_MSCO Image
CAEA 84DF                                                  ANDA #$DF               Set -K_MASK = 0 (i.e., ignore keyboard keys)
CAEC 8A0D                                                  ORA  #$D                Start Recording, MOT Out = 1, Enable Osc's, Enable Outputs
CAEE 972F                                                  STA  WR_MSCO_IMG        Update WR_MSCO Image in memory
CAF0 B72001                                                STA  RD_MSCI_WR_MSCO    Update H/W WR_MSCO value
CAF3 1CAF                                                  ANDC #$AF               Enable FIRQ and IRQ
CAF5 108E0690                                              LDY  #$690              Y = Base Address of Inst 0
CAF9 EC26                              CASS_MORE_INST      LDD  $6,Y               D=Address of Program defining instrument
CAFB 2705                                                  BEQ  GOTO_NXT_INST      If D=0 there is no defining prog for this inst. - skip inst.
CAFD BDD994                                                JSR  INIT_BRD_4_INST    Else, init boards for instrument
CB00 ED26                                                  STD  $6,Y               Update address of program defining instrument
CB02 31A900B8                          GOTO_NXT_INST       LEAY 184,Y              Y=Base address of next instrument
CB06 108C0B98                                              CMPY #$B98              See if we're at the end of the instruments
CB0A 23ED                                                  BLS  CASS_MORE_INST     If still more instruments, branch
CB0C 39                                                    RTS                     else no more instruments - exit

CB0D BDDE98                            CANCEL_CASS_OP      JSR  PNT_PANL
CB10 FC1FF2                            CASS_MOT_OFF_2      LDD  CURR_PROG_NUM      D = curr prog # & modified bytes
CB13 BDDE04                                                JSR  OUTPUT_BIG_PROG    Show Current Program
CB16 BDDA55                                                JSR  BOARD_ASSIGN       Assign Boards (as appropriate)
CB19 1A50                                                  ORCC #$50 'P            Disable FIRQ and IRQ
CB1B 962F                                                  LDA  WR_MSCO_IMG        A = WR_MSCO Image
CB1D 84FA                                                  ANDA #$FA               Halt motor, Mute Outputs
CB1F 8A28                                                  ORA  #$28 '(            -K_MASK = 1 (don't ingore kybd keys) - turn rcrd motor on
CB21 972F                                                  STA  WR_MSCO_IMG        Update WR_MSCO Image in memory
CB23 B72001                                                STA  RD_MSCI_WR_MSCO    Update H/W WR_MSCO value
CB26 1CAF                                                  ANDC #$AF               Enable FIRQ and IRQ
CB28 39                                                    RTS  

CB29 3416                              FAST_SLOW_SAVE      PSHS X,B,A
CB2B 860C                                                  LDA  #$C                A = $0C = 12
CB2D F62001                                                LDB  RD_MSCI_WR_MSCO    B = Misc. I/O Byte
CB30 C420                                                  ANDB #$20               B = Value of "-LOCK"
CB32 2702                                                  BEQ  MEM_LOCKED         If Memory Locked, branch (fast save)
CB34 8D02                                                  BSR  LONG_CASS_PAUSE    Else, wait for cassette (slow save)
CB36 3596                              MEM_LOCKED          PULS A,B,X,PC

CB38 8E0000                            LONG_CASS_PAUSE     LDX  #$0                X=$0
CB3B 3001                              WAIT_FFFF           LEAX $1,X               X=Address of $1
CB3D 26FC                                                  BNE  WAIT_FFFF          Loop Until X<>0 (Let computer count to $FFFF)
CB3F BDC9EC                                                JSR  CHK_CASS_CMD       See if cassette command/key pressed
CB42 2603                                                  BNE  2ND_CASS_KEY       If so, cancel
CB44 4A                                                    DECA                    A = A - 1
CB45 26F1                                                  BNE  LONG_CASS_PAUSE    While A>0, do cass_cmd
CB47 39                                2ND_CASS_KEY        RTS                     Exit

CB48 A79F1FF4                                              STA  [$1FF4]            "SAVE ONE" - Fire Tapper
CB4C 8D8D                                                  BSR  TPE_LIGHTS_OUT
CB4E 8606                                                  LDA  #$6                A = $06
CB50 B72003                                                STA  RD_TIME_WR_TMOD    Set Timer Mode to "416 uS Mode"
CB53 8610                                                  LDA  #$10               # of $0 -> $FFFF loops system to wait
CB55 8DE1                                                  BSR  LONG_CASS_PAUSE    Check to see if user wants to quit (abort save)
CB57 26B4                                                  BNE  CANCEL_CASS_OP     if A =0, no cancel detected - else, user hit another tape key
CB59 4C                                                    INCA                    A = A + 1
CB5A B70140                                                STA  CASS_BUF_B0
CB5D 8E1400                                                LDX  #$1400             X = $1400 = Start Address of Programs
CB60 CE0141                                                LDU  #$141              U = 2nd byte in Cassette Buffer (program #)
CB63 BDDA2C                                                JSR  CP_PROG_X_2_U      Copy Prog 0 to Cassette Buffer
CB66 C63C                                                  LDB  #$3C '<            B = $3C (Length of 1 Packet)
CB68 BDC9B8                                                JSR  B_BYTES_2_TAPE
CB6B 20A0                                                  BRA  CANCEL_CASS_OP

CB6D A79F1FF4                                              STA  [$1FF4]            "SAVE ALL" - Fire Tapper
CB71 BDCADB                                                JSR  TPE_LIGHTS_OUT
CB74 8606                                                  LDA  #$6                A = $06
CB76 B72003                                                STA  RD_TIME_WR_TMOD    Set Timer Mode to "416 uS Mode"
CB79 8610                                                  LDA  #$10               A = $10 (the number of $0 -> $FFFF loops the system is to wait)
CB7B 8DBB                                                  BSR  LONG_CASS_PAUSE    Check to see if user wants to abort/cancel "save all"
CB7D 268E                                                  BNE  CANCEL_CASS_OP     If A = 0, no 'abort' issued 
CB7F CC0201                                                LDD  #$201              Else, no abort : D = $0201 - indicate we have a "cassette packet"
CB82 FD0140                                                STD  CASS_BUF_B0        Store result to cass_buf_b0/cass_buf_b1
CB85 5C                                                    INCB                    B=B+1 (B = $02)
CB86 BDC9B8                                                JSR  B_BYTES_2_TAPE     Output "B" Bytes (properly formatted) to tape
CB89 2682                                                  BNE  CANCEL_CASS_OP
CB8B 8E143B                                                LDX  #$143B             X = $143B = base address of program #1
CB8E CE0141                                                LDU  #$141              U = $0141 = Base addr. of Prog. Data in Cass. Buf.
CB91 7A0140                                                DEC  CASS_BUF_B0
CB94 CC323C                                                LDD  #$323C             D = $323C
CB97 8D90                              MORE_PROG_TO_GO     BSR  FAST_SLOW_SAVE     Check Lock Status on Memory (Speed of Save) - pause if slow save
CB99 1026FF70                                              LBNE CANCEL_CASS_OP     If A <> 0, tape button pressed (i.e., cancel)
CB9D BDDA2C                                                JSR  CP_PROG_X_2_U      Copy program to tape buffer
CBA0 BDC9B8                                                JSR  B_BYTES_2_TAPE     Output $3C bytes to tape (1 program)
CBA3 1026FF66                                              LBNE CANCEL_CASS_OP
CBA7 30883B                                                LEAX $3B,X              X = next program address
CBAA 4A                                                    DECA                    A = A - 1 (=# of programs still to be output)
CBAB 26EA                                                  BNE  MORE_PROG_TO_GO    If more programs left to go out, then branch
CBAD BDCB29                                                JSR  FAST_SLOW_SAVE     else - all data programs output
CBB0 1026FF59                                              LBNE CANCEL_CASS_OP
CBB4 CC0301                                                LDD  #$301              D = $0301
CBB7 B70140                                                STA  CASS_BUF_B0        Update buffer with 0301 (stop packet)
CBBA BDC9B8                                                JSR  B_BYTES_2_TAPE     Output stop packet
CBBD 7ECB0D                                                JMP  CANCEL_CASS_OP

CBC0 A79F1FF4                                              STA  [$1FF4]            "LOAD ONE" - Fire Tapper
CBC4 BDCADB                                                JSR  TPE_LIGHTS_OUT     Tape Lights Out
CBC7 8603                                                  LDA  #$3                A = $03
CBC9 B72003                                                STA  RD_TIME_WR_TMOD    Set Timer Mode to "TAPE MODE"
CBCC 8608                                                  LDA  #$8                A = $08
CBCE BDCB38                                                JSR  LONG_CASS_PAUSE
CBD1 1026FF38                                              LBNE CANCEL_CASS_OP     If A <> 0, then key pressed - want to cancel cass. op
CBD5 BDCA8F                                                JSR  READ_TAPE_HEAD     else continue w/cass. command
CBD8 2806                                                  BVC  L60                If overflow clear, branch
CBDA 1024FF2F                                              LBCC CANCEL_CASS_OP     Else overflow occurred - stop cassettee ops
CBDE 2057                                                  BRA  L61

CBE0 B60140                            L60                 LDA  CASS_BUF_B0
CBE3 4A                                                    DECA                    A = A-1
CBE4 2615                                                  BNE  C_PROG_DISP        If A<>0 then branch
CBE6 8E0141                                                LDX  #$141              else, error - X=Base Address of Prog. Data in Cass. Buf.
CBE9 CE1400                                                LDU  #$1400             U=Base Address of Prog. 0
CBEC BDDA2C                                                JSR  CP_PROG_X_2_U      Copy Program from cassette buffer to Prog. 0
CBEF BDDDA3                                                JSR  PARAM_FIX          Check & confirm all settings in new prog.
CBF2 BDCCC7                                                JSR  ACT_ON_P0_LNK      update link data based on link info in new Prog. 0
CBF5 BDDDF7                                                JSR  PROG_MODIFIED      Set Program Modified Flag
CBF8 7ECB10                                                JMP  CASS_MOT_OFF_2     Turn Cassette Motor Off

CBFB 4A                                C_PROG_DISP         DECA                    A = A-1
CBFC 2614                                                  BNE  C_STOP_DISP        If A<>0, branch
CBFE B60141                                                LDA  CASS_BUF_B1        else orig A=2 -> we have a prog./data packet
CC01 BDDE2A                                                JSR  DISP_PARAM_VAL
CC04 CC6705                                                LDD  #$6705             D = LED Value = 'Pr'
CC07 DD20                                                  STD  LED_DIG0           LED_DIG_0 = 'P', LED_DIG_1 = 'r'
CC09 0F22                                                  CLR  LED_DIG2           LED_DIG_2 = {blank}
CC0B CC151D                                                LDD  #$151D             D = LED Value = 'no'
CC0E DD23                                                  STD  LED_DIG3           LED_DIG_3 = 'n', LED_DIG_4 = 'o'
CC10 2028                                                  BRA  L62

CC12 4A                                C_STOP_DISP         DECA                    A = A-1
CC13 260D                                                  BNE  C_SUBR_DISP        If A<>0, branch
CC15 CC7E47                                                LDD  #$7E47             else orig A=3 -> we have a stop packet, D = LED Value = 'OF'
CC18 DD20                                                  STD  LED_DIG0           LED_DIG_0 = 'O', LED_DIG_1 = 'F'
CC1A D722                                                  STB  LED_DIG2           LED_DIG_2 = B = 'F'
CC1C 4F                                                    CLRA                    A = $00
CC1D 5F                                                    CLRB                    B = $00
CC1E 9723                                                  STA  LED_DIG3           LED_DIG_3 = 00 = {blank}
CC20 200F                                                  BRA  CLEAR_LED_4_7

CC22 4A                                C_SUBR_DISP         DECA                    A = A-1
CC23 2612                                                  BNE  L61                If A<>0, branch
CC25 CC5B1C                                                LDD  #$5B1C             else orig A=4 -> we have a subroutine packet, D = LED value = 'Su'
CC28 DD20                                                  STD  LED_DIG0           LED_DIG_0 = 'S', LED_DIG_1 = 'u'
CC2A CC1F05                                                LDD  #$1F05             D = LED Value = 'br'
CC2D DD22                                                  STD  LED_DIG2           LED_DIG_2 = 'b', LED_DIG_3 = 'r'
CC2F 4F                                                    CLRA                    A = $00
CC30 5F                                                    CLRB                    A = $00
CC31 DD24                              CLEAR_LED_4_7       STD  LED_DIG4           LED_DIG_4, LED_DIG_5 = {blank}
CC33 DD26                                                  STD  LED_DIG6           LED_DIG_6, LED_DIG_7 = {blank}
CC35 2003                                                  BRA  L62

CC37 BDCD0F                            L61                 JSR  ERROR_MSG          else, data stored is incorrect - show error message
CC3A BDDF32                            L62                 JSR  PAINT_LEDS
CC3D 7ECB10                                                JMP  CASS_MOT_OFF_2     turn cassette motor off

CC40 A79F1FF4                                              STA  [$1FF4]            "LOAD ALL" - Fire Tapper
CC44 962F                                                  LDA  WR_MSCO_IMG        A = MSCO Image
CC46 8404                                                  ANDA #$4                A = MOT OUT info
CC48 2708                                                  BEQ  MOTOR_OFF          Branch if MOT OUT = 0 (i.e., branch if we've turned motor off)
CC4A 7A1FF2                                                DEC  CURR_PROG_NUM      else motor info OK : Curr Prog Num = Curr Prog Num - 1
CC4D 2603                                                  BNE  MOTOR_OFF          Branch if Current Program Number <> 0
CC4F 7C1FF2                                                INC  CURR_PROG_NUM      Else, Current Program did = 0, Set Current Program = 1
CC52 BDCADB                            MOTOR_OFF           JSR  TPE_LIGHTS_OUT     Go turn tape lights out and wait
CC55 8603                                                  LDA  #$3                A = $3
CC57 B72003                                                STA  RD_TIME_WR_TMOD    Set timer to "TAPE MODE"
CC5A 8608                                                  LDA  #$8                A = $8
CC5C BDCB38                                                JSR  LONG_CASS_PAUSE
CC5F 1026FEAA                                              LBNE CANCEL_CASS_OP
CC63 8E0141                                                LDX  #$141              else, cassette mot. running : X = $0141 (Data Addr in Cass Buff)
CC66 BDCA8F                            LOAD_ALL_LOOP       JSR  READ_TAPE_HEAD     Get data from cassette
CC69 2804                                                  BVC  L63                If overflow clear, branch
CC6B 2438                                                  BCC  STOP_SUB_PKT
CC6D 204C                                                  BRA  CASS_BUF_ERR

CC6F FC0140                            L63                 LDD  CASS_BUF_B0        D = cass_buf_b0 & cass_buf_b1
CC72 4A                                                    DECA                    A = A - 1
CC73 2714                                                  BEQ  SINGLE_PACKET      If A was originally 1 we have single prog.
CC75 4A                                                    DECA                    A = A - 1
CC76 2708                                                  BEQ  PROG_PACKETS       If A was originally 2 we have data progs.
CC78 4A                                                    DECA                    A = A - 1
CC79 272A                                                  BEQ  STOP_SUB_PKT       If A was originally 3 we have stop packet
CC7B 4A                                                    DECA                    A = A - 1 
CC7C 2727                                                  BEQ  STOP_SUB_PKT       If A was originally 4 we have subroutine
CC7E 203B                                                  BRA  CASS_BUF_ERR       else, error in SAFE_BUF_B0

CC80 C132                              PROG_PACKETS        CMPB #$32 '2            Val = B - 50
CC82 2237                                                  BHI  CASS_BUF_ERR       If Val > 0 (B > 50), branch
CC84 F71FF2                                                STB  CURR_PROG_NUM      update curr_prog_num
CC87 20DD                                                  BRA  LOAD_ALL_LOOP

CC89 B62001                            SINGLE_PACKET       LDA  RD_MSCI_WR_MSCO    Read Misc I/O Byte
CC8C 8420                                                  ANDA #$20               Pick off value of "-LOCK" bit
CC8E 2711                                                  BEQ  MEM_LOCK_ON        If memory locked, branch
CC90 B61FF2                                                LDA  CURR_PROG_NUM      else, we can change mem. info -> A = Current Prog. #
CC93 C63B                                                  LDB  #$3B ';            B = $3B = 59, the length of 1 program
CC95 3D                                                    MUL                     D = Offset to current program
CC96 CE1400                                                LDU  #$1400             U = $1400, the address of program 0
CC99 33CB                                                  LEAU D,U                U = start addres of curr. prog.
CC9B BDDA2C                                                JSR  CP_PROG_X_2_U      Copy program from cass buffer to mem (program 0) location
CC9E BDDDA3                                                JSR  PARAM_FIX          Ensure stored parameters are good
CCA1 8D5E                              MEM_LOCK_ON         BSR  INC_CUR_PROG       inc. "curr_prog_num" (show prog. 1 for prog. 0)
CCA3 20C1                                                  BRA  LOAD_ALL_LOOP

CCA5 B61FF2                            STOP_SUB_PKT        LDA  CURR_PROG_NUM      A = Current Prog. #
CCA8 2704                                                  BEQ  CURR_PROG_EQ0      If current prog = 0, branch
CCAA 8132                                                  CMPA #$32 '2            else, see if current prog <= 50
CCAC 2305                                                  BLS  USE_CURR_P_NO
CCAE 8601                              CURR_PROG_EQ0       LDA  #$1                Current prog = 1 (show prog #1 for prog 0)
CCB0 B71FF2                                                STA  CURR_PROG_NUM      Current Prog # now OK
CCB3 8D12                              USE_CURR_P_NO       BSR  ACT_ON_P0_LNK      If there is a link, invoke it
CCB5 BDDDF7                                                JSR  PROG_MODIFIED      Show that program has been changed
CCB8 7ECB10                                                JMP  CASS_MOT_OFF_2     Turn off Cass Motor & Mute Output

CCBB 8D44                              CASS_BUF_ERR        BSR  INC_CUR_PROG       Go to next prog #
CCBD 8D08                                                  BSR  ACT_ON_P0_LNK      Update Link (as appropriate)
CCBF 8D4E                                                  BSR  ERROR_MSG          Show we had an error (i.e., "Error" in display)
CCC1 BDDDF7                                                JSR  PROG_MODIFIED      Show program modified.
CCC4 7ECB10                                                JMP  CASS_MOT_OFF_2     Stop Tape Recorder

CCC7 B61400                            ACT_ON_P0_LNK       LDA  P0_LINK_VALS       A = link value byte
CCCA 85C0                                                  BITA #$C0               see if we have a link
CCCC 2608                                                  BNE  P0_HAS_LINK        if Prog 0 has a link, branch
CCCE CE0000                                                LDU  #$0                else, U = $00
CCD1 FF074E                                                STU  LINK_P_ADDR        set link inst's "defining program" address to $0000
CCD4 200D                                                  BRA  P0_HAS_NO_LNK

CCD6 843F                              P0_HAS_LINK         ANDA #$3F '?            A = Link Program Number
CCD8 C63B                                                  LDB  #$3B ';            B = $3B = 59, the length of 1 memory program
CCDA 3D                                                    MUL                     D = Link Prg No * Length of 1 Prg.
CCDB CE1400                                                LDU  #$1400             U = $1400 = the start addr. of prog. 0
CCDE 33CB                                                  LEAU D,U                U = Start Address of Link Prog def'n
CCE0 FF074E                                                STU  LINK_P_ADDR        Store Address of Link Prog Param.
CCE3 108E0690                          P0_HAS_NO_LNK       LDY  #$690              Y = $0690
CCE7 EE26                              MORE_INST           LDU  $6,Y               U = Address of Program Defining main instrument
CCE9 2703                                                  BEQ  GOTO_NXT_INST      If program # = 0, then branch
CCEB BDD960                                                JSR  INVOKE_PROG        Else invoke program
CCEE 31A900B8                          GOTO_NXT_INST       LEAY 184,Y              Y = Address of "next" instrument
CCF2 108C0B98                                              CMPY #$B98              See if we are at the end of instruments
CCF6 23EF                                                  BLS  MORE_INST          If more instruments remaining, branch
CCF8 BDE85B                                                JSR  PARAM_EDIT
CCFB BDE7B9                                                JSR  SETUP_INST01_VOL
CCFE 7ECB10                                                JMP  CASS_MOT_OFF_2

CD01 B61FF2                            INC_CUR_PROG        LDA  CURR_PROG_NUM      A = Current Prog #
CD04 4C                                                    INCA                    Current Prog = Current Prog + 1 (A = A + 1)
CD05 8132                                                  CMPA #$32 '2            Compare current prog # to 50
CD07 2302                                                  BLS  CURPROG_LT_50      If curr. prog. <=50, branch
CD09 8601                                                  LDA  #$1                else, set curr. prog = 1
CD0B B71FF2                            CURPROG_LT_50       STA  CURR_PROG_NUM      Store a copy of the opcode
CD0E 39                                                    RTS  

CD0F CC4F05                            ERROR_MSG           LDD  #$4F05             D = LED Value = 'Er'
CD12 DD20                                                  STD  LED_DIG0           LED_DIG_0 = 'E', LED_DIG_1 = 'r'
CD14 CC051D                                                LDD  #$51D              D = LED Value = 'ro'
CD17 DD22                                                  STD  LED_DIG2           LED_DIG_2 = 'r', LED_DIG_3 = 'o'
CD19 5F                                                    CLRB                    B = $00
CD1A DD24                                                  STD  LED_DIG4           LED_DIG_4 = 'r', LEG_DIG_5 = {blank}
CD1C 4F                                                    CLRA                    A = $00
CD1D DD26                                                  STD  LED_DIG6           LED_DIG_6, LED_DIG_7 = {blank}
CD1F B70140                                                STA  CASS_BUF_B0        Store 00 to CASS_BUF_B0
CD22 39                                                    RTS  

CD23 BDCADB                                                JSR  TPE_LIGHTS_OUT     Set Split 15 (Output Subroutine) Handler
CD26 8606                                                  LDA  #$6                A = $06
CD28 B72003                                                STA  RD_TIME_WR_TMOD    Set timer mode to "416 uS Mode"
CD2B 8610                                                  LDA  #$10               A=$10
CD2D BDCB38                                                JSR  LONG_CASS_PAUSE
CD30 1026FDD9                                              LBNE CANCEL_CASS_OP
CD34 C630                                                  LDB  #$30 '0            B=$30 = length of total avail. NVRAM
CD36 8E1FC1                                                LDX  #$1FC1             X=$1FC1 = Base address of 2nd avail. NVRAM byte
CD39 CE0141                                                LDU  #$141              U = 1st Data byte in cassette buffer
CD3C A680                              LOOP_48             LDA  ,X+                Copy Byte from 1FC1 (Free NV Ram)
CD3E A7C0                                                  STA  ,U+                To 0141 (Data portion of Cassette Buffer)
CD40 5A                                                    DECB                    B =  B - 1
CD41 26F9                                                  BNE  LOOP_48            Branch until we've copied all avail NVRAM (48 bytes)
CD43 CC0431                                                LDD  #$431              D = $0431
CD46 B70140                                                STA  CASS_BUF_B0        Store $04 to Safe_Buf_B0 (indicating subroutine)
CD49 BDC9B8                                                JSR  B_BYTES_2_TAPE
CD4C 7ECB0D                                                JMP  CANCEL_CASS_OP

CD4F D758                              GET_A_FRM_BUF       STB  CI_OPCODE_NEW      B -> RAM[$0058]
CD51 D643                                                  LDB  C_IN_BUF_HEAD2     B = Head of Chroma Input Buffer
CD53 8610                                                  LDA  #$10               A = $10
CD55 4A                                CI_BUF_EMPTY        DECA                    A = A - 1
CD56 2720                                                  BEQ  LOADED_16_BYTES    If A = 0, branch
CD58 D141                                                  CMPB C_IN_BUF_TAIL2
CD5A 27F9                                                  BEQ  CI_BUF_EMPTY       See if LSB of Head = LSB of Tail - if so, branch
CD5C A69F0042                                              LDA  [$42]              A = C_IN_BUF_HEAD_1 (= C_IN_BUF_HEAD MSB)
CD60 5C                                                    INCB 
CD61 C43F                                                  ANDB #$3F '?            Ignore top two bits
CD63 D743                                                  STB  C_IN_BUF_HEAD2
CD65 1A50                                                  ORCC #$50 'P            Disable FIRQ and IRQ
CD67 D62F                                                  LDB  WR_MSCO_IMG        B = WR_MSCO Image
CD69 2B07                                                  BMI  XI_MASK_EQ_1       Branch if XI_MASK = 1 (i.e., if we're ready to read more)
CD6B CA80                                                  ORB  #$80               Set XI_MASK = 1
CD6D D72F                                                  STB  WR_MSCO_IMG        Update Image
CD6F F72001                                                STB  RD_MSCI_WR_MSCO    Update H/W MSCO value
CD72 1CAF                              XI_MASK_EQ_1        ANDC #$AF               Enable FIRQ and IRQ
CD74 D658                                                  LDB  CI_OPCODE_NEW      B = RAM[$0058]
CD76 4D                                                    TSTA 
CD77 39                                                    RTS  

CD78 DF52                              LOADED_16_BYTES     STU  L64                U -> RAM[$0052]
CD7A 9F54                                                  STX  CI_HNDLR_A1        X -> RAM[$0054]
CD7C 109F56                                                STY  L65                Y -> RAM[$0056]
CD7F 3506                                                  PULS A,B
CD81 DD50                                                  STD  CI_HNDLR_B1        D -> RAM[$0050] & RAM[$0051]
CD83 7ED6F8                                                JMP  CHK_NOTE_BUF

CD86 8DC7                                                  BSR  GET_A_FRM_BUF      Chroma Port handler for attack and release
CD88 1F89                                                  TFR  A,B                B = 1st byte read from chroma port
CD8A 8DC3                                                  BSR  GET_A_FRM_BUF      A = 2nd byte read from chroma port
CD8C 1E89                                                  EXG  A,B                Flip A & B
CD8E 6E84                                                  JMP  0,X                Go back to calling routine

CD90 0D0F                              C_INF_OUT           TST  C_INTF_ECHO        See if it is OK to output chroma info
CD92 2701                                                  BEQ  PRNT_C_INF_1_BYTE  If C_INT_ECHO = 0, it is OK to output data - do it
CD94 39                                                    RTS                     Exit

CD95 3406                              PRNT_C_INF_1_BYTE   PSHS B,A
CD97 D62F                                                  LDB  WR_MSCO_IMG        B = WR_MSCO Image
CD99 58                                                    ASLB                    Shift all bits to the left
CD9A 2B12                                                  BMI  C_FIFO_NOT_EMPTY   Branch if Minus (if -XO_MASK = 1 - Outgoing FIFO not empty)
CD9C 8610                                                  LDA  #$10               A = $10
CD9E C640                                                  LDB  #$40 '@            B = $40 (0100 0000)
CDA0 4A                                WAIT_XO_FULL_CLR    DECA                    A = A - 1
CDA1 270B                                                  BEQ  C_FIFO_NOT_EMPTY
CDA3 F52001                                                BITB RD_MSCI_WR_MSCO    See if "-XO FULL is =1
CDA6 27F8                                                  BEQ  WAIT_XO_FULL_CLR   Wait for XOFULL to CLEAR and branch when it is
CDA8 3506                                                  PULS A,B                Restore values of A and B
CDAA B72002                                                STA  RD_EXTI_WR_EXTO    Put "A" out Chroma Port
CDAD 39                                                    RTS  

CDAE D645                              C_FIFO_NOT_EMPTY    LDB  C_OUT_BUF_TAIL2
CDB0 5C                                                    INCB                    B = B + 1 
CDB1 CAC0                                                  ORB  #$C0               Set top two bits (make sure address in proper range)
CDB3 4F                                                    CLRA                    A = 0
CDB4 D147                              IS_EMPTY_DELAY      CMPB C_OUT_BUF_HEAD2
CDB6 262D                                                  BNE  C_BUF_NOT_EMPTY    If head <> tail then branch
CDB8 4A                                                    DECA                    Else A = A - 1 
CDB9 26F9                                                  BNE  IS_EMPTY_DELAY     If A <> 0, branch (i.e., if head = tail, wait $FF loops for new data)
CDBB 1A10                                                  ORCC #$10               Set IRQ mask - Ignore -IRQ (i.e., further chroma port int's)
CDBD 0F09                                                  CLR  C_INTF_PANL        Disconnect panel commands from chroma interface
CDBF 0F0A                                                  CLR  C_INTF_PERF        Disconnect performance commands from chroma interface
CDC1 0F08                                                  CLR  C_INTF_PRES        Disconnect pressure interface from chroma interface
CDC3 0C0F                                                  INC  C_INTF_ECHO
CDC5 962F                                                  LDA  WR_MSCO_IMG        A = MSCO Image
CDC7 84BF                                                  ANDA #$BF               Clear "XO Mask" Value - Outgoing FIFO is empty.
CDC9 972F                                                  STA  WR_MSCO_IMG        Update Image
CDCB B72001                                                STA  RD_MSCI_WR_MSCO    Update HW MSCO value
CDCE CC02C0                                                LDD  #$2C0              D = $02C0 = start mem. location
CDD1 DD44                                                  STD  C_OUT_BUF_TAIL1    Reset Tail of Chroma Output Data Buffer (Buffer Empty)
CDD3 DD46                                                  STD  C_OUT_BUF_HEAD1    Reset Head of Chroma Output Data Buffer (Buffer Empty)
CDD5 CC0100                                                LDD  #$100              D = $0100
CDD8 DD40                                                  STD  C_IN_BUF_TAIL1     Reset Tail of Chroma Note Data Buffer (Buffer Empty)
CDDA DD42                                                  STD  C_IN_BUF_HEAD1     Reset Head of Chroma Note Data Buffer (Buffer Empty)
CDDC CCCE07                                                LDD  #$CE07             D = $CE07
CDDF DD50                                                  STD  CI_HNDLR_B1        Reset address of Chroma Port Handler
CDE1 1CEF                                                  ANDC #$EF               Allow chroma port interupts to be serviced (enable IRQ)
CDE3 3586                                                  PULS A,B,PC

CDE5 3502                              C_BUF_NOT_EMPTY     PULS A                  We're here if C_OUT_BUF not empty
CDE7 A79F0044                                              STA  [$44]              Store Incoming Byte on Stack
CDEB D745                                                  STB  C_OUT_BUF_TAIL2    Update End address of Stack
CDED 1A10                                                  ORCC #$10               Ignore IRQ (chroma port) interrups
CDEF D62F                                                  LDB  WR_MSCO_IMG        Get current MSCO image value
CDF1 CA40                                                  ORB  #$40 '@            Update XO Mask Image (we have data in outgoing FIFO)
CDF3 D72F                                                  STB  WR_MSCO_IMG        Store new MSCO image
CDF5 F72001                                                STB  RD_MSCI_WR_MSCO    Store new H/W MSCO value
CDF8 1CEF                                                  ANDC #$EF               Re-enable IRQ (chroma port) interupts
CDFA 3584                                                  PULS B,PC               Exit

CDFC A6C0                              PRNT_C_INF_N_BYTE   LDA  ,U+                U=Base address to copy data from, B= number of bytes
CDFE 8D90                                                  BSR  C_INF_OUT          Print Byte to Chroma Port
CE00 5A                                                    DECB                    B = B - 1
CE01 26F9                                                  BNE  PRNT_C_INF_N_BYTE  Print all "B" bytes
CE03 39                                                    RTS                     Exit

CE04 BDCD4F                            PROCES_CHROMA_DAT   JSR  GET_A_FRM_BUF      Get a byte from incoming chroma buffer
CE07 8118                                                  CMPA #$18
CE09 251C                                                  BCS  OPCODE_LT_18       If A < $18 (24 dec.), branch (opcodes <18 are "system" opcodes)
CE0B 9759                                                  STA  CI_OPCODE_CUR      If here, got a "performance" opcode - store
CE0D D659                                                  LDB  CI_OPCODE_CUR      B = Current chroma_in Opcode
CE0F C018                                                  SUBB #$18               Subtract off offset.
CE11 54                                                    LSRB                    B = B/2
CE12 54                                                    LSRB                    B = B/2 (for a total of B/4)
CE13 C43E                                                  ANDB #$3E '>            Pick off bits (0011 1110)
CE15 8ECE5D                                                LDX  #$CE5D             X = $CE5D = address of C_OPCODE Vector 18
CE18 3085                                                  LEAX B,X                X = CE5D + B where (0 <= B <= 62, by 2's)
CE1A 8407                                                  ANDA #$7                Grab lower 3 bits of "A" (A = "which instrument, 0 - 7)
CE1C C6B8                                                  LDB  #$B8               B = $B8 (length of 1 "instrument")
CE1E 3D                                                    MUL                     Get offset to Ath instrument
CE1F 108E0690                                              LDY  #$690              Y = $690 (address of 0th instrument)
CE23 31AB                                                  LEAY D,Y                Y = Address of Ath instrument
CE25 6E94                                                  JMP  [0,X]              Jump to Handler for Chroma Port commands (selected Opcode)

CE27 48                                OPCODE_LT_18        ASLA                    A = A x 2 (now 0 <= A <= 48 by 2's)
CE28 8ECE2D                                                LDX  #$CE2D             X = $CE2D
CE2B 6E96                                                  JMP  [A,X]              Jump to Handler for Chroma Port commands

CE2D CE04                              C_PORT_00_VEC       FDB  $CE04              Chroma Port Handler Vector Opcode $00 - No Operation
CE2F CE97                              C_PORT_01_VEC       FDB  $CE97              Chroma Port Handler Vector Opcode $01 - Identification
CE31 CEA9                              C_PORT_02_VEC       FDB  $CEA9              Chroma Port Handler Vector Opcode $02 - Read Program
CE33 CEC6                              C_PORT_03_VEC       FDB  $CEC6              Chroma Port Handler Vector Opcode $03 - Write Program
CE35 C90A                              C_PORT_04_VEC       FDB  $C90A              Chroma Port Handler Vector Opcode $04 - Load Packet
CE37 C8D3                              C_PORT_05_VEC       FDB  $C8D3              Chroma Port Handler Vector Opcode $05 - Save Packet
CE39 CF18                              C_PORT_06_VEC       FDB  $CF18              Chroma Port Handler Vector Opcode $06 - Read Parameter
CE3B CF48                              C_PORT_07_VEC       FDB  $CF48              Chroma Port Handler Vector Opcode $07 - Write Parameter
CE3D CF7B                              C_PORT_08_VEC       FDB  $CF7B              Chroma Port Handler Vector Opcode $08 - Panel Switch Off
CE3F CF81                              C_PORT_09_VEC       FDB  $CF81              Chroma Port Handler Vector Opcode $09 - Panel Switch On
CE41 CF89                              C_PORT_0A_VEC       FDB  $CF89              Chroma Port Handler Vector Opcode $0A - Performance Switch Off
CE43 CF8F                              C_PORT_0B_VEC       FDB  $CF8F              Chroma Port Handler Vector Opcode $0B - Performance Switch On
CE45 CF97                              C_PORT_0C_VEC       FDB  $CF97              Chroma Port Handler Vector Opcode $0C - Peek
CE47 CFB3                              C_PORT_0D_VEC       FDB  $CFB3              Chroma Port Handler Vector Opcode $0D - Peek Two Bytes
CE49 CFCC                              C_PORT_0E_VEC       FDB  $CFCC              Chroma Port Handler Vector Opcode $0E - Poke
CE4B CFEA                              C_PORT_0F_VEC       FDB  $CFEA              Chroma Port Handler Vector Opcode $0F - Poke Two Bytes
CE4D D002                              C_PORT_10_VEC       FDB  $D002              Chroma Port Handler Vector Opcode $10 - Tap Panel
CE4F D009                              C_PORT_11_VEC       FDB  $D009              Chroma Port Handler Vector Opcode $11 - Unlock
CE51 C8B7                              C_PORT_12_VEC       FDB  $C8B7              Chroma Port Handler Vector Opcode $12 - Tape Space
CE53 D01D                              C_PORT_13_VEC       FDB  $D01D              Chroma Port Handler Vector Opcode $13 - Restore
CE55 D07B                              C_PORT_14_VEC       FDB  $D07B              Chroma Port Handler Vector Opcode $14 - Pressure Switch Off
CE57 D082                              C_PORT_15_VEC       FDB  $D082              Chroma Port Handler Vector Opcode $15 - Pressure Switch On
CE59 CE04                              C_PORT_16_VEC       FDB  $CE04              Chroma Port Handler Vector Opcode $16 - Tune Get (not impl on Chroma)
CE5B CE04                              C_PORT_17_VEC       FDB  $CE04              Chroma Port Handler Vector Opcode $17 - Tune Set (not impl on Chroma)
CE5D CE04                              C_PORT_18_VEC       FDB  $CE04              Chroma Port Handler - Opcode $18 - Open Object (not impl on Chroma)
CE5F CE04                              C_PORT_20_VEC       FDB  $CE04              Chroma Port Handler - Opcode $20? - Unused 
CE61 CE04                              C_PORT_28_VEC       FDB  $CE04              Chroma Port Handler Vector Opcode $28? - Unused
CE63 CE04                              C_PORT_30_VEC       FDB  $CE04              Chroma Port Handler Vector Opcode $30? - Unused
CE65 CE04                              C_PORT_38_VEC       FDB  $CE04              Chroma Port Handler Vector Opcode $38? - Unused
CE67 CE04                              C_PORT_40_VEC       FDB  $CE04              Chroma Port Handler Vector Opcode $40? - Unused
CE69 CE04                              C_PORT_48_VEC       FDB  $CE04              Chroma Port Handler Vector Opcode $48? - Unused
CE6B CE04                              C_PORT_50_VEC       FDB  $CE04              Chroma Port Handler Vector Opcode $50? - Unused
CE6D CE04                              C_PORT_58_VEC       FDB  $CE04              Chroma Port Handler Vector Opcode $58? - Unused
CE6F CE04                              C_PORT_60_VEC       FDB  $CE04              Chroma Port Handler Vector Opcode $60? - Unused
CE71 D08B                              C_PORT_68_VEC       FDB  $D08B              Chroma Port Handler Vector Opcode $68 - $6F - Pressure
CE73 D0A3                              C_PORT_70_VEC       FDB  $D0A3              Chroma Port Handler Vector Opcode $70 - $77 - Information
CE75 D0BD                              C_PORT_78_VEC       FDB  $D0BD              Chroma Port Handler Vector Opcode $78 - $7F - Volume
CE77 D0C6                              C_PORT_80_VEC       FDB  $D0C6              Chroma Port Handler Vector Opcode $80 - $87 - Lever 1
CE79 D0D2                              C_PORT_88_VEC       FDB  $D0D2              Chroma Port Handler Vector Opcode $88 - $8F - Lever 2
CE7B D0DE                              C_PORT_90_VEC       FDB  $D0DE              Chroma Port Handler Vector Opcode $90 - $97 - Pedal 1
CE7D D0EA                              C_PORT_98_VEC       FDB  $D0EA              Chroma Port Handler Vector Opcode $98 - $9F - Pedal 2
CE7F D0F6                              C_PORT_A0_VEC       FDB  $D0F6              Chroma Port Handler Vector Opcode $A0 - $A7 - Footswitch 1 Down
CE81 D102                              C_PORT_A8_VEC       FDB  $D102              Chroma Port Handler Vector Opcode $A8 - $AF - Footswitch 1 Up
CE83 D10E                              C_PORT_B0_VEC       FDB  $D10E              Chroma Port Handler Vector Opcode $B0 - $B7 - Footswitch 2 Down
CE85 D11A                              C_PORT_B8_VEC       FDB  $D11A              Chroma Port Handler Vector Opcode $B8 - $BF - Footswitch 2 Up
CE87 D135                              C_PORT_C0_VEC       FDB  $D135              Chroma Port Handler Vector Opcode $C0 - $C7 - Define
CE89 D126                              C_PORT_C8_VEC       FDB  $D126              Chroma Port Handler Vector Opcode $C8 - $CF - Undefine
CE8B D189                              C_PORT_D0_VEC       FDB  $D189              Chroma Port Handler Vector Opcode $D0 - $D7 - Attack
CE8D D1AB                              C_PORT_D8_VEC       FDB  $D1AB              Chroma Port Handler Vector Opcode $D8 - $DF - Release
CE8F D1C4                              C_PORT_E0_VEC       FDB  $D1C4              Chroma Port Handler Vector Opcode $E0 - $E7 - Set Parameter
CE91 D207                              C_PORT_E8_VEC       FDB  $D207              Chroma Port Handler Vector Opcode $E8 - $EF - Status
CE93 D24E                              C_PORT_F0_VEC       FDB  $D24E              Chroma Port Handler Vector Opcode $F0 - $F7 - Squelch
CE95 CE04                              C_PORT_F8_VEC       FDB  $CE04              Chroma Port Handler Vector Opcode $F8 - $FF - Unused

CE97 8601                                                  LDA  #$1                Chroma Port Handler Opcode $01 - Identification
CE99 BDCD90                                                JSR  C_INF_OUT          Output Opcode $01
CE9C 8601                                                  LDA  #$1                Identify device as a "Chroma"
CE9E BDCD90                                                JSR  C_INF_OUT
CEA1 8603                                                  LDA  #$3                Output software rev. value = $03
CEA3 BDCD90                                                JSR  C_INF_OUT
CEA6 7ECE04                                                JMP  PROCES_CHROMA_DAT

CEA9 BDCD4F                                                JSR  GET_A_FRM_BUF      Chroma Port Handler Opcode $02 - Read Program
CEAC 8132                                                  CMPA #$32 '2            Make sure prog <= 50
CEAE 2301                                                  BLS  READ_PRG_NO_OK     Branch if prog # OK
CEB0 4F                                                    CLRA                    Else, prog # in error, use program # 0
CEB1 C63B                              READ_PRG_NO_OK      LDB  #$3B ';            B = length of 1 stored program
CEB3 3D                                                    MUL                     D = offset to program selected
CEB4 CE1400                                                LDU  #$1400             U = address of program 0
CEB7 33CB                                                  LEAU D,U                U = start address of selected program
CEB9 8602                                                  LDA  #$2                Print out opcode
CEBB BDCD90                                                JSR  C_INF_OUT          Output opcode to chroma port
CEBE C63B                                                  LDB  #$3B ';            B = Number of bytes to be printed
CEC0 BDCDFC                                                JSR  PRNT_C_INF_N_BYTE  Output B bytes starting at Address "U"
CEC3 7ECE04                                                JMP  PROCES_CHROMA_DAT

CEC6 BDCD4F                                                JSR  GET_A_FRM_BUF      Chroma Port Handler Opcode $03 - Write Program
CEC9 8132                                                  CMPA #$32 '2            A = Program number to be written
CECB 230B                                                  BLS  WRTE_PRG_NO_OK     If A <= 50, branch
CECD C63B                                                  LDB  #$3B ';            else, prog. # in error
CECF BDCD4F                            STRIP_DAT_LOOP      JSR  GET_A_FRM_BUF      strip of $3B bytes -> do ot do anthing else
CED2 5A                                                    DECB                    B = B-1
CED3 26FA                                                  BNE  STRIP_DAT_LOOP
CED5 7ECE04                                                JMP  PROCES_CHROMA_DAT

CED8 4D                                WRTE_PRG_NO_OK      TSTA                    Check A
CED9 2705                                                  BEQ  WRITE_PROG_0       If A=0, branch (program input = 00)
CEDB B11FF2                                                CMPA CURR_PROG_NUM      Compare entered program against displayed number
CEDE 2603                                                  BNE  WRTE_PRG_NE_CUR    if entered prog. different, branch
CEE0 BDDDF7                            WRITE_PROG_0        JSR  PROG_MODIFIED      else, same program number - set modified bit & LED
CEE3 C63B                              WRTE_PRG_NE_CUR     LDB  #$3B ';            B = length of program
CEE5 3D                                                    MUL                     D = offset to selected program
CEE6 CE1400                                                LDU  #$1400             U = $1400
CEE9 33CB                                                  LEAU D,U                U = Base address for selected program
CEEB C63B                                                  LDB  #$3B ';            B = length of a program
CEED BDCD4F                            WRTE_MORE_DATA      JSR  GET_A_FRM_BUF
CEF0 A7C0                                                  STA  ,U+
CEF2 5A                                                    DECB                    B = B-1
CEF3 26F8                                                  BNE  WRTE_MORE_DATA     Get all B bytes from Buffer
CEF5 33C8C5                                                LEAU -59,U              U = Base address of selected program
CEF8 BDDDA3                                                JSR  PARAM_FIX          ensure loaded programs are OK
CEFB BDF75D                                                JSR  MKE_PROG_CHNGE
CEFE BDDA55                                                JSR  BOARD_ASSIGN
CF01 BDDDF7                                                JSR  PROG_MODIFIED      set program modified information
CF04 11831400                                              CMPU #$1400             compare U w/base program 0 address
CF08 1026FEF8                                              LBNE PROCES_CHROMA_DAT  if current prog <> prog 0 address, check chroma data
CF0C B6141E                                                LDA  P0_PANEL_EDIT      else A = panel edit vals
CF0F BDE85B                                                JSR  PARAM_EDIT         set up params
CF12 BDE7B9                                                JSR  SETUP_INST01_VOL   set up new link program
CF15 7ECE04                                                JMP  PROCES_CHROMA_DAT

CF18 8ECD86                                                LDX  #$CD86             Chroma Port Handler Opcode $06 - Read Parameter
CF1B 1E15                                                  EXG  X,PC               X= address of handler to get 2 bytes - jump to handler
CF1D 8132                                                  CMPA #$32 '2            A = Prog #, B = Param #
CF1F 2204                                                  BHI  R_ERR_PROG_NO      If A > 50, an incorrect Prog # was enterred - branch
CF21 C164                                                  CMPB #$64 'd            check to see if we have a valid param #
CF23 230C                                                  BLS  READ_DATA_OK       if param # <= 100, we're ok - branch
CF25 8606                              R_ERR_PROG_NO       LDA  #$6                else A = $06
CF27 BDCD90                                                JSR  C_INF_OUT          Output opcode for "read parameter"
CF2A 4F                                                    CLRA                    A = 0
CF2B BDCD90                                                JSR  C_INF_OUT          Output parameter value ("0" for undefined program)
CF2E 7ECE04                                                JMP  PROCES_CHROMA_DAT

CF31 D758                              READ_DATA_OK        STB  CI_OPCODE_NEW
CF33 C63B                                                  LDB  #$3B ';            B = $3B = length of 1 program
CF35 3D                                                    MUL                     D = offset to selected program
CF36 CE1400                                                LDU  #$1400             U = Base address of programs
CF39 33CB                                                  LEAU D,U                U = Base address of selected program
CF3B D658                                                  LDB  CI_OPCODE_NEW      B = selected Param
CF3D 8606                                                  LDA  #$6                A = $06
CF3F BDCD90                                                JSR  C_INF_OUT          Output opcode for "read parameter"
CF42 BDDC69                                                JSR  CHK_PARAM_DATA     confirm proper instrument values
CF45 7ECFC6                                                JMP  ALT_C_INT_OUT

CF48 8ECD86                                                LDX  #$CD86             Chroma Port Handler Opcode $07 - Write Parameter
CF4B 1E15                                                  EXG  X,PC               X = address of hander to get two bytes from chroma port - jump
CF4D 8132                                                  CMPA #$32 '2            A = Prog #, B = Param #
CF4F 2204                                                  BHI  W_ERR_PROG_NO      If prog # out of range, error - branch
CF51 C164                                                  CMPB #$64 'd            else check param value
CF53 2306                                                  BLS  WRITE_DATA_OK      if param val ok, branch
CF55 BDCD4F                            W_ERR_PROG_NO       JSR  GET_A_FRM_BUF      else, error, clear next byte from chroma buffer
CF58 7ECE04                                                JMP  PROCES_CHROMA_DAT

CF5B 4D                                WRITE_DATA_OK       TSTA                    See if selected program is "0"
CF5C 2705                                                  BEQ  W_SEL_PROG_0       if it is, branch
CF5E B11FF2                                                CMPA CURR_PROG_NUM      else, check to see if it is the currently selected prog.
CF61 2603                                                  BNE  W_NOT_SEL_PROG     if it isn't, branch
CF63 BDDDF7                            W_SEL_PROG_0        JSR  PROG_MODIFIED      else, indicate to user that prog. def'n has changed
CF66 D758                              W_NOT_SEL_PROG      STB  CI_OPCODE_NEW
CF68 C63B                                                  LDB  #$3B ';            B = length of 1 program
CF6A 3D                                                    MUL                     D = offset to selected program
CF6B CE1400                                                LDU  #$1400             U = base address of programs
CF6E 33CB                                                  LEAU D,U                U = base address of selected program
CF70 D658                                                  LDB  CI_OPCODE_NEW      B = parameter entered
CF72 BDCD4F                                                JSR  GET_A_FRM_BUF      A = requested value of param
CF75 BDDCAE                                                JSR  VALDTE_PARAM_2     update param value
CF78 7ECE04                                                JMP  PROCES_CHROMA_DAT

CF7B 0F09                                                  CLR  C_INTF_PANL        Chroma Port Handler Opcode $08 - Panel Switch Off
CF7D 8608                                                  LDA  #$8                A = $08
CF7F 2045                                                  BRA  ALT_C_INT_OUT

CF81 8601                                                  LDA  #$1                Chroma Port Handler Opcode $09 - Panel Switch On
CF83 9709                                                  STA  C_INTF_PANL
CF85 8609                                                  LDA  #$9                A = $09
CF87 203D                                                  BRA  ALT_C_INT_OUT

CF89 0F0A                                                  CLR  C_INTF_PERF        Chroma Port Handler Opcode $0A - Performance Switch Off
CF8B 860A                                                  LDA  #$A                A = $0A
CF8D 2037                                                  BRA  ALT_C_INT_OUT

CF8F 8601                                                  LDA  #$1                Chroma Port Handler Opcode $0B - Performance Switch On - A = $01
CF91 970A                                                  STA  C_INTF_PERF        turn performance switch on
CF93 860B                                                  LDA  #$B                $B = opcode for performance switch on
CF95 202F                                                  BRA  ALT_C_INT_OUT      output opcode

CF97 8ECD86                                                LDX  #$CD86             Chroma Port Handler Opcode $0C - Peek
CF9A 1E15                                                  EXG  X,PC               X = address of handler to get 2 bytes from chroma port - jump
CF9C 1F03                                                  TFR  D,U                U = address entered to be peeked at
CF9E BDCD4F                                                JSR  GET_A_FRM_BUF      A = number of bytes to be peeked
CFA1 1F89                                                  TFR  A,B                B = number of bytes to be peeked
CFA3 860C                                                  LDA  #$C                $C = opcode for "peek"
CFA5 BDCD90                                                JSR  C_INF_OUT          output peek opcode
CFA8 1F98                                                  TFR  B,A                A = number of bytes to be peeked
CFAA BDCD90                                                JSR  C_INF_OUT          output number of bytes to be peeked
CFAD BDCDFC                                                JSR  PRNT_C_INF_N_BYTE  U = base address, B = number of bytes
CFB0 7ECE04                                                JMP  PROCES_CHROMA_DAT

CFB3 8ECD86                                                LDX  #$CD86             Chroma Port Handler Opcode $0D - Peek Two Bytes
CFB6 1E15                                                  EXG  X,PC               X = address of handler to get 2 bytes from chroma port - jump
CFB8 1F03                                                  TFR  D,U                D = peek two bytes address -> U
CFBA 860D                                                  LDA  #$D                $0D = opcode for "Peek two bytes"
CFBC BDCD90                                                JSR  C_INF_OUT          Output "peek two bytes" opcode
CFBF ECC4                                                  LDD  0,U                D = 2 bytes at RAM[U]
CFC1 BDCD90                                                JSR  C_INF_OUT          output "A" bytes
CFC4 1F98                                                  TFR  B,A                B -> A
CFC6 BDCD90                            ALT_C_INT_OUT       JSR  C_INF_OUT          Output second byte
CFC9 7ECE04                                                JMP  PROCES_CHROMA_DAT

CFCC 8ECD86                                                LDX  #$CD86             Chroma Port Handler Opcode $0E - Poke
CFCF 1E15                                                  EXG  X,PC               X = address of handler to get 2 bytes from chroma port - jump
CFD1 1F03                                                  TFR  D,U                D = address ot poke -> U
CFD3 0D0E                                                  TST  UNLCK_STATE        Check to see if pokes are allowed
CFD5 2603                                                  BNE  POKES_ALLOWED      if UNLCK_STATE <> 0, then pokes allowed
CFD7 CEFF00                                                LDU  #$FF00             else pokes not allowed U=$FF00
CFDA BDCD4F                            POKES_ALLOWED       JSR  GET_A_FRM_BUF      A = number of bytes to poke
CFDD 1F89                                                  TFR  A,B                B = number of bytes to poke
CFDF BDCD4F                            MORE_B_TO_POKE      JSR  GET_A_FRM_BUF      A = first byte to poke (data)
CFE2 A7C0                                                  STA  ,U+                Poke byte in at address U
CFE4 5A                                                    DECB                    B = B-1
CFE5 26F8                                                  BNE  MORE_B_TO_POKE     Loop while still bytes to poke
CFE7 7ECE04                                                JMP  PROCES_CHROMA_DAT

CFEA 8ECD86                                                LDX  #$CD86             Chroma Port Handler Opcode $0F - Poke Two Bytes
CFED 1E15                                                  EXG  X,PC               X = address of handler to get 2 bytes from chroma port - jump
CFEF 1F03                                                  TFR  D,U                D = address to poke -> U
CFF1 0D0E                                                  TST  UNLCK_STATE        check to see if pokes are allowed
CFF3 2603                                                  BNE  POKE2_ALLOWED      if UNLCK_STATE <> 0, then pokes allowed
CFF5 CEFFF0                                                LDU  #$FFF0             else pokes not allowed - poke to ROM
CFF8 8ECD86                            POKE2_ALLOWED       LDX  #$CD86
CFFB 1E15                                                  EXG  X,PC               X = address of handler to get 2 bytes from chroma port - jump
CFFD EDC4                                                  STD  0,U                Poke A:B = D into address U
CFFF 7ECE04                                                JMP  PROCES_CHROMA_DAT

D002 A79F1FF4                                              STA  [$1FF4]            Chroma Port Handler Opcode $10 - Tap Panel - Fire Tapper
D006 7ECE04                                                JMP  PROCES_CHROMA_DAT

D009 8ECD86                                                LDX  #$CD86             Chroma Port Handler Opcode $11 - Unlock
D00C 1E15                                                  EXG  X,PC               X = address of handler to get 2 bytes from chroma port - jump
D00E 0F0E                                                  CLR  UNLCK_STATE        Set unlock state to 0 (i.e., memory locked)
D010 108300FF                                              CMPD #$FF               see if we received a well formed unlock command
D014 1026FDEC                                              LBNE PROCES_CHROMA_DAT  if we didn't, exit
D018 0C0E                                                  INC  UNLCK_STATE        else we did - set unlock state to 1 (unlocked)
D01A 7ECE04                                                JMP  PROCES_CHROMA_DAT

D01D 108E0690                                              LDY  #$690              Chroma Port Handler Opcode $13 - Restore Y = address of inst 0
D021 BDD994                            O13_INIT_NXTBRD     JSR  INIT_BRD_4_INST    Init board for selected instrument
D024 31A900B8                                              LEAY 184,Y              Y = address of next instrument
D028 108C0B98                                              CMPY #$B98              See if at last instrument
D02C 23F3                                                  BLS  O13_INIT_NXTBRD    if not at last instrument, branch
D02E 0F09                                                  CLR  C_INTF_PANL        Disconnect Chroma Panel Interface
D030 0F0A                                                  CLR  C_INTF_PERF        Disconnect Chroma Performance Interface
D032 0F08                                                  CLR  C_INTF_PRES        Disconnect Chroma Pressure Interface
D034 8608                                                  LDA  #$8                A = Opcode for Chroma Panel Switch Off
D036 BDCD90                                                JSR  C_INF_OUT          Print out Chroma Panel Switch Off to Chroma Port
D039 860A                                                  LDA  #$A                A = Opcode for Chroma Performance Switch Off
D03B BDCD90                                                JSR  C_INF_OUT          Print out last opcode
D03E 8614                                                  LDA  #$14               A = Opcode for Chroma Pressure Switch Off
D040 BDCD90                                                JSR  C_INF_OUT          Print out last opcode
D043 CE1400                                                LDU  #$1400             U = base address of programs
D046 108E0690                                              LDY  #$690              Y = base address of instruments
D04A EF26                                                  STU  $6,Y               U = address of program defining instrument 0
D04C BDD960                                                JSR  INVOKE_PROG        invoke selected program (P0)
D04F BDD9CC                                                JSR  FINISH_PROG_DEF    complete invokationof selected program
D052 B61400                                                LDA  P0_LINK_VALS       A = link setting
D055 85C0                                                  BITA #$C0
D057 2713                                                  BEQ  O13_NO_LINK        If Answer <> 0 then no link
D059 843F                                                  ANDA #$3F '?            else, there is a link - A = program #
D05B C63B                                                  LDB  #$3B ';            B = length of program
D05D 3D                                                    MUL                     D = offset to link program
D05E 33CB                                                  LEAU D,U                U = base address of link program
D060 31A900B8                                              LEAY 184,Y              Y = address of "next" instrument (link instrument)
D064 EF26                                                  STU  $6,Y               Update "defining program" field in inst. def'n
D066 BDD960                                                JSR  INVOKE_PROG        Invoke Link Program
D069 BDD9CC                                                JSR  FINISH_PROG_DEF    complete invokation of link program
D06C BDDA55                            O13_NO_LINK         JSR  BOARD_ASSIGN       do something about checking/assigning boards
D06F FC1FF2                                                LDD  CURR_PROG_NUM      D = curr program # & modify state
D072 BDDE04                                                JSR  OUTPUT_BIG_PROG    Update display
D075 BDE85B                                                JSR  PARAM_EDIT
D078 7ECE04                                                JMP  PROCES_CHROMA_DAT

D07B 0F08                                                  CLR  C_INTF_PRES        Chroma Port Handler Opcode $14 - Pressure Switch Off
D07D 8614                                                  LDA  #$14               A = opcode for pressure switch off
D07F 7ECFC6                                                JMP  ALT_C_INT_OUT      output opcode

D082 8601                                                  LDA  #$1                Chroma Port Handler Opcode $15 - Pressure Switch On
D084 9708                                                  STA  C_INTF_PRES        Turn pressure switch on
D086 8615                                                  LDA  #$15               A = opcode for pressure switch on
D088 7ECFC6                                                JMP  ALT_C_INT_OUT      output opcode

D08B 8ECD86                                                LDX  #$CD86             Chroma Port Handler Opcode $68 - $6F - Pressure
D08E 1E15                                                  EXG  X,PC               Do 2-byte chroma handler (A = note #, B = pressure value)
D090 C43F                                                  ANDB #$3F '?            limit pressure value to a max 0 <= X <= 63
D092 D75F                                                  STB  PLAYED_PRES        Store pressure value
D094 48                                                    ASLA                    note # = note # x 2
D095 47                                                    ASRA                    Shift note right -> now note is even
D096 975C                                                  STA  CORR_NOTE          store corrected note
D098 965F                                                  LDA  PLAYED_PRES        A = played pressure
D09A BDE8E2                                                JSR  CALC_PRESS         calculate internally used pressure value - store in MEM0 - MEM4
D09D BDE8FA                                                JSR  PRESS_TO_CHNL      put new pressure value inside channel boards
D0A0 7ECE04                                                JMP  PROCES_CHROMA_DAT

D0A3 9659                                                  LDA  CI_OPCODE_CUR      Chroma Port Handler Opcode $70 - $77 - Information
D0A5 BDCD90                                                JSR  C_INF_OUT          Print out Opcode
D0A8 AE24                                                  LDX  $4,Y               X = address of board containing first channel assigned to inst Y
D0AA BDDA42                                                JSR  COUNT_BRD_ASGN     Count number of boards assigned - return value in A
D0AD BDCD90                                                JSR  C_INF_OUT          Print out Info Byte #1 (number of boards assigned to ins. A)
D0B0 4F                                                    CLRA                    A = 0
D0B1 BDCD90                                                JSR  C_INF_OUT          Print out Info Byte # 2 (print out $00)
D0B4 BDCD90                                                JSR  C_INF_OUT          Print out Info Byte # 3 (print out $00)
D0B7 BDCD90                                                JSR  C_INF_OUT          Print out Info Byte # 4 (print out $00)
D0BA 7ECE04                                                JMP  PROCES_CHROMA_DAT

D0BD BDCD4F                                                JSR  GET_A_FRM_BUF      Chroma Port Handler Opcode $78 - $7F - Volume
D0C0 BDDA13                                                JSR  SET_LNK_BAL        X = reqstd volume (0 <= V <= 255) - update vol. in inst def'n
D0C3 7ECE04                                                JMP  PROCES_CHROMA_DAT

D0C6 BDCD4F                                                JSR  GET_A_FRM_BUF      Chroma Port Handler Opcode $80 - $87 - Lever 1
D0C9 A7A808                                                STA  $8,Y               A = lever 1 value : store value in instrument def'n
D0CC BDDC07                                                JSR  UPD_LEV1_IN_CHAN   Update lever 1 value for instruments
D0CF 7ECE04                                                JMP  PROCES_CHROMA_DAT

D0D2 BDCD4F                                                JSR  GET_A_FRM_BUF      Chroma Port Handler Opcode $88 - $8F - Lever 2
D0D5 A7A809                                                STA  $9,Y               A = lever 2 value : store value in instrument def'n
D0D8 BDDC18                                                JSR  UPD_LEV2_IN_CHAN   Update lever 2 value for instruments
D0DB 7ECE04                                                JMP  PROCES_CHROMA_DAT

D0DE BDCD4F                                                JSR  GET_A_FRM_BUF      Chroma Port Handler Opcode $90 - $97 - Pedal 1
D0E1 A7A864                                                STA  $64,Y              A = pedal 1 val (0 <= X <= 255) - store converted pedal 1 val
D0E4 BDDC3E                                                JSR  UPD_PED1_VAL       update pedal 1 value for instrument
D0E7 7ECE04                                                JMP  PROCES_CHROMA_DAT

D0EA BDCD4F                                                JSR  GET_A_FRM_BUF      Chroma Port Handler Opcode $98 - $9F - Pedal 2
D0ED A7A865                                                STA  $65,Y              A = pedal 2 val (0 <= X <= 255) - store converted pedal 2 val
D0F0 BDDC4F                                                JSR  UPD_PED2_VAL       update pedal 2 val for instrument
D0F3 7ECE04                                                JMP  PROCES_CHROMA_DAT

D0F6 EE26                                                  LDU  $6,Y               Chroma Port Handler Opcode $A0 - $A7 - Footswitch 1 Down
D0F8 1027FD08                                              LBEQ PROCES_CHROMA_DAT  U = address of prog. defining inst.
D0FC ADB80E                                                JSR  [$E,Y]             jump to footswitch 1 assert handler
D0FF 7ECE04                                                JMP  PROCES_CHROMA_DAT

D102 EE26                                                  LDU  $6,Y               Chroma Port Handler Opcode $A8 - $AF - Footswitch 1 Up
D104 1027FCFC                                              LBEQ PROCES_CHROMA_DAT
D108 ADB86A                                                JSR  [$6A,Y]            jump to footswitch 1 deassert handler
D10B 7ECE04                                                JMP  PROCES_CHROMA_DAT

D10E EE26                                                  LDU  $6,Y               Chroma Port Handler Opcode $B0 - $B7 - Footswitch 2 Down
D110 1027FCF0                                              LBEQ PROCES_CHROMA_DAT
D114 ADB810                                                JSR  [$10,Y]            jump to footswitch 2 assert handler
D117 7ECE04                                                JMP  PROCES_CHROMA_DAT

D11A EE26                                                  LDU  $6,Y               Chroma Port Handler Opcode $B8 - $BF - Footswitch 2 Up
D11C 1027FCE4                                              LBEQ PROCES_CHROMA_DAT
D120 ADB86C                                                JSR  [$6C,Y]            jump to footswitch 2 deassert handler
D123 7ECE04                                                JMP  PROCES_CHROMA_DAT

D126 EE26                                                  LDU  $6,Y               Chroma Port Handler Opcode $C8 - $CF - Undefine
D128 1027FCD8                                              LBEQ PROCES_CHROMA_DAT  U = address of defining program
D12C BDD994                                                JSR  INIT_BRD_4_INST    Init board for inst.
D12F BDDA55                                                JSR  BOARD_ASSIGN       Assign Boards
D132 7ECE04                                                JMP  PROCES_CHROMA_DAT

D135 BDCD4F                                                JSR  GET_A_FRM_BUF      Chroma Port Handler Opcode $C0 - $C7 - Define (A=Prog. #)
D138 8132                                                  CMPA #$32 '2            Compare A w/50
D13A 230B                                                  BLS  DEFINE_PROG_OK     Branch if A <= 50
D13C C606                              LD_DEF_BYTES        LDB  #$6                else, error - strip off six chroma define bytes - B = $6
D13E BDCD4F                                                JSR  GET_A_FRM_BUF      Get Chroma Byte
D141 5A                                                    DECB                    B = B - 1
D142 26F8                                                  BNE  LD_DEF_BYTES       If we haven't got all 6 bytes yet, get another
D144 7ECE04                                                JMP  PROCES_CHROMA_DAT

D147 C63B                              DEFINE_PROG_OK      LDB  #$3B ';            B = length of program
D149 3D                                                    MUL                     D = offset to selected program
D14A CE1400                                                LDU  #$1400             U = Base address of Program 0
D14D 33CB                                                  LEAU D,U                U = base address of selected program
D14F EC26                                                  LDD  $6,Y               D = address of program defining instrument
D151 2703                                                  BEQ  NEW_INST           If D=0, instrument not defined
D153 BDD994                                                JSR  INIT_BRD_4_INST    else, instrument was assigned -> free up old boards
D156 EF26                              NEW_INST            STU  $6,Y               store base address of selected program as defining prog.
D158 BDCD4F                                                JSR  GET_A_FRM_BUF      A = Lever 1 Value
D15B A7A808                                                STA  $8,Y               Store converted Lev 1 value to Inst. Def'n
D15E BDCD4F                                                JSR  GET_A_FRM_BUF      A = Lever 2 Value
D161 A7A809                                                STA  $9,Y               Store converted Lev 2 value to Inst. Def'n
D164 BDCD4F                                                JSR  GET_A_FRM_BUF      A = Pedal 1 Value
D167 A7A864                                                STA  $64,Y              Store Pedal 1 value to Inst. Def'n
D16A BDCD4F                                                JSR  GET_A_FRM_BUF      A = Pedal 2 Value
D16D A7A865                                                STA  $65,Y              Store Pedal 2 value to Inst. Def'n
D170 BDCD4F                                                JSR  GET_A_FRM_BUF      A = Volume
D173 1F89                                                  TFR  A,B                B = Volume
D175 BDCD4F                                                JSR  GET_A_FRM_BUF      A = Footswitch Settings
D178 A7A861                                                STA  $61,Y              Store footswitch settings in inst. def'n
D17B BDD960                                                JSR  INVOKE_PROG
D17E 1F98                                                  TFR  B,A                A = Volume
D180 BDDA13                                                JSR  SET_LNK_BAL        Set Volume Level
D183 BDDA55                                                JSR  BOARD_ASSIGN       Perform Board Assignment
D186 7ECE04                                                JMP  PROCES_CHROMA_DAT

D189 8ECD86                                                LDX  #$CD86             Chroma Port Handler Opcode $D0 - $D7 - Attack
D18C 1E15                                                  EXG  X,PC               Jump and get 2 bytes from Chroma Port - A = Note, B = Velocity
D18E 48                                                    ASLA 
D18F 47                                                    ASRA                    Double top bit of note (ensure sign bit is correct for 6 -bit number)
D190 C41F                                                  ANDB #$1F               ensure velocity value is within limits
D192 1F03                                                  TFR  D,U                U = Note:Velocity
D194 BDCD4F                                                JSR  GET_A_FRM_BUF      A = pressure
D197 975F                                                  STA  PLAYED_PRES        Store pressure value
D199 1F30                                                  TFR  U,D                D = note:velocity
D19B 975C                                                  STA  CORR_NOTE          Store note data
D19D D75E                                                  STB  PLAYED_VEL         Store velocity data
D19F EE26                                                  LDU  $6,Y               U = address of defining program
D1A1 1027FC5F                                              LBEQ PROCES_CHROMA_DAT
D1A5 ADB80C                                                JSR  [$C,Y]             Jump to handler for keyboard algorithm
D1A8 7ECE04                                                JMP  PROCES_CHROMA_DAT

D1AB 8ECD86                                                LDX  #$CD86             Chroma Port Handler Opcode $D8 - $DF - Release
D1AE 1E15                                                  EXG  X,PC               jump and get 2 bytes from Chroma Port - A = Note, B = Velocity
D1B0 48                                                    ASLA 
D1B1 47                                                    ASRA 
D1B2 975C                                                  STA  CORR_NOTE
D1B4 C41F                                                  ANDB #$1F
D1B6 D75E                                                  STB  PLAYED_VEL
D1B8 EE26                                                  LDU  $6,Y               Y = address of defining program
D1BA 1027FC46                                              LBEQ PROCES_CHROMA_DAT
D1BE ADB868                                                JSR  [$68,Y]            Jump to release handler (set by keybd algorithm)
D1C1 7ECE04                                                JMP  PROCES_CHROMA_DAT

D1C4 BDCD4F                                                JSR  GET_A_FRM_BUF      Chroma Port Handler Opcode $E0 - $E7 - Set Parameter A=param #
D1C7 2710                                                  BEQ  OP_E0_NOP          if param # = 0, this is a no-op, exit
D1C9 EE26                                                  LDU  $6,Y               Y = address of defining program
D1CB 270C                                                  BEQ  OP_E0_NOP          If no program defined for this instrument, exit
D1CD 8132                                                  CMPA #$32 '2            see if param # is legal
D1CF 2313                                                  BLS  E0_PARM_VAL_OK     If param # <= 50, branch
D1D1 8137                                                  CMPA #$37 '7            else, param > 50
D1D3 2304                                                  BLS  OP_E0_NOP          branch if "control" param
D1D5 8164                                                  CMPA #$64 'd            else, see if param is a "b" param
D1D7 2306                                                  BLS  B_PARAM_OK         branch if valid B-param
D1D9 BDCD4F                            OP_E0_NOP           JSR  GET_A_FRM_BUF      A = value for param
D1DC 7ECE04                                                JMP  PROCES_CHROMA_DAT

D1DF 8032                              B_PARAM_OK          SUBA #$32 '2            A = A-32
D1E1 31A85C                                                LEAY $5C,Y              Y = Base address of B params in instrument
D1E4 1F89                              E0_PARM_VAL_OK      TFR  A,B                A->B - B = Param #
D1E6 58                                                    ASLB                    B = Bx2
D1E7 58                                                    ASLB                    B = Bx2
D1E8 4F                                                    CLRA                    A = 0
D1E9 8EE39A                                                LDX  #$E39A             X = $E39A = base address of lookup info for params
D1EC 308B                                                  LEAX D,X                X = E39A + 4xparam # = address of handler for param
D1EE BDCD4F                                                JSR  GET_A_FRM_BUF      A = value requested for param
D1F1 E603                                                  LDB  $3,X               B = offset to param limit info
D1F3 C508                                                  BITB #$8                see if bit 3 clear
D1F5 2704                                                  BEQ  NORM_PARAM         if bit 3 clear, "norm" param (branch)
D1F7 48                                                    ASLA                    else all values OK, as long as top bit clear
D1F8 47                                                    ASRA 
D1F9 2007                                                  BRA  BIG_PARAM_VAL

D1FB C407                              NORM_PARAM          ANDB #$7                B = lower 3 bits of "offset to param limit"
D1FD CEFB95                                                LDU  #$FB95             U = Address of "parameter limits"
D200 A4C5                                                  ANDA B,U                A = selected param value, truncated by limit param
D202 AD94                              BIG_PARAM_VAL       JSR  [0,X]              Do handler for param selected
D204 7ECE04                                                JMP  PROCES_CHROMA_DAT

D207 C6FF                                                  LDB  #$FF               Chroma Port Handler Opcode $E8 - $EF - Status B=$FF
D209 EE26                                                  LDU  $6,Y               U = address of defining program
D20B 11831400                          NOT_AT_P0_YET       CMPU #$1400             check defining prog. address against P0 address
D20F 2506                                                  BCS  NOW_AT_P0          If defining prg. address < P0, branch
D211 5C                                                    INCB 
D212 33C8C5                                                LEAU -59,U              U = address of "previous program"
D215 20F4                                                  BRA  NOT_AT_P0_YET      Loop until we've reached P0's address

D217 5D                                NOW_AT_P0           TSTB 
D218 2603                                                  BNE  NO_STRT_AT_P0      If B <> 0, then we didn't start at P0 address
D21A F61FF2                                                LDB  CURR_PROG_NUM      else, we did - provide info on "current" prog.
D21D 9659                              NO_STRT_AT_P0       LDA  CI_OPCODE_CUR      A = instrument opcode received via chroma port
D21F BDCD90                                                JSR  C_INF_OUT          Output opcode
D222 1F98                                                  TFR  B,A                B = number of programs "away" from P0 = program #
D224 BDCD90                                                JSR  C_INF_OUT          output program #
D227 A6A808                                                LDA  $8,Y               A = Lever 1 Data
D22A BDCD90                                                JSR  C_INF_OUT          Output data to chroma port
D22D A6A809                                                LDA  $9,Y               A = Lever 2 Data
D230 BDCD90                                                JSR  C_INF_OUT          Output data to chroma port
D233 A6A864                                                LDA  $64,Y              A = Pedal 1 data
D236 BDCD90                                                JSR  C_INF_OUT          Output data to chroma port
D239 A6A865                                                LDA  $65,Y              A = Pedal 2 data
D23C BDCD90                                                JSR  C_INF_OUT          Output data to chroma port
D23F A6A818                                                LDA  $18,Y              A = Volume Data
D242 BDCD90                                                JSR  C_INF_OUT          Output data to chroma port
D245 A6A861                                                LDA  $61,Y              A = Footswitch Byte
D248 BDCD90                                                JSR  C_INF_OUT          Output data to chroma port
D24B 7ECE04                                                JMP  PROCES_CHROMA_DAT

D24E E6A85F                                                LDB  $5F,Y              Chroma Port Handler Opcode $F0 - $F7 - Squelch
D251 8E0000                                                LDX  #$0                B = indication of indep. or dep. channel mode - X = $0
D254 BDCD4F                                                JSR  GET_A_FRM_BUF      A = key to be squelched
D257 48                                                    ASLA                    A = A x 2
D258 2818                                                  BVC  SQLCH_NOTE_OK      If overflow clear, branch
D25A 10AEA4                            16_CH_SQUELCH       LDY  0,Y                Else, overflow set - Y = addr. of chan last played using this inst
D25D 1027FBA3                                              LBEQ PROCES_CHROMA_DAT  If no channel assigned, this is a no op (continue parsing data) 
D261 AFA828                                                STX  $28,Y              else channel was assigned - reset env 1 ampl - channel N
D264 AFA830                                                STX  $30,Y              reset env 2 ampl - channel N
D267 5D                                                    TSTB                    See if 8 or 16 channel mode
D268 26F0                                                  BNE  16_CH_SQUELCH      If 16 channel, branch
D26A AFA861                                                STX  $61,Y              else 8-channel mode - reset env 1 ampl - channel N+1
D26D AFA869                                                STX  $69,Y              reset env 2 ampl - channel N+1
D270 20E8                                                  BRA  16_CH_SQUELCH

D272 47                                SQLCH_NOTE_OK       ASRA                    A = A / 2
D273 10AEA4                            SQLCH_NXT_CHAN      LDY  0,Y                Y = address of channel last played using this inst.
D276 1027FB8A                                              LBEQ PROCES_CHROMA_DAT  If no channel assigned - this is a no-op, continue parsing chroma data
D27A A128                                                  CMPA $8,Y               compare requested note w/note assigned to channel
D27C 26F5                                                  BNE  SQLCH_NXT_CHAN     If note not played by this channel - branch
D27E AFA828                                                STX  $28,Y              else, channel is playing note - reset env 1 ampl - channel N
D281 AFA830                                                STX  $30,Y              reset env 2 ampl - channel N
D284 5D                                                    TSTB                    See if 8 or 16 channel mode
D285 26EC                                                  BNE  SQLCH_NXT_CHAN     If 16 channel, branch
D287 AFA861                                                STX  $61,Y              else 8-channel mode - reset env 1 ampl - channel N+1
D28A AFA869                                                STX  $69,Y              reset env 2 ampl - channel N + 1
D28D 20E4                                                  BRA  SQLCH_NXT_CHAN     continue until all channels assigned to this inst have been chked

D28F 966E                              TUNE_AND_MORE       LDA  LAST_KEY_ROW       A = Last Row (STB0 - STB9) where data was found
D291 4C                                                    INCA                    A = A + 1
D292 8110                                                  CMPA #$10               Compare A & 16
D294 251A                                                  BCS  VALID_ROW_SCAN     If A < 16, branch
D296 DC64                                                  LDD  CUR_KSTACK_ADR     else, A = 16 (have STB15) D = Kstack Curr. Addr
D298 DD66                                                  STD  LST_KSTACK_ADR     Save a copy at RAM[0066] RAM[0067]
D29A 9670                                                  LDA  MAJOR_LP_CNT       A = RAM[0070]
D29C 8B40                                                  ADDA #$40 '@            Add 128 to A
D29E 9770                                                  STA  MAJOR_LP_CNT       Store A -> RAM[0070]
D2A0 2409                                                  BCC  MAJ_LP_HOOK        If carry clear, branch
D2A2 962A                                                  LDA  LED_IMAGE1         else, flash LEDs. A = LED Image 1
D2A4 982C                                                  EORA LED_BLINK          Cause LEDs to Change
D2A6 972A                                                  STA  LED_IMAGE1         Update LED Image Byte
D2A8 B72006                                                STA  RD_NOTE_WR_LED     Update Flashable LEDs
D2AB AD9F006A                          MAJ_LP_HOOK         JSR  [$6A]              Major Loop Hook
D2AF 4F                                                    CLRA                    A = 0 (Reset Row Count)
D2B0 976E                              VALID_ROW_SCAN      STA  LAST_KEY_ROW       Store Updated Row Count
D2B2 AD9F006C                                              JSR  [$6C]              Minor Loop Hook
D2B6 DE66                                                  LDU  LST_KSTACK_ADR     U = Address to Note:Velocity Data
D2B8 2707                                                  BEQ  NO_NOTE_THERE      If Address = 0, no note to be played - branch
D2BA A6C4                                                  LDA  0,U                Else A = note value
D2BC 843F                                                  ANDA #$3F '?            Ensure keyvalue is in range (i.e., 0-63)
D2BE B7200E                                                STA  WR_PRSS            Selects a given key (in prep. for reading the prss of that key)
D2C1 966F                              NO_NOTE_THERE       LDA  SH_TEMP            A = Last S&H Value
D2C3 4C                                                    INCA                    A = A+1
D2C4 843C                                                  ANDA #$3C '<            Drop top Two and bottom Two bits
D2C6 44                                                    LSRA                    A = Channel x 2
D2C7 8EFA3A                                                LDX  #$FA3A             X = $FA3A = Base memory address of table w/addresses of chan's
D2CA AE86                                                  LDX  A,X                X = Address of channel board "A"
D2CC 8606                                                  LDA  #$6                A = $06
D2CE B72000                                                STA  RD_ADCI_WR_ADCO    Select Pressure Level as A/D Input
D2D1 B72000                                                STA  RD_ADCI_WR_ADCO    Reselect Pressure Level as A/D Input
D2D4 8602                                                  LDA  #$2                A = $02
D2D6 B72003                                                STA  RD_TIME_WR_TMOD    Select "1024 uS mode" of system timer
D2D9 B72003                                                STA  RD_TIME_WR_TMOD    Reset main software loop timer.
D2DC 10AE02                                                LDY  $2,X               Y = Address of "defining" instrument
D2DF 2711                                                  BEQ  NO_DEFND_INST
D2E1 BDDBE4                                                JSR  SET_RAM006X
D2E4 BDEB1E                                                JSR  L66
D2E7 8D2A                                                  BSR  L67
D2E9 ADB816                                                JSR  [$16,Y]            Jump to unknown inst. handler (defaults to always C100)
D2EC BDE921                                                JSR  L68
D2EF 7ED3B5                                                JMP  L69

D2F2 D66F                              NO_DEFND_INST       LDB  SH_TEMP            B = Last S&H Setting
D2F4 CE0FFF                                                LDU  #$FFF              U = $0FFF
D2F7 BDD39A                                                JSR  L70
D2FA CE0800                                                LDU  #$800              U = $0800
D2FD BDD39A                                                JSR  L70
D300 8D11                                                  BSR  L67
D302 CE0FFF                                                LDU  #$FFF
D305 BDD39A                                                JSR  L70
D308 CE0000                                                LDU  #$0
D30B BDD39A                                                JSR  L70
D30E D76F                                                  STB  SH_TEMP
D310 7ED3B5                                                JMP  L69

D313 3434                              L67                 PSHS Y,X,B
D315 DE66                                                  LDU  LST_KSTACK_ADR
D317 2761                                                  BEQ  BAD_CONV
D319 AE42                                                  LDX  2,U    $2
D31B EC02                                                  LDD  $2,X
D31D DD66                                                  STD  LST_KSTACK_ADR
D31F B62008                                                LDA  RD_EOC_WR_SYND     A = B7-B0, where B7 = -EOC
D322 2A56                                                  BPL  BAD_CONV           If A > 0 (Conversion Bad), Jump
D324 B62000                                                LDA  RD_ADCI_WR_ADCO    A = Value from A to D
D327 44                                                    LSRA                    A = 0 B7 B6 B5 B4 B3 B2 B1
D328 44                                                    LSRA                    A = 0 0  B7 B6 B5 B4 B3 B2 = 6 MSB of A to D
D329 9700                                                  STA  MEM_00
D32B A601                                                  LDA  $1,X
D32D 9701                                                  STA  MEM_01
D32F A684                                                  LDA  0,X
D331 843F                                                  ANDA #$3F '?
D333 A701                                                  STA  $1,X
D335 E641                                                  LDB  1,U    $1
D337 E784                                                  STB  0,X
D339 C4C0                                                  ANDB #$C0
D33B DA00                                                  ORB  MEM_00
D33D E741                                                  STB  1,U    $1
D33F 9101                                                  CMPA MEM_01
D341 2737                                                  BEQ  BAD_CONV
D343 975F                                                  STA  PLAYED_PRES
D345 BDE8E2                                                JSR  CALC_PRESS
D348 A6C4                                                  LDA  0,U
D34A 84C0                                                  ANDA #$C0
D34C 81C0                                                  CMPA #$C0
D34E 2711                                                  BEQ  L71
D350 E6C4                                                  LDB  0,U
D352 C43F                                                  ANDB #$3F '?
D354 BDD803                                                JSR  L72
D357 D75C                                                  STB  CORR_NOTE
D359 8668                                                  LDA  #$68 'h
D35B 108E0690                                              LDY  #$690
D35F 8D25                                                  BSR  C_OUT_PRESSURE
D361 A641                              L71                 LDA  1,U    $1
D363 84C0                                                  ANDA #$C0
D365 81C0                                                  CMPA #$C0
D367 2711                                                  BEQ  BAD_CONV
D369 E6C4                                                  LDB  0,U
D36B C43F                                                  ANDB #$3F '?
D36D BDD803                                                JSR  L72
D370 D75C                                                  STB  CORR_NOTE
D372 8669                                                  LDA  #$69 'i
D374 108E0748                                              LDY  #$748
D378 8D0C                                                  BSR  C_OUT_PRESSURE
D37A 966E                              BAD_CONV            LDA  LAST_KEY_ROW
D37C 800A                                                  SUBA #$A
D37E B72000                                                STA  RD_ADCI_WR_ADCO
D381 B72000                                                STA  RD_ADCI_WR_ADCO
D384 35B4                                                  PULS B,X,Y,PC

D386 D608                              C_OUT_PRESSURE      LDB  C_INTF_PRES        B = pressure interface on/off flag
D388 270D                                                  BEQ  PRES_INT_OFF       if b = 0, pressure interface disabled - branch
D38A BDCD90                                                JSR  C_INF_OUT          Output pressure opcode
D38D 965C                                                  LDA  CORR_NOTE          A = note played
D38F BDCD90                                                JSR  C_INF_OUT          Output note value
D392 965F                                                  LDA  PLAYED_PRES        A = pressure value
D394 BDCD90                                                JSR  C_INF_OUT          Output pressure value
D397 7EE8FA                            PRES_INT_OFF        JMP  PRESS_TO_CHNL      Send pressure info to channels

D39A CAC0                              L70                 ORB  #$C0               Set top two bits of SHA (i.e., -FAST not sel, must be a "SHA" value)
D39C F7200B                                                STB  WR_SHA             Select 1 of Pitch, Width, Cutoff, Volume (A or B)
D39F FF200C                                                STU  WR_MDAC            Store U value to MDAC
D3A2 5C                                                    INCB                    B = B + 1
D3A3 CAC0                                                  ORB  #$C0               Set top two bits of SHA (must be a "SHA" value)
D3A5 F7200B                                                STB  WR_SHA             Select 1 of Pitch, Width, Cutoff, Volume (A or B)
D3A8 C43F                                                  ANDB #$3F '?            Drop top two bits (i.e, -FAST & SHEN select.)
D3AA 86FF                                                  LDA  #$FF               A = $FF
D3AC FD200A                                                STD  WR_RDAC            Latch in Reference DAC Value
D3AF 8628                                                  LDA  #$28 '(            A = $28
D3B1 4A                                WAIT_HEX_28         DECA                    A = A-1
D3B2 26FD                                                  BNE  WAIT_HEX_28        Wait for DAC to settle
D3B4 39                                                    RTS  

D3B5 8608                              L69                 LDA  #$8                A = $08
D3B7 B52001                            CHK_TRDY            BITA RD_MSCI_WR_MSCO    Get MISC I/O Timer Ready Signal (TRDY)
D3BA 26FB                                                  BNE  CHK_TRDY           Wait for timer ready - loop until we get it
D3BC B62001                                                LDA  RD_MSCI_WR_MSCO    A = RD MSCI
D3BF B41FF1                                                ANDA CASS_TYPE          Pull off "MOT IN" signal (1 if cassette motor control enabled)
D3C2 43                                                    COMA                    Invert Bits (0000 0100 -> 1111 1011)
D3C3 9A2F                                                  ORA  WR_MSCO_IMG        OR w/ Copy of WR_MSCO in MEM
D3C5 8404                                                  ANDA #$4                A = MOT OUT setting = 0 if cassette motor control enabled
D3C7 260D                                                  BNE  NO_MOTR_CNTRL      Branch if motor control not supported
D3C9 1A10                                                  ORCC #$10               Ignore IRQ (chroma port) interrupts
D3CB 962F                                                  LDA  WR_MSCO_IMG        A = RAM[$002F]
D3CD 8A04                                                  ORA  #$4                Set MOT OUT bit - Turn on external cassette motor
D3CF 972F                                                  STA  WR_MSCO_IMG        Store new Value back to [$002F]
D3D1 B72001                                                STA  RD_MSCI_WR_MSCO    Start External Tape Drive
D3D4 1CEF                                                  ANDC #$EF               Enable IRQ (chroma port) interrupts
D3D6 966E                              NO_MOTR_CNTRL       LDA  LAST_KEY_ROW       A = Row Number where last keypress found
D3D8 810A                                                  CMPA #$A                Compare row number with 10
D3DA 2502                                                  BCS  GET_NXT_ROW        If Number < 10, branch
D3DC 8409                                                  ANDA #$9                else set A = 9
D3DE CE0020                            GET_NXT_ROW         LDU  #$20               U = $20 
D3E1 7F2004                                                CLR  RD_TIME1WR_SEGS    Blank Display
D3E4 B72005                                                STA  RD_SWB_WR_SDS      Write A ($09) to SDS
D3E7 F62005                                                LDB  RD_SWB_WR_SDS      B = Which switches were set for Row A
D3EA A6C6                                                  LDA  A,U                A = RAM[A + 20] = Old LED Value
D3EC B72004                                                STA  RD_TIME1WR_SEGS    Restore LED display
D3EF 966E                                                  LDA  LAST_KEY_ROW       A = last row number where switch pressed
D3F1 810A                                                  CMPA #$A                Compare A and 10
D3F3 2468                                                  BCC  SLIDE_MVMT         Branch if "last row" >= 10 (i.e., not reg. key press but slider)
D3F5 0D37                                                  TST  L73                Look at RAM[$0037]
D3F7 2705                                                  BEQ  NEW_KEY_PRSS2      If RAM[$0037] = 0, branch
D3F9 0A37                                                  DEC  L73                else, RAM[$0037] = RAM[$0037] - 1
D3FB 7ED643                                                JMP  SAME_KEY_PRSS      Jump

D3FE CE0010                            NEW_KEY_PRSS2       LDU  #$10               U = $10
D401 33C6                                                  LEAU A,U                U = $10 + A = address of STB#a
D403 1F98                                                  TFR  B,A                B = Switch Reading for STB#a -> A
D405 43                                                    COMA                    -A -> A (1110 1111 -> 0001 0000)
D406 A4C4                                                  ANDA 0,U                Check to see if this key is the same one stored before
D408 E7C4                                                  STB  0,U                Put current keypress in memory at appropriate "row" (0 if set)
D40A 4D                                                    TSTA                    Check A (if Test = 0, keypress this time was same as last)
D40B 10270234                                              LBEQ SAME_KEY_PRSS      Long Branch (if the same key was pressed again)
D40F 5F                                                    CLRB                    Else, B = 0 (new key press)
D410 44                                SHIFT_BIT           LSRA                    A = Bit shifted to Left
D411 2503                                                  BCS  NEW_KEY_PRESS      If we have shifted bit out the end, branch
D413 5C                                                    INCB                    B = B + 1
D414 20FA                                                  BRA  SHIFT_BIT          Count how many shifts are required to shift bit out

D416 C105                              NEW_KEY_PRESS       CMPB #$5                Compare B against 5 (B = # of shifts) (SW #)
D418 2522                                                  BCS  PUSHED_1_50        If B < 5, pushed a right panel button (1-50) (branch)
D41A 3406                                                  PSHS B,A                Else, pushed a "control" button, Save A and B
D41C 966E                                                  LDA  LAST_KEY_ROW       A = Last Row Number Press Found
D41E 8107                                                  CMPA #$7                Compare this against 7
D420 240D                                                  BCC  GET_NXT_ROW_2      If A >=7, out of range for valid panel button, branch
D422 48                                                    ASLA                    else valid left panel sw. button : 5 <= B < 7 : A = A x 2
D423 9B6E                                                  ADDA LAST_KEY_ROW       A = A + RAM [006E] = 3 x original A
D425 AB61                                                  ADDA $1,S               A = A + orig. value of B 
D427 8005                                                  SUBA #$5                A = A - 5
D429 48                                                    ASLA                    A = A x 2
D42A 8EF340                                                LDX  #$F340             X = $F340
D42D AD96                                                  JSR  [A,X]              Jump to Keypress handler for button
D42F 860E                              GET_NXT_ROW_2       LDA  #$E                A = $0E
D431 9737                                                  STA  L73                A -> RAM [$0037]
D433 3506                                                  PULS A,B                Retrieve original A and B values
D435 5C                                                    INCB                    B = B + 1
D436 4D                                                    TSTA                    Test A
D437 26D7                                                  BNE  SHIFT_BIT          If A doesn't equal 0, branch
D439 7ED643                                                JMP  SAME_KEY_PRSS      Else Jump

D43C 3406                              PUSHED_1_50         PSHS B,A                Save A and B (we have 1 of the 1-50 buttons)
D43E 966E                                                  LDA  LAST_KEY_ROW       A = Last Row we saw a keypress on
D440 48                                                    ASLA                    A = A x 2
D441 48                                                    ASLA                    A = A x 2 (A = A x 4)
D442 9B6E                                                  ADDA LAST_KEY_ROW       A = 5 x original value in [$006E]
D444 4C                                                    INCA                    A = A + 1
D445 AB61                                                  ADDA $1,S               A = Actual key number pressed x 2
D447 F61FF7                                                LDB  PNL_KEY_CODE       B = Last Panel Key Pressed
D44A 260A                                                  BNE  PNL_CODE_W_NO      If the last key pressed was not "0", branch
D44C 8EF37E                                                LDX  #$F37E             else, X = F37E
D44F F61FF6                                                LDB  COPY_MODE          B = RAM[$1FF6]
D452 AD95                                                  JSR  [B,X]              Jump to keyhandler vector for copy mode [n]
D454 20D9                                                  BRA  GET_NXT_ROW_2

D456 8EF384                            PNL_CODE_W_NO       LDX  #$F384             X = base address for [PANEL][n] handlers
D459 AD95                                                  JSR  [B,X]              Jump and do handler
D45B 20D2                                                  BRA  GET_NXT_ROW_2

D45D F62008                            SLIDE_MVMT          LDB  RD_EOC_WR_SYND
D460 102A01DF                                              LBPL SAME_KEY_PRSS
D464 F62000                                                LDB  RD_ADCI_WR_ADCO    B = ADC Value
D467 800A                                                  SUBA #$A                A = A - 10
D469 8103                                                  CMPA #$3                Compare A w/3 (main slider)
D46B 2613                                                  BNE  NOT_MAIN_S         Branch if anything BUT main slider mvmt
D46D D700                                                  STB  MEM_00             B= ADCI Value -> RAM[$0000]
D46F C002                                                  SUBB #$2                B = B - 2
D471 2403                                                  BCC  M_SLIDE_HI         If B was > 2, branch
D473 5F                                                    CLRB                    else set B = 0
D474 2006                                                  BRA  M_NULL_DONE        Lower Bound OK, jump

D476 C1FB                              M_SLIDE_HI          CMPB #$FB               See if We're greater than max slider val.
D478 2302                                                  BLS  M_NULL_DONE        If val Ok, branch
D47A C6FB                                                  LDB  #$FB               else, set B to max (have null at end)
D47C D72D                              M_NULL_DONE         STB  CONV_MAIN_POT      B -> RAM[$002D]
D47E D600                                                  LDB  MEM_00             B = Raw Main Slider ADCI Value
D480 8E001A                            NOT_MAIN_S          LDX  #$1A               X = $001A
D483 E186                                                  CMPB A,X                Compare Raw value (B) with Stored Value RAM[$001A + 'A']
D485 250C                                                  BCS  RAW_LT_STORED      If B [Raw value] < Stored Value, branch
D487 C004                                                  SUBB #$4                Raw Value = Raw Value - 4
D489 102501B6                                              LBCS SAME_KEY_PRSS      If [Raw value - 4] = 0, branch
D48D E186                                                  CMPB A,X                Compare Raw value (B) w/Stored Value RAM[$001A + 'A'] + 4
D48F 102301B0                                              LBLS SAME_KEY_PRSS      If Raw Value - 4 is LT stored valued, branch
D493 E786                              RAW_LT_STORED       STB  A,X                Store new (corrected) slide value into RAM
D495 48                                                    ASLA                    A = A X 2 (convert command # into offset value)
D496 8ED49B                                                LDX  #$D49B             Load Vector Offset
D499 6E96                                                  JMP  [A,X]              Got to Handler for appropriate action/movement

D49B D552                              SLIDE_V_01          FDB  $D552              A = 0 : Lever 1 Handler
D49D D587                              SLIDE_V_02          FDB  $D587              A = 2 : Lever 2 Handler
D49F D5BE                              SLIDE_V_03          FDB  $D5BE              A = 4 : Tune Slide Handler
D4A1 D5C6                              SLIDE_V_04          FDB  $D5C6              A = 6 : Main Slider Handler
D4A3 D4A7                              SLIDE_V_05          FDB  $D4A7              A = 8 : Pedal 1 Handler
D4A5 D4D9                              SLIDE_V_06          FDB  $D4D9              A = A : Pedal 2 Handler

D4A7 8D62                                                  BSR  L74                PEDAL 1 HANDLER
D4A9 9132                                                  CMPA CONV_PEDAL1
D4AB 10270194                                              LBEQ SAME_KEY_PRSS
D4AF 9732                                                  STA  CONV_PEDAL1
D4B1 108E0690                                              LDY  #$690
D4B5 A7A864                                                STA  $64,Y
D4B8 BDDC3E                                                JSR  UPD_PED1_VAL
D4BB C690                                                  LDB  #$90
D4BD 8D5D                                                  BSR  C_OUT_MVMT_VAL
D4BF F61400                                                LDB  P0_LINK_VALS
D4C2 C4C0                                                  ANDB #$C0
D4C4 1027017B                                              LBEQ SAME_KEY_PRSS
D4C8 108E0748                                              LDY  #$748
D4CC A7A864                                                STA  $64,Y
D4CF BDDC3E                                                JSR  UPD_PED1_VAL
D4D2 C691                                                  LDB  #$91
D4D4 8D46                                                  BSR  C_OUT_MVMT_VAL
D4D6 7ED643                                                JMP  SAME_KEY_PRSS

D4D9 8D30                                                  BSR  L74                PEDAL 2 HANDLER
D4DB 9133                                                  CMPA CONV_PEDAL2
D4DD 10270162                                              LBEQ SAME_KEY_PRSS
D4E1 9733                                                  STA  CONV_PEDAL2
D4E3 108E0690                                              LDY  #$690
D4E7 A7A865                                                STA  $65,Y
D4EA BDDC4F                                                JSR  UPD_PED2_VAL
D4ED C698                                                  LDB  #$98
D4EF 8D2B                                                  BSR  C_OUT_MVMT_VAL
D4F1 F61400                                                LDB  P0_LINK_VALS
D4F4 C4C0                                                  ANDB #$C0
D4F6 10270149                                              LBEQ SAME_KEY_PRSS
D4FA 108E0748                                              LDY  #$748
D4FE A7A865                                                STA  $65,Y
D501 BDDC4F                                                JSR  UPD_PED2_VAL
D504 C699                                                  LDB  #$99
D506 8D14                                                  BSR  C_OUT_MVMT_VAL
D508 7ED643                                                JMP  SAME_KEY_PRSS

D50B C003                              L74                 SUBB #$3                B = ADC Value - 3
D50D 2202                                                  BHI  L75                Branch if orig ADC value was +ve
D50F 4F                                                    CLRA 
D510 39                                                    RTS                     A = 0

D511 3404                              L75                 PSHS B                  Save a copy of B
D513 8609                                                  LDA  #$9                A = $09
D515 3D                                                    MUL                     D = AxB
D516 ABE0                                                  ADDA ,S+
D518 2401                                                  BCC  PEDAL_EXIT
D51A 43                                                    COMA 
D51B 39                                PEDAL_EXIT          RTS  

D51C 0D0A                              C_OUT_MVMT_VAL      TST  C_INTF_PERF        See if chroma interface enabled
D51E 27FB                                                  BEQ  PEDAL_EXIT         If it isn't, exit
D520 1E89                                                  EXG  A,B                Else put "pedal code" into A
D522 BDCD90                                                JSR  C_INF_OUT          Output Pedal Opcode
D525 1F98                                                  TFR  B,A                Put pedal value into A
D527 7ECD90                                                JMP  C_INF_OUT          Output Pedal value 

D52A E084                              LEVER_MOVE_CHK      SUBB 0,X                B = Diff. between Current Lever Val & Stored Lever Centre Value
D52C 2510                                                  BCS  LEVER_PULLED       If carry set, new val < stored centre (i.e., lever pulled) - branch
D52E C020                                                  SUBB #$20               Else, lever pushed - difference = difference = $20
D530 231E                                                  BLS  IN_LEVEL_NULL      If original difference was < $20, we're in null area - branch
D532 A602                                                  LDA  $2,X               else, diff. >=$20 - A = Push Multiplicative Factor
D534 3D                                                    MUL                     D = AxB
D535 58                                                    ASLB 
D536 49                                                    ROLA 
D537 2802                                                  BVC  RET_CALC_PUSH
D539 867F                                                  LDA  #$7F               A = Max possible value
D53B 84FF                              RET_CALC_PUSH       ANDA #$FF
D53D 39                                                    RTS  

D53E C0E0                              LEVER_PULLED        SUBB #$E0               B = -ve difference - $E0
D540 240E                                                  BCC  IN_LEVEL_NULL      If carry clear, then we're in null area - branch
D542 A601                                                  LDA  $1,X               else, outside if null, A = Pull Multiplicative Factor
D544 3D                                                    MUL  
D545 A001                                                  SUBA $1,X
D547 58                                                    ASLB 
D548 49                                                    ROLA 
D549 2802                                                  BVC  RET_CALC_PULL
D54B 8680                                                  LDA  #$80               A = Min. possible value
D54D 84FF                              RET_CALC_PULL       ANDA #$FF
D54F 39                                                    RTS  

D550 4F                                IN_LEVEL_NULL       CLRA                    A = 0 (i.e., indicate we're still at centre)
D551 39                                                    RTS  

D552 8E004A                                                LDX  #$4A               LEVER 1 HANDLER
D555 8DD3                                                  BSR  LEVER_MOVE_CHK     Returns "A" (=current lever 1 val)
D557 9130                                                  CMPA CONV_LEVER1        compare new lever val w/old
D559 102700E6                                              LBEQ SAME_KEY_PRSS      If no different, then no act'n req'd (branch)
D55D 9730                                                  STA  CONV_LEVER1        else, store new value 
D55F 108E0690                                              LDY  #$690              Y = base address of inst 0
D563 A7A808                                                STA  $8,Y               Store converted lever 1 val to inst 0
D566 BDDC07                                                JSR  UPD_LEV1_IN_CHAN
D569 C680                                                  LDB  #$80               Opcode for Inst 0 lever 1 data
D56B 8DAF                                                  BSR  C_OUT_MVMT_VAL     Output Lever 1 data out chroma port
D56D F61400                                                LDB  P0_LINK_VALS       B = program link values
D570 C4C0                                                  ANDB #$C0               B = link type
D572 102700CD                                              LBEQ SAME_KEY_PRSS      If B = 0, no link (no further action req'd)
D576 108E0748                                              LDY  #$748              else, we do have a link, Y = base addr. of link instr.
D57A A7A808                                                STA  $8,Y               Update Lever 1 Vals in link instr.
D57D BDDC07                                                JSR  UPD_LEV1_IN_CHAN
D580 C681                                                  LDB  #$81               B = Opcode for Inst 1, Lever 1
D582 8D98                                                  BSR  C_OUT_MVMT_VAL     Output Inst 1, Lever 1 data to chroma port
D584 7ED643                                                JMP  SAME_KEY_PRSS

D587 8E004D                                                LDX  #$4D               LEVER 2 HANDLER
D58A 8D9E                                                  BSR  LEVER_MOVE_CHK     Returns "A" (=current lever 1 val)
D58C 9131                                                  CMPA CONV_LEVER2        compare new lever val w/old
D58E 102700B1                                              LBEQ SAME_KEY_PRSS      If no different, then no act'n req'd (branch)
D592 9731                                                  STA  CONV_LEVER2        else, store new value 
D594 108E0690                                              LDY  #$690              Y = base address of inst 0
D598 A7A809                                                STA  $9,Y               Store converted lever 1 val to inst 0
D59B BDDC18                                                JSR  UPD_LEV2_IN_CHAN
D59E C688                                                  LDB  #$88               Opcode for Inst 0 lever 1 data 
D5A0 BDD51C                                                JSR  C_OUT_MVMT_VAL     Output Lever 1 data out chroma port
D5A3 F61400                                                LDB  P0_LINK_VALS       B = program link values 
D5A6 C4C0                                                  ANDB #$C0               B = link type
D5A8 10270097                                              LBEQ SAME_KEY_PRSS      If B = 0, no link (no further action req'd)
D5AC 108E0748                                              LDY  #$748              Update Lever 1 Vals in link instr.
D5B0 A7A809                                                STA  $9,Y
D5B3 BDDC18                                                JSR  UPD_LEV2_IN_CHAN
D5B6 C689                                                  LDB  #$89
D5B8 BDD51C                                                JSR  C_OUT_MVMT_VAL
D5BB 7ED643                                                JMP  SAME_KEY_PRSS

D5BE C880                                                  EORB #$80               TUNE HANDER
D5C0 1D                                                    SEX  
D5C1 58                                                    ASLB 
D5C2 DD48                                                  STD  MASTER_TUNE1
D5C4 207D                                                  BRA  SAME_KEY_PRSS

D5C6 9636                                                  LDA  SLIDER_DIVISOR     MAIN SLIDER HANDLER : A = RAM[$0036] = Slider Divider
D5C8 2B0C                                                  BMI  SLIDEDIV_LT_0      If A < 0, branch
D5CA 2607                                                  BNE  SLIDEDIV_GE_0      else if A <> 0, branch (i.e., A > 0)
D5CC 860F                                                  LDA  #$F                else we're here if A = 0.  Default A to $0F
D5CE 3D                                                    MUL                     D = AxB = raw slider value * $0F
D5CF 8007                                                  SUBA #$7                A = A - 7
D5D1 2006                                                  BRA  SLIDER_HNDLR

D5D3 3D                                SLIDEDIV_GE_0       MUL                     D = AxB = raw slider val * RAM[0036]
D5D4 2003                                                  BRA  SLIDER_HNDLR

D5D6 3D                                SLIDEDIV_LT_0       MUL                     D = AxB = raw slider val * RAM[0036]
D5D7 8040                                                  SUBA #$40 '@            A = A - $40 (64 decimal)
D5D9 9135                              SLIDER_HNDLR        CMPA DISP_PARAM_VAL     Compare "Slider Value" (A) w/ currently displayed parameter value
D5DB 2766                                                  BEQ  SAME_KEY_PRSS      If the current slider value = disp. param - no work necess. - exit
D5DD 9735                                                  STA  DISP_PARAM_VAL     Else, Slider Value is new - update stored slider value
D5DF BDDDF7                                                JSR  PROG_MODIFIED      Register that a change in Prog. 0 has occured
D5E2 CE1400                                                LDU  #$1400             U = Address of Prog. 0
D5E5 F6141E                                                LDB  P0_PANEL_EDIT      B = Panel Edit Params
D5E8 C43F                                                  ANDB #$3F '?            B = Number of Parameter being edited now
D5EA 272B                                                  BEQ  PRG_0_EDIT         If Param Edited = 0, Branch 
D5EC C105                                                  CMPB #$5                Compare B w/ $05 (see if 'special' param being edited)
D5EE 2315                                                  BLS  SPCL_PARAM         Brach if Special Param
D5F0 F6141E                                                LDB  P0_PANEL_EDIT      else, regular parameter - B = Panel Edit Params
D5F3 58                                                    ASLB                    B = B x 2
D5F4 2A0F                                                  BPL  SPCL_PARAM         Branch if Edit B or Edit Both
D5F6 F6141E                                                LDB  P0_PANEL_EDIT      B = Panel Edit Params
D5F9 C43F                                                  ANDB #$3F '?            B = Number of Parameter being edited now
D5FB CB32                                                  ADDB #$32 '2            B = B + 50 ($32)
D5FD BDF5AF                                                JSR  CHK_2_SND_PANL     Check to send chroma panel info
D600 F6141E                                                LDB  P0_PANEL_EDIT      B = Number of Parameter being edited now
D603 2A08                                                  BPL  EDIT_A_OR_ERR      If Edit B or Error, jump
D605 F6141E                            SPCL_PARAM          LDB  P0_PANEL_EDIT      else, edit A or Edit Both, B = Panel Edit Params
D608 C43F                                                  ANDB #$3F '?            B = Number of Parameter being edited now
D60A BDF5AF                                                JSR  CHK_2_SND_PANL     Check to send chroma panel info
D60D A603                              EDIT_A_OR_ERR       LDA  $3,X               A = RAM[D49B + 3] = $D5 ? 
D60F 2A32                                                  BPL  SAME_KEY_PRSS
D611 A79F1FF4                                              STA  [$1FF4]            Fire Tapper
D615 202C                                                  BRA  SAME_KEY_PRSS

D617 BDDCAE                            PRG_0_EDIT          JSR  VALDTE_PARAM_2
D61A F61400                                                LDB  P0_LINK_VALS
D61D C4C0                                                  ANDB #$C0
D61F 2722                                                  BEQ  SAME_KEY_PRSS
D621 D609                                                  LDB  C_INTF_PANL
D623 271E                                                  BEQ  SAME_KEY_PRSS
D625 8EE7FB                                                LDX  #$E7FB
D628 9700                                                  STA  MEM_00
D62A 8678                                                  LDA  #$78 'x
D62C BDCD90                                                JSR  C_INF_OUT
D62F 9600                                                  LDA  MEM_00
D631 A686                                                  LDA  A,X
D633 BDCD90                                                JSR  C_INF_OUT
D636 8679                                                  LDA  #$79 'y
D638 BDCD90                                                JSR  C_INF_OUT
D63B 9600                                                  LDA  MEM_00
D63D 40                                                    NEGA 
D63E A686                                                  LDA  A,X
D640 BDCD90                                                JSR  C_INF_OUT
D643 B62001                            SAME_KEY_PRSS       LDA  RD_MSCI_WR_MSCO    A = MISC I/O Vals
D646 982E                                                  EORA RD_MSCI_IMG        EOR w/Prev. Val (see if any changes)
D648 8413                                                  ANDA #$13               Pickoff -SEQ, SUST and EFF bits
D64A 10270096                                              LBEQ NO_CHANGES         If no change (A = 0, -SEQ = 0, SUST = 0 & EFF=0) branch
D64E 1F89                                                  TFR  A,B                else, new data B = A
D650 D82E                                                  EORB RD_MSCI_IMG        Store new RD_MSCI data in B
D652 D72E                                                  STB  RD_MSCI_IMG        Store new RD_MSCI data from B to Image
D654 1F89                                                  TFR  A,B                B = A (clean copy of SEQ, SUST...settings)
D656 D834                                                  EORB FOOTSW_VALS
D658 D734                                                  STB  FOOTSW_VALS
D65A 44                                                    LSRA                    Branch if carry clear (i.e., EFF not changed)
D65B 2402                                                  BCC  FSW2_NOT_CHNGD
D65D 8D3D                                                  BSR  FSW2_CHANGED
D65F 44                                FSW2_NOT_CHNGD      LSRA                    A = A / 2 (check footswitch 1 byte)
D660 2402                                                  BCC  FSW1_NOT_CHNGD     Branch if carry clear (i.e., FSW1 not changed)
D662 8D26                                                  BSR  FSW1_CHANGED       else, we've had a FSW1 change
D664 8404                              FSW1_NOT_CHNGD      ANDA #$4                If we're here, SUST not change, so SEQ
D666 277C                                                  BEQ  NO_CHANGES         If bit 3 not set, error (branch)
D668 C410                                                  ANDB #$10               Set SEQ bit (B=0001 0000)
D66A 2716                                                  BEQ  SEQ_CHNGD
D66C 8612                                                  LDA  #$12               A = $12
D66E B71FF7                                                STA  PNL_KEY_CODE       A = $12 - opcode for Sequence Change
D671 8606                                                  LDA  #$6                A = $06
D673 B71FF6                                                STA  COPY_MODE
D676 B6141D                                                LDA  P0_SEQNC_PROG      A = Seq. Prog
D679 5F                                                    CLRB                    B = 0
D67A BDDE04                                                JSR  OUTPUT_BIG_PROG
D67D BDDE98                                                JSR  PNT_PANL
D680 2062                                                  BRA  NO_CHANGES

D682 B6141D                            SEQ_CHNGD           LDA  P0_SEQNC_PROG
D685 BDF637                                                JSR  GO_SEQ_PROG
D688 205A                                                  BRA  NO_CHANGES

D68A 3406                              FSW1_CHANGED        PSHS B,A
D68C C402                                                  ANDB #$2
D68E 2606                                                  BNE  FSW1_DOWN
D690 C66A                                                  LDB  #$6A 'j            B = $6A = offset for FSW1 UP Handler
D692 86A8                                                  LDA  #$A8               A = $A8 = Chroma opcode for FSW1 UP
D694 2015                                                  BRA  DO_FSW_WORK

D696 C60E                              FSW1_DOWN           LDB  #$E                B = $0E = offset for FSW1 DOWN Handler
D698 86A0                                                  LDA  #$A0               A = $A0 = Chroma opcode for FSW1 DOWN
D69A 200F                                                  BRA  DO_FSW_WORK

D69C 3406                              FSW2_CHANGED        PSHS B,A
D69E 54                                                    LSRB 
D69F 2506                                                  BCS  FSW2_DOWN
D6A1 C66C                                                  LDB  #$6C 'l            B = $6C = offset for FSW2 UP Handler
D6A3 86B8                                                  LDA  #$B8               A = $B8 = Chroma opcode for FSW2 UP
D6A5 2004                                                  BRA  DO_FSW_WORK

D6A7 C610                              FSW2_DOWN           LDB  #$10               B = $10 = offset to FSW2 DOWN Handler
D6A9 86B0                                                  LDA  #$B0               A = $B0 = Chroma opcode for FSW2 DOWN
D6AB 3406                              DO_FSW_WORK         PSHS B,A                Save copies of old A & B
D6AD 108E0690                                              LDY  #$690              Y = address of main instrument
D6B1 EE26                                                  LDU  $6,Y               U = address of defining instrument
D6B3 2702                                                  BEQ  NO_DEFN_INST       If not defining instrument, branch
D6B5 ADB5                                                  JSR  [B,Y]              else go do subroutine for Footswitch 2 DOWN
D6B7 F61400                            NO_DEFN_INST        LDB  P0_LINK_VALS       B = Link Vals
D6BA C4C0                                                  ANDB #$C0               B = Link Type
D6BC 270C                                                  BEQ  NO_LINK            If B=00, we don't have a link - branch
D6BE E661                                                  LDB  $1,S               else, we do have a link : B = $10
D6C0 31A900B8                                              LEAY 184,Y              Y = address of link instrument
D6C4 EE26                                                  LDU  $6,Y               U = address of program which defines link instr.
D6C6 2702                                                  BEQ  NO_LINK            If link program undefined, branch
D6C8 ADB5                                                  JSR  [B,Y]              else, go do subroutine for Footswitch 2 DOWN for link inst.
D6CA 3506                              NO_LINK             PULS A,B                Restore A & B
D6CC D60A                                                  LDB  C_INTF_PERF        Check performance switch
D6CE 2703                                                  BEQ  SKIP_FSW2_COUT     If performance switch off, branch
D6D0 BDCD90                                                JSR  C_INF_OUT          else, print out B0 (opcode for footswitch 2 down on inst 0)
D6D3 F61400                            SKIP_FSW2_COUT      LDB  P0_LINK_VALS       B = link Vals
D6D6 C4C0                                                  ANDB #$C0               B = Link Type
D6D8 2708                                                  BEQ  FSW2_EXIT          If B <> 0, no link (i.e., only issue 1 FSW mode code)
D6DA D60A                                                  LDB  C_INTF_PERF        check performance switch
D6DC 2704                                                  BEQ  FSW2_EXIT          If performance switch off, exit
D6DE 4C                                                    INCA                    else, increment to link instrument
D6DF BDCD90                                                JSR  C_INF_OUT          output chroma port $B1 - FSW2 down for inst #1 (link)
D6E2 3586                              FSW2_EXIT           PULS A,B,PC

D6E4 108E0690                          NO_CHANGES          LDY  #$690              Y = base address of main/link instrument
D6E8 C608                                                  LDB  #$8                B = total # of instruments
D6EA EE26                              ARP_NEXT_INST       LDU  $6,Y               U = address of defining program
D6EC 2703                                                  BEQ  NO_DEF_PROG        if no def prog (i.e., U = 0), branch
D6EE ADB862                                                JSR  [$62,Y]            Else go do arpeg handler
D6F1 31A900B8                          NO_DEF_PROG         LEAY 184,Y              Y = base address of 'next' instrument
D6F5 5A                                                    DECB                    B = B - 1
D6F6 26F2                                                  BNE  ARP_NEXT_INST      Do for all 8 instruments
D6F8 D63F                              CHK_NOTE_BUF        LDB  N_BUF_HEAD2        B = Address of 1 end of the note buffer
D6FA D13D                                                  CMPB N_BUF_TAIL2        See if Head of Buffer = Tail of Buffer
D6FC 262E                                                  BNE  BUF_NOT_EMPTY      If Head <> Tail, still data there, branch
D6FE D643                                                  LDB  C_IN_BUF_HEAD2     See if data in Chroma In Buffer
D700 D141                                                  CMPB C_IN_BUF_TAIL2     Compare with tail of buffer
D702 1027FB89                                              LBEQ TUNE_AND_MORE      If Head = Tail, branch to D28F
D706 A69F0042                                              LDA  [$42]              Else, A = Chroma Data pointed to at head of buffer
D70A 5C                                                    INCB                    Increment buffer head
D70B C43F                                                  ANDB #$3F '?            Don't allow overrun of buffer (wrap if needed)
D70D D743                                                  STB  C_IN_BUF_HEAD2     Store updated "head" address
D70F 1A50                                                  ORCC #$50 'P            Disable IRQ and FIRQ
D711 D62F                                                  LDB  WR_MSCO_IMG        B = WR_MSCO Image
D713 2B07                                                  BMI  XI_MASK_EQ_1       Branch if -XI_MASK = 1 (i.e., willing to accept chroma data)
D715 CA80                                                  ORB  #$80               Set XI_MASK = 1
D717 D72F                                                  STB  WR_MSCO_IMG        Update WR_MSCO Image
D719 F72001                                                STB  RD_MSCI_WR_MSCO    Update WR_MSCO H/W value
D71C 1CAF                              XI_MASK_EQ_1        ANDC #$AF               Re-enable IRQ and FIRQ
D71E DE52                                                  LDU  L64                U = RAM[$0052] & RAM[$0053]
D720 9E54                                                  LDX  CI_HNDLR_A1        X = RAM[$0054] & RAM[$0055]
D722 109E56                                                LDY  L65                Y = RAM[$0056] & RAM[$0057]
D725 D658                                                  LDB  CI_OPCODE_NEW      B = RAM[$0058]
D727 4D                                                    TSTA                    Check Value of "A" (note to be played)
D728 6E9F0050                                              JMP  [$50]              Jump to Hndlr for Chroma Port Data (addr of hndlr at $0050)

D72C 8600                              BUF_NOT_EMPTY       LDA  #$0                Here if there are notes in the note buffer A = 0
D72E 10260100                                              LBNE L76                Branch to D832 if A <> 0 (never jump)
D732 EE9F003E                                              LDU  [$3E]              U = Note/Velocity pointed to by Head address of Note Buffer
D736 DF5D                                                  STU  PLAYED_NOTE        Store Note/Vel to RAM[$005D] and RAM[$005E]
D738 CB02                                                  ADDB #$2                B = B + 2 (B = Low Byte of N_Buf_Head)
D73A CAE0                                                  ORB  #$E0               Make sure address is still in the right range
D73C D73F                                                  STB  N_BUF_HEAD2        Store updated & incremented "start buffer" address
D73E 1CBF                                                  ANDC #$BF               Re-enable FIRQ interrups 
D740 D65E                                                  LDB  PLAYED_VEL         B = Velocity of played/currently worked on note
D742 102B00FE                                              LBMI RELEASE_VEL        If we have a -ve vel. val, branch
D746 B61FF7                                                LDA  PNL_KEY_CODE       A = Panel Key Code
D749 810C                                                  CMPA #$C                See if we're doing a "set split"
D74B 2615                                                  BNE  NOT_SET_SPLT       If we aren't doing a "set split", branch
D74D 7F1FF7                                                CLR  PNL_KEY_CODE       If we are doing a "set split", clear key code
D750 965D                                                  LDA  PLAYED_NOTE        A = Note val of played/currently worked on note
D752 8020                                                  SUBA #$20               A = A - $20 (32 dec.) - convert note to 0 at middle C
D754 B71FF9                                                STA  PREV_SPLIT         Update "previous" split value
D757 B71420                                                STA  P0_KBRD_SPLT       Update keyboard split value in Program 0
D75A BDDDF7                                                JSR  PROG_MODIFIED      Show that program 0 has changed
D75D BDDE98                                                JSR  PNT_PANL           Update LEDs, etc.
D760 2096                                                  BRA  CHK_NOTE_BUF       See if there are more notes to deal with (branch always)

D762 CEFA5A                            NOT_SET_SPLT        LDU  #$FA5A             Else, we have key press, but no "set split" pnl code; U = $FA5A
D765 A6C5                                                  LDA  B,U                A = RAM[B+U] = RAM[B+$FA5A] where B is "PLAYED VEL"
D767 975E                                                  STA  PLAYED_VEL         Store "Vel. Value" from RAM lookup table ("time" to velocity)
D769 CEFADA                                                LDU  #$FADA             U = $FADA = Base address of "Sqeeze" to pressure value lookup tbl.
D76C A6C6                                                  LDA  A,U                A = RAM[A + $FADA] where 0 <= A <= 31 (get "played pressure val)
D76E 975F                                                  STA  PLAYED_PRES        Store "looked-up" Value
D770 BDD8C9                                                JSR  PUSH_ON_K_STACK    Push note on keystack
D773 2783                                                  BEQ  CHK_NOTE_BUF       See if we have any more notes to process (Ret 0 if no space, 1 if OK)
D775 DC64                                                  LDD  CUR_KSTACK_ADR     D = Keystack Address for "Current" note
D777 ED02                                                  STD  $2,X               D = AxB = Press. Vel -> X
D779 DF64                                                  STU  CUR_KSTACK_ADR
D77B 965F                                                  LDA  PLAYED_PRES
D77D A784                                                  STA  0,X
D77F A701                                                  STA  $1,X
D781 B61400                                                LDA  P0_LINK_VALS       A = Link Vals
D784 48                                                    ASLA                    A = A x 2
D785 254B                                                  BCS  LNK_LOW_UNI        Branch if we have a link lower or link unison
D787 2B1E                                                  BMI  LNK_UP             Branch if we have a link upper
D789 B61401                            L77                 LDA  P0_TRNSPOSE        else, no link - A = Transpose value  
D78C 84C0                                                  ANDA #$C0               Pick off main transpose values
D78E 9A5D                                                  ORA  PLAYED_NOTE        Add transpose value to curr. note
D790 C6C0                                                  LDB  #$C0               B = $C0
D792 DA5F                                                  ORB  PLAYED_PRES        add $C0 to pressure value
D794 EDC4                                                  STD  0,U
D796 D65D                                                  LDB  PLAYED_NOTE
D798 8D69                                                  BSR  L72                Offset to "B", depending on orig. value of B
D79A D75C                                                  STB  CORR_NOTE
D79C 86D0                                                  LDA  #$D0
D79E 108E0690                                              LDY  #$690
D7A2 8D6D                                                  BSR  C_OUT_NOTE         Check performance setting.  If on, then output info from Chroma Port
D7A4 7ED6F8                                                JMP  CHK_NOTE_BUF

D7A7 965D                              LNK_UP              LDA  PLAYED_NOTE        A = pressed note val
D7A9 8020                                                  SUBA #$20               Convert note val to -32 <= note <= 31
D7AB B11420                                                CMPA P0_KBRD_SPLT       Compare note w/present split value
D7AE 2DD9                                                  BLT  L77                If we were below te split value, branch
D7B0 F61401                            L78                 LDB  P0_TRNSPOSE        Else, B = transpose value
D7B3 58                                                    ASLB 
D7B4 58                                                    ASLB 
D7B5 C4C0                                                  ANDB #$C0               B = Link Transpose Values
D7B7 DA5F                                                  ORB  PLAYED_PRES
D7B9 86C0                                                  LDA  #$C0
D7BB 9A5D                                                  ORA  PLAYED_NOTE
D7BD EDC4                                                  STD  0,U
D7BF 1F98                                                  TFR  B,A
D7C1 D65D                              L79                 LDB  PLAYED_NOTE
D7C3 8D3E                                                  BSR  L72
D7C5 D75C                                                  STB  CORR_NOTE
D7C7 86D1                                                  LDA  #$D1
D7C9 108E0748                                              LDY  #$748
D7CD 8D42                                                  BSR  C_OUT_NOTE
D7CF 7ED6F8                                                JMP  CHK_NOTE_BUF

D7D2 2B0B                              LNK_LOW_UNI         BMI  LNK_UNI            Branch if link unison
D7D4 965D                                                  LDA  PLAYED_NOTE        Else, we've got a link lower.  A = Pressed key
D7D6 8020                                                  SUBA #$20               Convert note val to -32 <= note <= 31
D7D8 B11420                                                CMPA P0_KBRD_SPLT
D7DB 2DD3                                                  BLT  L78                If pressed key < keyboard split, branch 
D7DD 20AA                                                  BRA  L77                else, we're above kybd split - branch always

D7DF B61401                            LNK_UNI             LDA  P0_TRNSPOSE        A = Transpose value
D7E2 84C0                                                  ANDA #$C0               Pick off main transpose info
D7E4 9A5D                                                  ORA  PLAYED_NOTE        Add transpose value to pressed key value
D7E6 F61401                                                LDB  P0_TRNSPOSE
D7E9 58                                                    ASLB 
D7EA 58                                                    ASLB 
D7EB C4C0                                                  ANDB #$C0               Pick off link transpose info
D7ED DA5F                                                  ORB  PLAYED_PRES
D7EF EDC4                                                  STD  0,U
D7F1 D65D                                                  LDB  PLAYED_NOTE
D7F3 8D0E                                                  BSR  L72
D7F5 D75C                                                  STB  CORR_NOTE
D7F7 86D0                                                  LDA  #$D0
D7F9 108E0690                                              LDY  #$690
D7FD 8D12                                                  BSR  C_OUT_NOTE
D7FF A641                                                  LDA  1,U    $1
D801 20BE                                                  BRA  L79

D803 48                                L72                 ASLA                    A = A x 2
D804 2505                                                  BCS  L80                If carry set, note was below middle C
D806 2B06                                                  BMI  L81
D808 CBE0                                                  ADDB #$E0
D80A 39                                                    RTS  

D80B CBD4                              L80                 ADDB #$D4
D80D 39                                                    RTS  

D80E CBEC                              L81                 ADDB #$EC
D810 39                                                    RTS  

D811 0D0A                              C_OUT_NOTE          TST  C_INTF_PERF
D813 2712                                                  BEQ  NO_PERF            Branch if Performance Interface disconnected
D815 BDCD90                                                JSR  C_INF_OUT
D818 965C                                                  LDA  CORR_NOTE          A = "Converted" present note
D81A BDCD90                                                JSR  C_INF_OUT          Print Note info
D81D 965E                                                  LDA  PLAYED_VEL         A = present velocity info
D81F BDCD90                                                JSR  C_INF_OUT          Print velocity info
D822 965F                                                  LDA  PLAYED_PRES        A = present pressure info
D824 BDCD90                                                JSR  C_INF_OUT          Print pressure info
D827 3440                              NO_PERF             PSHS U
D829 EE26                                                  LDU  $6,Y               U = address of program defining instrument
D82B 2703                                                  BEQ  NO_PROG_DEFD       If no program defined, exit
D82D ADB80C                                                JSR  [$C,Y]             jump to instrument attack handler
D830 35C0                              NO_PROG_DEFD        PULS U,PC

D832 D73D                              L76                 STB  N_BUF_TAIL2        THIS CODE MAY NEVER BE ACCESSED
D834 1A50                                                  ORCC #$50 'P            disable FIRQ and IRQ
D836 D62F                                                  LDB  WR_MSCO_IMG        B = WR_MSCO Image
D838 C4DF                                                  ANDB #$DF               Set -K_MASK to 0 (all new kybd data is thrown away)
D83A D72F                                                  STB  WR_MSCO_IMG        Update value of WR_MSCO Image
D83C F72001                                                STB  RD_MSCI_WR_MSCO    Update H/W value of WR_MSCO
D83F 1CEF                                                  ANDC #$EF               Enable IRQ (chroma port) interrupts
D841 7ED6F8                                                JMP  CHK_NOTE_BUF

D844 CEFADA                            RELEASE_VEL         LDU  #$FADA             We're here if we had a release velocity (i.e, -ve time)
D847 A6C5                                                  LDA  B,U                D = Address of end of lookup table, A = "Backwards lookup"
D849 975E                                                  STA  PLAYED_VEL         A = velocity lookup from table - Store in Played Velocity Mem Loc.
D84B 8E0062                                                LDX  #$62
D84E EE02                              L83                 LDU  $2,X               U = RAM[$0064]
D850 1027FEA4                                              LBEQ CHK_NOTE_BUF       If no address stored, no note down - branch
D854 10AE42                                                LDY  2,U    $2          Else, key down, Y = address of "next" note in sequence
D857 A6C4                                                  LDA  0,U                A = current note
D859 843F                                                  ANDA #$3F '?            Make sure note <= $3F.
D85B 915D                                                  CMPA PLAYED_NOTE        Compare new note with currently played note
D85D 2704                                                  BEQ  L82                If they're the same, branch
D85F 30A4                                                  LEAX 0,Y                Else, we have a new note, X = Address of "next" note.
D861 20EB                                                  BRA  L83

D863 EC22                              L82                 LDD  $2,Y               D = Address of where note/velocity data resides in memory
D865 ED02                                                  STD  $2,X
D867 119366                                                CMPU LST_KSTACK_ADR
D86A 2602                                                  BNE  L84
D86C DD66                                                  STD  LST_KSTACK_ADR
D86E BDD8EF                            L84                 JSR  LASTNODEFROMHEAP
D871 1E32                                                  EXG  U,Y
D873 BDD8EF                                                JSR  LASTNODEFROMHEAP
D876 33A4                                                  LEAU 0,Y
D878 ECC4                                                  LDD  0,U
D87A 3404                                                  PSHS B
D87C 84C0                                                  ANDA #$C0
D87E 81C0                                                  CMPA #$C0
D880 270F                                                  BEQ  L85
D882 D65D                                                  LDB  PLAYED_NOTE
D884 BDD803                                                JSR  L72
D887 D75C                                                  STB  CORR_NOTE
D889 86D8                                                  LDA  #$D8
D88B 108E0690                                              LDY  #$690
D88F 8D1C                                                  BSR  DO_RELSE
D891 3502                              L85                 PULS A
D893 84C0                                                  ANDA #$C0
D895 81C0                                                  CMPA #$C0
D897 1027FE5D                                              LBEQ CHK_NOTE_BUF
D89B D65D                                                  LDB  PLAYED_NOTE
D89D BDD803                                                JSR  L72
D8A0 D75C                                                  STB  CORR_NOTE
D8A2 86D9                                                  LDA  #$D9
D8A4 108E0748                                              LDY  #$748
D8A8 8D03                                                  BSR  DO_RELSE
D8AA 7ED6F8                                                JMP  CHK_NOTE_BUF

D8AD 0D0A                              DO_RELSE            TST  C_INTF_PERF
D8AF 270D                                                  BEQ  L86
D8B1 BDCD90                                                JSR  C_INF_OUT
D8B4 965C                                                  LDA  CORR_NOTE
D8B6 BDCD90                                                JSR  C_INF_OUT
D8B9 965E                                                  LDA  PLAYED_VEL
D8BB BDCD90                                                JSR  C_INF_OUT
D8BE 3440                              L86                 PSHS U
D8C0 EE26                                                  LDU  $6,Y
D8C2 2703                                                  BEQ  L87
D8C4 ADB868                                                JSR  [$68,Y]            Jump to "B param" release handler
D8C7 35C0                              L87                 PULS U,PC

D8C9 BDD8E1                            PUSH_ON_K_STACK     JSR  L88                A=Press, B=Vel  Return A=1 if there was a "next", else returns "0"
D8CC 2712                                                  BEQ  L89                If returned a "0", branch (return/exit)
D8CE 30C4                                                  LEAX 0,U                else, there is a "next", X = Current stack address
D8D0 BDD8E1                                                JSR  L88
D8D3 2609                                                  BNE  L90                if return 0, store address in stack list
D8D5 3384                                                  LEAU 0,X                else U = X
D8D7 BDD8EF                                                JSR  LASTNODEFROMHEAP
D8DA CE0000                                                LDU  #$0
D8DD 39                                                    RTS  

D8DE AF42                              L90                 STX  2,U    $2
D8E0 39                                L89                 RTS  

D8E1 3406                              L88                 PSHS B,A                A = Played pressure, B = Played Vel
D8E3 DE3A                                                  LDU  NXT_KSTACK_ADR     U = next-assignable base address for note data (internal note stack)
D8E5 2706                                                  BEQ  NO_AVAIL_STACK     If U = 0, no "next address"
D8E7 EC42                                                  LDD  2,U    $2          else D = Address of "next" available data spot
D8E9 DD3A                                                  STD  NXT_KSTACK_ADR     Store next avail. base address, store press./vel on stack
D8EB 8601                                                  LDA  #$1                Set flag (to be checked upon return)
D8ED 3586                              NO_AVAIL_STACK      PULS A,B,PC

D8EF 3406                              LASTNODEFROMHEAP    PSHS B,A                U = Data Address [N]
D8F1 DC3A                                                  LDD  NXT_KSTACK_ADR     D = Data Address [N+1]
D8F3 ED42                                                  STD  2,U    $2          Store Data Address [N+1] in Pointer Address [N]
D8F5 DF3A                                                  STU  NXT_KSTACK_ADR     Update "N" so that we're now talking about Data [N+1]
D8F7 3586                                                  PULS A,B,PC             RTS

D8F9 3416                              GETNODEFROMHEAP     PSHS X,B,A
D8FB 1F30                                                  TFR  U,D                U = memory address of where inst. note/vel data is stored (base) U->D 
D8FD 10830000                                              CMPD #$0                See if Address = $0000
D901 270E                                                  BEQ  DONE_FREE_KEY      If it is, no notes assigned (i.e., no note ram to free) - exit
D903 AE42                              NEXT_NODE           LDX  2,U    $2          else X = "next" note/vel address (X = address stored in mem loc)
D905 2704                                                  BEQ  ADD_NOTE_NODE      If no "next" address, at end of list, branch
D907 3384                                                  LEAU 0,X                Else U = 'current' data address
D909 20F8                                                  BRA  NEXT_NODE          Branch until at end of data list

D90B 9E3A                              ADD_NOTE_NODE       LDX  NXT_KSTACK_ADR     X = Next Available New Note/Vel Memory Base Address
D90D AF42                                                  STX  2,U    $2          Store "next" new address as next node
D90F DD3A                                                  STD  NXT_KSTACK_ADR     Return original start address back to "next avail. new note" addressx
D911 3596                              DONE_FREE_KEY       PULS A,B,X,PC           Exit

D913 3406                              INIT_CHAN_X         PSHS B,A                X = Address of channel playing instrument
D915 CCED56                                                LDD  #$ED56
D918 ED8824                                                STD  $24,X              Store address for ENV1 Release Handler
D91B CCEE11                                                LDD  #$EE11
D91E ED882C                                                STD  $2C,X              Store address for ENV2 Release Handler
D921 4F                                                    CLRA 
D922 5F                                                    CLRB 
D923 ED8828                                                STD  $28,X              Set ENV 1 Ampl. Value to $0000
D926 ED8830                                                STD  $30,X              Set ENV 2 Ampl. Value to $0000
D929 53                                                    COMB                    B = $FF
D92A E706                                                  STB  $6,X               Indicate that channel should not be sounding
D92C C680                                                  LDB  #$80               B = $80
D92E E708                                                  STB  $8,X
D930 D66F                                                  LDB  SH_TEMP
D932 CAC0                                                  ORB  #$C0
D934 F7200B                                                STB  WR_SHA
D937 5F                                                    CLRB 
D938 FD200C                                                STD  WR_MDAC            B = Channel Number
D93B E607                                                  LDB  $7,X
D93D 58                                                    ASLB 
D93E 58                                                    ASLB 
D93F CAC3                                                  ORB  #$C3
D941 F7200B                                                STB  WR_SHA
D944 C43F                                                  ANDB #$3F '?
D946 F7200B                                                STB  WR_SHA
D949 8628                                                  LDA  #$28 '(
D94B 4A                                LOOP_40_TIMES       DECA                    X = $62
D94C 26FD                                                  BNE  LOOP_40_TIMES
D94E CAC0                                                  ORB  #$C0
D950 F7200B                                                STB  WR_SHA
D953 3586                                                  PULS A,B,PC

D955 8DBC                              INIT_WHOLE_BRD      BSR  INIT_CHAN_X        Init Channel
D957 308839                                                LEAX $39,X              X = Address of "next" channel
D95A 8DB7                                                  BSR  INIT_CHAN_X        Init Channel X + 1
D95C 3088C7                                                LEAX $C7,X              X = Address of Init channel (i.e., X = X-$39)
D95F 39                                                    RTS  

D960 3436                              INVOKE_PROG         PSHS Y,X,B,A            U = Addr of defining prog, Y = address of inst. being defined.
D962 0C0B                                                  INC  PRG_UNDERWAY       indicate that program is being defined/invoked
D964 4F                                                    CLRA                    A = 0
D965 A7A827                                                STA  $27,Y
D968 A7A90083                                              STA  131,Y
D96C CCC100                                                LDD  #$C100             D = $C100 = Loop Hook Address = RTS
D96F EDA816                                                STD  $16,Y
D972 EDA872                                                STD  $72,Y
D975 C601                                                  LDB  #$1                B = 1 (param #)
D977 BDDC69                            INIT_NXT_A_PARM     JSR  CHK_PARAM_DATA     Check current (A) parameter values for validity
D97A AD94                                                  JSR  [0,X]              Perform handler for selected parameter
D97C 5C                                                    INCB                    B = B + 1
D97D C132                                                  CMPB #$32 '2            See if we've done all 50 parameters
D97F 23F6                                                  BLS  INIT_NXT_A_PARM    Jump until we've done all 50 ($32) params
D981 31A85C                                                LEAY $5C,Y              Y = Base address of "B" params
D984 C638                                                  LDB  #$38 '8            B = 56 ($38) = start of "B" params
D986 BDDC69                            INIT_NXT_B_PARM     JSR  CHK_PARAM_DATA     Perform "handlers" for all "b" params of prog 0 (skip "cntrl" params)
D989 AD94                                                  JSR  [0,X]              Update all Param B Values
D98B 5C                                                    INCB                    B = B+1
D98C C164                                                  CMPB #$64 'd            See if we've done all 45 B-parameters
D98E 23F6                                                  BLS  INIT_NXT_B_PARM    Jump until we've def'd all B params too
D990 0F0B                                                  CLR  PRG_UNDERWAY       We're now done defining invoking programs
D992 35B6                                                  PULS A,B,X,Y,PC         Return

D994 3470                              INIT_BRD_4_INST     PSHS U,Y,X              Y = address of inst, u = base address of defining prog.
D996 CE0000                                                LDU  #$0
D999 AE24                              LOOP_NXT_BRD        LDX  $4,Y               Y = "Instr. Start Addr., X=Addr of Base Board for inst.
D99B 270C                                                  BEQ  NO_BASE_BOARD      If no next boards, jump & init channels
D99D BDD955                                                JSR  INIT_WHOLE_BRD     else next channel is defined - init whole board
D9A0 EF02                                                  STU  $2,X               store defining inst. address in channel def'n
D9A2 EF883B                                                STU  $3B,X              also store defining inst. address in "other" attached channel
D9A5 3184                                                  LEAY 0,X
D9A7 20F0                                                  BRA  LOOP_NXT_BRD       see if any more "next" channels

D9A9 9E38                              NO_BASE_BOARD       LDX  LNK_INST_ADR       X = RAM [0038] = address of channel 1 (link)
D9AB AF24                                                  STX  $4,Y               Update instrument to refelect base board address
D9AD 10AE62                                                LDY  $2,S               Y = Orig address of inst.
D9B0 AE24                                                  LDX  $4,Y
D9B2 9F38                                                  STX  LNK_INST_ADR       Update Link Channel Address
D9B4 EE22                                                  LDU  $2,Y               U = Address of where note/velocity data resides in memory
D9B6 BDD8F9                                                JSR  GETNODEFROMHEAP
D9B9 CE0000                                                LDU  #$0
D9BC EFA4                                                  STU  0,Y                Reset "Next Channel" for Instrument (to $0000)
D9BE EF22                                                  STU  $2,Y               Reset "Memory Address - Start of Note/Seq. Data for Inst"
D9C0 EF24                                                  STU  $4,Y               Reset "Base Board" for Instrument
D9C2 EF26                                                  STU  $6,Y               Reset "Address of Defining Prog." for Inst.
D9C4 CEC100                                                LDU  #$C100
D9C7 EFA862                                                STU  $62,Y
D9CA 35F0                                                  PULS X,Y,U,PC

D9CC 3406                              FINISH_PROG_DEF     PSHS B,A
D9CE BDE7B9                                                JSR  SETUP_INST01_VOL   Set up INST0_A_VOL, INST0_B_VOL, INST1_A_VOL, INST1_B_VOL
D9D1 DC30                                                  LDD  CONV_LEVER1        D = COnverted Lever 1 Value
D9D3 EDA808                                                STD  $8,Y               Store Lever 1/Lever 2 val
D9D6 DC32                                                  LDD  CONV_PEDAL1        D = Converted Pedal 1/Pedal 2 values
D9D8 EDA864                                                STD  $64,Y              Store converted values to inst0
D9DB 9634                                                  LDA  FOOTSW_VALS        Load System most recent FSW values
D9DD 44                                                    LSRA 
D9DE 46                                                    RORA 
D9DF 46                                                    RORA                    Shift FOOTSW_VALS by 3 locations to the right (puts in top 2 bits)
D9E0 A7A861                                                STA  $61,Y              Store shifted vals from system memory to inst def'n
D9E3 9609                                                  LDA  C_INTF_PANL        If A=0, chroma interface panel is disabled (it is disabled on startup)
D9E5 272A                                                  BEQ  C_INTF_PNL_OFF     If panel commands disabled, branch (exit)
D9E7 A6E4                                                  LDA  0,S                else, A = A from stack
D9E9 BDCD90                                                JSR  C_INF_OUT          Output C0 + Instrument number
D9EC A661                                                  LDA  $1,S
D9EE BDCD90                                                JSR  C_INF_OUT          Output program defining instrument
D9F1 9630                                                  LDA  CONV_LEVER1
D9F3 BDCD90                                                JSR  C_INF_OUT          Output Lever 1 Val
D9F6 9631                                                  LDA  CONV_LEVER2
D9F8 BDCD90                                                JSR  C_INF_OUT          Output Lever 2 Val
D9FB 9632                                                  LDA  CONV_PEDAL1
D9FD BDCD90                                                JSR  C_INF_OUT          Output Pedal 1 Val
DA00 9633                                                  LDA  CONV_PEDAL2
DA02 BDCD90                                                JSR  C_INF_OUT          Output Pedal 2 Val
DA05 A6A818                                                LDA  $18,Y
DA08 BDCD90                                                JSR  C_INF_OUT          Output Instrument Volume
DA0B A6A861                                                LDA  $61,Y
DA0E BDCD90                                                JSR  C_INF_OUT          Output Footswitch Settings
DA11 3586                              C_INTF_PNL_OFF      PULS A,B,PC

DA13 3406                              SET_LNK_BAL         PSHS B,A
DA15 A7A818                                                STA  $18,Y              A = Value from "link balance" lookup table or Volume command
DA18 E6A80A                                                LDB  $A,Y               B =  "Patch" byte from memory
DA1B C502                                                  BITB #$2                See if "Patch 1" was selected 
DA1D 2606                                                  BNE  PATCH_1            Branch if Patch 1 was selected (i.e., series or par. filt. mode)
DA1F C430                                                  ANDB #$30 '0            Else, Patch 1 not selected - Pull off "modulation" settings
DA21 C110                                                  CMPB #$10               See if we have "FILT FM"
DA23 2602                                                  BNE  NOT_ONLY_FILT_FM   Branch if we don't only have "FILT FM"
DA25 86FF                              PATCH_1             LDA  #$FF               A = $FF (series or parallel filter mode)
DA27 A7A874                            NOT_ONLY_FILT_FM    STA  $74,Y              Update Inst0_B_VOL
DA2A 3586                                                  PULS A,B,PC

DA2C 3456                              CP_PROG_X_2_U       PSHS U,X,B,A
DA2E 861D                                                  LDA  #$1D               A = $1D
DA30 3402                                                  PSHS A                  Save/Copy value of A
DA32 EC81                              NEXT_ELEMENT        LDD  ,X++               Do $1D copies (2 byte) (2 x $1D = $3A bytes)
DA34 EDC1                                                  STD  ,U++
DA36 6AE4                                                  DEC  0,S
DA38 26F8                                                  BNE  NEXT_ELEMENT
DA3A A684                                                  LDA  0,X                Copy last element (for total of $3B bytes)
DA3C A7C4                                                  STA  0,U
DA3E 3261                                                  LEAS $1,S               move back, in stack (i.e., drop A we pushed on)
DA40 35D6                                                  PULS A,B,X,U,PC

DA42 4F                                COUNT_BRD_ASGN      CLRA                    A = 0 (Determines # of boards assigned to instrument i)
DA43 3084                                                  LEAX 0,X                X = 0 + X
DA45 2705                                                  BEQ  NO_BRD_ASSIGN      If X <> 0, we have a board assigned, else we don't - branch and exit
DA47 4C                                BRD_ASSIGNED        INCA                    A = A + 1 (count number of boards assigned)
DA48 AE04                                                  LDX  $4,X               X = Address of next board's "next board" location
DA4A 26FB                                                  BNE  BRD_ASSIGNED       If Address <> 0, then the board is assigned.
DA4C 39                                NO_BRD_ASSIGN       RTS  

DA4D 31A900B8                          B_LAST_INST_CHK     LEAY 184,Y              Y = address of "next" instrument
DA51 5C                                                    INCB                    B = B+1
DA52 C107                                                  CMPB #$7                See if we're at last instrument
DA54 39                                                    RTS                     Return

DA55 3476                              BOARD_ASSIGN        PSHS U,Y,X,B,A          U = Base addr. of prog. controlling inst, Y = base addr of inst.
DA57 3275                                                  LEAS $15,S              Jump forward $15 blank spots in stack
DA59 9E38                                                  LDX  LNK_INST_ADR       X = address of link channel board
DA5B 8DE5                                                  BSR  COUNT_BRD_ASGN     see how many brds are assigned to the link inst. Answer = A
DA5D A768                                                  STA  $8,S               Number of boards assigned stored to $8 on stack
DA5F A769                                                  STA  $9,S               Number of boards assigned stored to $9 on stack
DA61 5F                                                    CLRB                    B=0
DA62 108E0690                                              LDY  #$690              Y = address of instrument 0 (main inst)
DA66 AE24                              COUNT_NXT_INST      LDX  $4,Y               X = address of base board for inst 0
DA68 8DD8                                                  BSR  COUNT_BRD_ASGN
DA6A A7E5                                                  STA  B,S                Count # of brds assgnd (Ans. ret'd in A) and store in pos. 0 on stack
DA6C AB69                                                  ADDA $9,S               Tot. # of boards assigned ($9 on stack = running total of brds asgnd)
DA6E A769                                                  STA  $9,S               Store A = Total num. brds. assgnd for main/link inst.
DA70 8DDB                                                  BSR  B_LAST_INST_CHK    Check to see if we've looked at all instruments (increments Y)
DA72 23F2                                                  BLS  COUNT_NXT_INST     if B <= 7, there are still more instruments
DA74 4D                                                    TSTA                    A = running tally of # of boards assigned
DA75 2747                                                  BEQ  NO_BRDS_EXIT       If A = 0, no boards were assigned to any inst. - exit
DA77 5F                                                    CLRB                    else, B = 0
DA78 108E0690                                              LDY  #$690              X = Base Address of Inst. 0
DA7C EE26                              MORE_INST_ALLOC     LDU  $6,Y               U = address of program defining current instrument
DA7E 2706                                                  BEQ  DEFD_PROG0         If prog=0, branch
DA80 6AE5                                                  DEC  B,S                else, inst has non-0 defining prog - dec. num of brds for that inst.
DA82 6A69                                                  DEC  $9,S               decrement total number of boards available
DA84 2726                                                  BEQ  NO_BRDS_LEFT       If no boards left, branch
DA86 8DC5                              DEFD_PROG0          BSR  B_LAST_INST_CHK    Check to see if we're at last instrument
DA88 23F2                                                  BLS  MORE_INST_ALLOC    Branch if we're not at end of instruments (and alloc. more inst.)
DA8A 6F6A                              HAVE_POLY_INST      CLR  $A,S               else, we've loked at all inst. - RAM[S+$A] = 0
DA8C 5F                                                    CLRB                    B = 0
DA8D 108E0690                                              LDY  #$690              Y = base address of Inst 0
DA91 EE26                              TALLY_BY_ALG        LDU  $6,Y               U = base address of defining program
DA93 270F                                                  BEQ  ALG_GE_5           If no defining prog., branch
DA95 A6A860                                                LDA  $60,Y              else A = keyboard algorithm selection
DA98 8105                                                  CMPA #$5                See if choice > 5
DA9A 2408                                                  BCC  ALG_GE_5           if carry clear then choice >= 5 (voice only req's 1 board)
DA9C 6C6A                                                  INC  $A,S               else, we have polyphonic inst [$A] = [$A] + 1
DA9E 6AE5                                                  DEC  B,S                Number of Avail voices of chanell is decremented by 1
DAA0 6A69                                                  DEC  $9,S               Total number of boards decremented by 1
DAA2 2708                                                  BEQ  NO_BRDS_LEFT       If no boards left, branch
DAA4 8DA7                              ALG_GE_5            BSR  B_LAST_INST_CHK    else check if we're at end of instruments
DAA6 23E9                                                  BLS  TALLY_BY_ALG       if we're not at end of instruments, branch
DAA8 A66A                                                  LDA  $A,S               if we are at end of inst., A = total polyphonic voices?
DAAA 26DE                                                  BNE  HAVE_POLY_INST     if A<>0, we have at least 1 poly. inst, branch and assgn more brds
DAAC A668                              NO_BRDS_LEFT        LDA  $8,S               if we're here, we're all out of boards - A = orig. # of link
DAAE A069                                                  SUBA $9,S               A = A-total num of boards assigned/required
DAB0 A768                                                  STA  $8,S               Store updated value back on position $8 on stack
DAB2 5F                                                    CLRB                    B = 0
DAB3 E76A                                                  STB  $A,S               Reset # of poly boards/instruments
DAB5 A6E5                              CHECK4_PRE_ASGN     LDA  B,S                A = # of boards assign to Inst "B"
DAB7 2E09                                                  BGT  SOMEBRD_PREASGN    If some boards already assigned, branch
DAB9 5C                                                    INCB                    B = B + 1
DABA C108                                                  CMPB #$8                See if Wer'eat last board, including fictitious "next" board
DABC 23F7                                                  BLS  CHECK4_PRE_ASGN
DABE 326B                              NO_BRDS_EXIT        LEAS $B,S               Else advance stack by $B spots & exit
DAC0 35F6                                                  PULS A,B,X,Y,U,PC

DAC2 4A                                SOMEBRD_PREASGN     DECA                    A = A - 1
DAC3 A7E5                                                  STA  B,S                Lessen preassigned count by 1 & put number back on stack
DAC5 E769                                                  STB  $9,S               B = Current Inst # (store in [$9])
DAC7 8D15                                                  BSR  L91
DAC9 E66A                                                  LDB  $A,S
DACB A6E5                              L93                 LDA  B,S
DACD 2B03                                                  BMI  L92
DACF 5C                                                    INCB 
DAD0 20F9                                                  BRA  L93

DAD2 4C                                L92                 INCA 
DAD3 A7E5                                                  STA  B,S
DAD5 E76A                                                  STB  $A,S
DAD7 BDDB63                                                JSR  L94
DADA E669                                                  LDB  $9,S
DADC 20D7                                                  BRA  CHECK4_PRE_ASGN

DADE C108                              L91                 CMPB #$8                Compare B & 8 (B = instrument number)
DAE0 2507                                                  BCS  L95                If B was < 8, then we're validly within 8 possible instruments
DAE2 9E38                                                  LDX  LNK_INST_ADR
DAE4 EE04                                                  LDU  $4,X               U = Address of next board assigned to instrument
DAE6 DF38                                                  STU  LNK_INST_ADR
DAE8 39                                                    RTS  

DAE9 86B8                              L95                 LDA  #$B8               A = $B8 = length of instrument def'n
DAEB 3D                                                    MUL                     D = $B8 x channel board #
DAEC 108E0690                                              LDY  #$690              Y = base address of instrument #1
DAF0 31AB                                                  LEAY D,Y                Y = address of instrument "B"
DAF2 A6A85F                                                LDA  $5F,Y              A = 16-channel mode for this inst. 
DAF5 2617                                                  BNE  16_CHAN            if A <> 0, then 16 channel mode = true (branch)
DAF7 AEA4                                                  LDX  0,Y                else, 8-channel mode, X = channel board address
DAF9 EE84                                                  LDU  0,X                U = address of 'next' channel assigned to inst.
DAFB EFA4                                                  STU  0,Y
DAFD BDD955                            L102                JSR  INIT_WHOLE_BRD
DB00 AC24                              L97                 CMPX $4,Y
DB02 2705                                                  BEQ  L96
DB04 10AE24                                                LDY  $4,Y
DB07 20F7                                                  BRA  L97

DB09 EE04                              L96                 LDU  $4,X               U = address of next board assigned to instrument
DB0B EF24                                                  STU  $4,Y
DB0D 39                                                    RTS  

DB0E 3420                              16_CHAN             PSHS Y
DB10 AEA4                              L104                LDX  0,Y
DB12 A606                                                  LDA  $6,X               A = indication if note is depressed (0 = depressed, $FF = up)
DB14 2D22                                                  BLT  L98
DB16 EEF4                                                  LDU  [0,S]
DB18 E647                                                  LDB  7,U    $7
DB1A C801                                                  EORB #$1
DB1C E107                              L100                CMPB $7,X               Compare B with channel number of current channel
DB1E 2706                                                  BEQ  L99
DB20 3184                                                  LEAY 0,X
DB22 AEA4                                                  LDX  0,Y
DB24 20F6                                                  BRA  L100

DB26 EE84                              L99                 LDU  0,X                U = address of next channel assigned to current inst.
DB28 EFA4                                                  STU  0,Y
DB2A 54                                                    LSRB 
DB2B 2403                                                  BCC  L101
DB2D 3088C7                                                LEAX $C7,X
DB30 3520                              L101                PULS Y
DB32 ECB4                                                  LDD  [0,Y]
DB34 EDA4                                                  STD  0,Y
DB36 20C5                                                  BRA  L102

DB38 E607                              L98                 LDB  $7,X               B = channel number ($00-$0F)
DB3A C801                                                  EORB #$1                Toggle Lowest Bit
DB3C EE84                              L106                LDU  0,X                U = address of next channel assigned to current inst.
DB3E A646                                                  LDA  6,U    $6          A = First Byte of address of program controlling inst.
DB40 2D05                                                  BLT  L103
DB42 10AEA4                                                LDY  0,Y                Y = address of channel which first played inst.
DB45 20C9                                                  BRA  L104

DB47 E147                              L103                CMPB 7,U    $7
DB49 2704                                                  BEQ  L105
DB4B 30C4                                                  LEAX 0,U                else X = address of "next" channel
DB4D 20ED                                                  BRA  L106

DB4F EEC4                              L105                LDU  0,U
DB51 EF84                                                  STU  0,X                U = address of next channel assigned to current inst.
DB53 AEA4                                                  LDX  0,Y
DB55 EE84                                                  LDU  0,X                U = address of next channel assigned to current isnt.
DB57 EFA4                                                  STU  0,Y
DB59 3520                                                  PULS Y
DB5B 54                                                    LSRB 
DB5C 2503                                                  BCS  L107
DB5E 3088C7                                                LEAX $C7,X
DB61 209A                              L107                BRA  L102

DB63 86B8                              L94                 LDA  #$B8               Length of one instrument def'n
DB65 A78809                                                STA  $9,X               Store length to channel
DB68 A78842                                                STA  $42,X              Store length to channel + 1
DB6B 3D                                                    MUL  
DB6C 108E0690                                              LDY  #$690              Y = base address of Inst 0
DB70 31AB                                                  LEAY D,Y                Y = Address of Instrument "A"
DB72 A6A808                                                LDA  $8,Y               A = Converted Lever 1 Value from Inst.
DB75 BDDC29                                                JSR  CHK_LEV_VAL
DB78 ED880A                                                STD  $A,X
DB7B A6A809                                                LDA  $9,Y               A = Converted Lever 2 Value from Inst.
DB7E BDDC29                                                JSR  CHK_LEV_VAL
DB81 ED880C                                                STD  $C,X
DB84 A6A864                                                LDA  $64,Y              A = Converted Pedal 1 Value from Inst.
DB87 BDDC60                                                JSR  CONV_PED_VAL
DB8A ED8843                                                STD  $43,X
DB8D A6A865                                                LDA  $65,Y              A = Converted Pedal 2 Value from Inst.
DB90 BDDC60                                                JSR  CONV_PED_VAL
DB93 ED8845                                                STD  $45,X
DB96 A6A80A                                                LDA  $A,Y               A = "Patch" Parameters from board/Instrument
DB99 E607                                                  LDB  $7,X               B = channel number ($00-$0F)
DB9B 54                                                    LSRB 
DB9C CA10                                                  ORB  #$10               Set "B4" Bit of the byte to go to WR_SYNA (select STB2)
DB9E FD2008                                                STD  RD_EOC_WR_SYND
DBA1 A6A80B                                                LDA  $B,Y               A = Resonance and Filter Settings for current board/voice
DBA4 C407                                                  ANDB #$7                Select STB0 or STB1 (deselect STB2)
DBA6 FD2008                                                STD  RD_EOC_WR_SYND     Store Resonance and Filter settings to channel "A" (or B) parameters
DBA9 CA08                                                  ORB  #$8
DBAB 6DA85F                                                TST  $5F,Y              See if we have a 8 or 16 channel mode
DBAE 2603                                                  BNE  L108
DBB0 A6A867                                                LDA  $67,Y
DBB3 FD2008                            L108                STD  RD_EOC_WR_SYND
DBB6 EC24                                                  LDD  $4,Y               D = Address of base board for inst. Y
DBB8 ED04                                                  STD  $4,X               Store Base Board as address of next board assigned to instrument
DBBA AF24                                                  STX  $4,Y               Update Instrument to reflect new Base Board address.
DBBC ECA4                                                  LDD  0,Y
DBBE ED84                                                  STD  0,X                U = address of next channel assigned to current inst.
DBC0 AFA4                                                  STX  0,Y
DBC2 10AF02                                                STY  $2,X               Store Address of "defining instrument"
DBC5 AFA814                                                STX  $14,Y
DBC8 308839                                                LEAX $39,X
DBCB E6A85F                                                LDB  $5F,Y              B = 0 if 8 channel mode, else 16 channel mode
DBCE 260A                                                  BNE  L109
DBD0 31A85C                                                LEAY $5C,Y              Y = Base address of "B" params in instrument
DBD3 10AF02                                                STY  $2,X               Store Address of "defining instrument"
DBD6 AFA814                                                STX  $14,Y
DBD9 39                                                    RTS  

DBDA 10AF02                            L109                STY  $2,X               Store Address of "defining instrument"
DBDD ECA4                                                  LDD  0,Y
DBDF ED84                                                  STD  0,X                Store address of next channel assigned to current inst.
DBE1 AFA4                                                  STX  0,Y
DBE3 39                                                    RTS  

DBE4 A607                              SET_RAM006X         LDA  $7,X               A = Channel Number ($00-$0F)
DBE6 43                                                    COMA 
DBE7 8401                                                  ANDA #$1                If A = 0, number was chan. # was orig. odd (1 = even)
DBE9 2702                                                  BEQ  CHAN_B_PAR         If we have odd chan. #, do B_Param
DBEB 8639                                                  LDA  #$39 '9            Else, we have even channel - A = $39 (offset to...)
DBED 9762                              CHAN_B_PAR          STA  CHAN_OFSET_2       A = 0, if "B" param, 39 if "A" param
DBEF 9761                                                  STA  CHAN_OFSET_1       A = 0, if "B" param, 39 if "A" param
DBF1 8039                                                  SUBA #$39 '9            A = A-39 (-39 if B param, 0 if A param)
DBF3 9760                                                  STA  RAM0060            A = -39 if "B", 0 if "A"
DBF5 2B02                                                  BMI  CHAN_B_2
DBF7 8639                                                  LDA  #$39 '9            A = $39
DBF9 8B02                              CHAN_B_2            ADDA #$2
DBFB 10AC86                                                CMPY A,X                Compare current inst. with inst. from chan.
DBFE 2604                                                  BNE  DIFF_INSTRS        If diff inst, branch
DC00 0F60                                                  CLR  RAM0060            else, RAM0060 = 0
DC02 0F61                                                  CLR  CHAN_OFSET_1       RAM0061 = 0
DC04 0F63                              DIFF_INSTRS         CLR  RAM0063            RAM0063 = 0 
DC06 39                                                    RTS  

DC07 3406                              UPD_LEV1_IN_CHAN    PSHS B,A                Save A&B - A = Lever Value
DC09 AE24                                                  LDX  $4,Y               X = base board assigned to play inst Y
DC0B 2709                                                  BEQ  LEV1_NOBRD_EXIT    If address of Board = 0, no boards assigned
DC0D 8D1A                                                  BSR  CHK_LEV_VAL
DC0F ED880A                            LEV1_MORE_CHAN      STD  $A,X               Store new lever value in board def'n
DC12 AE04                                                  LDX  $4,X               X = address of "next" channel
DC14 26F9                                                  BNE  LEV1_MORE_CHAN     While there are still "next" channels, branch
DC16 3586                              LEV1_NOBRD_EXIT     PULS A,B,PC             else, exit

DC18 3406                              UPD_LEV2_IN_CHAN    PSHS B,A                Save A&B - A = Lever Value
DC1A AE24                                                  LDX  $4,Y               X = address of board assigned to play inst. Y
DC1C 2709                                                  BEQ  LEV2_NOBRD_EXIT
DC1E 8D09                                                  BSR  CHK_LEV_VAL
DC20 ED880C                            LEV2_MORE_CHAN      STD  $C,X               Store new Lever 2 value in Board Df'n
DC23 AE04                                                  LDX  $4,X               X = address of next channel assigned to instrument
DC25 26F9                                                  BNE  LEV2_MORE_CHAN     while there are still "next" channels, branch
DC27 3586                              LEV2_NOBRD_EXIT     PULS A,B,PC             else, exit

DC29 4D                                CHK_LEV_VAL         TSTA                    Check "A" - look at lever value
DC2A 2B0C                                                  BMI  LEV_PULL           If A < 0, then lever was pulled - branch
DC2C C641                                                  LDB  #$41 'A            else, B=$41
DC2E 3D                                                    MUL  
DC2F 8120                                                  CMPA #$20
DC31 250A                                                  BCS  LEV_DONE
DC33 CC2000                                                LDD  #$2000             D = $2000
DC36 2005                                                  BRA  LEV_DONE           Return from subroutine

DC38 5F                                LEV_PULL            CLRB 
DC39 47                                                    ASRA 
DC3A 56                                                    RORB 
DC3B 47                                                    ASRA 
DC3C 56                                                    RORB 
DC3D 39                                LEV_DONE            RTS  

DC3E 3406                              UPD_PED1_VAL        PSHS B,A                Save A&B - A = Pedal 1 Value
DC40 AE24                                                  LDX  $4,Y               X = base board assigned to inst. Y
DC42 2709                                                  BEQ  PED1_NOBRD_EXIT    If address = 0, no boards assigned - jump
DC44 8D1A                                                  BSR  CONV_PED_VAL
DC46 ED8843                            PED1_MORE_CHAN      STD  $43,X              Store new Pedal value in channel def'n
DC49 AE04                                                  LDX  $4,X               X = address of next channel assigned to inst.
DC4B 26F9                                                  BNE  PED1_MORE_CHAN     while there are more channels assigned, branch
DC4D 3586                              PED1_NOBRD_EXIT     PULS A,B,PC             exit

DC4F 3406                              UPD_PED2_VAL        PSHS B,A                Save A&B - A = Pedal 2 Value
DC51 AE24                                                  LDX  $4,Y               X = base board assigned to inst. Y
DC53 2709                                                  BEQ  PED2_NOBRD_EXIT    If address = 0, no boards assigned - jump
DC55 8D09                                                  BSR  CONV_PED_VAL
DC57 ED8845                            PED2_MORE_CHAN      STD  $45,X              Store new Pedal 2 value in channel def'n
DC5A AE04                                                  LDX  $4,X               X = address of next channel assigned to inst.
DC5C 26F9                                                  BNE  PED2_MORE_CHAN     While there are more channels assigned, branch
DC5E 3586                              PED2_NOBRD_EXIT     PULS A,B,PC             exit

DC60 1F89                              CONV_PED_VAL        TFR  A,B                Convert pedal value
DC62 44                                                    LSRA 
DC63 56                                                    RORB 
DC64 44                                                    LSRA 
DC65 56                                                    RORB 
DC66 44                                                    LSRA 
DC67 56                                                    RORB 
DC68 39                                                    RTS                     Return

DC69 3444                              CHK_PARAM_DATA      PSHS U,B                U = address of defining program, B = param # (B>=1 upon first call)
DC6B C138                                                  CMPB #$38 '8            Compare B w/56 (i.e., A or B params)
DC6D 2505                                                  BCS  A_PARAMS_1         If B < 56 (A params) Branch
DC6F C032                                                  SUBB #$32 '2            Else (B params) B = B - 50
DC71 33C81E                                                LEAU 30,U               U = $1400 + 30 = $141E = Offset to centre of program
DC74 58                                A_PARAMS_1          ASLB                    B = B x 2
DC75 58                                                    ASLB                    B = B x 2
DC76 4F                                                    CLRA                    A = 0
DC77 8EE39A                                                LDX  #$E39A             X = $E39A (base address of param data table)
DC7A 308B                                                  LEAX D,X                D = A:B = 0:Bx4  X = $E39A + Bx4 - X = addr of hndlr for param B
DC7C 10830000                                              CMPD #$0                Compare D and 0 (D = 0 if B was 0) & we chose "set link bal"
DC80 271E                                                  BEQ  SET_LNK_BAL        If D = 0, branch
DC82 EC02                                                  LDD  $2,X               D =  A = Offset, B = Format
DC84 A6C6                                                  LDA  A,U                A = whole byte from program def'n at offset A (Byte w/ param value)
DC86 C570                              SHIFT_AGAIN         BITB #$70 'p            Check bits 4, 5 and 6 of the "format" byte.
DC88 2705                                                  BEQ  VAL_AT_RIGHT       when = 0, param val right justified in "A"
DC8A 44                                                    LSRA                    Shift data to right, 0 into left, right into carry
DC8B C010                                                  SUBB #$10               remove one "1"
DC8D 20F7                                                  BRA  SHIFT_AGAIN        Upper nibble format

DC8F C508                              VAL_AT_RIGHT        BITB #$8                Check B3 of "Format" Byte
DC91 2704                                                  BEQ  VALIDATE_LMT       If B3 = 0, then we should check the value of param
DC93 48                                                    ASLA                    Else, we've got +/-64 value ... no need to check 
DC94 47                                                    ASRA                    Extend 6th bit (sign) into real sign bit (7th)
DC95 35C4                                                  PULS B,U,PC             Exit, return

DC97 CEFB95                            VALIDATE_LMT        LDU  #$FB95             U = Address of "param limits"
DC9A C407                                                  ANDB #$7                B = Lower 3 bits of "B" ("offset" to limit)
DC9C A4C5                                                  ANDA B,U                A = "corrected"/limited value
DC9E 35C4                                                  PULS B,U,PC             Exit w/A = new/corrected value

DCA0 A6C81F                            SET_LNK_BAL         LDA  31,U               A = Keyboard Algorithm | Link Balance
DCA3 840F                                                  ANDA #$F                A = pick off Panel Link Balance portion
DCA5 8808                                                  EORA #$8                Toggle Top bit of Link Balance
DCA7 2601                                                  BNE  LNK_BAL_NE_0       If Link Balance <> 0 (Change Sign)
DCA9 4C                                                    INCA                    A = A + 1
DCAA 8008                              LNK_BAL_NE_0        SUBA #$8                A = A - 8 (all vals ref to -8..7)
DCAC 35C4                                                  PULS B,U,PC             Exit, return with "A" value set to param value

DCAE 3466                              VALDTE_PARAM_2      PSHS U,Y,B,A            B = Param #, A = new param value to be set
DCB0 C138                                                  CMPB #$38 '8            Compare B w/56
DCB2 2505                                                  BCS  PROG_LT_56         If B < 56 (A params) Branch
DCB4 C032                                                  SUBB #$32 '2            else B = B - 50 (B params)
DCB6 33C81E                                                LEAU 30,U               Old U = Addr of Prog 0 [1400], new U = start addr. of B params
DCB9 58                                PROG_LT_56          ASLB                    B = B x 2
DCBA 58                                                    ASLB                    B = B x 2 (Shift out Edit Mode) - B=prog # x 4
DCBB 4F                                                    CLRA                    A = 0 
DCBC 8EE39A                                                LDX  #$E39A             X = $E39A (Start of Vector Table for Params)
DCBF 308B                                                  LEAX D,X                D = A:B = 0:Bx4 X = $E39A + Bx4  X = handler address
DCC1 10830000                                              CMPD #$0                Compare D and 0 (D = 0 if B = 0)
DCC5 273F                                                  BEQ  D_EQ_0_2           If D = 0, we're doing a "set link balance" - branch
DCC7 E603                                                  LDB  $3,X               B = "Utility" Byte 
DCC9 C407                                                  ANDB #$7                B = Lower 3 bits of B = Offset to limit in table
DCCB 108EFB95                                              LDY  #$FB95             Y = $FB95 Memory Base address to table of "allowable" param values
DCCF A6A5                                                  LDA  B,Y                A = max param. allowable value for the selected param
DCD1 E602                                                  LDB  $2,X               B = Offset to param. location (offset from "U")
DCD3 33C5                                                  LEAU B,U                U = address of param. in program 0
DCD5 E603                                                  LDB  $3,X               B = "Utility" Byte
DCD7 C470                                                  ANDB #$70 'p            Pull out 3 bits (0xxx 0000)
DCD9 108E0000                                              LDY  #$0                Y = $0
DCDD 31A5                                                  LEAY B,Y                Y = 3 bits + y
DCDF E6E4                                                  LDB  0,S
DCE1 3402                                                  PSHS A
DCE3 E4E0                                                  ANDB ,S+
DCE5 E7E4                                                  STB  0,S
DCE7 31A4                                                  LEAY 0,Y
DCE9 2706                                                  BEQ  L110
DCEB 58                                L111                ASLB 
DCEC 48                                                    ASLA 
DCED 3130                                                  LEAY $10,Y
DCEF 26FA                                                  BNE  L111
DCF1 3404                              L110                PSHS B
DCF3 43                                                    COMA 
DCF4 A4C4                                                  ANDA 0,U
DCF6 AAE0                                                  ORA  ,S+
DCF8 A7C4                                                  STA  0,U
DCFA E603                                                  LDB  $3,X
DCFC C508                                                  BITB #$8
DCFE 2725                                                  BEQ  L112
DD00 68E4                                                  ASL  0,S
DD02 67E4                                                  ASR  0,S
DD04 201F                                                  BRA  L112

DD06 A6C81F                            D_EQ_0_2            LDA  31,U               A = Keyboard Alg | Panel Link Balance
DD09 84F0                                                  ANDA #$F0               Pick off keyboard Alg. Value, setting panel link bal to 0
DD0B A7C81F                                                STA  31,U               Store updated Ag/link balance value to program
DD0E A6E4                                                  LDA  0,S                A = new param value to be set
DD10 840F                                                  ANDA #$F                only take lower 4 bits
DD12 8808                                                  EORA #$8                toggle bit 3
DD14 2601                                                  BNE  L113               branch if a <> $00
DD16 4C                                                    INCA                    A = A+1
DD17 8008                              L113                SUBA #$8
DD19 A7E4                                                  STA  0,S                Store updated value
DD1B 840F                                                  ANDA #$F
DD1D AAC81F                                                ORA  31,U               Update program values
DD20 A7C81F                                                STA  31,U               store link balance amount
DD23 2067                                                  BRA  L114

DD25 ECE4                              L112                LDD  0,S
DD27 EE64                                                  LDU  $4,S
DD29 C132                                                  CMPB #$32 '2            check B against 50
DD2B 2304                                                  BLS  DO_NEXT_INSTR      branch if B <= 50
DD2D C137                                                  CMPB #$37 '7            else, check B against 55
DD2F 2368                                                  BLS  51_B_55            branch if B is 51-55 (link, edit, kybd split, main, link transp)
DD31 108E0690                          DO_NEXT_INSTR       LDY  #$690              else, Y = $690 = base address for instruments
DD35 11A326                            B_LT_50             CMPU $6,Y
DD38 2610                                                  BNE  L115
DD3A C138                                                  CMPB #$38 '8            see if B >= 56 (i.e., B params)
DD3C 2503                                                  BCS  A_PARAMS           Branch if A params
DD3E 31A85C                                                LEAY $5C,Y              else, Y = address of "B params" in instrument
DD41 AD94                              A_PARAMS            JSR  [0,X]              go do handler for selected param change
DD43 C138                                                  CMPB #$38 '8
DD45 2503                                                  BCS  L115
DD47 31A8A4                                                LEAY $A4,Y              Y = Base address for original instrument
DD4A 31A900B8                          L115                LEAY 184,Y              Y = base address for next instrument
DD4E 108C0B98                                              CMPY #$B98              see if we're at the last instrument
DD52 23E1                                                  BLS  B_LT_50            if we haven't done all instrs, go to next
DD54 11831400                                              CMPU #$1400             compare U w/ prog 0 base address
DD58 2647                                                  BNE  DONE_UPDATE        if we're not at P0, branch
DD5A C105                              L117                CMPB #$5                else, we're at P0, see what sort of change
DD5C 220B                                                  BHI  P0_PARAM_A         if B>5, we're not doing A control - branch
DD5E F6141E                                                LDB  P0_PANEL_EDIT      else, B = panel edit settings
DD61 C43F                                                  ANDB #$3F '?            b = program/param being edited
DD63 E161                                                  CMPB $1,S
DD65 263A                                                  BNE  DONE_UPDATE
DD67 201E                                                  BRA  L116

DD69 C132                              P0_PARAM_A          CMPB #$32 '2            Check b against 50
DD6B 220D                                                  BHI  P0_PARAM_B         if we're dealing w/"A" param, stay - else, branch
DD6D F6141E                                                LDB  P0_PANEL_EDIT      B = panel edit setting
DD70 2A2F                                                  BPL  DONE_UPDATE        Brach if "edit B" or "error"
DD72 C43F                                                  ANDB #$3F '?            else, edit A or Edit Both
DD74 E161                                                  CMPB $1,S
DD76 2629                                                  BNE  DONE_UPDATE
DD78 200D                                                  BRA  L116

DD7A F6141E                            P0_PARAM_B          LDB  P0_PANEL_EDIT      B = panel edit settings
DD7D 2B22                                                  BMI  DONE_UPDATE        branch if Edit A or Edit Both
DD7F C00E                                                  SUBB #$E                B = B - $E
DD81 E161                                                  CMPB $1,S
DD83 261C                                                  BNE  DONE_UPDATE
DD85 C032                                                  SUBB #$32 '2
DD87 BDDE79                            L116                JSR  DISP_SMALL_LEDS
DD8A 35E6                                                  PULS A,B,Y,U,PC

DD8C 11831400                          L114                CMPU #$1400             Compare against base address for prog 0
DD90 260F                                                  BNE  DONE_UPDATE        If comparison <> 0, then we're not working on P0
DD92 BDE7B9                                                JSR  SETUP_INST01_VOL   Else, we are, and have to set up link program
DD95 A6E4                                                  LDA  0,S
DD97 20C1                                                  BRA  L117

DD99 11831400                          51_B_55             CMPU #$1400             Compare against base address for Prog 0
DD9D 2602                                                  BNE  DONE_UPDATE        If comparison <> 0, then we're not working on P0, exit
DD9F AD94                                                  JSR  [0,X]              Else, do handler for change
DDA1 35E6                              DONE_UPDATE         PULS A,B,Y,U,PC

DDA3 A6C4                              PARAM_FIX           LDA  0,U                A = RAM[$1400] = Read Params from Prog 0, B=$00, A = link data
DDA5 843F                                                  ANDA #$3F '?            A = Lower 6 bits = Link Program Number
DDA7 2704                                                  BEQ  FIX_LINK_PROG      Does the stored link = 0 ?, if so - jump & fix
DDA9 8132                                                  CMPA #$32 '2            A = 50?
DDAB 2304                                                  BLS  LINK_VAL_OK        Branch if A <= 50 (i.e., valid no changes needed)
DDAD 8601                              FIX_LINK_PROG       LDA  #$1                else incorrect, set to 1 (A = 1)
DDAF A7C4                                                  STA  0,U                Store correct value to A to RAM (program base address)
DDB1 A6C81E                            LINK_VAL_OK         LDA  30,U               Load Panel Edit settings
DDB4 843F                                                  ANDA #$3F '?            Grab lower 6 bits (panel edit setting - prog/param being edited)
DDB6 8132                                                  CMPA #$32 '2            A = 50?
DDB8 2207                                                  BHI  FIX_PNL_PARAM      if A > 50, error in #, jump & fix
DDBA A6C81E                                                LDA  30,U               Load Panel Edit settings
DDBD 85C0                                                  BITA #$C0               Check top two bits (panel edit mode)
DDBF 2605                                                  BNE  PANEL_MODE_OK      If panel edit mode <> 0, we don't have an error 
DDC1 8681                              FIX_PNL_PARAM       LDA  #$81               else, error - Reset to default (Edit A, Prog 1/Param 1)
DDC3 A7C81E                                                STA  30,U               Store correct value back to panel edit settings
DDC6 A641                              PANEL_MODE_OK       LDA  1,U    $1          A = Transpose Values (Main & Link)
DDC8 2A06                                                  BPL  M_TRANS_OK         If Top bit =1 (possible error in val), do not jump
DDCA 8540                                                  BITA #$40 '@            Pick out 2nd bit of Main value
DDCC 2702                                                  BEQ  M_TRANS_OK         If Main Transpose = 10 (down 1 oct), jump else error val
DDCE 843F                                                  ANDA #$3F '?            Make main transpose = 00 (val = "no transpose" if error)
DDD0 8520                              M_TRANS_OK          BITA #$20               Check Link Transpose value, bit one
DDD2 2706                                                  BEQ  L_TRANS_OK         If = 0, value OK & branch, else maybe fix
DDD4 8510                                                  BITA #$10               Check Link Transpose Type
DDD6 2702                                                  BEQ  L_TRANS_OK         If 2nd bit = 0, value OK - branch (else, error)
DDD8 84CF                                                  ANDA #$CF               Make link transpose = 00 = No link transpose (if we had error)
DDDA A741                              L_TRANS_OK          STA  1,U    $1          Put correct Link/Main Transpose values into memory
DDDC A6C81D                                                LDA  29,U               A = Program Sequence Number
DDDF 2704                                                  BEQ  SEQ_NO_0           If Seq. Num = 0, branch
DDE1 8132                                                  CMPA #$32 '2            else, compare Seq. Num with 50
DDE3 2305                                                  BLS  SEQ_NO_OK          If A<=50, num. good - otherwise fix
DDE5 8601                              SEQ_NO_0            LDA  #$1                A = 1 (fixed value)
DDE7 A7C81D                                                STA  29,U               Store fixed seq. num. value
DDEA A6C820                            SEQ_NO_OK           LDA  32,U               A = keyboard split
DDED 48                                                    ASLA                    Split value = value * 2
DDEE 2903                                                  BVS  FIX_KYBD_SPLT      if overflow set, error - go fix
DDF0 48                                                    ASLA                    shift again (split = value * 2)
DDF1 2803                                                  BVC  SPLIT_OK           if v still set, error & fix
DDF3 6FC820                            FIX_KYBD_SPLT       CLR  32,U               Split Value = default = 0 
DDF6 39                                SPLIT_OK            RTS                     Values Checked and Fixed - Return 

DDF7 3402                              PROG_MODIFIED       PSHS A
DDF9 8680                                                  LDA  #$80               A = $80
DDFB B71FF3                                                STA  PROG_MOD_FLAG      $80 -> RAM[1FF3] = Program was modified
DDFE 9A29                                                  ORA  LED_DIG9           Turn on Bit B7 of LED_DIG_9 = Decimal Pt.
DE00 9729                                                  STA  LED_DIG9           Write decimal point to display
DE02 3582                                                  PULS A,PC               Restore A value and jump back to calling spot

DE04 3416                              OUTPUT_BIG_PROG     PSHS X,B,A              A = current display prog #, B = prog. modified byte
DE06 8EFB8B                                                LDX  #$FB8B             X = base address of LED Values (0-9)
DE09 810A                                                  CMPA #$A                Compare A with decimal 10 (i.e., see if we need two digits)
DE0B 2409                                                  BCC  DIGIT_GE10         If A >= 10, jump, else go on (only 1 digit needed)
DE0D E686                                                  LDB  A,X                B = Ath data item  - LED Value for "A"
DE0F EA61                                                  ORB  $1,S               OR old B w/new B (i.e., turn on DP if needed)
DE11 4F                                                    CLRA                    A = $00
DE12 DD28                                                  STD  LED_DIG8           LED_DIG_8 = {blank}, LED_DIG_9 = "A"
DE14 3596                                                  PULS A,B,X,PC           Return

DE16 5F                                DIGIT_GE10          CLRB                    B = $00
DE17 5C                                NEXT_DECADE         INCB                    B = B + 1
DE18 800A                                                  SUBA #$A                A = A - 10
DE1A 810A                                                  CMPA #$A                Compare A with decimal 10
DE1C 24F9                                                  BCC  NEXT_DECADE        If A >= 10, jump, else go on
DE1E A686                                                  LDA  A,X                A = LED Value for "Ones"
DE20 E685                                                  LDB  B,X                B = LED Value for "Tens"
DE22 AA61                                                  ORA  $1,S               'OR' in old "DP" setting
DE24 9729                                                  STA  LED_DIG9           Store "Ones" value to big display
DE26 D728                                                  STB  LED_DIG8           Store "Tens" value to big display
DE28 3596                                                  PULS A,B,X,PC           Return

DE2A 3416                              DISP_PARAM_VAL      PSHS X,B,A              Store values of X, B and A
DE2C 8EFB8B                                                LDX  #$FB8B             X = $FB8B = Base address for LED Val's
DE2F 4D                                                    TSTA                    A = Disp Param Val
DE30 2A01                                                  BPL  DISP_PARAM_GT0     If A >= 0, branch
DE32 40                                                    NEGA                    Change A -ve to A +ve
DE33 810A                              DISP_PARAM_GT0      CMPA #$A                Compare A with 10
DE35 2412                                                  BCC  DISP_PARAM_GT10    If A >= 10, branch
DE37 5F                                                    CLRB                    B = 0, LED Value = {blank}
DE38 D724                                                  STB  LED_DIG4           LED_DIG_4 = {blank}
DE3A D725                                                  STB  LED_DIG5           LED_DIG_5 = {blank}
DE3C 6DE4                                                  TST  0,S                Check original "A" value
DE3E 2A01                                                  BPL  ORIG_A_POS_1       If it wasn't a negative val, then jump
DE40 5C                                                    INCB                    B = B + 1
DE41 D726                              ORIG_A_POS_1        STB  LED_DIG6           If A -ve, LED_DIG_6 = '-', else +ve and LED_DIG_6 = {blank}
DE43 A686                                                  LDA  A,X                A = Ath digit LED Value
DE45 9727                                                  STA  LED_DIG7           LED_DIG_7 = Ath value
DE47 3596                                                  PULS A,B,X,PC           Exit

DE49 8164                              DISP_PARAM_GT10     CMPA #$64 'd
DE4B 240C                                                  BCC  DISP_PARAM_GT100   If A >= 100, jump
DE4D 5F                                                    CLRB                    B = 0
DE4E D724                                                  STB  LED_DIG4           DIG4 = {Blank}
DE50 6DE4                                                  TST  0,S                Check original A value
DE52 2A01                                                  BPL  ORIG_A_POS_2       If A >= 0, branch
DE54 5C                                                    INCB                    B = B + 1
DE55 D725                              ORIG_A_POS_2        STB  LED_DIG5           If A -ve, LED_DIG_5 = '-', else +ve and LED_DIG_5 = {blank}  
DE57 200E                                                  BRA  DO_TENS

DE59 5F                                DISP_PARAM_GT100    CLRB                    B = 0
DE5A 6DE4                                                  TST  0,S
DE5C 2A01                                                  BPL  ORIG_A_POS_3
DE5E 5C                                                    INCB 
DE5F D724                              ORIG_A_POS_3        STB  LED_DIG4
DE61 C630                                                  LDB  #$30 '0            B = $30 = LED Val '1'
DE63 D725                                                  STB  LED_DIG5           LED_DIG_5 = '1' ("100's")
DE65 8064                                                  SUBA #$64 'd            A = A - 100
DE67 5F                                DO_TENS             CLRB                    B = 0
DE68 5C                                GET_NEXT_10         INCB                    B = B + 1
DE69 800A                                                  SUBA #$A                A = A - 10
DE6B 810A                                                  CMPA #$A                Compare A and 10
DE6D 24F9                                                  BCC  GET_NEXT_10        Branch until all 10's removed
DE6F A686                                                  LDA  A,X                A = LED Val for Ath Number ("1s")
DE71 E685                                                  LDB  B,X                B = LED Val for Bth Number ("10s")
DE73 9727                                                  STA  LED_DIG7           LED_DIG_7 = 1's value (A)
DE75 D726                                                  STB  LED_DIG6           LED_DIG_6 = 10's value (B)
DE77 3596                                                  PULS A,B,X,PC           Restore original values to A, B, X and return

DE79 3406                              DISP_SMALL_LEDS     PSHS B,A                Store a copy of B and A on the stack, B=param # part of P0_linkval
DE7B 5D                                                    TSTB                    Check B.  If B <> 0, then we have a param #
DE7C 260E                                                  BNE  DISP_PARAM_DAT     If B <> 0, we have a param values - jump
DE7E 48                                                    ASLA                    Else we have a link #, A = Ax2
DE7F 8DA9                                                  BSR  DISP_PARAM_VAL     Display Link Balance #
DE81 860E                                                  LDA  #$E                A = LED Value = 'L'
DE83 9720                                                  STA  LED_DIG0           LED_DIG_0 = 'L'
DE85 B61400                                                LDA  P0_LINK_VALS       A = Link Vals
DE88 843F                                                  ANDA #$3F '?            A = Link Program
DE8A 2008                                                  BRA  DISP_SEL_VAL       Display Link Program Number

DE8C 8D9C                              DISP_PARAM_DAT      BSR  DISP_PARAM_VAL
DE8E 8667                                                  LDA  #$67 'g            A = LED Value = 'P'
DE90 9720                                                  STA  LED_DIG0           LED_DIG_0 = 'P'
DE92 A661                                                  LDA  $1,S
DE94 8D12                              DISP_SEL_VAL        BSR  PROG_PARAM_NO      Display program/param/link number
DE96 3586                                                  PULS A,B,PC

DE98 3406                              PNT_PANL            PSHS B,A
DE9A F6141E                                                LDB  P0_PANEL_EDIT      B = Panel Edit Settings = Panel Edit Mode:Panel Edit Prog
DE9D C43F                                                  ANDB #$3F '?            B = Program/Param
DE9F 9635                                                  LDA  DISP_PARAM_VAL     Current param value -> A 
DEA1 BDDF32                                                JSR  PAINT_LEDS
DEA4 8DD3                                                  BSR  DISP_SMALL_LEDS
DEA6 3586                                                  PULS A,B,PC

DEA8 3416                              PROG_PARAM_NO       PSHS X,B,A
DEAA 8EFB8B                                                LDX  #$FB8B             X = $FB8B = Base address of LED Val values
DEAD 810A                                                  CMPA #$A                Compare A and 10
DEAF 2409                                                  BCC  PROG_PARAM_GT10    If A >= 10, branch
DEB1 A686                                                  LDA  A,X                A = Ath LED Value
DEB3 5F                                                    CLRB                    B = 0
DEB4 DD21                                                  STD  LED_DIG1           LED_DIG_1 = Ath value, LED_DIG_2 = {blank}
DEB6 D723                                                  STB  LED_DIG3           LED_DIG_3 = {blank}
DEB8 3596                                                  PULS A,B,X,PC

DEBA 5F                                PROG_PARAM_GT10     CLRB                    B = 0
DEBB 5C                                GT10_NEXT_DIGIT     INCB                    B = B + 1
DEBC 800A                                                  SUBA #$A                A = A - 10
DEBE 810A                                                  CMPA #$A                Compare A and 10
DEC0 24F9                                                  BCC  GT10_NEXT_DIGIT    If A >= 10, branch
DEC2 A686                                                  LDA  A,X                A = Ath LED Value (1's value)
DEC4 E685                                                  LDB  B,X                B = Bth LED Value (10's value)
DEC6 9722                                                  STA  LED_DIG2           LED_DIG_2 = 1's Value (A)
DEC8 D721                                                  STB  LED_DIG1           LED_DIG_1 = 10's Value (B)
DECA 0F23                                                  CLR  LED_DIG3           LED_DIG_3 = {Blank}
DECC 3596                                                  PULS A,B,X,PC           Return, restoring A, B and X

DECE 3474                              BAD_BRD_HNDLR       PSHS U,Y,X,B            Set Split 8 (Display Bad Boards) Handler
DED0 0F00                                                  CLR  MEM_00             Use MEM_00 to store bad board summary = reset
DED2 CEDF98                                                LDU  #$DF98             U = $DF98 = base address for bad board lookup table
DED5 108E0034                                              LDY  #$34               Y = $0034
DED9 8D17                                                  BSR  BAD_BRD_1          Check Board Data
DEDB 108E0690                                              LDY  #$690              Y = instrument 0 base address
DEDF 8D11                              BB_CHK_NXT_INST     BSR  BAD_BRD_1          Check instrument data
DEE1 31A900B8                                              LEAY 184,Y              Y = address of next instrument
DEE5 108C0B98                                              CMPY #$B98              see if we're at end of instruments
DEE9 23F4                                                  BLS  BB_CHK_NXT_INST    If not, go through all boards
DEEB 0300                                                  COM  MEM_00             Before, have a "1" for good board - now have a "1" where bad board
DEED 2615                                                  BNE  PRNT_BAD_BRDS      If RAM[0000] <> 0, there are bad boards to print
DEEF 4F                                                    CLRA                    A = 0
DEF0 35F4                                                  PULS B,X,Y,U,PC         Exit

DEF2 AE24                              BAD_BRD_1           LDX  $4,Y               X = RAM[$34 + 4] 
DEF4 270D                                                  BEQ  BAD_BRD_NO_NXT     If X = 0 (no next channel) branch
DEF6 A607                              BB_CHK_NXT_BRD      LDA  $7,X               A = channel # of chosen channel
DEF8 44                                                    LSRA                    A = A/2 (board number)
DEF9 A6C6                                                  LDA  A,U                Get Number from Lookup table
DEFB 9A00                                                  ORA  MEM_00             Or w/ RAM[0000] (tally results)
DEFD 9700                                                  STA  MEM_00             A -> RAM[0000] (store results)
DEFF AE04                                                  LDX  $4,X               X = address of next pair of boards
DF01 26F3                                                  BNE  BB_CHK_NXT_BRD     If next set of boards exist, branch
DF03 39                                BAD_BRD_NO_NXT      RTS                     Else, done - return

DF04 CC4F05                            PRNT_BAD_BRDS       LDD  #$4F05             D = LED Value = 'Er'
DF07 DD20                                                  STD  LED_DIG0           LED_DIG_0 = 'E', LED_DIG_1 = 'r'
DF09 D722                                                  STB  LED_DIG2           LED_DIG_2 = 'r'
DF0B 4F                                                    CLRA                    A = $00
DF0C 5F                                                    CLRB 
DF0D DD23                                                  STD  LED_DIG3           LED_DIG_3, LED_DIG_4 = {blank}
DF0F DD25                                                  STD  LED_DIG5           LED_DIG_5, LED_DIG_6 = {blank}
DF11 9600                                                  LDA  MEM_00             RAM[0000] -> A = Bit set for Bad board
DF13 8E0028                                                LDX  #$28               X = $0028 = mem addr of LED Digit 8/9
DF16 CEFB92                                                LDU  #$FB92             U = $FB92 = address of LED val for "7"
DF19 48                                STILL_2_CHK         ASLA                    A = A * 2
DF1A 2404                                                  BCC  BRD_OK             If A >= 0, branch (shift each bit off, branch if this bit not set)
DF1C E6C4                                                  LDB  0,U                RAM[FB92] -> B = $70, B = LED Val '7'
DF1E E782                                                  STB  ,-X                B -> RAM[0027] Put failed board # to LED display
DF20 335F                              BRD_OK              LEAU -1,U    $1F        Get address of next lower LED code
DF22 1183FB8B                                              CMPU #$FB8B             = bottom addressof LED vals 0-7
DF26 24F1                                                  BCC  STILL_2_CHK        If not under board zero, check next board
DF28 1F10                                                  TFR  X,D                else done, X = last LED digt location used in memory -> D
DF2A 830028                                                SUBD #$28               D = D - $28
DF2D 1F98                                                  TFR  B,A
DF2F 40                                                    NEGA                    A will contain the number (qty) of bad boards
DF30 35F4                                                  PULS B,X,Y,U,PC

DF32 3416                              PAINT_LEDS          PSHS X,B,A
DF34 B61FF7                                                LDA  PNL_KEY_CODE       A = Panel Key Code
DF37 8B00                                                  ADDA #$0                A = A + 0
DF39 8EDF74                                                LDX  #$DF74             X = $DF74 = base address of flash leds
DF3C A686                                                  LDA  A,X                RAM[A+DF74] -> A = blink image from table
DF3E 972C                                                  STA  LED_BLINK          Store "A" value to Blinkable LED mask
DF40 F61401                                                LDB  P0_TRNSPOSE        B = Transpose Value
DF43 C4F0                                                  ANDB #$F0               B = Main and Link Transpose Values
DF45 B6141E                                                LDA  P0_PANEL_EDIT      A = Panel Edit Settings
DF48 2A02                                                  BPL  EDIT_B             If Edit B, Branch
DF4A CA08                                                  ORB  #$8                Else edit A or Edit Both (B= Type of Patch = 8 - 15)
DF4C 48                                EDIT_B              ASLA                    A = A x 2
DF4D 2A02                                                  BPL  ERROR              If we still have a +ve value, then we have an edit error
DF4F CA04                                                  ORB  #$4                else, edit B (B=type of patch set bit 2 B2)
DF51 B61400                            ERROR               LDA  P0_LINK_VALS       A = Link Type | Link Program
DF54 49                                                    ROLA 
DF55 49                                                    ROLA 
DF56 49                                                    ROLA 
DF57 49                                                    ROLA 
DF58 8406                                                  ANDA #$6                Pull off top 2 digits of orig. value (0000 0{link type}0)
DF5A 8B00                                                  ADDA #$0
DF5C 8EDF90                                                LDX  #$DF90             X = $DF90
DF5F A686                                                  LDA  A,X                RAM[DF90 + A] -> A, = LED Image for selected Link Type
DF61 DD2A                                                  STD  LED_IMAGE1         D = value for flash & non flash LEDs (0<=A<=6 by 2's)
DF63 B61FF6                                                LDA  COPY_MODE          RAM[1FF6] -> A
DF66 8EDF88                                                LDX  #$DF88             Memory address for "copy mode" LED data
DF69 EC86                                                  LDD  A,X                RAM[DF88 + A] -> D
DF6B D32A                                                  ADDD LED_IMAGE1         Write image of flashable LEDS
DF6D DD2A                                                  STD  LED_IMAGE1         Store Flash & No_Flash LED states
DF6F FD2006                                                STD  RD_NOTE_WR_LED     Actually Turn LEDS ON/OFF, as appropriate
DF72 3596                                                  PULS A,B,X,PC

DF74 0000                              BLNK_IMG_00         FDB  $0000              No Flash
DF76 8040                              BLNK_IMG_02         FDB  $8040              Flash - No Link
DF78 4020                              BLNK_IMG_04         FDB  $4020              Flash - Link Lower
DF7A 2020                              BLNK_IMG_06         FDB  $2020              Flash - Link Unison
DF7C 1020                              BLNK_IMG_08         FDB  $1020              Flash - Link Upper
DF7E 0404                              BLNK_IMG_0A         FDB  $0404              Flash - Store
DF80 0808                              BLNK_IMG_0C         FDB  $0808              Flash - Set Split
DF82 0101                              BLNK_IMG_0E         FDB  $0101              Flash - Copy From A
DF84 0202                              BLNK_IMG_10         FDB  $0202              Flash - Copy From B
DF86 0000                              BLNK_IMG_12         FDB  $0000
DF88 0001                              COPY_MODE_0         FDB  $0001              Param Select LED (no Blink)
DF8A 0100                              COPY_MODE_2         FDB  $0100              Copy From A (blink)
DF8C 0200                              COPY_MODE_4         FDB  $0200              Copy From B (blink)
DF8E 0002                              COPY_MODE_6         FDB  $0002              Program Select (no blink)
DF90 8040                              LINK_LED_1          FDB  $8040              No Link - Up 1 Oct (Main)
DF92 1020                              LINK_LED_2          FDB  $1020              Link Upper - Down 1 Oct (Link)
DF94 4020                              LINK_LED_3          FDB  $4020              Link Lower - Down 1 Oct (Link)
DF96 2020                              LINK_LED_4          FDB  $2020              Link Unison - Down 1 Oct (Link)
DF98 01                                BRD_CHK_00          FCB  $01                Board # 0 Bad (Lookup) 
DF99 02                                BRD_CHK_01          FCB  $02                Board # 1 Bad (Lookup)
DF9A 04                                BRD_CHK_02          FCB  $04                Board # 2 Bad (Lookup)
DF9B 08                                BRD_CHK_03          FCB  $08                Board # 3 Bad (Lookup)
DF9C 10                                BRD_CHK_04          FCB  $10                Board # 4 Bad (Lookup)
DF9D 20                                BRD_CHK_05          FCB  $20                Board # 5 Bad (Lookup)
DF9E 40                                BRD_CHK_06          FCB  $40                Board # 6 Bad (Lookup)
DF9F 80                                BRD_CHK_07          FCB  $80                Board # 7 Bad (Lookup)

DFA0 965E                              CALC_VEL_PRES       LDA  PLAYED_VEL         A = Played Velocity
DFA2 5F                                                    CLRB                    B = 0
DFA3 8880                                                  EORA #$80               Toggle top velocity bit
DFA5 ED880E                                                STD  $E,X               Store to channel params
DFA8 8880                                                  EORA #$80               Toggle top velocity bit back again
DFAA B11FFC                                                CMPA ATTACK_THRES       Compare A and Stored Attack (Velocity Threshold)
DFAD 2504                                                  BCS  VEL_BELW_THRSH     Branch if Threshold > played velocity
DFAF 86A0                                                  LDA  #$A0               else the vel played was > attack thresh, A = $A0 ("hard")
DFB1 2002                                                  BRA  VEL_ABOV_THRSH

DFB3 8680                              VEL_BELW_THRSH      LDA  #$80               A = $80 ("soft")
DFB5 ED8810                            VEL_ABOV_THRSH      STD  $10,X              Store D to Channel Def'n
DFB8 965F                                                  LDA  PLAYED_PRES        A = played pressure
DFBA BDE8E2                                                JSR  CALC_PRESS         Returns vals in MEM0 & MEM1 (& sometimes in MEM 2/3 too)
DFBD DC00                                                  LDD  MEM_00
DFBF 8880                                                  EORA #$80
DFC1 ED8812                                                STD  $12,X              Store pressure value in channel
DFC4 DC02                                                  LDD  MEM_02
DFC6 8880                                                  EORA #$80
DFC8 ED8814                                                STD  $14,X              Store 2nd pressure byte to channel
DFCB 960D                                                  LDA  16_CHNL_MODE
DFCD 2618                                                  BNE  CALC_V_P_DONE      Branch if 16 channel mode
DFCF EC880E                                                LDD  $E,X               else, 8-chan mode - store vals to other half of dual ch. board
DFD2 ED8847                                                STD  $47,X              store velocity value | diff between thresh to channel N+1
DFD5 EC8810                                                LDD  $10,X
DFD8 ED8849                                                STD  $49,X              read played vel & vel. attack thresh from channel N
DFDB A68812                                                LDA  $12,X
DFDE ED884B                                                STD  $4B,X
DFE1 EC8814                                                LDD  $14,X
DFE4 ED884D                                                STD  $4D,X
DFE7 39                                CALC_V_P_DONE       RTS  

DFE8 965C                              L11                 LDA  CORR_NOTE
DFEA A708                                                  STA  $8,X
DFEC A78819                                                STA  $19,X
DFEF 8880                                                  EORA #$80
DFF1 A78816                                                STA  $16,X
DFF4 0D0D                                                  TST  16_CHNL_MODE
DFF6 260A                                                  BNE  L118
DFF8 8880                                                  EORA #$80
DFFA A78852                                                STA  $52,X
DFFD 8880                                                  EORA #$80
DFFF A7884F                                                STA  $4F,X
E002 39                                L118                RTS  

E003 965C                              L13                 LDA  CORR_NOTE
E005 A708                                                  STA  $8,X
E007 A78819                                                STA  $19,X
E00A C880                                                  EORB #$80
E00C E78816                                                STB  $16,X
E00F A08816                                                SUBA $16,X
E012 8880                                                  EORA #$80
E014 2E01                                                  BGT  L119
E016 4A                                                    DECA 
E017 A78818                            L119                STA  $18,X
E01A 0D0D                                                  TST  16_CHNL_MODE
E01C 2613                                                  BNE  L120
E01E 965C                                                  LDA  CORR_NOTE
E020 A78852                                                STA  $52,X
E023 E7884F                                                STB  $4F,X
E026 A0884F                                                SUBA $4F,X
E029 8880                                                  EORA #$80
E02B 2E01                                                  BGT  L121
E02D 4A                                                    DECA 
E02E A78851                            L121                STA  $51,X
E031 C880                              L120                EORB #$80
E033 39                                                    RTS  

E034 965C                              STORE_NOTE2CHAN     LDA  CORR_NOTE          A = System Specified corrected note
E036 A708                                                  STA  $8,X               Store 'corrected' note to channel def'n
E038 A78819                                                STA  $19,X              Store updated 'kybd' value
E03B A08816                                                SUBA $16,X              Subtrack note away from stored portamento value
E03E 2E01                                                  BGT  L122               If resulting value is > 0, branch
E040 4A                                                    DECA                    else, A = A - 1
E041 A78818                            L122                STA  $18,X              Store portamento/Glissandro value
E044 0D0D                                                  TST  16_CHNL_MODE       Check current state of 16 channel mode
E046 260E                                                  BNE  DONE_NOTE2CHAN     If 16-channel mode, branch (and exit)
E048 965C                                                  LDA  CORR_NOTE          else, 8-channel mode, A = original corrected note
E04A A78852                                                STA  $52,X              Store 'KYBD' value for link channel/b-param
E04D A0884F                                                SUBA $4F,X
E050 2E01                                                  BGT  L123
E052 4A                                                    DECA 
E053 A78851                            L123                STA  $51,X
E056 39                                DONE_NOTE2CHAN      RTS  

E057 3420                              DO_SWEEP_SETUP      PSHS Y
E059 10AE02                                                LDY  $2,X               Y = address of defining instrument
E05C AFA814                                                STX  $14,Y              Store channel address to instrument def'n
E05F A6A81D                                                LDA  $1D,Y              A = sweep mode (param 8, val = 0 to 3)
E062 44                                                    LSRA                    Shift lowest bit into carry 
E063 2414                                                  BCC  FREE_RUN_SWPA      C = 0 (clear) if sweep mode bit 0 used to = 0 (i.e., free run mode)
E065 CCFFFF                                                LDD  #$FFFF             Else, we have a key-triggered sweep - reset now (D = $FFFF)
E068 ED881C                                                STD  $1C,X              Store sweep data to channel N
E06B ECA823                                                LDD  $23,Y              D = address of sweep wave shape handler
E06E 1083EFBE                                              CMPD #$EFBE             $EFBE = address of random sweep
E072 2705                                                  BEQ  FREE_RUN_SWPA      Branch if instrument sweep = random
E074 86FF                                                  LDA  #$FF               A = $FF (reset sweep position)
E076 A78820                                                STA  $20,X              Store A (current position in sweep) to channel def'n
E079 8680                              FREE_RUN_SWPA       LDA  #$80               A = $80
E07B A7881F                                                STA  $1F,X              $80 = index of sweep data set (Amp Mod Delay)
E07E 960D                                                  LDA  16_CHNL_MODE       A = Indication if 16 or 8 channel mode
E080 2629                                                  BNE  SWP_SETUP_DONE     Branch if 16 channel mode, else set up rest of board
E082 308839                                                LEAX $39,X              X = address of channel N+1
E085 AFA870                                                STX  $70,Y              Store channel N+1 address in instrument def'n
E088 A6A879                                                LDA  $79,Y              A = Sweep Mode (for Channel N + 1 - B param)
E08B 44                                                    LSRA 
E08C 2415                                                  BCC  FREE_RUN_SWPB
E08E CCFFFF                                                LDD  #$FFFF
E091 ED881C                                                STD  $1C,X
E094 ECA9007F                                              LDD  127,Y
E098 1083EFBE                                              CMPD #$EFBE             $EFBE = memory address for "all other sweeps"
E09C 2705                                                  BEQ  FREE_RUN_SWPB
E09E 86FF                                                  LDA  #$FF               A = $FF
E0A0 A78820                                                STA  $20,X
E0A3 8680                              FREE_RUN_SWPB       LDA  #$80
E0A5 A7881F                                                STA  $1F,X
E0A8 3088C7                                                LEAX $C7,X
E0AB 35A0                              SWP_SETUP_DONE      PULS Y,PC

E0AD 3460                              RESTRT_NOTE_ENV     PSHS U,Y                Save Y and U
E0AF 10AE02                                                LDY  $2,X               Y = address of defining instrument
E0B2 8D29                                                  BSR  ENV_AMPL_WRK1
E0B4 960D                                                  LDA  16_CHNL_MODE       See if we have 8 or 16 channel mode
E0B6 260B                                                  BNE  DONE_RESTRT_ENV    If A <> 0 (i.e., if 16 channel mode), exit
E0B8 308839                                                LEAX $39,X              else, set up next channel, X = address of next chan (N+1)
E0BB 31A85C                                                LEAY $5C,Y              Y = base address of "B" params in old def. inst.
E0BE 8D1D                                                  BSR  ENV_AMPL_WRK1
E0C0 3088C7                                                LEAX $C7,X              X = address of original channel
E0C3 35E0                              DONE_RESTRT_ENV     PULS Y,U,PC

E0C5 3460                              START_NOTE_ENV      PSHS U,Y                Save Y and U
E0C7 10AE02                                                LDY  $2,X               Y = address of defining instrument
E0CA 8D58                                                  BSR  ENV_AMPL_WRK2
E0CC 960D                                                  LDA  16_CHNL_MODE       See if we have 8 or 16 channel mode
E0CE 260B                                                  BNE  DONE_START_ENV     If A <> 0 (i.e., if 16 channel mode), exit
E0D0 308839                                                LEAX $39,X              else, set up next channel, X = address of next channel (N+1)
E0D3 31A85C                                                LEAY $5C,Y              Y = base address of "B" params in old def. instrument.
E0D6 8D4C                                                  BSR  ENV_AMPL_WRK2
E0D8 3088C7                                                LEAX $C7,X              X = address of previous channel
E0DB 35E0                              DONE_START_ENV      PULS Y,U,PC

E0DD A6A828                            ENV_AMPL_WRK1       LDA  $28,Y              A = ENV1 Ampl. Touch value (from user panel input)
E0E0 8D75                                                  BSR  ENV_AMPL_TCH       convert user value to value used by channel board
E0E2 A78827                                                STA  $27,X              Store Env 1 channel touch Ampl value (to channel)
E0E5 E6A827                                                LDB  $27,Y
E0E8 E78823                                                STB  $23,X              If B = 0, we just did a program invoke
E0EB 2607                                                  BNE  L124               Branch if B <> 0
E0ED A08828                                                SUBA $28,X
E0F0 2E02                                                  BGT  L124
E0F2 8601                                                  LDA  #$1                A = $1
E0F4 A78826                            L124                STA  $26,X
E0F7 5D                                                    TSTB                    Check Value of B
E0F8 2B06                                                  BMI  L125               If B < 0, branch
E0FA CCECF0                                                LDD  #$ECF0             Address of subroutine for ...
E0FD ED8824                                                STD  $24,X              Update ENV 1 Handler in channel def'n
E100 A6A831                            L125                LDA  $31,Y              A = Env 2 Ampl Touch Value
E103 8D52                                                  BSR  ENV_AMPL_TCH       Convert Env 2 Ampl Touch Value to a Channel Value
E105 A7882F                                                STA  $2F,X              Store Channel Env 2 Touch Ampl. value
E108 E6A830                                                LDB  $30,Y              A = Env 2 delay from instr. (0 = none, $FF = swp triggered)
E10B E7882B                                                STB  $2B,X              Store Env 2 Delay amt. to channel
E10E 2607                                                  BNE  L126
E110 A08830                                                SUBA $30,X              A = A - Env 2 Ampl. Value from channel
E113 2E02                                                  BGT  L126               If A > 0, branch
E115 8601                                                  LDA  #$1                else, A is now <= 0, set A = 1
E117 A7882E                            L126                STA  $2E,X              Set 'Env 2 Ampl. Touch' temp value ??? (don't really)
E11A 5D                                                    TSTB                    Check "B"
E11B 2B06                                                  BMI  EXIT_AMPLWRK1      If B<0, branch
E11D CCEDA7                                                LDD  #$EDA7             Handler address
E120 ED882C                                                STD  $2C,X              Update Env 2 Handler Address in Channel Def'n
E123 39                                EXIT_AMPLWRK1       RTS                     we're done - return

E124 A6A828                            ENV_AMPL_WRK2       LDA  $28,Y              A = Env 1 Ampl. Touch Value (0-7)
E127 8D2E                                                  BSR  ENV_AMPL_TCH       Calculate Channel Ampl. Touch Value
E129 A78827                                                STA  $27,X              Store Channel Env 1 Touch Ampl. value (to channel)
E12C A78826                                                STA  $26,X              Store Channel Env 1 Touch Ampl. value to $26 in channel
E12F A6A827                                                LDA  $27,Y
E132 A78823                                                STA  $23,X
E135 2B06                                                  BMI  SKIP_E1_DELAY
E137 CCECD8                                                LDD  #$ECD8             Env 1 'Delay' ? Handler address
E13A ED8824                                                STD  $24,X              Store Env 1 'Delay'? address to channel params
E13D A6A831                            SKIP_E1_DELAY       LDA  $31,Y              A = Env 2 Ampl. Touch Value (0-7)
E140 8D15                                                  BSR  ENV_AMPL_TCH       Convert instrument value of Ampl. Touch to a Channel Value
E142 A7882F                                                STA  $2F,X              Store channel Env 2 Touch Ampl. value
E145 A7882E                                                STA  $2E,X              Store channel Env 2 Touch Ampl. value
E148 A6A830                                                LDA  $30,Y              A = Env 2 delay from instrument (0=none, 2=short, $FF=swp triggered) 
E14B A7882B                                                STA  $2B,X              Store Env 2 delay amount to channel
E14E 2B06                                                  BMI  EXIT_AMPLWRK2      Branch if sweep triggered Env 2 delay
E150 CCED8F                                                LDD  #$ED8F             Else, we have some valid dealy, D = Env 2 Delay Handler
E153 ED882C                                                STD  $2C,X              Store Env 2 Delay Handler address to channel params
E156 39                                EXIT_AMPLWRK2       RTS  

E157 270D                              ENV_AMPL_TCH        BEQ  TRSH_VAL_FULL      If ENV1 Ampl. Touch value = 0 (Ampl Touch = NONE), branch
E159 8106                                                  CMPA #$6                check ENV1 Ampl. Touch against 6
E15B 220C                                                  BHI  ENV1_TCH_TRSH      If A > 6 (i.e., -THRESH), branch
E15D 2513                                                  BCS  ENV1_TCH_1TO5      if carry set, A < 6
E15F 965E                                                  LDA  PLAYED_VEL         If we're here, ampl. touch = thresh, A = played velocity
E161 B11FFC                                                CMPA ATTACK_THRES
E164 250A                                                  BCS  THSH_VAL_NONE      If played_vel < attack_thresh, branch
E166 8620                              TRSH_VAL_FULL       LDA  #$20               A = $20
E168 39                                                    RTS                     Return

E169 965E                              ENV1_TCH_TRSH       LDA  PLAYED_VEL         A = Played Velocity
E16B B11FFC                                                CMPA ATTACK_THRES
E16E 25F6                                                  BCS  TRSH_VAL_FULL      If played velocity < attack threshold, set max value
E170 4F                                THSH_VAL_NONE       CLRA                    else, we didn't meet criteria (clear value A = 0)
E171 39                                                    RTS                     Return

E172 D65E                              ENV1_TCH_1TO5       LDB  PLAYED_VEL         B = Played Velocity (0 <= B <= 31)
E174 C510                                                  BITB #$10
E176 2608                                                  BNE  VEL_GT_HALF        If we're not zero, then velocity was >= 16, branch
E178 40                                                    NEGA                    Else vel. < 1/2 max, A = -ve version of panel ENV1 touch value
E179 8B07                                                  ADDA #$7                A = # from 2 to 6, 2 = highest ampl. touch
E17B D65E                                                  LDB  PLAYED_VEL         B = played velocity
E17D 3D                                                    MUL  
E17E 2011                                                  BRA  L127

E180 9700                              VEL_GT_HALF         STA  MEM_00             else vel. > 1/2 max, store panel ENV1 touch val to scratch
E182 C620                                                  LDB  #$20
E184 3D                                                    MUL  
E185 C060                                                  SUBB #$60 '`
E187 D701                                                  STB  MEM_01
E189 9600                                                  LDA  MEM_00
E18B 4C                                                    INCA 
E18C D65E                                                  LDB  PLAYED_VEL
E18E 3D                                                    MUL  
E18F D001                                                  SUBB MEM_01
E191 1F98                              L127                TFR  B,A
E193 44                                                    LSRA 
E194 39                                                    RTS  

E195 CCED34                            ACTIVATE_ATK        LDD  #$ED34             D = $ED34 address of ENV 1 handler  
E198 ED8824                                                STD  $24,X              Store ENV 1 handler to channel
E19B CCEDEB                                                LDD  #$EDEB             D = $EDEB address of ENV 2 handler 
E19E ED882C                                                STD  $2C,X              Store ENV 2 handler to channel
E1A1 960D                                                  LDA  16_CHNL_MODE       A = system '16-channel' mode/val
E1A3 260C                                                  BNE  EXIT_CH_ENVS       Branch if 16-channel mode (we're done)
E1A5 CCED34                                                LDD  #$ED34             else, 8-channel mode - D = address of ENV 1 handler
E1A8 ED885D                                                STD  $5D,X              Store ENV 1 handler to link channel
E1AB CCEDEB                                                LDD  #$EDEB             D= address of ENV 2 handler
E1AE ED8865                                                STD  $65,X              Store ENV 2 handler to link channel
E1B1 39                                EXIT_CH_ENVS        RTS                     Return

E1B2 4F                                CHK_REL_THRSH       CLRA                    A = 0
E1B3 F61FFD                                                LDB  RELSE_THRES        B = Release Threshold Value
E1B6 D15E                                                  CMPB PLAYED_VEL         Compare Played Velocity w/Threshold Velocity
E1B8 49                                                    ROLA                    If Release Velocity < Played Vel, Carry = 1 (into B0 of A)
E1B9 A7880F                                                STA  $F,X               Store indication if Release was faster than threshold
E1BC D60D                                                  LDB  16_CHNL_MODE       B = An indication if we're in 16 channel mode or not
E1BE 2603                                                  BNE  EXIT_REL_THRSH     if B <> 0, we're in 16 channel mode - done w/threshold info
E1C0 A78848                                                STA  $48,X              Else, we're in 8 channel mode - store threshold info to "B" param
E1C3 39                                EXIT_REL_THRSH      RTS  

E1C4 CCED56                            ACTIVATE_REL        LDD  #$ED56             Reset Env 1 Release handler
E1C7 ED8824                                                STD  $24,X              Store new release handler of Env 1 to channel
E1CA CCEE11                                                LDD  #$EE11             Reset/Set Env 2 release handler
E1CD ED882C                                                STD  $2C,X              Store new Env 2 release handler
E1D0 960D                                                  LDA  16_CHNL_MODE
E1D2 260C                                                  BNE  L128               If in 16 channel mode, we're done (exit)
E1D4 CCED56                                                LDD  #$ED56             else, we're in 8 channel mode - work on link half of board
E1D7 ED885D                                                STD  $5D,X              Env 1 (link) release handler
E1DA CCEE11                                                LDD  #$EE11
E1DD ED8865                                                STD  $65,X              Env 2 (link) release handler 
E1E0 39                                L128                RTS  

E1E1 3470                              PUT_S_H_TO_BRD      PSHS U,Y,X
E1E3 10AE02                                                LDY  $2,X               Y = Address of Defining Instrument
E1E6 BDDBE4                                                JSR  SET_RAM006X
E1E9 BDEB1E                                                JSR  L66
E1EC 960D                                                  LDA  16_CHNL_MODE       A = Channel Mode (see if 8- or 16-channel mode)
E1EE 2612                                                  BNE  16_CHAN_BR1        Branch if 16 channel mode - else do work on "B" params
E1F0 308839                                                LEAX $39,X
E1F3 31A85C                                                LEAY $5C,Y              Y = Base address of "B" params in instrument
E1F6 BDDBE4                                                JSR  SET_RAM006X
E1F9 BDEB1E                                                JSR  L66
E1FC 3088C7                                                LEAX $C7,X
E1FF 31A8A4                                                LEAY $A4,Y
E202 966F                              16_CHAN_BR1         LDA  SH_TEMP
E204 8AC0                                                  ORA  #$C0
E206 B7200B                                                STA  WR_SHA
E209 A607                                                  LDA  $7,X
E20B 48                                                    ASLA 
E20C 48                                                    ASLA 
E20D 4A                                                    DECA 
E20E 843F                                                  ANDA #$3F '?
E210 976F                                                  STA  SH_TEMP
E212 8D0E                                                  BSR  L129
E214 960D                                                  LDA  16_CHNL_MODE
E216 2608                                                  BNE  16_CHAN_BR2
E218 308839                                                LEAX $39,X
E21B 31A85C                                                LEAY $5C,Y              Y = Base address of "B" params in instrument
E21E 8D02                                                  BSR  L129
E220 35F0                              16_CHAN_BR2         PULS X,Y,U,PC

E222 BDDBE4                            L129                JSR  SET_RAM006X
E225 BDE921                                                JSR  L68
E228 68880E                                                ASL  $E,X
E22B 67880E                                                ASR  $E,X               Double Top Bit - 0 into Carry
E22E 688810                                                ASL  $10,X
E231 678810                                                ASR  $10,X              Double Top Bit - 0 into Carry
E234 688812                                                ASL  $12,X
E237 678812                                                ASR  $12,X              Double Top Bit - 0 into Carry
E23A 688814                                                ASL  $14,X
E23D 678814                                                ASR  $14,X              Dobble Top Bit - 0 into Carry
E240 39                                                    RTS  

E241 3402                              CHK_NGATE           PSHS A                  Save A
E243 A6A866                                                LDA  $66,Y              A = footswitch mode from inst. at Y
E246 2A0A                                                  BPL  GATEOK_PLAYNOTE    If +ve, we don't have a note gate mode - branch
E248 A8A861                                                EORA $61,Y              else, we do have a note gate mode - check on how pedal asserted
E24B 48                                                    ASLA                    shift left to determine if -NOTE GATE or NOTE GATE
E24C 2A04                                                  BPL  GATEOK_PLAYNOTE    we should hear note
E24E 3502                                                  PULS A                  else, we are gating out a note (do not play) : A=orig. A value
E250 2058                                                  BRA  FSW_MODE_DUP

E252 3582                              GATEOK_PLAYNOTE     PULS A,PC               exit

E254 A6A866                            MASK_FSW            LDA  $66,Y              A = Footswitch Mode 
E257 48                                                    ASLA                    Shift Bit over left 1 spot
E258 48                                                    ASLA                    another shift to get "disabled" bits in B7 and B6
E259 43                                                    COMA                    Invert sense of Disabled Bits (disabled bits become Zeros)
E25A A4A861                                                ANDA $61,Y              AND FSW Mode (how FSW works) with FSW Byte (Status of Pedals)
E25D 39                                                    RTS                     A = 0 if no FSW data relevant or if disabled - return

E25E E6A861                            FSW1_DESERT_OKCHK   LDB  $61,Y              B = 'sense' of footswitch
E261 2A47                                                  BPL  FSW_MODE_DUP       Branch if FSW1 is _already_ deasserted 
E263 C440                                                  ANDB #$40 '@            else, make sure we 'deassert' value
E265 E7A861                                                STB  $61,Y              update footswitch byte setting FSW1 deasserted
E268 E6A866                                                LDB  $66,Y              B = footswitch mode
E26B C420                                                  ANDB #$20               Pick of 'right disabled' bit 
E26D 263B                                                  BNE  FSW_MODE_DUP       If FSW1 disabled, exit 
E26F 39                                                    RTS                     else, return to calling routine and continue FSW work

E270 E6A861                            FSW1_ASSERT_OKCHK   LDB  $61,Y              B = 'sense' of footswitch 
E273 2B35                                                  BMI  FSW_MODE_DUP       Branch if FSW1 is _already_ asserted (i.e., no new action required) 
E275 CA80                                                  ORB  #$80               else FSW1 was deasserted - set FSW1 to 'asserted' state 
E277 E7A861                                                STB  $61,Y              update footswitch byte
E27A E6A866                                                LDB  $66,Y              B = footswitch mode
E27D C420                                                  ANDB #$20               pick off "right disabled" bit
E27F 2629                                                  BNE  FSW_MODE_DUP       If FSW1 'disabled', exit   
E281 39                                                    RTS                     else, return to calling routing and continue with FSW work

E282 E6A861                            FSW2_DESERT_OKCHK   LDB  $61,Y              B = 'sense' of footswitch
E285 C540                                                  BITB #$40 '@            check FSW2 assert/deassert state
E287 2721                                                  BEQ  FSW_MODE_DUP       If FSW2 already deasserted, exit
E289 C480                                                  ANDB #$80               else, FSW2 newly deasserted, ensure value is set
E28B E7A861                                                STB  $61,Y              update footswitch byte setting FSW2 deasserted
E28E E6A866                                                LDB  $66,Y              B = footswitch mode
E291 C410                                                  ANDB #$10               pick off 'left disabled' bit
E293 2615                                                  BNE  FSW_MODE_DUP       If FSW2 disabled, exit
E295 39                                                    RTS                     else, return to calling routing and continue with FSW work

E296 E6A861                            FSW2_ASSERT_OKCHK   LDB  $61,Y              B = 'sense' of footswitch
E299 C540                                                  BITB #$40 '@            check FSW2 assert/deassert status
E29B 260D                                                  BNE  FSW_MODE_DUP       If FSW2 already asserted, then branch
E29D CA40                                                  ORB  #$40 '@            else, FSW2 newly asserted, ensure value is set
E29F E7A861                                                STB  $61,Y              update footswitch byte setting FSW2 asserted
E2A2 E6A866                                                LDB  $66,Y              B = footswitch byte
E2A5 C410                                                  ANDB #$10
E2A7 2601                                                  BNE  FSW_MODE_DUP       If FSW2 disabled, exit
E2A9 39                                                    RTS                     else, return to calling routine and continue with FSW work

E2AA 3262                              FSW_MODE_DUP        LEAS $2,S               Double Exit (do not return to FSW handler - return to calling prog)
E2AC 39                                                    RTS  

E2AD EC84                              L130                LDD  0,X
E2AF EDA4                                                  STD  0,Y
E2B1 ECC4                                                  LDD  0,U
E2B3 ED84                                                  STD  0,X
E2B5 AFC4                                                  STX  0,U
E2B7 AEA4                                                  LDX  0,Y
E2B9 EEC4                                                  LDU  0,U
E2BB 39                                                    RTS  

E2BC 3410                              SET_NXT_LAST_DAT    PSHS X                  Save Value of X
E2BE 11A3E1                                                CMPU ,S++
E2C1 26EA                                                  BNE  L130
E2C3 39                                                    RTS  

E2C4 3420                              L1                  PSHS Y
E2C6 11A3E1                                                CMPU ,S++
E2C9 26E2                                                  BNE  L130
E2CB 3184                                                  LEAY 0,X
E2CD AE84                                                  LDX  0,X
E2CF EEC4                                                  LDU  0,U
E2D1 39                                                    RTS  

E2D2 BDD8E1                            PUT_NOTE_ON_STK     JSR  L88                Check for stack space
E2D5 2602                                                  BNE  INS_IN2_STK_AT_U   A = 1 if we can successfully store note/vel data on stack
E2D7 4F                                                    CLRA                    else, we didn't have stack space 
E2D8 39                                                    RTS  

E2D9 965C                              INS_IN2_STK_AT_U    LDA  CORR_NOTE          A = Corrected Note (Just Played)
E2DB D65E                                                  LDB  PLAYED_VEL         B = Note Velocity (Just Played)
E2DD EDC4                                                  STD  0,U                Store Note:Velocity in Sequencer Note List
E2DF AF42                                                  STX  2,U    $2          Store old "Next Address" for new data slot 
E2E1 EF22                                                  STU  $2,Y               Update 'next' pointer for spot before
E2E3 8601                                                  LDA  #$1                A = 1
E2E5 39                                                    RTS  

E2E6 3460                              TOP_BOT_RELEASE     PSHS U,Y
E2E8 EE22                              L132                LDU  $2,Y               U = Address of where note/velocity data resides in memory
E2EA 2715                                                  BEQ  L131               If no address, exit
E2EC A6C4                                                  LDA  0,U                compare stored note w/ current note
E2EE 915C                                                  CMPA CORR_NOTE
E2F0 2704                                                  BEQ  REL_PLAYING        if they're the same, branch
E2F2 31C4                                                  LEAY 0,U                else we have a non-sounding note
E2F4 20F2                                                  BRA  L132

E2F6 EC42                              REL_PLAYING         LDD  2,U    $2          U = addr. of note/vel
E2F8 ED22                                                  STD  $2,Y               Update address in inst. defn'
E2FA BDD8EF                                                JSR  LASTNODEFROMHEAP   Update stack pointer
E2FD 8601                                                  LDA  #$1                A = 1
E2FF 35E0                                                  PULS Y,U,PC             Return

E301 4F                                L131                CLRA 
E302 35E0                                                  PULS Y,U,PC

E304 3470                                                  PSHS U,Y,X              Arp Up/Down Attack Handler - highest note at end of stack
E306 AE22                              CURR_GT_STACKN      LDX  $2,Y               X = start address of note/stack in memory, then X = 'next'
E308 2728                                                  BEQ  ADD_NOTE_HERE      If X = 0, then no notes stored or at end of notes
E30A A684                                                  LDA  0,X                Else, we have stored notes - A = Note at Mem Address
E30C 915C                                                  CMPA CORR_NOTE          Compare stored note w/currently played note
E30E 2E22                                                  BGT  ADD_NOTE_HERE      If Stored Note > Current Note, branch
E310 2724                                                  BEQ  REPL_STACK_VEL     Else, if Stored Note = Current Note - Branch & Update Velocity value
E312 3184                                                  LEAY 0,X                else, Stored Note < Current Note - Y = current stack (data) address
E314 20F0                                                  BRA  CURR_GT_STACKN     go back and do more comparisons

E316 3470                              ORDER_STK_DESCND    PSHS U,Y,X              Arp Down, Arp Down-Up (ordered w/highest note at beg. of stack)
E318 AE22                              CURR_LT_STACKN      LDX  $2,Y               X = Address of note/stack in memory
E31A 2716                                                  BEQ  ADD_NOTE_HERE      If X = 0, then no notes stored (at end of notes)
E31C A684                                                  LDA  0,X                Else, we have stored notes - A = Note at curr stack pos.
E31E 915C                                                  CMPA CORR_NOTE          Compare stored note w/currently played note
E320 2D10                                                  BLT  ADD_NOTE_HERE      If Stored Note < Current Note, branch
E322 2712                                                  BEQ  REPL_STACK_VEL     Else, if stored Note = Current Note - Branch & Update Velocity value
E324 3184                                                  LEAY 0,X                else, Stored Note > Current Note - Y = current stack (data) address
E326 20F0                                                  BRA  CURR_LT_STACKN     go back and do more comparisons

E328 3470                                                  PSHS U,Y,X              Random Arp List (Seq/Random) Add notes to seq list in order played
E32A AE22                              L133                LDX  $2,Y               X = Address of where note/velicity data resides in memory
E32C 2704                                                  BEQ  ADD_NOTE_HERE      If no notes already stored in memory, branch
E32E 3184                                                  LEAY 0,X                Else, Y = note/velocity data address
E330 20F8                                                  BRA  L133               Jump back up and look for end of list

E332 8D9E                              ADD_NOTE_HERE       BSR  PUT_NOTE_ON_STK    Put note/velocity into next avail stack spot, A = success
E334 35F0                                                  PULS X,Y,U,PC           Exit

E336 965E                              REPL_STACK_VEL      LDA  PLAYED_VEL         A = Played Velocity
E338 A701                                                  STA  $1,X               Store Played Velocity in old note's note stack entry
E33A 8601                                                  LDA  #$1                A = 1
E33C 35F0                                                  PULS X,Y,U,PC           Return from Subroutine

E33E 3440                              L19                 PSHS U
E340 EE22                                                  LDU  $2,Y
E342 270E                              L136                BEQ  L134
E344 A6C4                                                  LDA  0,U
E346 915C                                                  CMPA CORR_NOTE
E348 2704                                                  BEQ  L135
E34A EE42                                                  LDU  2,U    $2
E34C 20F4                                                  BRA  L136

E34E 8601                              L135                LDA  #$1
E350 35C0                                                  PULS U,PC

E352 4F                                L134                CLRA 
E353 35C0                                                  PULS U,PC

E355 EE22                              L54                 LDU  $2,Y               U = Address of where note/velocity data resides in memory
E357 2708                              L138                BEQ  EXIT_ARP           If Address = 0, no data stored - exit
E359 4A                                                    DECA                    Else, A = A - 1 (decrement how far to move in stack)
E35A 2704                                                  BEQ  L137               If A = 0 (went too far), branch
E35C EE42                                                  LDU  2,U    $2          U = 'next' address
E35E 20F7                                                  BRA  L138               Check data - branch

E360 4C                                L137                INCA                    A = A + 1
E361 39                                EXIT_ARP            RTS  

E362 1A00                              P_LIST_0_00         FDB  $1A00              Selection "0" = KYBD Glide A
E364 2100                              P_LIST_0_01         FDB  $2100              Selection "1" = Sweep A
E366 2800                              P_LIST_0_02         FDB  $2800              Selection "2" = Env 1A
E368 3000                              P_LIST_0_03         FDB  $3000              Selection "3" = Env 2A
E36A 1A01                              P_LIST_0_04         FDB  $1A01              Selection "4" = KYBD Glide B
E36C 2101                              P_LIST_0_05         FDB  $2101              Selection "5" = Sweep B
E36E 2801                              P_LIST_0_06         FDB  $2801              Selection "6" = Env 1B
E370 3001                              P_LIST_0_07         FDB  $3001              Selection "7" = Env 2B
E372 D102                              P_LIST_0_08         FDB  $D102              Selection "8" = Lever 1
E374 D302                              P_LIST_0_09         FDB  $D302              Selection "9" = Lever 2
E376 0A02                              P_LIST_0_10         FDB  $0A02              Selection "10" = Pedal 1
E378 0C02                              P_LIST_0_11         FDB  $0C02              Selection "11" = Pedal 2
E37A 0E03                              P_LIST_0_12         FDB  $0E03              Selection "12" = Velocity
E37C 1003                              P_LIST_0_13         FDB  $1003              Selection "13" = Thresh Vel
E37E 1203                              P_LIST_0_14         FDB  $1203              Selection "14" = Pressure
E380 1403                              P_LIST_0_15         FDB  $1403              Selection "15" = Thresh Pressure
E382 2800                              P_LIST_1_0          FDB  $2800              Selection "0" = MOD Sel = Env 1A
E384 3000                              P_LIST_1_1          FDB  $3000              Selection "1" = MOD Sel = Env 2A   
E386 2801                              P_LIST_1_2          FDB  $2801              Selection "2" = MOD Sel = Env 1B   
E388 3001                              P_LIST_1_3          FDB  $3001              Selection "3" = MOD Sel = Env 2B   
E38A 00                                P_LIST_2_00         FCB  $00
E38B 01                                P_LIST_2_01         FCB  $01
E38C 02                                P_LIST_2_02         FCB  $02
E38D 03                                P_LIST_2_03         FCB  $03
E38E 04                                P_LIST_2_04         FCB  $04
E38F 06                                P_LIST_2_05         FCB  $06
E390 08                                P_LIST_2_06         FCB  $08
E391 0A                                P_LIST_2_07         FCB  $0A
E392 0D                                P_LIST_2_08         FCB  $0D
E393 10                                P_LIST_2_09         FCB  $10
E394 14                                P_LIST_2_10         FCB  $14
E395 19                                P_LIST_2_11         FCB  $19
E396 20                                P_LIST_2_12         FCB  $20
E397 28                                P_LIST_2_13         FCB  $28
E398 33                                P_LIST_2_14         FCB  $33
E399 40                                P_LIST_2_15         FCB  $40
E39A E7B9                              PARAM_0_VEC         FDB  $E7B9              AABB CCDD AABB = Handler Address = Link Balance
E39C 1F                                PARAM_0_OFF         FCB  $1F                CC = Offset of parameter to location in param 0
E39D 03                                PARAM_0_FMT         FCB  $03                DD (7654 3iii)= iii = Offset to "limit"
E39E E47A                              PARAM_1_VEC         FDB  $E47A
E3A0 01                                PARAM_1_OFF         FCB  $01
E3A1 83                                PARAM_1_FMT         FCB  $83
E3A2 E51C                              PARAM_2_VEC         FDB  $E51C
E3A4 05                                PARAM_2_OFF         FCB  $05
E3A5 82                                PARAM_2_FMT         FCB  $82
E3A6 E576                              PARAM_3_VEC         FDB  $E576
E3A8 1F                                PARAM_3_OFF         FCB  $1F
E3A9 C3                                PARAM_3_FMT         FCB  $C3
E3AA E5D1                              PARAM_4_VEC         FDB  $E5D1
E3AC 02                                PARAM_4_OFF         FCB  $02
E3AD 34                                PARAM_4_FMT         FCB  $34
E3AE E5DF                              PARAM_5_VEC         FDB  $E5DF
E3B0 02                                PARAM_5_OFF         FCB  $02
E3B1 91                                PARAM_5_FMT         FCB  $91
E3B2 E608                              PARAM_6_VEC         FDB  $E608
E3B4 1C                                PARAM_6_OFF         FCB  $1C
E3B5 34                                PARAM_6_FMT         FCB  $34
E3B6 E60C                              PARAM_7_VEC         FDB  $E60C
E3B8 0E                                PARAM_7_OFF         FCB  $0E
E3B9 E0                                PARAM_7_FMT         FCB  $E0
E3BA E619                              PARAM_8_VEC         FDB  $E619
E3BC 04                                PARAM_8_OFF         FCB  $04
E3BD 81                                PARAM_8_FMT         FCB  $81
E3BE E61D                              PARAM_9_VEC         FDB  $E61D
E3C0 04                                PARAM_9_OFF         FCB  $04
E3C1 25                                PARAM_9_FMT         FCB  $25
E3C2 E621                              PARAM_10_VEC        FDB  $E621
E3C4 03                                PARAM_10_OFF        FCB  $03
E3C5 C3                                PARAM_10_FMT        FCB  $C3
E3C6 E62E                              PARAM_11_VEC        FDB  $E62E
E3C8 06                                PARAM_11_OFF        FCB  $06
E3C9 C3                                PARAM_11_FMT        FCB  $C3
E3CA E64D                              PARAM_12_VEC        FDB  $E64D
E3CC 06                                PARAM_12_OFF        FCB  $06
E3CD 83                                PARAM_12_FMT        FCB  $83
E3CE E65A                              PARAM_13_VEC        FDB  $E65A
E3D0 09                                PARAM_13_OFF        FCB  $09
E3D1 82                                PARAM_13_FMT        FCB  $82
E3D2 E65E                              PARAM_14_VEC        FDB  $E65E
E3D4 07                                PARAM_14_OFF        FCB  $07
E3D5 34                                PARAM_14_FMT        FCB  $34
E3D6 E662                              PARAM_15_VEC        FDB  $E662
E3D8 07                                PARAM_15_OFF        FCB  $07
E3D9 82                                PARAM_15_FMT        FCB  $82
E3DA E66F                              PARAM_16_VEC        FDB  $E66F
E3DC 08                                PARAM_16_OFF        FCB  $08
E3DD 34                                PARAM_16_FMT        FCB  $34
E3DE E673                              PARAM_17_VEC        FDB  $E673
E3E0 08                                PARAM_17_OFF        FCB  $08
E3E1 82                                PARAM_17_FMT        FCB  $82
E3E2 E680                              PARAM_18_VEC        FDB  $E680
E3E4 09                                PARAM_18_OFF        FCB  $09
E3E5 34                                PARAM_18_FMT        FCB  $34
E3E6 E684                              PARAM_19_VEC        FDB  $E684
E3E8 0A                                PARAM_19_OFF        FCB  $0A
E3E9 34                                PARAM_19_FMT        FCB  $34
E3EA E697                              PARAM_20_VEC        FDB  $E697
E3EC 0D                                PARAM_20_OFF        FCB  $0D
E3ED 82                                PARAM_20_FMT        FCB  $82
E3EE E69B                              PARAM_21_VEC        FDB  $E69B
E3F0 0B                                PARAM_21_OFF        FCB  $0B
E3F1 34                                PARAM_21_FMT        FCB  $34
E3F2 E69F                              PARAM_22_VEC        FDB  $E69F
E3F4 0B                                PARAM_22_OFF        FCB  $0B
E3F5 82                                PARAM_22_FMT        FCB  $82
E3F6 E6AC                              PARAM_23_VEC        FDB  $E6AC
E3F8 0C                                PARAM_23_OFF        FCB  $0C
E3F9 34                                PARAM_23_FMT        FCB  $34
E3FA E6B0                              PARAM_24_VEC        FDB  $E6B0
E3FC 0C                                PARAM_24_OFF        FCB  $0C
E3FD 82                                PARAM_24_FMT        FCB  $82
E3FE E6BD                              PARAM_25_VEC        FDB  $E6BD
E400 0D                                PARAM_25_OFF        FCB  $0D
E401 34                                PARAM_25_FMT        FCB  $34
E402 E6C1                              PARAM_26_VEC        FDB  $E6C1
E404 0E                                PARAM_26_OFF        FCB  $0E
E405 05                                PARAM_26_FMT        FCB  $05
E406 E6C5                              PARAM_27_VEC        FDB  $E6C5
E408 12                                PARAM_27_OFF        FCB  $12
E409 C3                                PARAM_27_FMT        FCB  $C3
E40A E6C8                              PARAM_28_VEC        FDB  $E6C8
E40C 0F                                PARAM_28_OFF        FCB  $0F
E40D 0E                                PARAM_28_FMT        FCB  $0E
E40E E6CC                              PARAM_29_VEC        FDB  $E6CC
E410 12                                PARAM_29_OFF        FCB  $12
E411 83                                PARAM_29_FMT        FCB  $83
E412 E6CF                              PARAM_30_VEC        FDB  $E6CF
E414 10                                PARAM_30_OFF        FCB  $10
E415 0E                                PARAM_30_FMT        FCB  $0E
E416 E6D3                              PARAM_31_VEC        FDB  $E6D3
E418 13                                PARAM_31_OFF        FCB  $13
E419 C3                                PARAM_31_FMT        FCB  $C3
E41A E6D6                              PARAM_32_VEC        FDB  $E6D6
E41C 11                                PARAM_32_OFF        FCB  $11
E41D 0E                                PARAM_32_FMT        FCB  $0E
E41E E6DA                              PARAM_33_VEC        FDB  $E6DA
E420 14                                PARAM_33_OFF        FCB  $14
E421 81                                PARAM_33_FMT        FCB  $81
E422 E6F2                              PARAM_34_VEC        FDB  $E6F2
E424 14                                PARAM_34_OFF        FCB  $14
E425 25                                PARAM_34_FMT        FCB  $25
E426 E6FE                              PARAM_35_VEC        FDB  $E6FE
E428 13                                PARAM_35_OFF        FCB  $13
E429 83                                PARAM_35_FMT        FCB  $83
E42A E701                              PARAM_36_VEC        FDB  $E701
E42C 15                                PARAM_36_OFF        FCB  $15
E42D 0E                                PARAM_36_FMT        FCB  $0E
E42E E717                              PARAM_37_VEC        FDB  $E717
E430 0F                                PARAM_37_OFF        FCB  $0F
E431 F0                                PARAM_37_FMT        FCB  $F0
E432 E725                              PARAM_38_VEC        FDB  $E725
E434 0A                                PARAM_38_OFF        FCB  $0A
E435 02                                PARAM_38_FMT        FCB  $02
E436 E759                              PARAM_39_VEC        FDB  $E759
E438 16                                PARAM_39_OFF        FCB  $16
E439 05                                PARAM_39_FMT        FCB  $05
E43A E765                              PARAM_40_VEC        FDB  $E765
E43C 1A                                PARAM_40_OFF        FCB  $1A
E43D C3                                PARAM_40_FMT        FCB  $C3
E43E E768                              PARAM_41_VEC        FDB  $E768
E440 17                                PARAM_41_OFF        FCB  $17
E441 0E                                PARAM_41_FMT        FCB  $0E
E442 E76C                              PARAM_42_VEC        FDB  $E76C
E444 1A                                PARAM_42_OFF        FCB  $1A
E445 83                                PARAM_42_FMT        FCB  $83
E446 E76F                              PARAM_43_VEC        FDB  $E76F
E448 18                                PARAM_43_OFF        FCB  $18
E449 0E                                PARAM_43_FMT        FCB  $0E
E44A E773                              PARAM_44_VEC        FDB  $E773
E44C 1B                                PARAM_44_OFF        FCB  $1B
E44D C3                                PARAM_44_FMT        FCB  $C3
E44E E776                              PARAM_45_VEC        FDB  $E776
E450 19                                PARAM_45_OFF        FCB  $19
E451 0E                                PARAM_45_FMT        FCB  $0E
E452 E77A                              PARAM_46_VEC        FDB  $E77A
E454 1B                                PARAM_46_OFF        FCB  $1B
E455 A1                                PARAM_46_FMT        FCB  $A1
E456 E787                              PARAM_47_VEC        FDB  $E787
E458 03                                PARAM_47_OFF        FCB  $03
E459 03                                PARAM_47_FMT        FCB  $03
E45A E793                              PARAM_48_VEC        FDB  $E793
E45C 1B                                PARAM_48_OFF        FCB  $1B
E45D 81                                PARAM_48_FMT        FCB  $81
E45E E7A0                              PARAM_49_VEC        FDB  $E7A0
E460 05                                PARAM_49_OFF        FCB  $05
E461 43                                PARAM_49_FMT        FCB  $43
E462 E7AC                              PARAM_50_VEC        FDB  $E7AC
E464 1C                                PARAM_50_OFF        FCB  $1C
E465 82                                PARAM_50_FMT        FCB  $82
E466 E804                              PARAM_51_VEC        FDB  $E804              Panel Link
E468 00                                PARAM_51_OFF        FCB  $00
E469 07                                PARAM_51_FMT        FCB  $07
E46A E85B                              PARAM_52_VEC        FDB  $E85B              Panel Edit
E46C 1E                                PARAM_52_OFF        FCB  $1E
E46D 07                                PARAM_52_FMT        FCB  $07
E46E E8BB                              PARAM_53_VEC        FDB  $E8BB              Keyboard Split
E470 20                                PARAM_53_OFF        FCB  $20
E471 07                                PARAM_53_FMT        FCB  $07
E472 E8C3                              PARAM_54_VEC        FDB  $E8C3              Main Transpose
E474 01                                PARAM_54_OFF        FCB  $01
E475 61                                PARAM_54_FMT        FCB  $61
E476 E8D2                              PARAM_55_VEC        FDB  $E8D2              Link Transpose
E478 01                                PARAM_55_OFF        FCB  $01
E479 41                                PARAM_55_FMT        FCB  $41

E47A 3436                              PATCH_HNDLR         PSHS Y,X,B,A            PARAM 1 HANDLER (PATCH) A = "value"
E47C 8EE50C                                                LDX  #$E50C             X = $E50C (start of lookup table) for patch selection values
E47F E6A80A                                                LDB  $A,Y               B = "patch" value from inst 
E482 C40C                                                  ANDB #$C                Pull off 2 bits (0000 1100) (OUT 1 and OUT 0 bits)
E484 EA86                                                  ORB  A,X                B = Corrected "patch" byte, based on lookup table data (0<=A<=15)
E486 E7A80A                                                STB  $A,Y               Store updated Patch byte
E489 D60B                                                  LDB  PRG_UNDERWAY       B = RAM[$000B] - see if we're still defining
E48B 270C                                                  BEQ  PROG_DEFN_DONE     If B = 0 (program def'n done)
E48D 4D                                                    TSTA                    else, we're defining a program, check A (A = patch #)
E48E 2703                                                  BEQ  16_CHAN_MODE       If A = 0, we're in 16 channel mode, branch
E490 4F                                                    CLRA                    else, we're in 8 channel mode, A = 0
E491 2001                                                  BRA  8_CHAN_MODE

E493 4C                                16_CHAN_MODE        INCA                    A = A + 1 
E494 A7A85F                            8_CHAN_MODE         STA  $5F,Y              Store Param 1 Val + 1 (indicating if 8 or 16 channels)
E497 35B6                                                  PULS A,B,X,Y,PC         Exit

E499 4D                                PROG_DEFN_DONE      TSTA                    A = 0?
E49A 2630                                                  BNE  NOT_16_CHNL        If not, we're not in 16 channel mode, branch
E49C 6DA85F                                                TST  $5F,Y              else, we are in 16 channel mode - see if we were before
E49F 2702                                                  BEQ  WAS_DEP_NOW_16     If $5F = 0 , we used to be in 8 channel mode, branch
E4A1 35B6                                                  PULS A,B,X,Y,PC         Exit

E4A3 6CA85F                            WAS_DEP_NOW_16      INC  $5F,Y              Update $5F to current status (i.e., 16 channel mode)
E4A6 A6A80B                                                LDA  $B,Y               A = Resoncance and Filter Settings
E4A9 B72008                                                STA  RD_EOC_WR_SYND     Store Resonance and Slider Values in Synth Data Latches
E4AC AEA4                                                  LDX  0,Y                Address of channel playing inst. (channel board address)
E4AE 274C                              L139                BEQ  NEED_NEW_CHAN      Branch if no channel assigned
E4B0 BDD955                                                JSR  INIT_WHOLE_BRD     else, we do have a channel assigned - jump
E4B3 308839                                                LEAX $39,X              X = address of "next" channel
E4B6 10AF02                                                STY  $2,X               store address of defining instrument
E4B9 A607                                                  LDA  $7,X               A = current channel #
E4BB 44                                                    LSRA                    A = A/2 (this will give board #)
E4BC 8A08                                                  ORA  #$8                Set B3 (selects STB1)
E4BE B72009                                                STA  WR_SYNA            Write synth address - STB1 (B Board Param) & Channel
E4C1 ECA4                                                  LDD  0,Y                D = Address of 1st channel assigned to inst.
E4C3 ED84                                                  STD  0,X                Store to current channel
E4C5 AFA4                                                  STX  0,Y                Update address of channel assigned
E4C7 AE88C7                                                LDX  $C7,X              X = address of previous (next backward) channel
E4CA 20E2                                                  BRA  L139

E4CC 6DA85F                            NOT_16_CHNL         TST  $5F,Y              see if we previoulsy were in 16 channel mode
E4CF 272B                                                  BEQ  NEED_NEW_CHAN      If we used to be in Dep. Mode, branch
E4D1 6FA85F                                                CLR  $5F,Y              else, we used to be in 16-channel mode - update to new state
E4D4 A6A867                                                LDA  $67,Y
E4D7 B72008                                                STA  RD_EOC_WR_SYND
E4DA AEA4                              L141                LDX  0,Y
E4DC 271E                              L140                BEQ  NEED_NEW_CHAN
E4DE BDD913                                                JSR  INIT_CHAN_X
E4E1 A607                                                  LDA  $7,X               A = current channel number
E4E3 44                                                    LSRA                    A = A/2 = current board #
E4E4 2412                                                  BCC  EVEN_CH_NO         If C clear, then we had an even channel number, branch
E4E6 8A08                                                  ORA  #$8                else, we've got an odd channel # - B Param
E4E8 B72009                                                STA  WR_SYNA            select "B" param & channel
E4EB EC02                                                  LDD  $2,X
E4ED C3005C                                                ADDD #$5C
E4F0 ED02                                                  STD  $2,X
E4F2 AE84                                                  LDX  0,X
E4F4 AFA4                                                  STX  0,Y
E4F6 20E4                                                  BRA  L140

E4F8 3184                              EVEN_CH_NO          LEAY 0,X
E4FA 20DE                                                  BRA  L141

E4FC 3536                              NEED_NEW_CHAN       PULS A,B,X,Y
E4FE 3416                                                  PSHS X,B,A
E500 A6A818                                                LDA  $18,Y
E503 BDDA13                                                JSR  SET_LNK_BAL
E506 A6A80A                                                LDA  $A,Y
E509 7EE5F3                                                JMP  L142

E50C 00                                PCH_SEL_00          FCB  $00                Patch Sel 00 = 16 Channel Mode (see $069A)
E50D 00                                PCH_SEL_01          FCB  $00                Patch Sel 01 = Independent Channel Mode (No Cross-Mod)
E50E 30                                PCH_SEL_02          FCB  $30                Patch Sel 02 = Independent Channel Mode (w/Sync)  
E50F 20                                PCH_SEL_03          FCB  $20                Patch Sel 03 = Independent Channel Mode (W/Ring Mod)  
E510 10                                PCH_SEL_04          FCB  $10                Patch Sel 04 = Independent Channel Mode (w/Filter FM)  
E511 03                                PCH_SEL_05          FCB  $03                Patch Sel 05 = Parallel Filter Mode (No Cross-Mod) 
E512 33                                PCH_SEL_06          FCB  $33                Patch Sel 06 = Parallel Filter Mode (w/Sync) (see $069A)         
E513 23                                PCH_SEL_07          FCB  $23                Patch Sel 07 = Parallel Filter Mode (W/Ring Mod)       
E514 13                                PCH_SEL_08          FCB  $13                Patch Sel 08 = Parallel Filter Mode (w/Filter FM)         
E515 02                                PCH_SEL_09          FCB  $02                Patch Sel 09 = Series Filter Mode (No Cross-Mod)   
E516 32                                PCH_SEL_10          FCB  $32                Patch Sel 10 = Series Filter Mode (w/Sync)
E517 22                                PCH_SEL_11          FCB  $22                Patch Sel 11 = Series Filter Mode (W/Ring Mod)     
E518 12                                PCH_SEL_12          FCB  $12                Patch Sel 12 = Series Filter Mode (w/Filter FM)  
E519 01                                PCH_SEL_13          FCB  $01                Patch Sel 13 = Variable Mix Filter Mode (No Cross-Mod)    
E51A 31                                PCH_SEL_14          FCB  $31                Patch Sel 14 = Variable Mix Filter Mode (w/Sync)    
E51B 21                                PCH_SEL_15          FCB  $21                Patch Sel 15 = Variable Mix Filter Mode (W/Ring Mod)  

E51C 3446                                                  PSHS U,B,A              PARAM 2 HANDLER (FSW MODE)
E51E CEE56E                                                LDU  #$E56E             U = $E56E (lookup table)
E521 E6C6                                                  LDB  A,U                B = value from lookup table (based on selected value)
E523 E1A866                                                CMPB $66,Y              compare w/stored FSW mode from instrument
E526 2744                                                  BEQ  NO_FSW_CHNGE       if no change, branch (exit)
E528 0D0B                                                  TST  PRG_UNDERWAY       else see if we've done prog. set up
E52A 2705                                                  BEQ  FSW_PROG_SETUP     If we're done defining, branch
E52C E7A866                                                STB  $66,Y              else, we're still defining simply store new FSW mode val
E52F 35C6                                                  PULS A,B,U,PC           exit

E531 E8A866                            FSW_PROG_SETUP      EORB $66,Y              see what bits have changed
E534 A6C6                                                  LDA  A,U                A = value from lookup table
E536 A7A866                                                STA  $66,Y              store new value
E539 C520                                                  BITB #$20               See if "Right Disabled" changed
E53B 2717                                                  BEQ  NO_RIGHT_DISBL     If =0, no change
E53D 3406                                                  PSHS B,A                else, we have had a change - save A and B
E53F E6A861                                                LDB  $61,Y              B = current status of footswitch byte
E542 2A0E                                                  BPL  FSW1_ASSERT        If FSW 1 asserted, branch
E544 8520                                                  BITA #$20               See if right disabled
E546 2605                                                  BNE  FSW1_NOT_DISBL     If right FSW disabled, jump
E548 EEA80E                                                LDU  $E,Y               U = Address for FSW 1 asserted handler
E54B 2003                                                  BRA  FSW1_HDNLR_JMP

E54D EEA86A                            FSW1_NOT_DISBL      LDU  $6A,Y              U = Address for footswitch 1 deasserted hander
E550 AD43                              FSW1_HDNLR_JMP      JSR  3,U    $3          jump to handler for foot switch
E552 3506                              FSW1_ASSERT         PULS A,B
E554 C510                              NO_RIGHT_DISBL      BITB #$10               see if "left disabled" changed
E556 2714                                                  BEQ  NO_FSW_CHNGE       branch if no change to left disable
E558 E6A861                                                LDB  $61,Y              B = footswitch byte
E55B 58                                                    ASLB                    Look at FSW 2 data
E55C 2A0E                                                  BPL  NO_FSW_CHNGE       Branch if FSW 2 not asserted
E55E 8510                                                  BITA #$10               See if left disabled
E560 2605                                                  BNE  LEFT_DISBL         branch if left disabled
E562 EEA810                                                LDU  $10,Y              U = address of FSW 2 asserted hndlr.
E565 2003                                                  BRA  FSW2_HNDLR_JMP

E567 EEA86C                            LEFT_DISBL          LDU  $6C,Y              U = address of FSW 2 UP Handler
E56A AD43                              FSW2_HNDLR_JMP      JSR  3,U    $3
E56C 35C6                              NO_FSW_CHNGE        PULS A,B,U,PC

E56E 00                                FSW_MODE_0          FCB  $00                Param 2 hndlr (FSW Mode) Data - left ena (latch), right ena(sust)
E56F 20                                FSW_MODE_1          FCB  $20                left = enabled (latch), right = disabled
E570 10                                FSW_MODE_2          FCB  $10                left = disabled,        right = enabled (sustain)
E571 30                                FSW_MODE_3          FCB  $30                left = disabled,        right = disabled
E572 D0                                FSW_MODE_4          FCB  $D0                left = note gate,       right = sustain
E573 F0                                FSW_MODE_5          FCB  $F0                left = note gate,       right = disabled
E574 90                                FSW_MODE_6          FCB  $90                left = inverted gate,   right = sustain
E575 B0                                FSW_MODE_7          FCB  $B0                left = inverted gate,   right = disabled

E576 3446                                                  PSHS U,B,A              PARAM 3 HANDLER (KYBD ALG)
E578 0D0B                                                  TST  PRG_UNDERWAY       See if we're still defining
E57A 2612                                                  BNE  P_3_STILL_DEFN     Branch if prog's still being defined
E57C A1A860                                                CMPA $60,Y              Else, see if we've changed algorithm (compare current w/stored)
E57F 274E                                                  BEQ  NO_KYBD_ALG_CHNG   if we haven't, exit
E581 A7A860                                                STA  $60,Y              else, store new keyboard alg. value
E584 EE26                                                  LDU  $6,Y               U = base address of program controlling this instrument (inst 0)
E586 BDD994                                                JSR  INIT_BRD_4_INST    Init board for instrument
E589 EF26                                                  STU  $6,Y
E58B BDDA55                                                JSR  BOARD_ASSIGN
E58E A7A860                            P_3_STILL_DEFN      STA  $60,Y              Store Keyboard Alg. Value
E591 C610                                                  LDB  #$10               B = $10 (16 dec.)
E593 3D                                                    MUL                     D = keyboard alg. # x 16-bit offset
E594 CEC000                                                LDU  #$C000             U = base address for keyboard algorithm handlers
E597 33CB                                                  LEAU D,U                U = C000 + Ax16 0 <= A <= 15 (U=base addr for hndlr of sel. alg)
E599 ECC1                                                  LDD  ,U++               D = address @ U
E59B EDA80C                                                STD  $C,Y               Store address in inst def'n for attack handler
E59E ECC1                                                  LDD  ,U++
E5A0 EDA868                                                STD  $68,Y              Store address in inst def'n for release handler
E5A3 ECC1                                                  LDD  ,U++
E5A5 EDA86A                                                STD  $6A,Y              FSW 1 Deasserted Handler
E5A8 ECC1                                                  LDD  ,U++
E5AA EDA80E                                                STD  $E,Y               FSW 1 Asserted Handler
E5AD ECC1                                                  LDD  ,U++
E5AF EDA86C                                                STD  $6C,Y              FSW 2 Deasserted Handler
E5B2 ECC1                                                  LDD  ,U++
E5B4 EDA810                                                STD  $10,Y              FSW 2 Asserted Handler
E5B7 ECC1                                                  LDD  ,U++
E5B9 EDA812                                                STD  $12,Y              Store address for unused kybd. alg. handler #1
E5BC ECC4                                                  LDD  0,U
E5BE EDA86E                                                STD  $6E,Y              Store address for unused kybd. alg. handler #2
E5C1 CCC100                                                LDD  #$C100
E5C4 EDA862                                                STD  $62,Y              Store addr for unkn handler (maybe major/minor loop hook)
E5C7 4F                                                    CLRA                    A = 0
E5C8 5F                                                    CLRB                    B = 0
E5C9 EDA85C                                                STD  $5C,Y              Clear Sequencer Information store in instrument Clear Detune Info
E5CC A7A85E                                                STA  $5E,Y              Clear Detune Info
E5CF 35C6                              NO_KYBD_ALG_CHNG    PULS A,B,U,PC           Exit

E5D1 3402                                                  PSHS A                  PARAM 4 HANDLER (DETUNE) - Y = base addr of inst (A=0-31, 0=NONE)
E5D3 48                                                    ASLA 
E5D4 48                                                    ASLA 
E5D5 48                                                    ASLA                    A = A x 8 (total) therefore 0 <= A <= $F8
E5D6 6FA83A                                                CLR  $3A,Y              Indicate Detune is in effect
E5D9 A7A90096                                              STA  150,Y              Store Detune value
E5DD 3582                                                  PULS A,PC

E5DF 3416                              OUTPUT_SEL          PSHS X,B,A              PARAM 5 HANDLER (OUTPUT SELECT) (A=Which "SUM" buss chosen, 0-3)
E5E1 48                                                    ASLA                    A = A x 2
E5E2 48                                                    ASLA                    A = A x 2 (shift value over to proper bit location)
E5E3 3402                                                  PSHS A                  Save A
E5E5 A6A80A                                                LDA  $A,Y               A = Stored "patch byte" info (Y=address of inst)
E5E8 8433                                                  ANDA #$33 '3            Ignore Top 2 bits and clear "out" bits (set to "sum 0")
E5EA AAE0                                                  ORA  ,S+                update "out 1" and "out 0" bits per selection (0=output0, etc.)
E5EC A7A80A                                                STA  $A,Y               Store updated "patch byte" info
E5EF D60B                                                  LDB  PRG_UNDERWAY       B = indication if we're still defining programs (=1 if still defn)
E5F1 2613                                                  BNE  EXIT_OUT_SEL       Branch if we're still defining (exit)
E5F3 B72008                            L142                STA  RD_EOC_WR_SYND     Output "patch byte" to synth data bus
E5F6 AE24                                                  LDX  $4,Y               X = address of base board for current inst.
E5F8 270C                                                  BEQ  EXIT_OUT_SEL       If no base board assigned, exit 
E5FA A607                              OS_MORE_LNK_CHAN    LDA  $7,X               else, a board is defined - A = "params" value from channel board
E5FC 44                                                    LSRA                    A = A/2
E5FD 8A10                                                  ORA  #$10               Set Bit 4 -> XXX1 XXXX
E5FF B72009                                                STA  WR_SYNA            Latch Syn data to -STB2, channel X (as def'd)
E602 AE04                                                  LDX  $4,X               X = Address of next link channel/board
E604 26F4                                                  BNE  OS_MORE_LNK_CHAN   if more link channels remaining, branch
E606 3596                              EXIT_OUT_SEL        PULS A,B,X,PC           else, exit

E608 A7A819                                                STA  $19,Y              PARAM 6 HANDLER (GLIDE RATE)
E60B 39                                                    RTS  

E60C 3412                                                  PSHS X,A                PARAM 7 HANDLER (GLIDE SHAPE)
E60E 48                                                    ASLA                    A = param value (0 or 1, 0 = portamento)
E60F 8EEC60                                                LDX  #$EC60             X = base address of table w/handler addresses
E612 AE86                                                  LDX  A,X                X = address of handler for chosen glide
E614 AFA81A                                                STX  $1A,Y
E617 3592                                                  PULS A,X,PC

E619 A7A81D                                                STA  $1D,Y              PARAM 8 HANDLER (SWEEP MODE)
E61C 39                                                    RTS  

E61D A7A81C                                                STA  $1C,Y              PARAM 9 HANDLER (SWEEP RATE)
E620 39                                                    RTS  

E621 3412                                                  PSHS X,A                PARAM 10 HANDLER (SWEEP RATE MOD)
E623 48                                                    ASLA                    A = Ax2
E624 8EEB3B                                                LDX  #$EB3B             X = base address of table w/sweep rate mod handlers
E627 AE86                                                  LDX  A,X                X = address of sweep rate mod handler
E629 AFA821                                                STX  $21,Y              Store address of Handler
E62C 3592                                                  PULS A,X,PC

E62E 3412                                                  PSHS X,A                PARAM 11 HANDLER (SWEEP WAVE SHAPE)
E630 48                                                    ASLA                    A = Ax2 (to get offset to memory address)
E631 8EEF58                                                LDX  #$EF58             X = base address of sweep wave shape vector table
E634 AE86                                                  LDX  A,X                X = address of vector for selected weep wave shape
E636 AFA823                                                STX  $23,Y              Store handler address in instrument definition
E639 ABE4                                                  ADDA 0,S                Add orig. value of A to current A (i.e., A = orig A x 3)
E63B 8EFC1D                                                LDX  #$FC1D             X = base address of data vector address
E63E AE86                                                  LDX  A,X                X = address of start of data for sweep chosen
E640 AFA81F                                                STX  $1F,Y              Store start of data address in instrument definition
E643 8EFC1F                                                LDX  #$FC1F             X= base address of length of data for sweep
E646 A686                                                  LDA  A,X                A = length of data for selected sweep wave shape
E648 A7A81E                                                STA  $1E,Y              Store length of data in instrument definition
E64B 3592                                                  PULS A,X,PC             Exit

E64D 3412                                                  PSHS X,A                PARAM 12 HANDLER (SWEEP AMPL. MOD)
E64F 48                                                    ASLA                    A = Ax2
E650 8EEFF6                                                LDX  #$EFF6             X = base address of sweep amplitude mod vector table
E653 AE86                                                  LDX  A,X                A = handler address for sweep amplitude mod selected
E655 AFA825                                                STX  $25,Y              store address of sweep amplitude handler to instrument
E658 3592                                                  PULS A,X,PC

E65A A7A828                                                STA  $28,Y              PARAM 13 HANDLER (ENV 1 AMPL TOUCH)
E65D 39                                                    RTS  

E65E A7A829                                                STA  $29,Y              PARAM 14 HANDLER (ENV 1 ATTACK)
E661 39                                                    RTS  

E662 3412                                                  PSHS X,A                PARAM 15 HANDLER (ENV 1 ATTACK MOD)
E664 48                                                    ASLA                    A = Ax2
E665 8EEE4D                                                LDX  #$EE4D             X = Base address of envelope attack mod vector table
E668 AE86                                                  LDX  A,X                A = Handler address for chosen Env 1 attack mod
E66A AFA82A                                                STX  $2A,Y              Store handler address to instrument
E66D 3592                                                  PULS A,X,PC

E66F A7A82C                                                STA  $2C,Y              PARAM 16 HANDLER (ENV 1 DECAY)
E672 39                                                    RTS  

E673 3412                                                  PSHS X,A                PARAM 17 HANDLER (ENV 1 DECAY MOD)
E675 48                                                    ASLA 
E676 8EEEAF                                                LDX  #$EEAF
E679 AE86                                                  LDX  A,X
E67B AFA82D                                                STX  $2D,Y
E67E 3592                                                  PULS A,X,PC

E680 A7A82F                                                STA  $2F,Y              PARAM 18 HANDLER (ENV 1 RELEASE)
E683 39                                                    RTS  

E684 3402                                                  PSHS A                  PARAM 19 HANDLER (ENV 2 DELAY)
E686 811F                                                  CMPA #$1F               compare A w/ 31
E688 2507                                                  BCS  TIMED_DELAY        If A < 31, branch
E68A 86FF                                                  LDA  #$FF               else, sweep triggered delay
E68C A7A830                                                STA  $30,Y              store ENV2 delay to instrument
E68F 3582                                                  PULS A,PC

E691 48                                TIMED_DELAY         ASLA                    A = Ax2
E692 A7A830                                                STA  $30,Y              Store ENV2 dealy setting to instrument
E695 3582                                                  PULS A,PC

E697 A7A831                                                STA  $31,Y              PARAM 20 HANDLER (ENV 2 AMPL TOUCH)
E69A 39                                                    RTS  

E69B A7A832                                                STA  $32,Y              PARAM 21 HANDLER (ENV 2 ATTACK)
E69E 39                                                    RTS  

E69F 3412                                                  PSHS X,A                PARAM 22 HANDLER (ENV 2 ATTACK MOD)
E6A1 48                                                    ASLA                    A = Ax2
E6A2 8EEE4D                                                LDX  #$EE4D             X = Base address of vector handler table
E6A5 AE86                                                  LDX  A,X                X = address of handler for selection
E6A7 AFA833                                                STX  $33,Y              store handler address to instrument
E6AA 3592                                                  PULS A,X,PC

E6AC A7A835                                                STA  $35,Y              PARAM 23 HANDLER (ENV 2 DECAY)
E6AF 39                                                    RTS  

E6B0 3412                                                  PSHS X,A                PARAM 24 HANDLER (ENV 2 DECAY MOD)
E6B2 48                                                    ASLA                    A = Ax2
E6B3 8EEEAF                                                LDX  #$EEAF             X = Base address of vector handler table
E6B6 AE86                                                  LDX  A,X                X = address of handler for selection
E6B8 AFA836                                                STX  $36,Y              Store handler address to instrument
E6BB 3592                                                  PULS A,X,PC

E6BD A7A838                                                STA  $38,Y              PARAM 25 HANDLER (ENV 2 RELEASE)
E6C0 39                                                    RTS  

E6C1 A7A839                                                STA  $39,Y              PARAM 26 HANDLER (PITCH TUNE)
E6C4 39                                                    RTS  

E6C5 8D3E                                                  BSR  PICK_LIST          PARAM 27 HANDLER (PITCH MOD 1 SEL)
E6C7 3B                                PARAM27_DAT         FCB  $3B                Location in Memory that result is to be stored in

E6C8 A7A83D                                                STA  $3D,Y              PARAM 28 HANDLER (PITCH MOD 1 DEPTH)
E6CB 39                                                    RTS  

E6CC 8D37                                                  BSR  PICK_LIST          PARAM 29 HANDLER (PITCH MOD 2 SEL)
E6CE 3E                                PARAM29_DAT         FCB  $3E                Location in Memory that result is to be stored in

E6CF A7A840                                                STA  $40,Y              PARAM 30 HANDLER (PITCH MOD 2 DEPTH
E6D2 39                                                    RTS  

E6D3 8D30                                                  BSR  PICK_LIST          PARAM 31 HANDLER (PITCH MOD 3 SEL)
E6D5 41                                PARAM31_DAT         FCB  $41                Location in Memory that result is to be stored in

E6D6 A7A843                                                STA  $43,Y              PARAM 32 HANDLER (PITCH MOD 3 DEPTH)
E6D9 39                                                    RTS  

E6DA 3416                                                  PSHS X,B,A              PARAM 33 HANDLER (WAVE SHAPE)
E6DC 48                                                    ASLA 
E6DD 48                                                    ASLA 
E6DE 48                                                    ASLA 
E6DF 48                                                    ASLA                    A = A x 16 (0000 0001 -> 0001 0000) orig # now in 00xx 0000
E6E0 3402                                                  PSHS A                  Save A
E6E2 A6A80B                                                LDA  $B,Y               A = Resonance and Filter Settings
E6E5 840F                                                  ANDA #$F                Keep old Lower 4 bits, resetting "wave" bits to zero
E6E7 AAE0                                                  ORA  ,S+                Add in "wave shape" value into upper nibble
E6E9 A7A80B                                                STA  $B,Y               store updated value to inst. def'n
E6EC D60B                                                  LDB  PRG_UNDERWAY       See if we're defining an instrument
E6EE 274A                                                  BEQ  STOR_FILT_DAT      branch if we've completed prog def'n, put "filt data" in chan mem
E6F0 3596                                                  PULS A,B,X,PC           else, we're done (exit)

E6F2 3406                                                  PSHS B,A                PARAM 34 HANDLER (WAVE SHAPE WIDTH) (0-63)
E6F4 5F                                                    CLRB                    B = 0
E6F5 44                                                    LSRA                    A -> 0XX1 1111 (C=1)
E6F6 56                                                    RORB                    1000 0000 (C=0)
E6F7 44                                                    LSRA                    A =  00XX 1111 (C=1)
E6F8 56                                                    RORB                    B = 1100 0000 (C=0) 0-4032 in multiples of 64
E6F9 EDA844                                                STD  $44,Y              Lower two bits of old A value go into upper two bits of B
E6FC 3586                                                  PULS A,B,PC

E6FE 8D05                                                  BSR  PICK_LIST          PARAM 35 HANDLER (WAVE MOD SELECT) (0-15)
E700 46                                PARAM35_DAT         FCB  $46                Data for Pick List

E701 A7A848                                                STA  $48,Y              PARAM 36 HANDLER (WAVE MOD DEPTH) (-64 to 64)
E704 39                                                    RTS  

E705 3416                              PICK_LIST           PSHS X,B,A              Pick list for param 27, 29, 31, 35, 40, 42 and 44
E707 E6F804                                                LDB  [$4,S]             B = address (offset in instrument) to store result to
E70A 48                                                    ASLA                    A = Ax2
E70B 8EE362                                                LDX  #$E362             X = $E362 = base address of picklist #1 values
E70E AE86                                                  LDX  A,X                X = Value of "A" selection (from picklist)
E710 AFA5                                                  STX  B,Y                Store data to specified memory location (B=offset, Y=inst base addr)
E712 3516                                                  PULS A,B,X              Restore old values
E714 3262                                                  LEAS $2,S               Stack pointed to original calling location
E716 39                                                    RTS                     Exit/Return

E717 3416                                                  PSHS X,B,A              PARAM 37 HANDLER (FILTER LP/HP) (0-1)
E719 48                                                    ASLA                    A = Ax2
E71A 48                                                    ASLA                    A = Ax2
E71B 48                                                    ASLA                    A = Ax2 for a total of Ax8 (i.e., orig val in top bit of nibble)
E71C 3402                                                  PSHS A                  Save this val.
E71E A6A80B                                                LDA  $B,Y               A = old resonance & Filter settings
E721 8437                                                  ANDA #$37 '7            Drop top 2 bits, leave filter bit
E723 200C                                                  BRA  SET_FILTER

E725 3416                                                  PSHS X,B,A              PARAM 38 HANDLER (FILTER RESONANCE)
E727 43                                                    COMA                    A = -ve A (take -ve version of entered value)
E728 8407                                                  ANDA #$7                We're only looking at bottom 3 bits (0-7, -> 7-0)
E72A 3402                                                  PSHS A                  push A on stack (save -ve version of A)
E72C A6A80B                                                LDA  $B,Y               get old filter value
E72F 8438                                                  ANDA #$38 '8            drop off top 2 bits & keep all bits, but reset 3 resonance bits
E731 AAE0                              SET_FILTER          ORA  ,S+                combine new filter info w/old
E733 A7A80B                                                STA  $B,Y               store updated filter info
E736 D60B                                                  LDB  PRG_UNDERWAY       check to see if we're defining a prog. (if b=0, we're done)
E738 261D                                                  BNE  NO_CHNL_UPDATE     If B <> = 0, (i.e., programs still being defined, branch & exit)
E73A B72008                            STOR_FILT_DAT       STA  RD_EOC_WR_SYND     Place filter data on Data Bus
E73D 8E0300                                                LDX  #$300              X =$0300 = base address of channels
E740 10AC02                            DO_ALL_CHNLS        CMPY $2,X               See if this channel is def'd by curr instrument
E743 260A                                                  BNE  NEXT_CHANNEL       Is this filter info for this channel?  Branch if NO
E745 A607                                                  LDA  $7,X               A = channel number
E747 44                                                    LSRA                    A = A/2 -> if carry = 0, we had an even channel, else odd
E748 2402                                                  BCC  STORE_SYNA         If carry clear, was an even # channel (STB0, "A params")
E74A 8A08                                                  ORA  #$8                Select "B" params (STB1)
E74C B72009                            STORE_SYNA          STA  WR_SYNA            Write in synth address (for A or B params) sel. STB0 or STB1
E74F 308839                            NEXT_CHANNEL        LEAX $39,X              X = address of "next" channel
E752 8C0657                                                CMPX #$657              compare w/address of last channel     
E755 23E9                                                  BLS  DO_ALL_CHNLS       If all 16 channel not done, branch
E757 3596                              NO_CHNL_UPDATE      PULS A,B,X,PC           Exit

E759 3406                                                  PSHS B,A                PARAM 39 HANDLER (FILTER TUNE) (0-63)
E75B 5F                                                    CLRB                    (see param 34)
E75C 44                                                    LSRA 
E75D 56                                                    RORB 
E75E 44                                                    LSRA 
E75F 56                                                    RORB 
E760 EDA849                                                STD  $49,Y
E763 3586                                                  PULS A,B,PC

E765 8D9E                                                  BSR  PICK_LIST          PARAM 40 HANDLER (FILTER MOD 1 SEL) (0 <= A <= 15)
E767 4B                                PARAM40_DAT         FCB  $4B                Location in memory that result is to be stored in

E768 A7A84D                                                STA  $4D,Y              PARAM 41 HANDLER (FILTER MOD 1 DEPTH) (-64 <= A <= 64)
E76B 39                                                    RTS  

E76C 8D97                                                  BSR  PICK_LIST          PARAM 42 HANDLER (FILTER MOD 2 SEL) (0 <= A <= 15)
E76E 4E                                PARAM42_DAT         FCB  $4E                Location in memory that result is to be stored in

E76F A7A850                                                STA  $50,Y              PARAM 43 HANDLER (FILTER MOD 2 DEPTH) (-64 <= A <= 64)
E772 39                                                    RTS  

E773 8D90                                                  BSR  PICK_LIST          PARAM 44 HANDLER (FITLER MOD 3 SEL) (0 <= A <= 15)
E775 51                                PARAM44_DAT         FCB  $51                Location in memory that result is to be stored in 

E776 A7A853                                                STA  $53,Y              PARAM 45 HANDLER (FILTER MOD 3 DEPTH) (-64 <= A <= 64)
E779 39                                                    RTS  

E77A 3412                                                  PSHS X,A                PARAM 46 HANDLER (VOLUME MOD 1 SEL) (0 <= A <= 3)
E77C 48                                                    ASLA                    A = Ax2
E77D 8EE382                                                LDX  #$E382             X = Address of 2nd picklist "Pick List values"
E780 AE86                                                  LDX  A,X                X = Value from "Picklist lookup table"
E782 AFA854                                                STX  $54,Y
E785 3592                                                  PULS A,X,PC

E787 3412                                                  PSHS X,A                PARAM 47 HANDLER (VOLUME MOD 1 DEPTH) (0 <= A <= 15)
E789 8EE38A                                                LDX  #$E38A             Base address of 3rd picklist
E78C A686                                                  LDA  A,X                A = Value from Picklist
E78E A7A856                                                STA  $56,Y
E791 3592                                                  PULS A,X,PC

E793 3412                                                  PSHS X,A                PARAM 48 HANDLER (VOLUME MOD 2 SEL) (0 <= A <= 3)
E795 48                                                    ASLA 
E796 8EE382                                                LDX  #$E382             Base address of 2nd picklist
E799 AE86                                                  LDX  A,X
E79B AFA857                                                STX  $57,Y
E79E 3592                                                  PULS A,X,PC

E7A0 3412                                                  PSHS X,A                PARAM 49 HANDLER (VOLUME MOD 2 DEPTH) (0 <= A <= 15)
E7A2 8EE38A                                                LDX  #$E38A             Base address of 3rd picklist
E7A5 A686                                                  LDA  A,X
E7A7 A7A859                                                STA  $59,Y
E7AA 3592                                                  PULS A,X,PC

E7AC 3412                                                  PSHS X,A                PARAM 50 HANDLER (VOLUME MOD 3 SELECT) (0 <= A <= 7)
E7AE 48                                                    ASLA                    A = Ax2
E7AF 8EEA91                                                LDX  #$EA91             Base address for volume mod lookup table
E7B2 AE86                                                  LDX  A,X                X = handler for volume mode 3 select
E7B4 AFA85A                                                STX  $5A,Y
E7B7 3592                                                  PULS A,X,PC

E7B9 3436                              SETUP_INST01_VOL    PSHS Y,X,B,A            Param 0 Handler (Link Balance)
E7BB F61400                                                LDB  P0_LINK_VALS       B = Link Type | Link Prog
E7BE C4C0                                                  ANDB #$C0               B = Link Type
E7C0 2721                                                  BEQ  NO_PROG_LINK       branch if Link Type = NONE
E7C2 F6141F                                                LDB  P0_LINK_BALNCE     B = Panel Link Balance
E7C5 C40F                                                  ANDB #$F                B = Panel Link Balance
E7C7 C808                                                  EORB #$8                Toggle top bit of value
E7C9 C008                                                  SUBB #$8                subtract off 8 ( -8..7 value)
E7CB 8EE7FB                                                LDX  #$E7FB             X = $E7FB = base of lookup table
E7CE A685                                                  LDA  B,X                A = value from lookup table
E7D0 108E0690                                              LDY  #$690              Y = Base address of instr. 0
E7D4 BDDA13                                                JSR  SET_LNK_BAL        Set link balance param. for inst0_a_vol & inst0_b_vol
E7D7 50                                                    NEGB                    B = +ve B
E7D8 A685                                                  LDA  B,X                A = set "complimentary" link
E7DA 108E0748                                              LDY  #$748              vals in link param
E7DE BDDA13                                                JSR  SET_LNK_BAL        set up link bal params in link inst (inst1_a_vol, inst1_b_vol).
E7E1 35B6                                                  PULS A,B,X,Y,PC

E7E3 86FF                              NO_PROG_LINK        LDA  #$FF               A = $FF
E7E5 B706A8                                                STA  INST_0_A_VOL       A -> Instrument 0, A param volume
E7E8 B70704                                                STA  INST_0_B_VOL       A -> Instrument 0, B param volume
E7EB B70760                                                STA  INST_1_A_VOL       A -> Instrument 1, A param volume
E7EE B707BC                                                STA  INST_1_B_VOL       A -> Instrument 1, B param volume
E7F1 35B6                                                  PULS A,B,X,Y,PC         Exit and Return

E7F3 FF                                LNK_BAL_NEG8        FCB  $FF
E7F4 FF                                LNK_BAL_NEG7        FCB  $FF
E7F5 FF                                LNK_BAL_NEG6        FCB  $FF
E7F6 FF                                LNK_BAL_NEG5        FCB  $FF
E7F7 FF                                LNK_BAL_NEG4        FCB  $FF
E7F8 FF                                LNK_BAL_NEG3        FCB  $FF
E7F9 FF                                LNK_BAL_NEG2        FCB  $FF
E7FA FF                                LNK_BAL_NEG1        FCB  $FF
E7FB FF                                LNK_BAL_0           FCB  $FF
E7FC CB                                LNK_BAL_POS1        FCB  $CB
E7FD A1                                LNK_BAL_POS2        FCB  $A1
E7FE 80                                LNK_BAL_POS3        FCB  $80
E7FF 66                                LNK_BAL_POS4        FCB  $66
E800 51                                LNK_BAL_POS5        FCB  $51
E801 40                                LNK_BAL_POS6        FCB  $40
E802 33                                LNK_BAL_POS7        FCB  $33
E803 33                                LNK_BAL_POS8        FCB  $33

E804 3466                                                  PSHS U,Y,B,A            Param 51 Handler (Panel Link) (A= Link Type|Link Prog)
E806 843F                                                  ANDA #$3F '?            Set Link type to "No Link"
E808 2704                                                  BEQ  LINK_PROG_0        Branch if Link Program = 0
E80A 8150                                                  CMPA #$50 'P            Else, link Prog <>0  ERROR ERROR ERROR? Should compare w/dec. 50
E80C 230A                                                  BLS  LINK_P_NO_OK       Branch if link prg < $50 (it will _always_ be)
E80E A6E4                              LINK_PROG_0         LDA  0,S                Else, A = orig. A
E810 84C0                                                  ANDA #$C0               Reset Link Prog, but keep link type
E812 4C                                                    INCA                    A = A + 1 (i.e., selected link type w/Prog 1 as link prog).
E813 A7E4                                                  STA  0,S                update new A
E815 B71400                                                STA  P0_LINK_VALS       Store new link vals
E818 A6E4                              LINK_P_NO_OK        LDA  0,S                A = orig. A
E81A C63B                                                  LDB  #$3B ';            B = $3B
E81C 3D                                                    MUL                     D = offset to prog. "A"
E81D CE1400                                                LDU  #$1400             U = base address of prog. 0
E820 33CB                                                  LEAU D,U                U = base address of prog "A" (link prog.)
E822 108E0748                                              LDY  #$748              Y = address of link instrument
E826 A6E4                                                  LDA  0,S                A = orig. A
E828 84C0                                                  ANDA #$C0               A = w. lin prog reset
E82A 271C                                                  BEQ  L143
E82C BDD994                                                JSR  INIT_BRD_4_INST
E82F EF26                                                  STU  $6,Y               Store U as address defiing prog Y
E831 BDD960                                                JSR  INVOKE_PROG
E834 FC0698                                                LDD  L144               D = converted lever 1/lever 2 value
E837 EDA808                                                STD  $8,Y               Store Inst 0 conv. lever data in "y" inst.
E83A FC06F4                                                LDD  L145               D = inst 0 converted pdeal 1/2 data
E83D EDA864                                                STD  $64,Y              Store inst 0 conv. pedal data in "y" inst.
E840 B606F1                                                LDA  L146               Footswitch byte
E843 A7A861                                                STA  $61,Y              Store Inst 0 footswitch byte to inst. Y
E846 2008                                                  BRA  L147

E848 11A326                            L143                CMPU $6,Y
E84B 2606                                                  BNE  L148
E84D BDD994                                                JSR  INIT_BRD_4_INST
E850 BDDA55                            L147                JSR  BOARD_ASSIGN
E853 BDE7B9                            L148                JSR  SETUP_INST01_VOL
E856 BDDF32                                                JSR  PAINT_LEDS
E859 35E6                                                  PULS A,B,Y,U,PC

E85B 3456                              PARAM_EDIT          PSHS U,X,B,A            Param 52 Handler (Panel Edit) (A = Edit Mode | Param #)
E85D CE1400                                                LDU  #$1400             U = $1400 = Address of Prog #0
E860 B6141E                                                LDA  P0_PANEL_EDIT      A = Panel Edit Settings
E863 85C0                                                  BITA #$C0               Check Edit Mode
E865 2605                                                  BNE  EDIT_OK            Branch if edit mode OK
E867 8AC0                                                  ORA  #$C0               Else error, set to edit both (MINOR ERROR-DIF. DEFAULT THAN BEFORE)
E869 B7141E                                                STA  P0_PANEL_EDIT      store fixed values
E86C 843F                              EDIT_OK             ANDA #$3F '?            A = Edit Param #
E86E 8132                                                  CMPA #$32 '2            Compare param. # w/50
E870 230A                                                  BLS  PARAM_LT_50        If A <= 50 (i.e., num OK), branch
E872 B6141E                                                LDA  P0_PANEL_EDIT      Else error, A = Full Panel Edit Value & Param > 50
E875 84C0                                                  ANDA #$C0               A = Old Edit Mode Value, with Param = 0
E877 8A01                                                  ORA  #$1                A = Old Edit Mode Values, with Param = 1
E879 B7141E                            PARAM_NO_OK         STA  P0_PANEL_EDIT      Store Fixed value
E87C B6141E                            PARAM_LT_50         LDA  P0_PANEL_EDIT      A = Full Panel Edit Byte
E87F 2B0A                                                  BMI  CNTRL_PARAM        If Edit A or Edit Both (i.e., top bit = 1)
E881 843F                                                  ANDA #$3F '?            A = Param. Number (reset edit mode)
E883 8105                                                  CMPA #$5                Compare A w/ 5
E885 2304                                                  BLS  CNTRL_PARAM        If A <= 5 (we have one of the "control" params), branch
E887 8B32                                                  ADDA #$32 '2            else we have a "B", A = A + 50 (make param # into B-param #)
E889 2002                                                  BRA  B_PARAM

E88B 843F                              CNTRL_PARAM         ANDA #$3F '?            A = Param #, ignore edit mode
E88D 1F89                              B_PARAM             TFR  A,B                A -> B, B = Param #
E88F BDDC69                                                JSR  CHK_PARAM_DATA     A = "Corrected" param value
E892 9735                                                  STA  DISP_PARAM_VAL     Store "corrected" param value in mem as "current disp param value"
E894 F6141E                                                LDB  P0_PANEL_EDIT      B = Panel Edit Settings
E897 C43F                                                  ANDB #$3F '?            B = Param Being Edited
E899 BDDE79                                                JSR  DISP_SMALL_LEDS    Fill Out all items in Small LED display
E89C 962D                                                  LDA  CONV_MAIN_POT      A = Main Pot Value
E89E 971D                                                  STA  MAIN_POT_ADC       A -> Main pot ADC
E8A0 A603                                                  LDA  $3,X               X = Table Lookup ($E39A) - get full byte
E8A2 8407                                                  ANDA #$7                A = "offset to limit" (see $E39A)
E8A4 CEE8B4                                                LDU  #$E8B4             U = $E8B4 = base address for allowable slider address values
E8A7 A6C6                                                  LDA  A,U                A = Divisor for # of division on slider
E8A9 5D                                                    TSTB                    Check param being edited
E8AA 2601                                                  BNE  PARAM_SLIDE_OK     As long as param <> 0, branch
E8AC 4F                                                    CLRA                    Else, param = 0; no allowable slider states
E8AD 9736                              PARAM_SLIDE_OK      STA  SLIDER_DIVISOR     Store A to "current slider divider"
E8AF BDDF32                                                JSR  PAINT_LEDS         Update all LEDs on panel per current settings
E8B2 35D6                                                  PULS A,B,X,U,PC         Exit/Return

E8B4 02                                ALLOW_STE_00        FCB  $02
E8B5 04                                ALLOW_STE_01        FCB  $04
E8B6 08                                ALLOW_STE_02        FCB  $08
E8B7 10                                ALLOW_STE_03        FCB  $10
E8B8 20                                ALLOW_STE_04        FCB  $20
E8B9 41                                ALLOW_STE_05        FCB  $41
E8BA 82                                ALLOW_STE_06        FCB  $82

E8BB 48                                                    ASLA                    Param 53 Hanlder (Keyboard Split)
E8BC 48                                                    ASLA                    A = A / 4 (total)
E8BD 2803                                                  BVC  SPLIT_EXIT         Branch if overflow clear (exit)
E8BF 7F1420                                                CLR  P0_KBRD_SPLT       Else, clear previous keyboard split
E8C2 39                                SPLIT_EXIT          RTS                     Exit

E8C3 8103                                                  CMPA #$3                Param 54 Handler (Main Transpose)
E8C5 2518                                                  BCS  TRANSPSE_OK        If carry set, A < 3 (main transpose value OK - show LEDs, exit)
E8C7 B61401                                                LDA  P0_TRNSPOSE        Else, main transpose value in error, A = stored transpose value
E8CA 843F                                                  ANDA #$3F '?            Reset main transpose to "no transpose"
E8CC B71401                                                STA  P0_TRNSPOSE        Update stored transpose data w/corrected value
E8CF 4F                                                    CLRA                    A = 0
E8D0 200D                                                  BRA  TRANSPSE_OK

E8D2 8103                                                  CMPA #$3                Param 55 Handler (Link Transpose)
E8D4 2509                                                  BCS  TRANSPSE_OK        If carry set, A < 3 (link transpose value OK - show LEDs, exit)
E8D6 B61401                                                LDA  P0_TRNSPOSE        else, link transpose value in error, A = stored transpose value
E8D9 84CF                                                  ANDA #$CF               Reset link transpose value w/ 00 = no transpose.
E8DB B71401                                                STA  P0_TRNSPOSE        Update stored transpose value w/ corrected value
E8DE 4F                                                    CLRA                    A = 0
E8DF 7EDF32                            TRANSPSE_OK         JMP  PAINT_LEDS         Paint LEDs

E8E2 9700                              CALC_PRESS          STA  MEM_00             Played Pressure -> MEM_00
E8E4 D600                                                  LDB  MEM_00             B = Played Pressure (0 <= X <= 63)
E8E6 58                                                    ASLB                    B = B x 2
E8E7 58                                                    ASLB                    B = B x 2
E8E8 44                                                    LSRA 
E8E9 56                                                    RORB 
E8EA DD00                                                  STD  MEM_00             MEM_00 & MEM_01 = updated pressure value
E8EC 8010                                                  SUBA #$10               A = A-$10
E8EE 2B05                                                  BMI  PRESS_LT_16        If -A was < $10, branch
E8F0 58                                                    ASLB 
E8F1 49                                                    ROLA 
E8F2 DD02                                                  STD  MEM_02
E8F4 39                                                    RTS  

E8F5 0F02                              PRESS_LT_16         CLR  MEM_02             MEM_02 = 0
E8F7 0F03                                                  CLR  MEM_03             MEM_03 = 0
E8F9 39                                EXIT_PRESS          RTS                     Return

E8FA 30A4                              PRESS_TO_CHNL       LEAX 0,Y                X = address of last/current board playing current inst.
E8FC AE84                              L149                LDX  0,X
E8FE 27F9                                                  BEQ  EXIT_PRESS         If stored address = 0, branch (exit)
E900 A608                                                  LDA  $8,X               A = corrected noted stored in channel def'n
E902 915C                                                  CMPA CORR_NOTE          Compare with current CORR_NOTE
E904 26F6                                                  BNE  L149               If we don't have same note, see if we should exit
E906 DC00                                                  LDD  MEM_00             else, pressure command is for this note D= main pressure value
E908 ED8812                                                STD  $12,X              Store main pressure value
E90B DC02                                                  LDD  MEM_02             D = supplementary pressure value
E90D ED8814                                                STD  $14,X              Store supplementary pressure value
E910 A6A85F                                                LDA  $5F,Y              A = 0 if 8 channel mode, else 16 channel mode
E913 26E7                                                  BNE  L149               If A<>0, ensure note still being played
E915 DC00                                                  LDD  MEM_00             else, get pressure value
E917 ED884B                                                STD  $4B,X              store main pressure value to other channel on board
E91A DC02                                                  LDD  MEM_02
E91C ED884D                                                STD  $4D,X              store supplemental value to other/link chan on brd
E91F 20DB                                                  BRA  L149

E921 A68835                            L68                 LDA  $35,X              A = RDAC value for pitch from channel
E924 9706                                                  STA  RDAC_OFFSET
E926 A68809                                                LDA  $9,X
E929 970C                                                  STA  SWEEP_INDEX
E92B CE0060                                                LDU  #$60               U = $60
E92E EC881A                                                LDD  $1A,X
E931 48                                                    ASLA 
E932 2802                                                  BVC  L150
E934 0C0C                                                  INC  SWEEP_INDEX
E936 47                                L150                ASRA 
E937 D348                                                  ADDD MASTER_TUNE1
E939 E3A839                                                ADDD $39,Y
E93C 8D48                                                  BSR  L151
E93E E38833                                                ADDD $33,X
E941 DD00                                                  STD  MEM_00
E943 A6A83D                                                LDA  $3D,Y
E946 270E                                                  BEQ  L152
E948 9705                                                  STA  MEM_05
E94A ECA83B                                                LDD  $3B,Y
E94D BDE9FC                                                JSR  L153
E950 8D32                                                  BSR  L154
E952 D300                                                  ADDD MEM_00
E954 DD00                                                  STD  MEM_00
E956 A6A840                            L152                LDA  $40,Y
E959 270E                                                  BEQ  L155
E95B 9705                                                  STA  MEM_05
E95D ECA83E                                                LDD  $3E,Y
E960 BDE9FC                                                JSR  L153
E963 8D23                                                  BSR  L156
E965 D300                                                  ADDD MEM_00
E967 DD00                                                  STD  MEM_00
E969 A6A843                            L155                LDA  $43,Y
E96C 270C                                                  BEQ  L157
E96E 9705                                                  STA  MEM_05
E970 ECA841                                                LDD  $41,Y
E973 BDE9FC                                                JSR  L153
E976 D300                                                  ADDD MEM_00
E978 DD00                                                  STD  MEM_00
E97A CC0FFF                            L157                LDD  #$FFF
E97D 9300                                                  SUBD MEM_00
E97F BDEA23                                                JSR  L158
E982 2009                                                  BRA  L159

E984 47                                L154                ASRA 
E985 56                                                    RORB 
E986 47                                L151                ASRA 
E987 56                                                    RORB 
E988 47                                L156                ASRA 
E989 56                                                    RORB 
E98A 47                                                    ASRA 
E98B 56                                                    RORB 
E98C 39                                                    RTS  

E98D 86FF                              L159                LDA  #$FF
E98F 9706                                                  STA  RDAC_OFFSET
E991 A68809                                                LDA  $9,X
E994 970C                                                  STA  SWEEP_INDEX
E996 A6A848                                                LDA  $48,Y
E999 9705                                                  STA  MEM_05
E99B CE0060                                                LDU  #$60
E99E ECA846                                                LDD  $46,Y
E9A1 8D59                                                  BSR  L153
E9A3 58                                                    ASLB 
E9A4 49                                                    ROLA 
E9A5 E3A844                                                ADDD $44,Y
E9A8 8D79                                                  BSR  L158
E9AA A68838                                                LDA  $38,X
E9AD 9706                                                  STA  RDAC_OFFSET
E9AF A68809                                                LDA  $9,X
E9B2 970C                                                  STA  SWEEP_INDEX
E9B4 CE0060                                                LDU  #$60
E9B7 DC48                                                  LDD  MASTER_TUNE1
E9B9 8DCB                                                  BSR  L151
E9BB E3A849                                                ADDD $49,Y
E9BE E38836                                                ADDD $36,X
E9C1 DD00                                                  STD  MEM_00
E9C3 A6A84D                                                LDA  $4D,Y
E9C6 270B                                                  BEQ  L160
E9C8 9705                                                  STA  MEM_05
E9CA ECA84B                                                LDD  $4B,Y
E9CD 8D2D                                                  BSR  L153
E9CF D300                                                  ADDD MEM_00
E9D1 DD00                                                  STD  MEM_00
E9D3 A6A850                            L160                LDA  $50,Y
E9D6 270B                                                  BEQ  L161
E9D8 9705                                                  STA  MEM_05
E9DA ECA84E                                                LDD  $4E,Y
E9DD 8D1D                                                  BSR  L153
E9DF D300                                                  ADDD MEM_00
E9E1 DD00                                                  STD  MEM_00
E9E3 A6A853                            L161                LDA  $53,Y
E9E6 270B                                                  BEQ  L162
E9E8 9705                                                  STA  MEM_05
E9EA ECA851                                                LDD  $51,Y
E9ED 8D0D                                                  BSR  L153
E9EF D300                                                  ADDD MEM_00
E9F1 DD00                                                  STD  MEM_00
E9F3 CC0FFF                            L162                LDD  #$FFF
E9F6 9300                                                  SUBD MEM_00
E9F8 8D29                                                  BSR  L158
E9FA 205E                                                  BRA  L163

E9FC ABC5                              L153                ADDA B,U
E9FE EC86                                                  LDD  A,X
EA00 48                                                    ASLA 
EA01 2802                                                  BVC  L164
EA03 0C0C                                                  INC  SWEEP_INDEX
EA05 47                                L164                ASRA 
EA06 DD02                                                  STD  MEM_02
EA08 9605                                                  LDA  MEM_05
EA0A 3D                                                    MUL  
EA0B 9704                                                  STA  MEM_04
EA0D 9605                                                  LDA  MEM_05
EA0F D602                                                  LDB  MEM_02
EA11 3D                                                    MUL  
EA12 DB04                                                  ADDB MEM_04
EA14 8900                                                  ADCA #$0
EA16 0D05                                                  TST  MEM_05
EA18 2A02                                                  BPL  L165
EA1A 9302                                                  SUBD MEM_02
EA1C 0D02                              L165                TST  MEM_02
EA1E 2A02                                                  BPL  L166
EA20 9005                                                  SUBA MEM_05
EA22 39                                L166                RTS  

EA23 2A05                              L158                BPL  L167
EA25 CE0000                                                LDU  #$0
EA28 200B                                                  BRA  WR_U_2_DAC

EA2A 810F                              L167                CMPA #$F
EA2C 2305                                                  BLS  WR_D_2_DAC
EA2E CE0FFF                                                LDU  #$FFF
EA31 2002                                                  BRA  WR_U_2_DAC

EA33 1F03                              WR_D_2_DAC          TFR  D,U
EA35 C6C0                              WR_U_2_DAC          LDB  #$C0               B = $C0
EA37 DA6F                                                  ORB  SH_TEMP            Set top 2 bits of RAM[006F]
EA39 F7200B                                                STB  WR_SHA             Get one of SHA, SHA1 or SHA2 (not fast)
EA3C 966F                                                  LDA  SH_TEMP            Orig/Old Sample & Hold Data
EA3E 4C                                                    INCA 
EA3F 843F                                                  ANDA #$3F '?            Drop off top 2 bits
EA41 976F                                                  STA  SH_TEMP            A -> RAM[006F]
EA43 C680                                                  LDB  #$80               B = $80
EA45 960C                                                  LDA  SWEEP_INDEX        A = RAM[000C]
EA47 8101                                                  CMPA #$1                Compare A and $1
EA49 56                                                    RORB                    B = 0100 0000
EA4A DA6F                                                  ORB  SH_TEMP            Set B6 of Data Byte = 1
EA4C 9606                                                  LDA  RDAC_OFFSET        A = RDAC Offset
EA4E FD200A                                                STD  WR_RDAC            Update RDAC and Store B to WR_SHA
EA51 FF200C                                                STU  WR_MDAC            Store U to MDAC and MDAC + 1
EA54 C4BF                                                  ANDB #$BF               Clear Bit 6
EA56 F7200B                                                STB  WR_SHA             Store to -SHEN for appropriate channel
EA59 39                                                    RTS  

EA5A 86FF                              L163                LDA  #$FF
EA5C 9706                                                  STA  RDAC_OFFSET
EA5E CE0060                                                LDU  #$60
EA61 A68809                                                LDA  $9,X
EA64 970C                                                  STA  SWEEP_INDEX
EA66 4F                                                    CLRA 
EA67 5F                                                    CLRB 
EA68 A78809                                                STA  $9,X
EA6B DD00                                                  STD  MEM_00
EA6D A6A856                                                LDA  $56,Y
EA70 270B                                                  BEQ  L168
EA72 9705                                                  STA  MEM_05
EA74 ECA854                                                LDD  $54,Y
EA77 8D83                                                  BSR  L153
EA79 D300                                                  ADDD MEM_00
EA7B DD00                                                  STD  MEM_00
EA7D A6A859                            L168                LDA  $59,Y
EA80 270C                                                  BEQ  L169
EA82 9705                                                  STA  MEM_05
EA84 ECA857                                                LDD  $57,Y
EA87 BDE9FC                                                JSR  L153
EA8A D300                                                  ADDD MEM_00
EA8C DD00                                                  STD  MEM_00
EA8E 6EB85A                            L169                JMP  [$5A,Y]            Jump to Volume Mod 3 Select Handler

EA91 EAA1                              V_MOD_SEL_00        FDB  $EAA1              Param 50 (Vol Mod 3 Sel) = 0 (None) Handler Addr
EA93 EAA6                              V_MOD_SEL_01        FDB  $EAA6              Param 50 (Vol Mod 3 Sel) = 1 (Press) Handler Addr    
EA95 EAAF                              V_MOD_SEL_02        FDB  $EAAF              Param 50 (Vol Mod 3 Sel) = 2 (Kybd) Handler Addr    
EA97 EACE                              V_MOD_SEL_03        FDB  $EACE              Param 50 (Vol Mod 3 Sel) = 3 (Sweep A) Handler Addr    
EA99 EAE4                              V_MOD_SEL_04        FDB  $EAE4              Param 50 (Vol Mod 3 Sel) = 4 (Pedal 1) Handler Addr    
EA9B EAE8                              V_MOD_SEL_05        FDB  $EAE8              Param 50 (Vol Mod 3 Sel) = 5 (-Pedal 1) Handler Addr    
EA9D EAEC                              V_MOD_SEL_06        FDB  $EAEC              Param 50 (Vol Mod 3 Sel) = 6 (Pedal 2) Handler Addr    
EA9F EAF4                              V_MOD_SEL_07        FDB  $EAF4              Param 50 (Vol Mod 3 Sel) = 7 (-Pedal 2) Handler Addr    

EAA1 A6A818                                                LDA  $18,Y              Param 50 (Vol Mod 3 Sel) = 0 (None) Handler
EAA4 2065                                                  BRA  L170

EAA6 EC8812                                                LDD  $12,X              Param 50 (Vol Mod 3 Sel) = 1 (Press) Handler
EAA9 847F                                                  ANDA #$7F
EAAB 8B20                                                  ADDA #$20
EAAD 2050                                                  BRA  L171

EAAF A6881A                                                LDA  $1A,X              Param 50 (Vol Mod 3 Sel) = 2 (Kybd) Handler
EAB2 48                                                    ASLA 
EAB3 2802                                                  BVC  L172
EAB5 0C0C                                                  INC  SWEEP_INDEX
EAB7 47                                L172                ASRA 
EAB8 811F                                                  CMPA #$1F
EABA 2D04                                                  BLT  L173
EABC 8681                                                  LDA  #$81
EABE 2047                                                  BRA  L174

EAC0 81E0                              L173                CMPA #$E0
EAC2 2E04                                                  BGT  L175
EAC4 86FF                                                  LDA  #$FF
EAC6 203F                                                  BRA  L174

EAC8 48                                L175                ASLA 
EAC9 40                                                    NEGA 
EACA 8BBF                                                  ADDA #$BF
EACC 2039                                                  BRA  L174

EACE 8621                                                  LDA  #$21 '!            Param 50 (Vol Mod 3 Sel) = 3 (Sweep A) Handler
EAD0 9B60                                                  ADDA RAM0060
EAD2 EC86                                                  LDD  A,X
EAD4 58                                                    ASLB 
EAD5 49                                                    ROLA 
EAD6 2802                                                  BVC  L176
EAD8 0C0C                                                  INC  SWEEP_INDEX
EADA 3406                              L176                PSHS B,A
EADC 47                                                    ASRA 
EADD 56                                                    RORB 
EADE E3E1                                                  ADDD ,S++
EAE0 8B9F                                                  ADDA #$9F
EAE2 2023                                                  BRA  L174

EAE4 860A                                                  LDA  #$A                Param 50 (Vol Mod 3 Sel) = 4 (Pedal 1) Handler
EAE6 2006                                                  BRA  L177

EAE8 860A                                                  LDA  #$A                Param 50 (Vol Mod 3 Sel) = 5 (-Pedal 1) Handler
EAEA 200A                                                  BRA  L178

EAEC 860C                                                  LDA  #$C                Param 50 (Vol Mod 3 Sel) = 6 (Pedal 2) Handler
EAEE 9B62                              L177                ADDA CHAN_OFSET_2
EAF0 EC86                                                  LDD  A,X
EAF2 2009                                                  BRA  L179

EAF4 860C                                                  LDA  #$C                Param 50 (Vol Mod 3 Sel) = 7 (-Pedal 2) Handler
EAF6 9B62                              L178                ADDA CHAN_OFSET_2
EAF8 EC86                                                  LDD  A,X
EAFA 881F                                                  EORA #$1F
EAFC 53                                                    COMB 
EAFD 58                                L179                ASLB 
EAFE 49                                                    ROLA 
EAFF 58                                L171                ASLB 
EB00 49                                                    ROLA 
EB01 58                                                    ASLB 
EB02 49                                                    ROLA 
EB03 2402                                                  BCC  L174
EB05 86FF                                                  LDA  #$FF
EB07 E6A818                            L174                LDB  $18,Y
EB0A 3D                                                    MUL  
EB0B 9702                              L170                STA  MEM_02
EB0D D601                                                  LDB  MEM_01
EB0F 3D                                                    MUL  
EB10 D602                                                  LDB  MEM_02
EB12 9702                                                  STA  MEM_02
EB14 9600                                                  LDA  MEM_00
EB16 3D                                                    MUL  
EB17 DB02                                                  ADDB MEM_02
EB19 8900                                                  ADCA #$0
EB1B 7EEA2A                                                JMP  L167

EB1E A6A81D                            L66                 LDA  $1D,Y              X = addr of defining chan, A = inst. sweep mode (0<=A<=3)
EB21 4A                                                    DECA                    A = A-1
EB22 2F14                                                  BLE  FREE_RUN_SWP       If sweep mode = Async free run or independ. key-trigf, branch
EB24 ACA814                                                CMPX $14,Y              else, sngl free run or sngl key trig. - compare stored chan. addr.
EB27 270F                                                  BEQ  FREE_RUN_SWP       If addresses are equal, branch (do free run sweep)
EB29 EEA814                                                LDU  $14,Y              else, addresses different, U = stored channel address
EB2C ECC81C                                                LDD  28,U               D = sweep envelope value from stored channel
EB2F ED881C                                                STD  $1C,X              Store sweep envelope from "other" channel to current channel
EB32 A6C81E                                                LDA  30,U               A = current index of sweep from "other" channel
EB35 7EEBFB                                                JMP  L180               Jump to body of sweep rate mod handler

EB38 6EB821                            FREE_RUN_SWP        JMP  [$21,Y]            Go do Sweep Rate Mod Hanlder

EB3B EB5B                              SWP_RM_VEC_00       FDB  $EB5B              Sweep Rate Mod = 0 (None) Handler Addr
EB3D EB60                              SWP_RM_VEC_01       FDB  $EB60              Sweep Rate Mod = 1 (Pressure) Handler Addr  
EB3F EB65                              SWP_RM_VEC_02       FDB  $EB65              Sweep Rate Mod = 2 (Kybd) Handler Addr  
EB41 EB6A                              SWP_RM_VEC_03       FDB  $EB6A              Sweep Rate Mod = 3 (-Kybd) Handler Addr  
EB43 EB70                              SWP_RM_VEC_04       FDB  $EB70              Sweep Rate Mod = 4 (Velocity) Handler Addr  
EB45 EB77                              SWP_RM_VEC_05       FDB  $EB77              Sweep Rate Mod = 5 (-Velocity) Handler Addr  
EB47 EB7F                              SWP_RM_VEC_06       FDB  $EB7F              Sweep Rate Mod = 6 (Env 2) Handler Addr  
EB49 EB84                              SWP_RM_VEC_07       FDB  $EB84              Sweep Rate Mod = 7 (-Env 2) Handler Addr  
EB4B EB8C                              SWP_RM_VEC_08       FDB  $EB8C              Sweep Rate Mod = 8 (Pedal 1) Handler Addr  
EB4D EB90                              SWP_RM_VEC_09       FDB  $EB90              Sweep Rate Mod = 9 (-Pedal 1) Handler Addr  
EB4F EB94                              SWP_RM_VEC_10       FDB  $EB94              Sweep Rate Mod = 10 (Pedal 2) Handler Addr  
EB51 EB9C                              SWP_RM_VEC_11       FDB  $EB9C              Sweep Rate Mod = 11 (-Pedal 2) Handler Addr  
EB53 EBA5                              SWP_RM_VEC_12       FDB  $EBA5              Sweep Rate Mod = 12 (Lever 1) Handler Addr  
EB55 EBA9                              SWP_RM_VEC_13       FDB  $EBA9              Sweep Rate Mod = 13 (-Lever 1) Handler Addr  
EB57 EBAD                              SWP_RM_VEC_14       FDB  $EBAD              Sweep Rate Mod = 14 (Lever 2) Handler Addr  
EB59 EBB5                              SWP_RM_VEC_15       FDB  $EBB5              Sweep Rate Mod = 15 (-Lever 2) Handler Addr  

EB5B A6A81C                                                LDA  $1C,Y              Sweep Rate Mod = 0 (None) Handler (A = Sweep Rate stored in inst.)
EB5E 2072                                                  BRA  DONE_SWP_R_CLC

EB60 A68812                                                LDA  $12,X              Sweep Rate Mod = 1 (Pressure) Handler (A = Chan Press Value - MSB)
EB63 2017                                                  BRA  K_DYN_MOD

EB65 A68819                                                LDA  $19,X              Sweep Rate Mod = 2 (Kybd) Handler (A = Chan. Kybd value)
EB68 2053                                                  BRA  L181

EB6A A68819                                                LDA  $19,X              Sweep Rate Mod = 3 (-Kybd) Handler (A = Chan. Kybd value)
EB6D 40                                                    NEGA                    A = -A
EB6E 204D                                                  BRA  L181

EB70 A6880E                                                LDA  $E,X               Sweep Rate Mod = 4 (Velocity) Handler (A = Chan. Velocity Value)
EB73 8010                                                  SUBA #$10               A = A - $10
EB75 2005                                                  BRA  K_DYN_MOD

EB77 8610                              LEVER_NGVE          LDA  #$10               Sweep Rate Mod = 5 (-Velocity) Handler (A = $10)
EB79 A0880E                                                SUBA $E,X               A = $10 - Channel Velocity value
EB7C 48                                K_DYN_MOD           ASLA                    A = Ax2
EB7D 203E                                                  BRA  L181

EB7F A68830                                                LDA  $30,X              Sweep Rate Mod = 6 (Env 2) Handler (A = ENV2 Ampl. Value from Chan)
EB82 2004                                                  BRA  ENV_MOD

EB84 A68830                                                LDA  $30,X              Sweep Rate Mod = 7 (-Env 2) Handler (A = ENV2 Ampl. value from chan)
EB87 40                                                    NEGA                    A = -A
EB88 48                                ENV_MOD             ASLA 
EB89 47                                                    ASRA 
EB8A 2031                                                  BRA  L181

EB8C 860A                                                  LDA  #$A                Sweep Rate Mod = 8 (Pedal 1) Handler (A = Pedal 1 MOD)
EB8E 2006                                                  BRA  PEDAL_PSVE

EB90 860A                                                  LDA  #$A                Sweep Rate Mod = 9 (-Pedal 1) Handler  
EB92 200A                                                  BRA  PEDAL_NGVE

EB94 860C                                                  LDA  #$C                Sweep Rate Mod = 10 (Pedal 2) Handler  
EB96 9B62                              PEDAL_PSVE          ADDA CHAN_OFSET_2
EB98 A686                                                  LDA  A,X
EB9A 2022                                                  BRA  L182

EB9C 860C                                                  LDA  #$C                Sweep Rate Mod = 11 (-Pedal 2) Handler  
EB9E 9B62                              PEDAL_NGVE          ADDA CHAN_OFSET_2
EBA0 A686                                                  LDA  A,X
EBA2 40                                                    NEGA 
EBA3 2019                                                  BRA  L182

EBA5 86D1                                                  LDA  #$D1               Sweep Rate Mod = 12 (Lever 1) Handler  
EBA7 2006                                                  BRA  LEVER_PSVE

EBA9 86D1                                                  LDA  #$D1               Sweep Rate Mod = 13 (-Lever 1) Handler  
EBAB 200A                                                  BRA  L183

EBAD 86D3                                                  LDA  #$D3               Sweep Rate Mod = 14 (Lever 2) Handler  
EBAF 9B62                              LEVER_PSVE          ADDA CHAN_OFSET_2
EBB1 A686                                                  LDA  A,X
EBB3 2007                                                  BRA  L184

EBB5 86D3                                                  LDA  #$D3               Sweep Rate Mod = 15 (-Lever 2) Handler
EBB7 9B62                              L183                ADDA CHAN_OFSET_2
EBB9 A686                                                  LDA  A,X
EBBB 40                                                    NEGA 
EBBC 47                                L184                ASRA 
EBBD 47                                L181                ASRA                    A = A/2
EBBE 47                                L182                ASRA                    A = A/2
EBBF 9700                                                  STA  MEM_00             A -> RAM[$0000]
EBC1 47                                                    ASRA                    A = A/2
EBC2 9B00                                                  ADDA MEM_00
EBC4 ABA81C                                                ADDA $1C,Y              Store new (modified) Sweep Rate into Instrument Def'n
EBC7 2C03                                                  BGE  L185               If sweep rate >= 0, then value already OK
EBC9 4F                                                    CLRA                    else, value too low, clamp sweek rate to 0 (slow)
EBCA 2006                                                  BRA  DONE_SWP_R_CLC     Branch Always

EBCC 813F                              L185                CMPA #$3F '?            Compare Sweep rate w/63 (max value).
EBCE 2F02                                                  BLE  DONE_SWP_R_CLC     If A <= 63, branch
EBD0 863F                                                  LDA  #$3F '?            Else, value too high - clmap to 63 (fast)
EBD2 48                                DONE_SWP_R_CLC      ASLA                    A = A x 2 = new/updated sweep rate x 2 (0-63, but two byte values)
EBD3 CEFB9D                                                LDU  #$FB9D             U = $FB9D = Base address of sweep rate values
EBD6 ECC6                                                  LDD  A,U                D = 2 data bytes from lookup table for sweep rate selection (0-63)
EBD8 6DA81D                                                TST  $1D,Y              Check Instrument's sweep mode
EBDB 2614                                                  BNE  NOT_AYNC_F_RUN     Branch if sweep mode <> async free run
EBDD 9700                                                  STA  MEM_00             Else, sweep mode = async free num, A -> RAM[$0000]
EBDF 966F                                                  LDA  SH_TEMP            A = RAM[$006F]
EBE1 8AC0                                                  ORA  #$C0               Set top 2 bits of A
EBE3 3D                                                    MUL                     D = AxB
EBE4 9701                                                  STA  MEM_01
EBE6 D600                                                  LDB  MEM_00
EBE8 966F                                                  LDA  SH_TEMP            A = RAM[$006F]
EBEA 8AC0                                                  ORA  #$C0               Set top 2 bits of A
EBEC 3D                                                    MUL                     A = AxB
EBED DB01                                                  ADDB MEM_01
EBEF 8900                                                  ADCA #$0                A = A + Carry
EBF1 E3881C                            NOT_AYNC_F_RUN      ADDD $1C,X              D = D + old, stored channel envelope value
EBF4 1F03                                                  TFR  D,U                D -> U
EBF6 1FA8                                                  TFR  CC,A
EBF8 EF881C                                                STU  $1C,X
EBFB A7881E                            L180                STA  $1E,X              Store "current sweep index" in current channel
EBFE 8403                                                  ANDA #$3                Only keep bottom 2 bits of A
EC00 2739                                                  BEQ  K_ALG_LE_5         If A = 0, branch
EC02 D661                                                  LDB  CHAN_OFSET_1       Else, A <> 0, B = RAM[$0061]
EC04 260F                                                  BNE  L186               if B <> 0, branch
EC06 D660                                                  LDB  RAM0060            Else B = 0, B = RAM[$0060]
EC08 2631                                                  BNE  K_ALG_LE_5
EC0A D662                                                  LDB  CHAN_OFSET_2
EC0C 2707                                                  BEQ  L186
EC0E E6A860                                                LDB  $60,Y              B = Keyboard Algorithm Selection from Inst. Def'n
EC11 C105                                                  CMPB #$5                Compare B w/5
EC13 2426                                                  BCC  K_ALG_LE_5         cc if B <= 5, branch
EC15 44                                L186                LSRA                    else, B > 5, A = A /2
EC16 2408                                                  BCC  L187
EC18 ADB812                                                JSR  [$12,Y]            Jump to Arpeg Specific Keybrd Alg. Handler 
EC1B CCEDA7                                                LDD  #$EDA7             D = $EDA7 = address for ENV2 work subr.
EC1E 2006                                                  BRA  L188

EC20 ADB86E                            L187                JSR  [$6E,Y]            Jump to Arpeg General Keybrd Alg. Handler 
EC23 CCEE11                                                LDD  #$EE11
EC26 6DA830                            L188                TST  $30,Y              Check ENV2 Delay Value
EC29 2A03                                                  BPL  SOME_ENV2_DLY      Branch if there is some delay for ENV2
EC2B ED882C                                                STD  $2C,X              else, no ENV2 Delay -> store address of ENV2 release handler
EC2E 0D61                              SOME_ENV2_DLY       TST  CHAN_OFSET_1       Test RAM[$0061]
EC30 2709                                                  BEQ  K_ALG_LE_5
EC32 6DA9008C                                              TST  140,Y
EC36 2A03                                                  BPL  K_ALG_LE_5
EC38 ED8865                                                STD  $65,X
EC3B A68819                            K_ALG_LE_5          LDA  $19,X              A = KYBD value
EC3E 5F                                                    CLRB                    B = 0
EC3F 10A38816                                              CMPD $16,X              Compare D against stored portamento offset
EC43 1027008B                                              LBEQ L189
EC47 6DA819                                                TST  $19,Y              Check Glide Rate setting in instrument def'n
EC4A 2707                                                  BEQ  GLIDE_RAT_0        Branch if Glide Rate Setting = 0 (none)
EC4C A68816                                                LDA  $16,X              Else we have some glide rate, A = MSB of Portamento offset
EC4F 48                                                    ASLA                    A = Ax2
EC50 2808                                                  BVC  L190               If we didn't overflow, branch
EC52 47                                                    ASRA                    else we did overflow - A = A/2
EC53 ED8816                            GLIDE_RAT_0         STD  $16,X
EC56 8880                                                  EORA #$80
EC58 2078                                                  BRA  L189

EC5A A6A819                            L190                LDA  $19,Y              A = Glide Rate setting from instrument
EC5D 6EB81A                                                JMP  [$1A,Y]            Jump to Glid shape handler (as appropriate)

EC60 EC64                              GLIDE_VEC_00        FDB  $EC64              Glide Shape Vector - Portamento
EC62 EC9E                              GLIDE_VEC_01        FDB  $EC9E              Glide Shape Vector - Glissandro

EC64 48                                                    ASLA                    PORTAMENTO HANDLER - smooth sliding transistion (A = glide val x 2)
EC65 CEFAFA                                                LDU  #$FAFA             U = $FAFA = base addr. of ENV attack. mod table
EC68 33C6                                                  LEAU A,U                U = pointer to ENV ATTACK MOD Lookup Table for glide rate settings
EC6A A68818                                                LDA  $18,X              A = Stored Portatmento Value
EC6D E641                                                  LDB  1,U    $1          B = ENV Attack Mod lookup value LSB
EC6F 3D                                                    MUL                     D = AxB
EC70 9700                                                  STA  MEM_00
EC72 A68818                                                LDA  $18,X              A = Stored Portamento value
EC75 E6C4                                                  LDB  0,U                B = ENV ATTACK MOD Lookup Table MSB
EC77 3D                                                    MUL                     D = AxB
EC78 DB00                                                  ADDB MEM_00
EC7A 8900                                                  ADCA #$0
EC7C 6D8818                                                TST  $18,X              Look at old stored portamento value
EC7F 2B0A                                                  BMI  L191               If Value < 0, branch
EC81 E38816                                                ADDD $16,X              else value >= 0
EC84 A18819                                                CMPA $19,X              Compare calculated portamento Note w/"played" note
EC87 2D10                                                  BLT  PORT_LT_PLAYED     If new note < played note, branch
EC89 200A                                                  BRA  PORT_GE_PLAYED     else port note > played note, branch always

EC8B A3C4                              L191                SUBD 0,U
EC8D E38816                                                ADDD $16,X
EC90 A18819                                                CMPA $19,X
EC93 2C04                                                  BGE  PORT_LT_PLAYED
EC95 A68819                            PORT_GE_PLAYED      LDA  $19,X              A = Corrected Note
EC98 5F                                                    CLRB                    B = 0
EC99 ED8816                            PORT_LT_PLAYED      STD  $16,X
EC9C 2034                                                  BRA  L189

EC9E CEFB5A                                                LDU  #$FB5A             GLISSANDRO HANDLER (one note to the next)
ECA1 E6C6                                                  LDB  A,U                B = offset into lookup table at $FB5A (0 <= B <=31)
ECA3 A68818                                                LDA  $18,X              A = Last Stored glissando/portamento value
ECA6 2B0B                                                  BMI  GLISS_NEG          If last value < 0, branch
ECA8 4F                                                    CLRA                    else A = 0
ECA9 E38816                                                ADDD $16,X              D = Old value + 0:lookup Glissandro Value
ECAC A18819                                                CMPA $19,X              See if A < played/struck note
ECAF 2D10                                                  BLT  GLISS_LT_PLAYED
ECB1 200A                                                  BRA  L192

ECB3 50                                GLISS_NEG           NEGB                    B = -B
ECB4 1D                                                    SEX  
ECB5 E38816                                                ADDD $16,X
ECB8 A18819                                                CMPA $19,X
ECBB 2C04                                                  BGE  GLISS_LT_PLAYED
ECBD A68819                            L192                LDA  $19,X              A = played note
ECC0 5F                                                    CLRB                    B = 0
ECC1 A18816                            GLISS_LT_PLAYED     CMPA $16,X
ECC4 2708                                                  BEQ  L193
ECC6 ED8816                                                STD  $16,X
ECC9 5F                                                    CLRB 
ECCA 8880                                                  EORA #$80
ECCC 2004                                                  BRA  L189

ECCE ED8816                            L193                STD  $16,X
ECD1 5F                                                    CLRB 
ECD2 ED881A                            L189                STD  $1A,X
ECD5 6E9824                                                JMP  [$24,X]            Go do ENV1 release handler for channel

ECD8 A68823                                                LDA  $23,X              ENV 1 DELAY HANDLER?!  If A <= 0, branch
ECDB 2F05                                                  BLE  L194               Branch if 'sweep' triggered Env.(?)
ECDD 6A8823                                                DEC  $23,X              else, value > 0, value = value-1
ECE0 2005                                                  BRA  ENV1_INST_ATK      Branch always

ECE2 A6A829                            L194                LDA  $29,Y              A = ENV1 Attack Byte
ECE5 2719                                                  BEQ  INST_ENV1_ATK      If ENV1 Attack = 0 (i.e., instant attack) branch
ECE7 CCECF0                            ENV1_INST_ATK       LDD  #$ECF0             D = $ECF0 (handler address)
ECEA ED8824                                                STD  $24,X              Store channel's ENV1 Release Handler
ECED 7EED79                                                JMP  ENV1_INST_REL

ECF0 A68823                                                LDA  $23,X
ECF3 2F06                                                  BLE  L195               If A <=0 Branch
ECF5 6A8823                                                DEC  $23,X
ECF8 7EED79                                                JMP  ENV1_INST_REL

ECFB A6A829                            L195                LDA  $29,Y              A = ENV1 Attack Byte 1
ECFE 2612                                                  BNE  L196               If A<>0, branch
ED00 CCED34                            INST_ENV1_ATK       LDD  #$ED34             A = 0, D = $ED34 = vector handler address
ED03 ED8824                                                STD  $24,X
ED06 A68827                                                LDA  $27,X
ED09 5F                                                    CLRB 
ED0A 8880                                                  EORA #$80
ED0C ED8828                                                STD  $28,X
ED0F 7EED8C                                                JMP  ENV1_EQ_0

ED12 E68826                            L196                LDB  $26,X
ED15 DD01                                                  STD  MEM_01
ED17 ADB82A                                                JSR  [$2A,Y]            Jump to Env 1 Attack Mod Handler
ED1A E38828                                                ADDD $28,X
ED1D 847F                                                  ANDA #$7F
ED1F A18827                                                CMPA $27,X
ED22 250A                                                  BCS  L197
ED24 CCED34                                                LDD  #$ED34
ED27 ED8824                                                STD  $24,X
ED2A A68827                                                LDA  $27,X
ED2D 5F                                                    CLRB 
ED2E ED8828                            L197                STD  $28,X
ED31 7EED8C                                                JMP  ENV1_EQ_0

ED34 A6A82C                                                LDA  $2C,Y              A = Env 1 Decay (from operator input - 0->31)
ED37 2740                                                  BEQ  ENV1_INST_REL      Branch if Env 1 Decay = 0 (Instant decay)
ED39 811F                                                  CMPA #$1F               else, we have some decay - see if ENV 1 Decay = 31
ED3B 250C                                                  BCS  SOME_ENV1_DCY      If A < 31, branch
ED3D A68828                                                LDA  $28,X              else, ENV 1 decay = 31 (inf sust), A = ENV 1 Ampl (MSB) from channel
ED40 2A4A                                                  BPL  ENV1_EQ_0          If ENV 1 Ampl (MSB) >=0 , branch
ED42 847F                                                  ANDA #$7F               Else, ENV1 Ampl is -ve - drop top bit (make positive)
ED44 A78828                                                STA  $28,X
ED47 2043                                                  BRA  ENV1_EQ_0

ED49 9700                              SOME_ENV1_DCY       STA  MEM_00
ED4B ADB82D                                                JSR  [$2D,Y]            Jump to ENV1 DECAY Mod Handler
ED4E 338828                                                LEAU $28,X
ED51 BDEF04                                                JSR  L198
ED54 2036                                                  BRA  ENV1_EQ_0

ED56 A6A82F                                                LDA  $2F,Y              A = ENV1 Release Value
ED59 271E                                                  BEQ  ENV1_INST_REL      If ENV1 Release Value = 0, instant release, branch
ED5B 811F                                                  CMPA #$1F               else, see if ENV1 Release Value
ED5D 2D0D                                                  BLT  ENV1_SET_R_RATE    if A < $1F, "norma" release - branch
ED5F A6880F                                                LDA  $F,X               else use release threshold, A = diff. between thresh & actual
ED62 2605                                                  BNE  ENV1_FAST_REL_R    if diff <> 0, branch (use fast rate)
ED64 B61FFE                                                LDA  REL_SLOW_RATE      else, A = REL_SLOW_RATE
ED67 2003                                                  BRA  ENV1_SET_R_RATE

ED69 B61FFF                            ENV1_FAST_REL_R     LDA  REL_FAST_RATE
ED6C CEFB3A                            ENV1_SET_R_RATE     LDU  #$FB3A             U = beginning of lookuup table for ENV DECAY MOD value
ED6F E6C6                                                  LDB  A,U                B = value from table
ED71 338828                                                LEAU $28,X              U = address of ENV1 Amplitude value (in channel)
ED74 BDEF04                                                JSR  L198
ED77 2013                                                  BRA  ENV1_EQ_0

ED79 EC8828                            ENV1_INST_REL       LDD  $28,X              D = ENV1 Amplitude value (in channel)
ED7C 270E                                                  BEQ  ENV1_EQ_0          If ENV1 Val = 0, branch
ED7E 847F                                                  ANDA #$7F               Drop off top bit of amplitude value
ED80 10830000                                              CMPD #$0                see if D = 0 now
ED84 2703                                                  BEQ  ENV1_EQ_128        if so, branch
ED86 CC8000                                                LDD  #$8000             else, D = $8000
ED89 ED8828                            ENV1_EQ_128         STD  $28,X              Update ENV 1 Value (in channel def'n)
ED8C 6E982C                            ENV1_EQ_0           JMP  [$2C,X]            Jump to ENV2 decay handler

ED8F A6882B                                                LDA  $2B,X              ENV 2 HANDLER
ED92 2F05                                                  BLE  ENV2_DELAY_DONE    Branch if A <= 0 (i.e., if delay is done, branch)
ED94 6A882B                                                DEC  $2B,X              Else, still delaying - decrement delay counter and store
ED97 2005                                                  BRA  L199

ED99 A6A832                            ENV2_DELAY_DONE     LDA  $32,Y              A = ENV2 Attack byte (0=instant, 31=slow)
ED9C 2719                                                  BEQ  L200               Branch if 'instant' attack
ED9E CCEDA7                            L199                LDD  #$EDA7             else, we have a 'timed' attack, D = $EDA7 = vector handler
EDA1 ED882C                                                STD  $2C,X
EDA4 7EEE35                                                JMP  ENV2_INST_REL

EDA7 A6882B                                                LDA  $2B,X
EDAA 2F06                                                  BLE  L201
EDAC 6A882B                                                DEC  $2B,X
EDAF 7EEE35                                                JMP  ENV2_INST_REL

EDB2 A6A832                            L201                LDA  $32,Y              A = ENV2 attack byte
EDB5 2612                                                  BNE  L202
EDB7 CCEDEB                            L200                LDD  #$EDEB
EDBA ED882C                                                STD  $2C,X
EDBD A6882F                                                LDA  $2F,X
EDC0 5F                                                    CLRB 
EDC1 8880                                                  EORA #$80
EDC3 ED8830                                                STD  $30,X
EDC6 7EEF50                                                JMP  DO_SWEEP_WAVE

EDC9 E6882E                            L202                LDB  $2E,X
EDCC DD01                                                  STD  MEM_01
EDCE ADB833                                                JSR  [$33,Y]            ENV2 Attack Modulation Handler
EDD1 E38830                                                ADDD $30,X              D = D + ENV2 Amplitude Value
EDD4 847F                                                  ANDA #$7F               Clear top bit of D (i.e., +ve value)
EDD6 A1882F                                                CMPA $2F,X
EDD9 250A                                                  BCS  L203
EDDB CCEDEB                                                LDD  #$EDEB             D = $EDEB
EDDE ED882C                                                STD  $2C,X              Store address of ENV2 Decay Hanlder
EDE1 A6882F                                                LDA  $2F,X
EDE4 5F                                                    CLRB                    B = 0
EDE5 ED8830                            L203                STD  $30,X
EDE8 7EEF50                                                JMP  DO_SWEEP_WAVE      Jump

EDEB A6A835                                                LDA  $35,Y              ENV2 Attack Handler, A = ENV2 Decay Value
EDEE 2745                                                  BEQ  ENV2_INST_REL      If decay value = 0, branch
EDF0 811F                                                  CMPA #$1F               else compare decay value with $1F ($1F=31=inf. sustain)
EDF2 250F                                                  BCS  SOME_ENV2_DCY      if A < $1f, carry set - branch
EDF4 A68830                                                LDA  $30,X              else "slow", A = ENV2 ampl value MSB
EDF7 102A0155                                              LBPL DO_SWEEP_WAVE      If ENV2 Value > 0, branch (do sweep value)
EDFB 847F                                                  ANDA #$7F
EDFD A78830                                                STA  $30,X              Store updated ENV2 AMPL MSB
EE00 7EEF50                                                JMP  DO_SWEEP_WAVE

EE03 9700                              SOME_ENV2_DCY       STA  MEM_00
EE05 ADB836                                                JSR  [$36,Y]            ENV2 Decay Modulation handler
EE08 338830                                                LEAU $30,X              U = address of ENV2 amplitude value
EE0B BDEF04                                                JSR  L198
EE0E 7EEF50                                                JMP  DO_SWEEP_WAVE      Jump and do sweep wave shape handler

EE11 A6A838                                                LDA  $38,Y              A = ENV2 Release value
EE14 271F                                                  BEQ  ENV2_INST_REL      If ENV2 release value = 0, instant release, branch
EE16 811F                                                  CMPA #$1F               else, see if we're dealing with a threshold release
EE18 250D                                                  BCS  ENV2_SET_R_RATE    if carry set, A < $1F, i.e., "normal" release, branch
EE1A A6880F                                                LDA  $F,X               else, threshold - A = diff. between rel. thresh & actual
EE1D 2605                                                  BNE  ENV2_FAST_REL_R    If Diff <> 0, branch (use fast rate)
EE1F B61FFE                                                LDA  REL_SLOW_RATE      else, A = Rel_slow_rate
EE22 2003                                                  BRA  ENV2_SET_R_RATE    Branch always

EE24 B61FFF                            ENV2_FAST_REL_R     LDA  REL_FAST_RATE
EE27 CEFB3A                            ENV2_SET_R_RATE     LDU  #$FB3A             U = lookup table for ENV Decay MOD value
EE2A E6C6                                                  LDB  A,U
EE2C 338830                                                LEAU $30,X              U = address of ENV2 amplitude value
EE2F BDEF04                                                JSR  L198
EE32 7EEF50                                                JMP  DO_SWEEP_WAVE

EE35 EC8830                            ENV2_INST_REL       LDD  $30,X
EE38 10270114                                              LBEQ DO_SWEEP_WAVE
EE3C 847F                                                  ANDA #$7F
EE3E 10830000                                              CMPD #$0
EE42 2703                                                  BEQ  L204
EE44 CC8000                                                LDD  #$8000
EE47 ED8830                            L204                STD  $30,X
EE4A 7EEF50                                                JMP  DO_SWEEP_WAVE      Set Sweep Data

EE4D EE9A                              ENV_ATK_M_VEC_0     FDB  $EE9A              Envelope Attack Mod = 0 (None) Vector Handler
EE4F EE5D                              ENV_ATK_M_VEC_1     FDB  $EE5D              Envelope Attack Mod = 1 (Pressure) Vector Handler    
EE51 EE62                              ENV_ATK_M_VEC_2     FDB  $EE62              Envelope Attack Mod = 2 (-KYBD) Vector Handler     
EE53 EE68                              ENV_ATK_M_VEC_3     FDB  $EE68              Envelope Attack Mod = 3 (KYBD) Vector Handler     
EE55 EE6D                              ENV_ATK_M_VEC_4     FDB  $EE6D              Envelope Attack Mod = 4 (Velocity) Vector Handler    
EE57 EE74                              ENV_ATK_M_VEC_5     FDB  $EE74              Envelope Attack Mod = 5 (-Velocity) Vector Handler  
EE59 EE7C                              ENV_ATK_M_VEC_6     FDB  $EE7C              Envelope Attack Mod = 6 (Pedal 1) Vector Handler   
EE5B EE80                              ENV_ATK_M_VEC_7     FDB  $EE80              Envelope Attack Mod = 7 (Pedal 2) Vector Handler

EE5D A68812                                                LDA  $12,X              Envelope Attack Mod = 1 (Pressure) Handler    
EE60 2017                                                  BRA  L205

EE62 A68819                                                LDA  $19,X              Envelope Attack Mod = 2 (-KYBD) Handler     
EE65 40                                                    NEGA 
EE66 2020                                                  BRA  L206

EE68 A68819                                                LDA  $19,X              Envelope Attack Mod = 3 (KYBD) Handler     
EE6B 201B                                                  BRA  L206

EE6D A6880E                                                LDA  $E,X               Envelope Attack Mod = 4 (Velocity) Handler    
EE70 8010                                                  SUBA #$10
EE72 2005                                                  BRA  L205

EE74 8610                                                  LDA  #$10               Envelope Attack Mod = 5 (-Velocity) Handler  
EE76 A0880E                                                SUBA $E,X
EE79 48                                L205                ASLA 
EE7A 200D                                                  BRA  L207

EE7C 860A                                                  LDA  #$A                Envelope Attack Mod = 6 (Pedal 1) Handler   
EE7E 2002                                                  BRA  L208

EE80 860C                                                  LDA  #$C                Envelope Attack Mod = 7 (Pedal 2) Handler
EE82 9B62                              L208                ADDA CHAN_OFSET_2
EE84 A686                                                  LDA  A,X
EE86 2002                                                  BRA  L209

EE88 47                                L206                ASRA 
EE89 47                                L207                ASRA 
EE8A 47                                L209                ASRA 
EE8B 40                                                    NEGA 
EE8C 9B01                                                  ADDA MEM_01
EE8E 2E04                                                  BGT  L210
EE90 8601                                                  LDA  #$1
EE92 2006                                                  BRA  L211

EE94 811F                              L210                CMPA #$1F
EE96 2F02                                                  BLE  L211
EE98 861F                                                  LDA  #$1F
EE9A 48                                L211                ASLA                    Envelope Attack Mod = 0 (None) Handler
EE9B CEFAFA                                                LDU  #$FAFA
EE9E 33C6                                                  LEAU A,U                U = (base lookup table + A) - a can be up to 62 in even no.'s
EEA0 A641                                                  LDA  1,U    $1          A = 2nd value from lookup table
EEA2 3D                                                    MUL                     D = AxB = ENV Attack value
EEA3 9700                                                  STA  MEM_00
EEA5 A6C4                                                  LDA  0,U
EEA7 D602                                                  LDB  MEM_02
EEA9 3D                                                    MUL  
EEAA DB00                                                  ADDB MEM_00
EEAC 8900                                                  ADCA #$0
EEAE 39                                                    RTS  

EEAF EEFC                              ENV_DCY_M_VEC_0     FDB  $EEFC              Envelope Decay Mod = 0 (None) Vector Handler   
EEB1 EEBF                              ENV_DCY_M_VEC_1     FDB  $EEBF              Envelope Decay Mod = 1 (Pressure) Vector Handler  
EEB3 EEC5                              ENV_DCY_M_VEC_2     FDB  $EEC5              Envelope Decay Mod = 2 (-KYBD) Vector Handler   
EEB5 EECB                              ENV_DCY_M_VEC_3     FDB  $EECB              Envelope Decay Mod = 3 (KYBD) Vector Handler   
EEB7 EED0                              ENV_DCY_M_VEC_4     FDB  $EED0              Envelope Decay Mod = 4 (Velocity) Vector Handler   
EEB9 EED7                              ENV_DCY_M_VEC_5     FDB  $EED7              Envelope Decay Mod = 5 (-Velocity) Vector Handler   
EEBB EEDF                              ENV_DCY_M_VEC_6     FDB  $EEDF              Envelope Decay Mod = 6 (Pedal 1) Vector Handler      
EEBD EEE3                              ENV_DCY_M_VEC_7     FDB  $EEE3              Envelope Decay Mod = 7 (Pedal 2) Vector Handler         

EEBF A68812                                                LDA  $12,X              Envelope Decay Mod = 1 (Pressure) Handler
EEC2 40                                                    NEGA                    A = ENV Attack Mod Pressure Value
EEC3 2017                                                  BRA  L212

EEC5 A68819                                                LDA  $19,X              Envelope Decay Mod = 2 (-KYBD) Handler
EEC8 40                                                    NEGA                    A = -KYBD Value
EEC9 2020                                                  BRA  L213

EECB A68819                                                LDA  $19,X              Envelope Decay Mod = 3 (KYBD) Handler
EECE 201B                                                  BRA  L213               A = KYBD Value

EED0 A6880E                                                LDA  $E,X               Envelope Decay Mod = 4 (Velocity) Handler
EED3 8010                                                  SUBA #$10               A = Velocity Value - $10
EED5 2005                                                  BRA  L212

EED7 8610                                                  LDA  #$10               Envelope Decay Mod = 5 (-Velocity) Handler   
EED9 A0880E                                                SUBA $E,X
EEDC 48                                L212                ASLA                    A = Ax2
EEDD 200D                                                  BRA  L214

EEDF 860A                                                  LDA  #$A                Envelope Decay Mod = 6 (Pedal 1) Handler
EEE1 2002                                                  BRA  ENV_DCY_MOD_PED    A = $A

EEE3 860C                                                  LDA  #$C                Envelope Decay Mod = 7 (Pedal 2) Handler
EEE5 9B62                              ENV_DCY_MOD_PED     ADDA CHAN_OFSET_2
EEE7 A686                                                  LDA  A,X                A = Pedal +ve value
EEE9 2002                                                  BRA  L215

EEEB 47                                L213                ASRA 
EEEC 47                                L214                ASRA 
EEED 47                                L215                ASRA 
EEEE 9B00                                                  ADDA MEM_00
EEF0 2E04                                                  BGT  L216
EEF2 8601                                                  LDA  #$1
EEF4 2006                                                  BRA  L217

EEF6 811F                              L216                CMPA #$1F
EEF8 2F02                                                  BLE  L217
EEFA 861F                                                  LDA  #$1F
EEFC 9700                              L217                STA  MEM_00             Envelope Decay Mod = 0 (None) Handler
EEFE CEFB3A                                                LDU  #$FB3A
EF01 E6C6                                                  LDB  A,U
EF03 39                                                    RTS  

EF04 DD00                              L198                STD  MEM_00             Rel Fast Rate:Lookup MOD Value
EF06 A641                                                  LDA  1,U    $1          U = address of 2 Byte ENV Amplitude Value
EF08 3D                                                    MUL                     B = value from mod lookup table, A = 2nd (LSB) of ENV AMP Val.
EF09 DD02                                                  STD  MEM_02             Store partial multiplication result
EF0B 9601                                                  LDA  MEM_01             A = Lookup Mod Value
EF0D E6C4                                                  LDB  0,U                B = MSB of ENV Amplitude Value
EF0F C47F                                                  ANDB #$7F               Drop Top Bit of MSB
EF11 3D                                                    MUL                     Mult. Lookup w/ MSB of Old Env Amp. Value
EF12 DB02                                                  ADDB MEM_02
EF14 8900                                                  ADCA #$0
EF16 DD01                                                  STD  MEM_01             Now MEM_01/MEM_02 contains full mult. result
EF18 9600                                                  LDA  MEM_00             A = rel fast rate
EF1A 8110                                                  CMPA #$10               see if rel fast rate = $10
EF1C 2510                                                  BCS  REL_FAST_LT_16     branch if rel fast rate < $10
EF1E 9601                                                  LDA  MEM_01             A = 1 Byte of Mult. Value
EF20 44                                                    LSRA 
EF21 56                                                    RORB 
EF22 0603                                                  ROR  MEM_03
EF24 44                                                    LSRA 
EF25 56                                                    RORB 
EF26 0603                                                  ROR  MEM_03
EF28 44                                                    LSRA 
EF29 56                                                    RORB 
EF2A 0603                                                  ROR  MEM_03
EF2C DD01                                                  STD  MEM_01
EF2E EC41                              REL_FAST_LT_16      LDD  1,U    $1
EF30 9302                                                  SUBD MEM_02
EF32 ED41                                                  STD  1,U    $1
EF34 A6C4                                                  LDA  0,U
EF36 9201                                                  SBCA MEM_01
EF38 847F                                                  ANDA #$7F
EF3A A7C4                                                  STA  0,U
EF3C 39                                                    RTS  

EF3D CEF9FA                            SINE_HANDLER        LDU  #$F9FA             U = $F9FA = beginning addr. of data block for sines
EF40 8540                                                  BITA #$40 '@            check 3rd bit
EF42 2702                                                  BEQ  COS_SWEEP_SEL      If 3rd bit = 0, we've got a cosine (branch)
EF44 883F                                                  EORA #$3F '?
EF46 8180                              COS_SWEEP_SEL       CMPA #$80
EF48 843F                                                  ANDA #$3F '?
EF4A A6C6                                                  LDA  A,U
EF4C 2501                                                  BCS  L218
EF4E 43                                                    COMA 
EF4F 39                                L218                RTS  

EF50 0F0C                              DO_SWEEP_WAVE       CLR  SWEEP_INDEX        Length of Sweep Data = 0
EF52 EC881C                                                LDD  $1C,X
EF55 6EB823                                                JMP  [$23,Y]            Do Sweep Wave Shape Handler

EF58 EF7A                              SWEEP_VEC_00        FDB  $EF7A              Sweep Wave Shape = Sine (0)
EF5A EF78                              SWEEP_VEC_01        FDB  $EF78              Cosine (1)
EF5C EF7E                              SWEEP_VEC_02        FDB  $EF7E              Offset Sine (2)
EF5E EF85                              SWEEP_VEC_03        FDB  $EF85              Half Sine (3)
EF60 EF8C                              SWEEP_VEC_04        FDB  $EF8C              Triangle B (4)
EF62 EF94                              SWEEP_VEC_05        FDB  $EF94              Triangle A (5)
EF64 EF9E                              SWEEP_VEC_06        FDB  $EF9E              Sawtooth (6) 
EF66 EFB0                              SWEEP_VEC_07        FDB  $EFB0              Lag Square (7)
EF68 EFBF                              SWEEP_VEC_08        FDB  $EFBF              Square (8)
EF6A EFBF                              SWEEP_VEC_09        FDB  $EFBF              Pattern F (9)
EF6C EFBF                              SWEEP_VEC_10        FDB  $EFBF              Pattern E (10)
EF6E EFBF                              SWEEP_VEC_11        FDB  $EFBF              Pattern D (11)
EF70 EFBF                              SWEEP_VEC_12        FDB  $EFBF              Pattern C (12)
EF72 EFBF                              SWEEP_VEC_13        FDB  $EFBF              Pattern B (13)
EF74 EFBF                              SWEEP_VEC_14        FDB  $EFBF              Pattern A (14)
EF76 EFBE                              SWEEP_VEC_15        FDB  $EFBE              Random (15)

EF78 8B40                                                  ADDA #$40 '@            COSINE SWEEP (1)
EF7A 8DC1                                                  BSR  SINE_HANDLER       SINE SWEEP 
EF7C 2070                                                  BRA  SINE_END

EF7E 8DBD                                                  BSR  SINE_HANDLER       OFFSET SINE SWEEP (2)
EF80 47                                                    ASRA 
EF81 8B40                                                  ADDA #$40 '@
EF83 2069                                                  BRA  SINE_END

EF85 8DB6                                                  BSR  SINE_HANDLER       HALF SINE SWEEP (3)
EF87 2A65                                                  BPL  SINE_END           Do Sine handler only if +ve
EF89 4F                                                    CLRA                    else, set value to 0
EF8A 2062                                                  BRA  SINE_END

EF8C 58                                                    ASLB                    TRIANGLE B SWEEP (4) 
EF8D 49                                                    ROLA 
EF8E 285F                                                  BVC  TRIANGLE_END
EF90 43                                                    COMA                    A = 0
EF91 53                                                    COMB 
EF92 205B                                                  BRA  TRIANGLE_END

EF94 8B40                                                  ADDA #$40 '@            TRIANGLE A SWEEP (5)
EF96 58                                                    ASLB 
EF97 49                                                    ROLA 
EF98 2855                                                  BVC  TRIANGLE_END
EF9A 43                                                    COMA 
EF9B 53                                                    COMB 
EF9C 2051                                                  BRA  TRIANGLE_END

EF9E 887F                                                  EORA #$7F               SAWTOOTH SWEEP (6)
EFA0 53                                                    COMB 
EFA1 47                                                    ASRA 
EFA2 56                                                    RORB 
EFA3 DD00                                                  STD  MEM_00
EFA5 A6881E                                                LDA  $1E,X
EFA8 44                                                    LSRA 
EFA9 2402                                                  BCC  L219
EFAB 0C0C                                                  INC  SWEEP_INDEX
EFAD 6EB825                            L219                JMP  [$25,Y]            Jump to Sweep Ampl. Mod Handler 

EFB0 2B05                                                  BMI  L220               LAG SQUARE SWEEP (7)
EFB2 CC7FFF                                                LDD  #$7FFF
EFB5 2002                                                  BRA  L221

EFB7 4F                                L220                CLRA 
EFB8 5F                                                    CLRB 
EFB9 DD00                              L221                STD  MEM_00
EFBB 6EB825                                                JMP  [$25,Y]            Jump to Sweep Amplitude Mod handler

EFBE 12                                                    NOP  
EFBF A6881E                                                LDA  $1E,X              ALL OTHER SWEEPS (8-15)
EFC2 8403                                                  ANDA #$3                Look only at lower 2 bits
EFC4 260E                                                  BNE  L222               If A <> 0, branch
EFC6 EEA81F                                                LDU  $1F,Y              U = address of sweep wave data
EFC9 A68820                                                LDA  $20,X              A = current position in sweep
EFCC A6C6                                                  LDA  A,U                A = Ath element from Sweep Data Set
EFCE 5F                                                    CLRB                    B = 0
EFCF DD00                                                  STD  MEM_00             Store A & B
EFD1 6EB825                                                JMP  [$25,Y]            Jump to Sweep Amplitude Mod Handler

EFD4 970C                              L222                STA  SWEEP_INDEX        Store current position in sweep
EFD6 EEA81F                                                LDU  $1F,Y              U = address of sweep wave data
EFD9 A68820                                                LDA  $20,X              A = current position in sweep
EFDC 4C                                                    INCA                    Increment current position in sweep
EFDD A1A81E                                                CMPA $1E,Y              See if current Pos. in sweep >= max sweep length
EFE0 2501                                                  BCS  NOT_SWEEP_END      branch if we're not past length of sweep data
EFE2 4F                                                    CLRA                    A = 0 (go to beginning of sweep data)
EFE3 A78820                            NOT_SWEEP_END       STA  $20,X              Store new sweep index
EFE6 A6C6                                                  LDA  A,U                A = Ath element from sweep data set
EFE8 5F                                                    CLRB                    B = 0
EFE9 DD00                                                  STD  MEM_00             Store A & B
EFEB 6EB825                                                JMP  [$25,Y]            Jump to Sweep Amplitude Mod Handler

EFEE 5F                                SINE_END            CLRB 
EFEF 47                                TRIANGLE_END        ASRA 
EFF0 56                                                    RORB 
EFF1 DD00                                                  STD  MEM_00             Put sweep Amplitude in MEM_00 and MEM_01
EFF3 6EB825                                                JMP  [$25,Y]            Jump to Sweep Amplitude Mod Handler

EFF6 F016                              SWP_AM_VEC_00       FDB  $F016              Sweep Ampl Mod = 0 (None) Handler Vector
EFF8 F01F                              SWP_AM_VEC_01       FDB  $F01F              Sweep Ampl Mod = 1 (Pressure) Handler Vector 
EFFA F024                              SWP_AM_VEC_02       FDB  $F024              Sweep Ampl Mod = 2 (KYBD) Handler Vector 
EFFC F029                              SWP_AM_VEC_03       FDB  $F029              Sweep Ampl Mod = 3 (-KYBD) Handler Vector 
EFFE F044                              SWP_AM_VEC_04       FDB  $F044              Sweep Ampl Mod = 4 (Velocity) Handler Vector 
F000 F049                              SWP_AM_VEC_05       FDB  $F049              Sweep Ampl Mod = 5 (-Velocity) Handler Vector 
F002 F050                              SWP_AM_VEC_06       FDB  $F050              Sweep Ampl Mod = 6 (Env 1) Handler Vector 
F004 F055                              SWP_AM_VEC_07       FDB  $F055              Sweep Ampl Mod = 7 (Env 2) Handler Vector 
F006 F05C                              SWP_AM_VEC_08       FDB  $F05C              Sweep Ampl Mod = 8 (Pedal 1) Handler Vector 
F008 F060                              SWP_AM_VEC_09       FDB  $F060              Sweep Ampl Mod = 9 (Pedal 2) Handler Vector 
F00A F064                              SWP_AM_VEC_10       FDB  $F064              Sweep Ampl Mod = 10 (Lever 1) Handler Vector 
F00C F068                              SWP_AM_VEC_11       FDB  $F068              Sweep Ampl Mod = 11 (Lever 2) Handler Vector 
F00E F070                              SWP_AM_VEC_12       FDB  $F070              Sweep Ampl Mod = 12 (0.85s Delay) Handler Vector 
F010 F074                              SWP_AM_VEC_13       FDB  $F074              Sweep Ampl Mod = 13 (1.3s Delay) Handler Vector 
F012 F078                              SWP_AM_VEC_14       FDB  $F078              Sweep Ampl Mod = 14 (2.6s Delay) Handler Vector 
F014 F07C                              SWP_AM_VEC_15       FDB  $F07C              Sweep Ampl Mod = 15 (5.1s Delay) Handler Vector 

F016 DC00                                                  LDD  MEM_00             Sweep Ampl Mod = 0 (None) Handler D= Sweep Amplitude Value
F018 47                                                    ASRA 
F019 56                                                    RORB 
F01A 47                                                    ASRA 
F01B 56                                                    RORB 
F01C 7EF0AA                                                JMP  VAL_POSVE_2

F01F A68812                                                LDA  $12,X              Sweep Ampl Mod = 1 (Pressure) Handler 
F022 2069                                                  BRA  SWP_AMPL_MOD2

F024 A68819                                                LDA  $19,X              Sweep Ampl Mod = 2 (KYBD) Handler Amp Inc. w/higher note
F027 2004                                                  BRA  KYBD_S_AMPL_MOD

F029 A68819                                                LDA  $19,X              Sweep Ampl Mod = 3 (-KYBD) Handler Amp Dec. w/higher note
F02C 40                                                    NEGA 
F02D 47                                KYBD_S_AMPL_MOD     ASRA 
F02E 47                                                    ASRA 
F02F 8108                                                  CMPA #$8                Compare A & 8
F031 2D04                                                  BLT  KYBD_LT_32         If A < 8 (orignal A < 32), branch
F033 8608                                                  LDA  #$8                else, A = $8
F035 2006                                                  BRA  KYBD_VAL_OK        branch always

F037 81F8                              KYBD_LT_32          CMPA #$F8               Compare against -8
F039 2E02                                                  BGT  KYBD_VAL_OK        If A > -8, branch
F03B 86F8                                                  LDA  #$F8               else, A = -8 ($F8)
F03D CEFB82                            KYBD_VAL_OK         LDU  #$FB82             U = $FB82 = centre of lookup table for Kybd Sweep Amp. Mod
F040 A6C6                                                  LDA  A,U                A = Amp. Mod. Value from Table
F042 204A                                                  BRA  SWP_AMPL_MOD

F044 A6880E                                                LDA  $E,X               Sweep Ampl Mod = 4 (Velocity) Handler (A = Vel. Mod. Val)
F047 2044                                                  BRA  SWP_AMPL_MOD2

F049 861F                                                  LDA  #$1F               Sweep Ampl Mod = 5 (-Velocity) Handler
F04B A0880E                                                SUBA $E,X               Velocity = 31 - Vel. (velocity is normally 0 - 31)
F04E 203D                                                  BRA  SWP_AMPL_MOD2

F050 A68828                                                LDA  $28,X              Sweep Ampl Mod = 6 (Env 1) Handler (A = MSB of ENV1 Amp)
F053 2003                                                  BRA  MAKE_ENV_POSVE

F055 A68830                                                LDA  $30,X              Sweep Ampl Mod = 7 (Env 2) Handler (A = MSB of ENV2 Amp)
F058 847F                              MAKE_ENV_POSVE      ANDA #$7F               Drop top bit (ensure # is +ve)
F05A 2032                                                  BRA  SWP_AMPL_MOD

F05C 860A                                                  LDA  #$A                Sweep Ampl Mod = 8 (Pedal 1) Handler  A = $A (Pedal increase Amp)
F05E 200A                                                  BRA  L223

F060 860C                                                  LDA  #$C                Sweep Ampl Mod = 9 (Pedal 2) Handler  A = $C (Pedal dec. Amp)
F062 2006                                                  BRA  L223

F064 86D1                                                  LDA  #$D1               Sweep Ampl Mod = 10 (Lever 1) Handler A = $01
F066 2002                                                  BRA  L223

F068 86D3                                                  LDA  #$D3               Sweep Ampl Mod = 11 (Lever 2) Handler A = $D3
F06A 9B62                              L223                ADDA CHAN_OFSET_2
F06C A686                                                  LDA  A,X
F06E 201D                                                  BRA  SWP_AMPL_MOD2

F070 8606                                                  LDA  #$6                Sweep Ampl Mod = 12 (0.85s Delay) Handler 
F072 200A                                                  BRA  AMPL_MOD_DELAY

F074 8604                                                  LDA  #$4                Sweep Ampl Mod = 13 (1.3s Delay) Handler 
F076 2006                                                  BRA  AMPL_MOD_DELAY

F078 8602                                                  LDA  #$2                Sweep Ampl Mod = 14 (2.6s Delay) Handler 
F07A 2002                                                  BRA  AMPL_MOD_DELAY

F07C 8601                              LONG_MOD_DELAY      LDA  #$1                Sweep Ampl Mod = 15 (5.1s Delay) Handler
F07E AB881F                            AMPL_MOD_DELAY      ADDA $1F,X
F081 2802                                                  BVC  L224               Branch if overflow clear
F083 867F                                                  LDA  #$7F               else A = $7F
F085 A7881F                            L224                STA  $1F,X
F088 2A04                                                  BPL  SWP_AMPL_MOD       If A > 0, branch
F08A 4F                                                    CLRA                    else A = 0
F08B 2001                                                  BRA  SWP_AMPL_MOD       Branch always

F08D 48                                SWP_AMPL_MOD2       ASLA                    A = mod Value x 2
F08E 9702                              SWP_AMPL_MOD        STA  MEM_02             A = Ampl. Mod. Value from Table
F090 D601                                                  LDB  MEM_01
F092 3D                                                    MUL  
F093 9703                                                  STA  MEM_03
F095 9602                                                  LDA  MEM_02
F097 D600                                                  LDB  MEM_00
F099 3D                                                    MUL  
F09A DB03                                                  ADDB MEM_03
F09C 8900                                                  ADCA #$0
F09E 0D00                                                  TST  MEM_00
F0A0 2A02                                                  BPL  VAL_POSVE_1
F0A2 9002                                                  SUBA MEM_02
F0A4 0D02                              VAL_POSVE_1         TST  MEM_02
F0A6 2A02                                                  BPL  VAL_POSVE_2
F0A8 9300                                                  SUBD MEM_00
F0AA 0D0C                              VAL_POSVE_2         TST  SWEEP_INDEX        Load up length of Sweep Data
F0AC 2702                                                  BEQ  SWEEP_LEN_EQ0      If Sweep Data Length = 0, branch
F0AE 8880                                                  EORA #$80
F0B0 ED8821                            SWEEP_LEN_EQ0       STD  $21,X              Store New Sweep Amplitude Value
F0B3 39                                                    RTS  

F0B4 3406                              FIRQ_ADDR           PSHS B,A                A keyboard interrupt got us here - Save copy of A and B
F0B6 FC2006                                                LDD  RD_NOTE_WR_LED     RD NOTE (and vel.) - Get two byte from kybd scanning computer
F0B9 ED9F003C                                              STD  [$3C]              Store NOTE & vel to addressed stored in RAM [$003C] RAM[$003D]
F0BD D63D                                                  LDB  N_BUF_TAIL2        N_BUF_TAIL LSB
F0BF CB02                                                  ADDB #$2                Increment N_BUF_TAIL by 2 bytes
F0C1 CAE0                                                  ORB  #$E0               B ORed w/ E0 -> B (make sure address is within range of buffer)
F0C3 D73D                                                  STB  N_BUF_TAIL2        Update new tail address value
F0C5 CB02                                                  ADDB #$2                Add another two bytes to tail
F0C7 CAE0                                                  ORB  #$E0
F0C9 D13F                                                  CMPB N_BUF_HEAD2        See if next increment would cause us to wrap buffer
F0CB 2606                                                  BNE  NO_N_BUF_WRAP      If not wrap, we're OK
F0CD E662                                                  LDB  $2,S
F0CF CA40                                                  ORB  #$40 '@
F0D1 E762                                                  STB  $2,S
F0D3 3506                              NO_N_BUF_WRAP       PULS A,B                Restore Values of A and B
F0D5 3B                                                    RTI                     Return from FINT Interrupt
F0D6 B62001                            IRQ_ADDR            LDA  RD_MSCI_WR_MSCO    Handler for Chroma Port Data - Reads XOFULL XIFULL
F0D9 8880                                                  EORA #$80               Toggle Value of XIFULL (=0 means data to be read, =1 means data read)
F0DB 942F                                                  ANDA WR_MSCO_IMG        Update Image byte with new XI_FULL value
F0DD 48                                                    ASLA 
F0DE 2B24                                                  BMI  XO_MASK_EQ_1       Branch if -XO_MASK = 1 (i.e., we have data in outgoing FIFO, branch)
F0E0 2449                                                  BCC  XI_MASK_EQ_0       Branch if -XI_MASK = 0 (Chroma interrupts not serviced if = 0, exit)
F0E2 B62002                            XI_MASK_EQ_1        LDA  RD_EXTI_WR_EXTO    -XO_MASK=0 and -XI_MASK=1 (chroma int's OK and outgoing FIFO empty)
F0E5 A79F0040                                              STA  [$40]              A = Byte from Chroma Port. Store to Addr at C_IN_BUF_TAIL
F0E9 D641                                                  LDB  C_IN_BUF_TAIL2     B = C_IN_BUF_TAIL address LSB
F0EB 5C                                                    INCB                    Increment Tail of Chroma In Buffer
F0EC C43F                                                  ANDB #$3F '?            Truncate value to allowable range
F0EE D741                                                  STB  C_IN_BUF_TAIL2     Store new tail value
F0F0 5C                                                    INCB                    Increment tail again
F0F1 C43F                                                  ANDB #$3F '?            Truncate to allowable range
F0F3 0F0F                                                  CLR  C_INTF_ECHO        compare next buffer address w/head of buffer
F0F5 D143                                                  CMPB C_IN_BUF_HEAD2     If we didn't wrap, we can take more input - branch to Int handler
F0F7 26DD                                                  BNE  IRQ_ADDR
F0F9 962F                                                  LDA  WR_MSCO_IMG        A = WR_MSCO Image
F0FB 847F                                                  ANDA #$7F               Set -XI_MASK = 0 (Incoming chroma bytes to be ingored ... not ready)     
F0FD 972F                                                  STA  WR_MSCO_IMG        Update WR_MSCO Image
F0FF B72001                                                STA  RD_MSCI_WR_MSCO    Update WR_MSCO H/W Value
F102 20D2                                                  BRA  IRQ_ADDR

F104 A69F0046                          XO_MASK_EQ_1        LDA  [$46]              A = next Outgoing Chroma Port Data in FIFO
F108 B72002                                                STA  RD_EXTI_WR_EXTO    Output Chroma Port Byte
F10B D647                                                  LDB  C_OUT_BUF_HEAD2    B = LSByte of FIFO data address
F10D 5C                                                    INCB                    B = B + 1 (increment data address)
F10E CAC0                                                  ORB  #$C0               Make sure address is in proper range
F110 D747                                                  STB  C_OUT_BUF_HEAD2    Store updated FIFO DATA Address
F112 D145                                                  CMPB C_OUT_BUF_TAIL2    Compare updated Outgoing Chroma data address
F114 2609                                                  BNE  IRQ_JUMP3          If HEAD <> TAIL, buffer not empty - still data to go out
F116 962F                                                  LDA  WR_MSCO_IMG        A = WR_MSCO Image
F118 84BF                                                  ANDA #$BF               Set -XO_MASK = 0 (Outgoing Chroma FIFO is empty - don't interrupt proc)
F11A 972F                                                  STA  WR_MSCO_IMG        Update WR_MSCO Image
F11C B72001                                                STA  RD_MSCI_WR_MSCO    Update WR_MSCO H/W Value
F11F B62001                            IRQ_JUMP3           LDA  RD_MSCI_WR_MSCO    A = WR_MSCO Image
F122 8880                                                  EORA #$80               Toggle Value of -XI_MASK (=1 incoming data accepted allowed) 
F124 942F                                                  ANDA WR_MSCO_IMG        Update A w/other bits of old WR_MSCO data
F126 48                                                    ASLA                    Shift bits to the Left
F127 25B9                                                  BCS  XI_MASK_EQ_1       If Carry Set, -XI_MASK = 1 (incoming interrupts processed)
F129 2BD9                                                  BMI  XO_MASK_EQ_1       Branch if -XO_MASK = 1 (interrupts are generated, FIFO not empty)
F12B 3B                                XI_MASK_EQ_0        RTI  
F12C 1A50                              RESET_JMP           ORCC #$50 'P            Start Program - Disable IRQ (Chroma Port Ints) and FIRQ (kybd ints)
F12E 10CE02C0                                              LDS  #$2C0              Hardware Stack Ptr = S = $02C0 = addr. of chroma port out buff.
F132 860F                                                  LDA  #$F                A = $0F
F134 5F                                                    CLRB                    B = $00
F135 1F9B                                                  TFR  B,DP               B -> DP = $00 (direct page register)
F137 FD2001                                                STD  RD_MSCI_WR_MSCO    WR MSC0 mute osc, ena output, put B ($00) on chroma port
F13A 86AC                                                  LDA  #$AC               A = $AC
F13C 972F                                                  STA  WR_MSCO_IMG        Init WR_MSCO_Img - allow chroma In & kybd data, ena. osc, mute out
F13E F72004                                                STB  RD_TIME1WR_SEGS    Write $00 to WR SEGS (initialize 7-seg display data)
F141 970F                                                  STA  C_INTF_ECHO        Don't allow chroma data out (turn echo off)
F143 4F                                                    CLRA                    A = $00
F144 970B                                                  STA  PRG_UNDERWAY       RAM $000B = $00 - We're not doing program def'n
F146 970E                                                  STA  UNLCK_STATE        RAM $000E = $00 Lock Memory - disallow Port Pokes
F148 DD30                                                  STD  CONV_LEVER1        Conv Lever 1 = Conv Lever 2 = $00 (Reset Lever Values)
F14A 9734                                                  STA  FOOTSW_VALS        Reset Footswtich Values to 0 (FSW1 desasserted, FSW2 Deasserted)
F14C DD64                                                  STD  CUR_KSTACK_ADR     Reset "Current Keystack Address"
F14E DD66                                                  STD  LST_KSTACK_ADR     RAM $0066 = $00, RAM $0067 = $00
F150 DD09                                                  STD  C_INTF_PANL        Disable Chroma Panel and Performance Interfaces
F152 9708                                                  STA  C_INTF_PRES        Disable Chroma Pressure Interface
F154 F62001                                                LDB  RD_MSCI_WR_MSCO    B = MISC I/O B = -XIFULL, -XOFULL, -LOCK, SEQ, -TRDY, MOTIN, SUST, EFF
F157 D72E                                                  STB  RD_MSCI_IMG        Update MSCI_Img based on H/W value
F159 9737                                                  STA  L73                RAM $0037 = A = $00
F15B FC1FF4                                                LDD  WR_TAP_ADDR        D = Val from CMOS RAM ($1FF4 and $1FF5)
F15E 1083FFFF                                              CMPD #$FFFF             See if D = $FFFF (i.e., see if tapper was turned off)
F162 2706                                                  BEQ  TAP_WAS_OFF        Tapper was off, branch
F164 CC200F                                                LDD  #$200F             Else, tapper on, D=data address to write to fire tapper
F167 FD1FF4                                                STD  WR_TAP_ADDR        Store tapper handler addr.
F16A CC00E0                            TAP_WAS_OFF         LDD  #$E0               D = $00E0
F16D DD3C                                                  STD  N_BUF_TAIL1        Init CUR_NOTE and CUR_VEL buffer tail
F16F DD3E                                                  STD  N_BUF_HEAD1        set head = tail
F171 CC0100                                                LDD  #$100              D = $0100
F174 DD40                                                  STD  C_IN_BUF_TAIL1     RAM $0040 = $01, RAM $0041 = $00 Chroma Input Buffer Tail
F176 DD42                                                  STD  C_IN_BUF_HEAD1     RAM $0042 = $01, RAM $0043 = $00 Chroma Input Buffer Head (Head = Tail)
F178 CC02C0                                                LDD  #$2C0              D = $02C0
F17B DD44                                                  STD  C_OUT_BUF_TAIL1    RAM $0044 = $02, RAM $0045 = $C0 Chroma Output Buffer
F17D DD46                                                  STD  C_OUT_BUF_HEAD1    RAM $0046 = $02, RAM $0047 = $C0 Chroma Output Buffer
F17F CCCE07                                                LDD  #$CE07             D = $CE07
F182 DD50                                                  STD  CI_HNDLR_B1        RAM $0050 = $CE, RAM $0051 = $07 Addr of Chroma Input hndlr
F184 8E001A                                                LDX  #$1A               X = $001A = base memory address of lever, pedal & slider ADC vals
F187 8605                                                  LDA  #$5                A = $05 = counter for # of ADC values
F189 B72000                            ADC_INPUT           STA  RD_ADCI_WR_ADCO    Value of "A" choses ADC input
F18C B72000                                                STA  RD_ADCI_WR_ADCO    ADC value chosen by "A" placed on data bus - select ADC val twice
F18F C63C                                                  LDB  #$3C '<            B = $3C = 60
F191 5A                                LOOP60              DECB                    B = B - 1
F192 26FD                                                  BNE  LOOP60             If B <> 0, jump (loop 60 times) - wait for ADC to settle
F194 F62008                                                LDB  RD_EOC_WR_SYND     B = B7-B0 -> B7 = -EOC
F197 2AF0                                                  BPL  ADC_INPUT          If B > 0 (A-D Conversion Bad), jump (redo conversion)
F199 F62000                                                LDB  RD_ADCI_WR_ADCO    else, B = ADC value
F19C C002                                                  SUBB #$2                B = B - 2
F19E 2403                                                  BCC  ADC_NE_0           If carry not set (B>0), jump
F1A0 5F                                                    CLRB                    Else, B = $00
F1A1 2406                                                  BCC  STORE_ADC_VAL      Branch Always (B = $00)
F1A3 C1FB                              ADC_NE_0            CMPB #$FB               B = $FB ?
F1A5 2302                                                  BLS  STORE_ADC_VAL      Branch if lower or same
F1A7 C6FB                                                  LDB  #$FB               B = $FB (max value)
F1A9 E786                              STORE_ADC_VAL       STB  A,X                B -> RAM[A+X], Store 0<=VAL<=$FB ADC Value to Memory
F1AB 4A                                                    DECA                    A = A - 1  Choose Next ADC Input
F1AC 2ADB                                                  BPL  ADC_INPUT          If not finished all input (N <> -1), get next one (branch)
F1AE D61C                                                  LDB  TUNE_POT_ADC       B = Tune ADC Value (0<=B<=$FB)
F1B0 C880                                                  EORB #$80               Toggle top bit
F1B2 1D                                                    SEX                     Move sign bit to A
F1B3 58                                                    ASLB                    Shift bits in B (mult. value by 2)
F1B4 DD48                                                  STD  MASTER_TUNE1       2 Byte # from -256 to 246
F1B6 961D                                                  LDA  MAIN_POT_ADC       A = Tune Value
F1B8 972D                                                  STA  CONV_MAIN_POT      Store Tune to RAM $002D
F1BA 961E                                                  LDA  PEDAL1_ADC         A = Pedal 1 Value
F1BC C605                                                  LDB  #$5                B = 5
F1BE 3D                                                    MUL                     D = Ax5
F1BF 9B1E                                                  ADDA PEDAL1_ADC         A = Pedal ADC Value to MSB of D
F1C1 9732                                                  STA  CONV_PEDAL1        Convert 0->$FB to 0 to 255 Value
F1C3 961F                                                  LDA  PEDAL2_ADC         A = RAM $001F (Pedal 2 Val)
F1C5 C605                                                  LDB  #$5                B = $5
F1C7 3D                                                    MUL                     D = A*B
F1C8 9B1E                                                  ADDA PEDAL1_ADC         ERROR?  ERROR?  SHOULD THIS BE PEDAL2?
F1CA 9733                                                  STA  CONV_PEDAL2        RAM $0033 = A (Converted Lever 1 Value)
F1CC 961A                                                  LDA  LEVER1_ADC         A = Lever 1 Value
F1CE 8E004A                                                LDX  #$4A               X = $4A
F1D1 BDF30C                                                JSR  CENTER_LEVER       Jump to Decode Subroutine for Lever 1
F1D4 961B                                                  LDA  LEVER2_ADC         A = RAM $001B = Lever 2 Value
F1D6 8E004D                                                LDX  #$4D               X = $4D
F1D9 BDF30C                                                JSR  CENTER_LEVER       Go Convert Lever 2 Value
F1DC CE1400                                                LDU  #$1400             U = $1400 = base addr. of Prog 0.
F1DF 5F                                                    CLRB                    B = $00
F1E0 BDDDA3                            FIX_PROG            JSR  PARAM_FIX          Do subroutine -correct kybd_split, seq_no, main&link trans, link...
F1E3 33C83B                                                LEAU 59,U               U = address of Program # B (B starts off at 0)
F1E6 5C                                                    INCB                    B = B + 1 
F1E7 C132                                                  CMPB #$32 '2            At 50th Program ?
F1E9 23F5                                                  BLS  FIX_PROG           If not done with all 50 Programs, go correct values
F1EB B61FF2                                                LDA  CURR_PROG_NUM      A = Current Program # (the one on the display)
F1EE 2704                                                  BEQ  CURR_PROG_0        If Curr. Prog. = 0, jump and set to 1
F1F0 8132                                                  CMPA #$32 '2            Is A <= 50? If so, ok
F1F2 2305                                                  BLS  CURR_PROG_OK       Curr. Prog. Number OK, branch
F1F4 8601                              CURR_PROG_0         LDA  #$1                Else in error, reset to $01
F1F6 B71FF2                                                STA  CURR_PROG_NUM      Store Correct Current Prog.
F1F9 8680                              CURR_PROG_OK        LDA  #$80               A = $80
F1FB B71FF3                                                STA  PROG_MOD_FLAG      RAM[1FF3] = $80 - Set Prog. modified flag (only 1st bit sig)
F1FE B61FF6                                                LDA  COPY_MODE          A = stored/last "copy mode"
F201 44                                                    LSRA                    A = A / 2
F202 2504                                                  BCS  FIX_COPY_MODE      If carry set, error in val (i.e., value was odd - not possible)
F204 8103                                                  CMPA #$3                See if copy Mode <= 3 (i.e., see if we have a valid code)
F206 2305                                                  BLS  COPY_MODE_OK       if A <= 3 (ok - branch), else, error
F208 8604                              FIX_COPY_MODE       LDA  #$4                else, A = copy B mode (default)
F20A B71FF6                            STORE_COPY_MODE     STA  COPY_MODE          update stored copy mode
F20D B61FF7                            COPY_MODE_OK        LDA  PNL_KEY_CODE       A = panel_key_code
F210 44                                                    LSRA                    A = A / 2
F211 2504                                                  BCS  FIX_KEY_CODE       If carry set, we have a bad key_code - fix (i.e., value odd)
F213 8109                                                  CMPA #$9                See if orig. val was $12 or less (i.e., valid value)
F215 2303                                                  BLS  KEY_CODE_OK        If A <= 9 we're not too high, val OK
F217 7F1FF7                            FIX_KEY_CODE        CLR  PNL_KEY_CODE       Else key code = 0
F21A B61FF8                            KEY_CODE_OK         LDA  CUR_PNL_PROG       A = Current PNL "link" prog.
F21D 8132                                                  CMPA #$32 '2            A = 50?
F21F 2305                                                  BLS  PANL_PROG_OK       If A <= 50, branch
F221 8601                                                  LDA  #$1                Else error, A = 1 (Reset PNL link Prog)
F223 B71FF8                                                STA  CUR_PNL_PROG       Store corrected value
F226 B61FF9                            PANL_PROG_OK        LDA  PREV_SPLIT         A = Prev. Split Val.
F229 48                                                    ASLA                    A = A x 2
F22A 2903                                                  BVS  FIX_PREV_SPLT      If Overflow is set, prev. split val is invalid
F22C 48                                                    ASLA                    A = Ax2
F22D 2803                                                  BVC  PREV_SPLT_OK       If Overflow still clear, then PREV_SPLIT_VALUE was OK
F22F 7F1FF9                            FIX_PREV_SPLT       CLR  PREV_SPLIT         Reset previous split to 0
F232 FC1FFC                            PREV_SPLT_OK        LDD  ATTACK_THRES       D = val of attack threshhold (and release)
F235 841F                                                  ANDA #$1F               A = attack threshhold (confine to 0<=X<=31)
F237 C41F                                                  ANDB #$1F               B = release threshhold (confine to 0<=X<=31)
F239 FD1FFC                                                STD  ATTACK_THRES       Store cleaned up attack/release threshhold values
F23C FC1FFE                                                LDD  REL_SLOW_RATE      D = val of slow/fast release
F23F 841F                                                  ANDA #$1F               A = Slow release val (confine to 0<=X<=31)
F241 C41F                                                  ANDB #$1F               B = Fast release val (confine to 0<=X<=31)
F243 FD1FFE                                                STD  REL_SLOW_RATE      Store cleaned up slow/fast release values
F246 CE0FFC                                                LDU  #$FFC              u = $0FFC = address of 2nd last work in volatile mem
F249 EF5E                              FILL_VOL_RAM        STU  -2,U    $1E        U -> RAM[$0FFA]
F24B 335C                                                  LEAU -4,U    $1C        U = $0FF8
F24D 11830C54                                              CMPU #$C54              Fill memory back to $0C54 ($0C52 = last entry)
F251 24F6                                                  BCC  FILL_VOL_RAM       Loop 468 times
F253 DF3A                                                  STU  NXT_KSTACK_ADR     Set/Reset "next" keystack address to bot. of avail. vol. ram stack
F255 CE0000                                                LDU  #$0                U = 0
F258 FF0FFE                                                STU  VOL_RAM_END        RAM[0FFE] = $00, RAM[0FFF] = $00 (End of Vol_ram)
F25B 8E0657                                                LDX  #$657              X = $0657 = Base address of channel # 15
F25E 860F                                                  LDA  #$F                A = $0F (dec. 15) = number of channels
F260 8D7E                              INIT_BOARD_N        BSR  CHANNEL_INIT       Initialize certain channel params.
F262 3088C7                                                LEAX $C7,X              X = base address of next previous channel
F265 4A                                                    DECA                    A = A - 1 (decrement channel #)
F266 8D78                                                  BSR  CHANNEL_INIT       Init Even Channel
F268 EF04                                                  STU  $4,X               Store address of "next" board assigned to inst
F26A 3384                                                  LEAU 0,X                Address of previous board
F26C 3088C7                                                LEAX $C7,X              subtract - got to next previous (odd) board)
F26F 4A                                                    DECA                    A = A - 1 (decrement channel #)
F270 2AEE                                                  BPL  INIT_BOARD_N       Loop 8 Times (loop until all 16 channels init'ed)
F272 DF38                                                  STU  LNK_INST_ADR       U = $0339 (2nd last channel)
F274 108E0690                                              LDY  #$690              Y = $0690 = Base address for Inst 0
F278 4F                                INIT_INTR_N         CLRA                    A = $00
F279 5F                                                    CLRB                    B = $00
F27A EDA4                                                  STD  0,Y                Reset "Next/Current Channel Address" for Inst 
F27C ED22                                                  STD  $2,Y               Reset "Note/Sequencer" Address for Instrument
F27E ED24                                                  STD  $4,Y               Reset "Base Board" Address for Instrument 
F280 ED26                                                  STD  $6,Y               Reset address of program defining this instrument 
F282 CCC100                                                LDD  #$C100             D = $C100
F285 EDA862                                                STD  $62,Y              RAM[06F2] = $C100
F288 31A900B8                                              LEAY 184,Y              Y = $0748 = Base address of next instrument
F28C 108C0B98                                              CMPY #$B98              Y = $0B98 (see if we're at last instrument)
F290 23E6                                                  BLS  INIT_INTR_N        Loop 8 times (if more instruments)
F292 DD6A                                                  STD  MJR_LOOP_H1        RAM[006A] = $C100 - Major Loop Hook
F294 DD6C                                                  STD  MIN_LOOP_H1        RAM[006C] = $C100 - Minor Loop Hook
F296 108E0690                                              LDY  #$690              Y = $0690 = Base address of instrument 0
F29A CE1400                                                LDU  #$1400             U = $1400 (start of prog. 0)
F29D EF26                                                  STU  $6,Y               RAM[0696] = $14, RAM[0697] = $00 Assign Inst. 0 to Prog 0
F29F BDD960                                                JSR  INVOKE_PROG        Invoke/exercise all prog settings (A&B) for inst Y (def main inst)
F2A2 BDD9CC                                                JSR  FINISH_PROG_DEF    Done prg invoke - set volumes & copy lvr/pedal/fsw vals from mem.
F2A5 B61400                                                LDA  P0_LINK_VALS       A = Link Vals
F2A8 85C0                                                  BITA #$C0               Check Link Type
F2AA 2713                                                  BEQ  NO_LINK            If no link, branch
F2AC 31A900B8                                              LEAY 184,Y              Y = $0748 = address of instr. 1 (link instrument)
F2B0 843F                                                  ANDA #$3F '?            A = Link program number
F2B2 C63B                                                  LDB  #$3B ';            B = $3B (number of bytes per prog.)
F2B4 3D                                                    MUL                     D = offset to start of link program
F2B5 33CB                                                  LEAU D,U                U = base address of link program
F2B7 EF26                                                  STU  $6,Y               Store adr. of Link prog to link instr. def'n
F2B9 BDD960                                                JSR  INVOKE_PROG        Invoke Link Prog.
F2BC BDD9CC                                                JSR  FINISH_PROG_DEF    copy lever/pedal/fsw vals to link inst. def'n
F2BF FC1FF2                            NO_LINK             LDD  CURR_PROG_NUM      D = RAM[$1FF2] = Curr. Prog. Number
F2C2 BDDE04                                                JSR  OUTPUT_BIG_PROG    Show Current Prog. #
F2C5 B6141E                                                LDA  P0_PANEL_EDIT      A = Panel Edit Settings
F2C8 BDE85B                                                JSR  PARAM_EDIT         Check, update & display panel settings & small LED vals
F2CB 4F                                                    CLRA                    A = $00
F2CC 5F                                                    CLRB                    B = $00
F2CD FD2006                                                STD  RD_NOTE_WR_LED     Turn all LEDs off
F2D0 B70140                                                STA  CASS_BUF_B0        A = cassette buffer byte 1 (init value)
F2D3 9707                                                  STA  RESET_VAL          RAM[0007] = $00 
F2D5 BDFC6E                                                JSR  DO_SPCL_RESET      Do reset w/reset val of 0
F2D8 DC2A                                                  LDD  LED_IMAGE1         D = Val @ RAM[002A] = LED Image Byte 1 & 2
F2DA FD2006                                                STD  RD_NOTE_WR_LED     WR LEDS with D value from $002A - Flash all LEDs 
F2DD 7ED28F                                                JMP  TUNE_AND_MORE      Do tuning and con't

F2E0 3406                              CHANNEL_INIT        PSHS B,A                Save a copy of B & A (A = Channel #)
F2E2 A707                                                  STA  $7,X               Store channel to channel at X
F2E4 4F                                                    CLRA                    A = $00
F2E5 5F                                                    CLRB                    B = $00
F2E6 ED02                                                  STD  $2,X               RAM[0659] = $00, RAM[065A] = $00 - Addr. of defining Inst.
F2E8 ED8828                                                STD  $28,X              RAM[067F] = $00, RAM[0680] = $00 - ENV 1 Amp. Val
F2EB ED8830                                                STD  $30,X              RAM[0687] = $00, RAM[0688] = $00 - ENV 2 Amp. Val
F2EE ED882E                                                STD  $2E,X              RAM[0685] = $00, RAM[0686] = $00 - ENV 2 Attack Value?
F2F1 ED8816                                                STD  $16,X              RAM[066D] = $00, RAM[066E] = $00
F2F4 ED8818                                                STD  $18,X              RAM[066F] = $00, RAM[0670] = $00
F2F7 43                                                    COMA                    A = $FF 
F2F8 A706                                                  STA  $6,X               Indicate that channel should not be playing/sounding
F2FA 8680                                                  LDA  #$80               A = $80
F2FC A708                                                  STA  $8,X               RAM[065F] = $80 - Note Played by this Inst.
F2FE CCED56                                                LDD  #$ED56             D = $ED56
F301 ED8824                                                STD  $24,X              RAM[067B] = $ED, RAM[067C] = $56 Default Hnldr for ENV 1 REL
F304 CCEE11                                                LDD  #$EE11             D = $EE11
F307 ED882C                                                STD  $2C,X              RAM[0683] = $EE, RAM[0684] = $11 Default Hndlr for ENV 2 REL
F30A 3586                                                  PULS A,B,PC             Restore A & B and Return

F30C 8163                              CENTER_LEVER        CMPA #$63 'c            Is A > $63 ? (lower limit of centre range)
F30E 2404                                                  BCC  A_GTE_63           If not below lower limit, jump centre range
F310 8663                                                  LDA  #$63 'c            else, we were below lower limit - set "lever zero" to $63 
F312 2006                                                  BRA  A_GT62_LT9B        Jump always 

F314 819A                              A_GTE_63            CMPA #$9A               We're here is A was greater than $63, see if A <= $9A
F316 2302                                                  BLS  A_GT62_LT9B        Jump if A <= $9A
F318 869A                                                  LDA  #$9A               Otherwise over high limit of centre range
F31A A784                              A_GT62_LT9B         STA  0,X                Store centre value to RAM (as appropriate)
F31C 8023                                                  SUBA #$23 '#            A = Centre - $23 "Lower Bound"
F31E 8D0B                                                  BSR  LEVER_DCD_2
F320 E701                                                  STB  $1,X
F322 86DA                                                  LDA  #$DA
F324 A084                                                  SUBA 0,X                A = "Upper Bound" ($3F over centre)
F326 8D03                                                  BSR  LEVER_DCD_2
F328 E702                                                  STB  $2,X
F32A 39                                                    RTS                     Return from Subroutine

F32B C608                              LEVER_DCD_2         LDB  #$8                B = $8
F32D DD00                                                  STD  MEM_00             Store A & B to MEM_00 and MEM_01
F32F CC3FFF                                                LDD  #$3FFF             D = $3FFF
F332 58                                DCD_LOOP_8          ASLB                    Shift in zero from the right
F333 49                                                    ROLA                    Shift in "carry"
F334 9100                                                  CMPA MEM_00
F336 2503                                                  BCS  L225               Branch if A < MEM_00
F338 9000                                                  SUBA MEM_00             Else, A> MEM_00, A = A - MEM_00
F33A 5C                                                    INCB                    B = B + 1
F33B 0A01                              L225                DEC  MEM_01             MEM_01 starts at $08
F33D 26F3                                                  BNE  DCD_LOOP_8
F33F 39                                                    RTS  

F340 CBC0                              L_PNL_SW_VEC_1      FDB  $CBC0              "Load One" Button Pushed
F342 F398                              L_PNL_SW_VEC_2      FDB  $F398              "Main Transpose Down" Button Pushed
F344 F36A                              L_PNL_SW_VEC_3      FDB  $F36A              "No Link" Button Pushed
F346 CC40                              L_PNL_SW_VEC_4      FDB  $CC40              "Load All" Button Pushed
F348 F3A1                              L_PNL_SW_VEC_5      FDB  $F3A1              "Main Transpose Up" Button Pushed
F34A F36F                              L_PNL_SW_VEC_6      FDB  $F36F              "Link Lower" Button Pushed
F34C CB48                              L_PNL_SW_VEC_7      FDB  $CB48              "Save One" Button Pushed
F34E F3AA                              L_PNL_SW_VEC_8      FDB  $F3AA              "Link Transpose Down" Button Pushed
F350 F3F8                              L_PNL_SW_VEC_9      FDB  $F3F8              "Link Unison" Button Pushed
F352 CB6D                              L_PNL_SW_VEC_10     FDB  $CB6D              "Save All" Button Pushed
F354 F3B3                              L_PNL_SW_VEC_11     FDB  $F3B3              "Link Transpose Up" Button Pushed
F356 F377                              L_PNL_SW_VEC_12     FDB  $F377              "Link Upper" Button Pushed
F358 F436                              L_PNL_SW_VEC_13     FDB  $F436              "Auto Tune" Button Pushed
F35A F46A                              L_PNL_SW_VEC_14     FDB  $F46A              "Set Split" Button Pushed
F35C F49C                              L_PNL_SW_VEC_15     FDB  $F49C              "Store" Button Pushed
F35E F4BD                              L_PNL_SW_VEC_16     FDB  $F4BD              "Edit A" Button Pushed
F360 F4CB                              L_PNL_SW_VEC_17     FDB  $F4CB              "Edit B" Button Pushed
F362 F506                              L_PNL_SW_VEC_18     FDB  $F506              "Param Select" Button Pushed
F364 F509                              L_PNL_SW_VEC_19     FDB  $F509              "Prog. Select" Button Pushed
F366 F4F1                              L_PNL_SW_VEC_20     FDB  $F4F1              "Copy B" Button Pushed
F368 F4E6                              L_PNL_SW_VEC_21     FDB  $F4E6              "Copy A" Button Pushed

F36A 8600                                                  LDA  #$0                "NO LINK" A = 0
F36C 275C                                                  BEQ  NO_LNK             IF A = 0, Branch
F36E 39                                                    RTS  

F36F 8600                                                  LDA  #$0                "LINK LOWER" A = 0
F371 1027007E                                              LBEQ LNK_LOWER          If A = 0, Branch
F375 2053                                                  BRA  NO_LNK

F377 8600                                                  LDA  #$0                "LINK UPPER" A = 0
F379 10270080                                              LBEQ LNK_UPPER          If A = 0, Branch
F37D 39                                                    RTS  

F37E F535                              PNL_MODE_VEC_1      FDB  $F535              Copy Mode 0 - PARAM SEL
F380 F5EA                              PNL_MODE_VEC_2      FDB  $F5EA              Copy Mode 2 - COPY A MODE
F382 F5E4                              PNL_MODE_VEC_3      FDB  $F5E4              Copy Mode 4 - COPY B MODE
F384 F61F                              PNL_MODE_VEC_4      FDB  $F61F              Copy Cassette Program to Program 0 ??
F386 F68B                              FLASH_KEY_VEC_1     FDB  $F68B              [NO LINK][n]
F388 F6F3                              FLASH_KEY_VEC_2     FDB  $F6F3              [LINK LOWER][n]
F38A F6F7                              FLASH_KEY_VEC_3     FDB  $F6F7              [LINK UNISON][n]
F38C F6FB                              FLASH_KEY_VEC_4     FDB  $F6FB              [LINK UPPER][n]
F38E F710                              FLASH_KEY_VEC_5     FDB  $F710              [STORE][n]
F390 F7B1                              FLASH_KEY_VEC_6     FDB  $F7B1              [SET SPLIT][n]
F392 F9BC                              FLASH_KEY_VEC_7     FDB  $F9BC              [COPY A][n]
F394 F9C0                              FLASH_KEY_VEC_8     FDB  $F9C0              [COPY B][n]
F396 F9D8                              FLASH_KEY_VEC_9     FDB  $F9D8              [SEQ][n]

F398 B61401                                                LDA  P0_TRNSPOSE        "MAIN TRANSPOSE DOWN"
F39B 8440                                                  ANDA #$40 '@
F39D 8A80                                                  ORA  #$80
F39F 2019                                                  BRA  STORE_TRANSPOSE

F3A1 B61401                                                LDA  P0_TRNSPOSE        "MAIN TRANSPOSE UP"
F3A4 8480                                                  ANDA #$80
F3A6 8A40                                                  ORA  #$40 '@
F3A8 2010                                                  BRA  STORE_TRANSPOSE

F3AA B61401                                                LDA  P0_TRNSPOSE        "LINK TRANSPOSE DOWN"
F3AD 8410                                                  ANDA #$10
F3AF 8A20                                                  ORA  #$20
F3B1 2007                                                  BRA  STORE_TRANSPOSE

F3B3 B61401                                                LDA  P0_TRNSPOSE        "LINK TRANSPOSE UP"
F3B6 8420                                                  ANDA #$20
F3B8 8A10                                                  ORA  #$10
F3BA B81401                            STORE_TRANSPOSE     EORA P0_TRNSPOSE
F3BD B71401                                                STA  P0_TRNSPOSE
F3C0 A79F1FF4                                              STA  [$1FF4]            Fire Tapper
F3C4 BDDDF7                                                JSR  PROG_MODIFIED
F3C7 7EDE98                                                JMP  PNT_PANL

F3CA A79F1FF4                          NO_LNK              STA  [$1FF4]            Fire Tapper
F3CE 8602                                                  LDA  #$2                A = $02 (NO LINK Panel Code)
F3D0 B11FF7                                                CMPA PNL_KEY_CODE       Was "No Link" pushed last time?
F3D3 2618                                                  BNE  FIRST_NO_LNK       Branch if "No Link" not pushed before (don't clear link mode)
F3D5 7F1FF7                                                CLR  PNL_KEY_CODE       Else yes, clear link mode - Panel Code = 0 - nothing outstanding
F3D8 B61400                                                LDA  P0_LINK_VALS       A = Link Type|Link Program
F3DB 85C0                                                  BITA #$C0               Pull off link type info
F3DD 2711                                                  BEQ  ALRDY_NO_LNK       Branch if LINK TYPE = NO LINK
F3DF 843F                                                  ANDA #$3F '?            else, we had a link, set link type to "none"
F3E1 B71400                                                STA  P0_LINK_VALS       Put link back with "no link" value
F3E4 BDF779                                                JSR  UNDEF_LNK_INST     Undefine Instrument
F3E7 BDF5C8                                                JSR  RESTORE_LNK
F3EA 7EF5D4                                                JMP  C_INST_0_VOL       Send Undefine Data out chroma port

F3ED B71FF7                            FIRST_NO_LNK        STA  PNL_KEY_CODE       A = 02 (store panel code)
F3F0 7EDE98                            ALRDY_NO_LNK        JMP  PNT_PANL

F3F3 CC8004                            LNK_LOWER           LDD  #$8004             D = $8004, A=$80, B=$04
F3F6 2008                                                  BRA  LNK_WORK

F3F8 CCC006                                                LDD  #$C006             "LINK UNISON" D = $C006, A=$C0, B=$06
F3FB 2003                                                  BRA  LNK_WORK

F3FD CC4008                            LNK_UPPER           LDD  #$4008             D = $4008, A=$40, B=$08
F400 A79F1FF4                          LNK_WORK            STA  [$1FF4]            Fire Tapper
F404 F11FF7                                                CMPA PNL_KEY_CODE       Compare A w/Last Panel Key pressed
F407 2715                                                  BEQ  LNK_SAME           Branch if it is the same
F409 F71FF7                                                STB  PNL_KEY_CODE       Else, first time LINK button pressed - store new Panel Command
F40C B6141E                                                LDA  P0_PANEL_EDIT      A = Panel Edit Vals
F40F 843F                                                  ANDA #$3F '?            Pick off Link Program Value
F411 27DD                                                  BEQ  ALRDY_NO_LNK       If Stored Prog. = "0", branch
F413 B71FF8                                                STA  CUR_PNL_PROG       Else, put link program val in CUR_PNL_PROG
F416 B6141E                                                LDA  P0_PANEL_EDIT      A = Panel Edit Vals
F419 84C0                                                  ANDA #$C0               Pick out original LINK mode values
F41B 7EF5A4                                                JMP  REFIX_PROG0

F41E 7F1FF7                            LNK_SAME            CLR  PNL_KEY_CODE       Reset Panel Key Code
F421 9700                                                  STA  MEM_00             A = Panel Key Code -> RAM[$0000]
F423 B61400                                                LDA  P0_LINK_VALS       A = Link Type | Link Prog
F426 843F                                                  ANDA #$3F '?            Clear Link Mode
F428 9A00                                                  ORA  MEM_00             Set Link mode to same prog, different mode
F42A B71400                                                STA  P0_LINK_VALS       Update new link mode in Prog. 0
F42D BDF789                                                JSR  START_LINK_PRG     Set up boards for Link Prog.
F430 BDF5C8                                                JSR  RESTORE_LNK        Restore Link program per "Link Type"
F433 7EF5D4                                                JMP  C_INST_0_VOL       Output Instrument 0 volume settings.

F436 A79F1FF4                                              STA  [$1FF4]            "AUTO TUNE" - Fire Tapper
F43A BDDE98                                                JSR  PNT_PANL
F43D 0F07                                                  CLR  RESET_VAL          Reset val = 0
F43F 860B                              SPCL_RESET          LDA  #$B                A = $B (0000 1011)
F441 B72001                                                STA  RD_MSCI_WR_MSCO    ignore incoming chroma port data, don't service chroma out
F444 7F2004                                                CLR  RD_TIME1WR_SEGS    Clear 7 seg. display data
F447 7F2006                                                CLR  RD_NOTE_WR_LED     Turn off all non-blinking LEDs
F44A 7F2007                                                CLR  RD_VEL_WR_LEDS1    Turn off all blinking LEDs
F44D 108E0690                                              LDY  #$690              Y = start address of instruments
F451 EE26                              UNDEF_PROG          LDU  $6,Y               U = address of program defining instrument
F453 2705                                                  BEQ  NO_DEF_INST
F455 BDD994                                                JSR  INIT_BRD_4_INST    If there is a defining program, branch
F458 EF26                                                  STU  $6,Y
F45A 31A900B8                          NO_DEF_INST         LEAY 184,Y              Get next instrument
F45E 108C0B98                                              CMPY #$B98              See if we're at the end of the instruments
F462 23ED                                                  BLS  UNDEF_PROG         If not, continue (branch)
F464 BDFC6E                                                JSR  DO_SPCL_RESET
F467 7EDF32                                                JMP  PAINT_LEDS

F46A A79F1FF4                                              STA  [$1FF4]            "SET SPLIT" - Fire Tapper
F46E B61FF7                                                LDA  PNL_KEY_CODE       A = RAM[1FF7]
F471 810C                                                  CMPA #$C                Compare A and 12
F473 260F                                                  BNE  SPLIT_ONCE         If we haven't pressed this key before, branch
F475 7F1FF7                                                CLR  PNL_KEY_CODE       Else, we hit this key twice, Store 0 to Panel Key Code
F478 B61FF9                                                LDA  PREV_SPLIT         A = Value of previous split
F47B B71420                                                STA  P0_KBRD_SPLT       Store default/old keyboard split
F47E BDDDF7                                                JSR  PROG_MODIFIED      We've modified the program - signify that
F481 7EDE98                                                JMP  PNT_PANL           Update panel values

F484 860C                              SPLIT_ONCE          LDA  #$C
F486 B71FF7                                                STA  PNL_KEY_CODE       Put "Split" code in key code buffer
F489 CC5B67                                                LDD  #$5B67             D = LED Value = 'SP'
F48C DD20                                                  STD  LED_DIG0           LED_DIG_0 = 'S', LED_DIG_1 = 'P'
F48E CC0E00                                                LDD  #$E00              D = LED Value = 'L{blank}'
F491 DD22                                                  STD  LED_DIG2           LED_DIG_2 = 'L', LED_DIG_3 = {blank}
F493 B61420                                                LDA  P0_KBRD_SPLT       A = Keyboard Split Value
F496 BDDE2A                                                JSR  DISP_PARAM_VAL     Show current split value
F499 7EDF32                                                JMP  PAINT_LEDS         Flash LEDs as appropriate

F49C B61FF7                                                LDA  PNL_KEY_CODE       "STORE" RAM[1FF7] -> A 
F49F 810A                                                  CMPA #$A                Compare A and 10
F4A1 2714                                                  BEQ  STORE_STORE_1      If A = 10, branch (i.e., last was a store)
F4A3 B62001                                                LDA  RD_MSCI_WR_MSCO    A = Misc I/O Byte
F4A6 8420                                                  ANDA #$20               A = Value of "-LOCK"
F4A8 2601                                                  BNE  STORE_UNLCKD       If memory not locked, branch
F4AA 39                                                    RTS  

F4AB A79F1FF4                          STORE_UNLCKD        STA  [$1FF4]            Fire Tapper
F4AF 860A                                                  LDA  #$A                A = $A (10)
F4B1 B71FF7                                                STA  PNL_KEY_CODE
F4B4 7EDE98                                                JMP  PNT_PANL

F4B7 B61FF2                            STORE_STORE_1       LDA  CURR_PROG_NUM      Store current program in location shown in program # display
F4BA 7EF710                                                JMP  STORE_STORE_2

F4BD 9615                                                  LDA  NOT_STB5           "EDIT A"
F4BF 48                                                    ASLA                    A = A x 2
F4C0 2A18                                                  BPL  EDIT_BOTH
F4C2 B6141E                                                LDA  P0_PANEL_EDIT      A = Panel Settings
F4C5 843F                                                  ANDA #$3F '?            A = Program being edited
F4C7 8A80                                                  ORA  #$80               A = Program edited plus "Edit A"
F4C9 2014                                                  BRA  L226

F4CB 9615                                                  LDA  NOT_STB5           "EDIT B"
F4CD 8420                                                  ANDA #$20
F4CF 2709                                                  BEQ  EDIT_BOTH
F4D1 B6141E                                                LDA  P0_PANEL_EDIT      A = Panel Settings
F4D4 843F                                                  ANDA #$3F '?            A = Program being edited
F4D6 8A40                                                  ORA  #$40 '@            A = Program edited plus "Edit B"
F4D8 2005                                                  BRA  L226

F4DA B6141E                            EDIT_BOTH           LDA  P0_PANEL_EDIT      A = Panel Settings
F4DD 8AC0                                                  ORA  #$C0               A = Program edited plus "Edit Both"
F4DF A79F1FF4                          L226                STA  [$1FF4]            Fire Tapper
F4E3 7EF5A4                                                JMP  REFIX_PROG0

F4E6 860E                                                  LDA  #$E                "COPY A"
F4E8 B11FF7                                                CMPA PNL_KEY_CODE
F4EB 260F                                                  BNE  COPY_PRES_ONCE
F4ED 4F                                                    CLRA                    Copy A, Copy A -> A = 0
F4EE 7EF9BC                                                JMP  CP_A_CP_A

F4F1 8610                                                  LDA  #$10               "COPY B"
F4F3 B11FF7                                                CMPA PNL_KEY_CODE
F4F6 2604                                                  BNE  COPY_PRES_ONCE
F4F8 4F                                                    CLRA                    Copy B, Copy B -> A = 0
F4F9 7EF9C0                                                JMP  CP_B_CP_B

F4FC A79F1FF4                          COPY_PRES_ONCE      STA  [$1FF4]            Fire Tapper
F500 B71FF7                                                STA  PNL_KEY_CODE       Panel code OK
F503 7EDE98                            NO_OP_KEY_PRES      JMP  PNT_PANL

F506 4F                                                    CLRA                    "PARAM SELECT" A = 0
F507 2002                                                  BRA  PARAM_SELECT

F509 8606                                                  LDA  #$6                "PROG SELECT"
F50B A79F1FF4                          PARAM_SELECT        STA  [$1FF4]            Fire Tapper
F50F B71FF6                                                STA  COPY_MODE          Store A to RAM[1FF6]
F512 B61FF7                                                LDA  PNL_KEY_CODE       A = Panel Code
F515 7F1FF7                                                CLR  PNL_KEY_CODE       Clear panel code
F518 8004                                                  SUBA #$4                Temp Panel code = Panel code - 4
F51A 8104                                                  CMPA #$4                Compare Temp Panel code against 4
F51C 22E5                                                  BHI  NO_OP_KEY_PRES     If A > 4, then no action - clear "2 part" panel item, branch
F51E B61FF8                                                LDA  CUR_PNL_PROG       A = current panel program
F521 27E0                                                  BEQ  NO_OP_KEY_PRES     If prog = 0, no work needed - branch
F523 B6141E                                                LDA  P0_PANEL_EDIT      A = Panel Edit data
F526 853F                                                  BITA #$3F '?
F528 26D9                                                  BNE  NO_OP_KEY_PRES     Branch if OK, else Program Key pressed
F52A 84C0                                                  ANDA #$C0               else Pick off Panel Edit Mode
F52C BA1FF8                                                ORA  CUR_PNL_PROG       Add on current Panel Program
F52F 7F1FF8                                                CLR  CUR_PNL_PROG       Current Panel Prog = 0
F532 7EF5A4                                                JMP  REFIX_PROG0

F535 9700                                                  STA  MEM_00             [PARAM][n] Handler
F537 D615                                                  LDB  NOT_STB5           B = -STB5 #'s
F539 2A13                                                  BPL  PARAM_HELD         If +ve, then Bit 7 = 0 (i.e., PARAM SEL) - Branch
F53B F6141E                                                LDB  P0_PANEL_EDIT
F53E C43F                                                  ANDB #$3F '?            B = Program Number
F540 D100                                                  CMPB MEM_00
F542 2605                                                  BNE  L227
F544 B61FF8                                                LDA  CUR_PNL_PROG       A = Current Panel Prog.
F547 9700                                                  STA  MEM_00             A -> RAM[$0000]
F549 F71FF8                            L227                STB  CUR_PNL_PROG
F54C 2048                                                  BRA  L228

F54E D600                              PARAM_HELD          LDB  MEM_00             B = Button value Pressed
F550 C110                                                  CMPB #$10
F552 2713                                                  BEQ  ENV_DCY_DFLT       If so, branch and set special default value
F554 C117                                                  CMPB #$17               else, see if ENV 2 Decay Param Held (param 23)
F556 270F                                                  BEQ  ENV_DCY_DFLT       If so, branch and set special default value
F558 C11A                                                  CMPB #$1A               else, see if TUNE (Pitch) param Held (param 26)
F55A 270F                                                  BEQ  TUNE_PTCH_DFLT     if so, branch and set special default value
F55C C127                                                  CMPB #$27 ''            else, see if TUNE (Cutoff) param Held (param 39)
F55E 270F                                                  BEQ  TUNE_CUTOF_DFLT    if so, branch and set special default value
F560 C12F                                                  CMPB #$2F '/            else, see if MOD 1 DEPTH (Volume) param Held (param 47)
F562 270F                                                  BEQ  MOD1_VOL_DFLT      if so, branch and set special default value
F564 4F                                                    CLRA                    else, not spcl default - set default value for rest to "0"
F565 200E                                                  BRA  SET_DEFAULT        branch and set all other default parameter values

F567 861F                              ENV_DCY_DFLT        LDA  #$1F               A = $1F = ENV 1/2 Decay Default (Reset) val = slow/infinite
F569 200A                                                  BRA  SET_DEFAULT

F56B 860C                              TUNE_PTCH_DFLT      LDA  #$C                A = $0C = Tune (Pitch) Default = 12 = concert pitch
F56D 2006                                                  BRA  SET_DEFAULT

F56F 863F                              TUNE_CUTOF_DFLT     LDA  #$3F '?            A = $3F = Tune (Cutoff) Default = 63 = high frequency
F571 2002                                                  BRA  SET_DEFAULT

F573 860F                              MOD1_VOL_DFLT       LDA  #$F                A = $0F = MOD1 Volume Depth Default = DEEP
F575 CE1400                            SET_DEFAULT         LDU  #$1400             U = $1400 = base address of prog. 0
F578 C105                                                  CMPB #$5                See if we chose a "control param"
F57A 2204                                                  BHI  NOT_CNTRL_PARAM    branch if _not_ a contro param
F57C 8D31                                                  BSR  CHK_2_SND_PANL     we're here if B <= 5 - set "set param" value
F57E 2016                                                  BRA  L228

F580 F6141E                            NOT_CNTRL_PARAM     LDB  P0_PANEL_EDIT      Else B > 5 (i.e., "normal param") B = panel edit
F583 2A0B                                                  BPL  L229
F585 D600                                                  LDB  MEM_00             Else Edit A or Edit Both, B = param #
F587 8D26                                                  BSR  CHK_2_SND_PANL
F589 F6141E                                                LDB  P0_PANEL_EDIT      B = Panel Edit Settings
F58C C540                                                  BITB #$40 '@            Check Edit B Bit
F58E 2706                                                  BEQ  L228
F590 D600                              L229                LDB  MEM_00             Orig. Param #
F592 CB32                                                  ADDB #$32 '2            B = Param # + 32 (i.e., make into "B" param #)
F594 8D19                                                  BSR  CHK_2_SND_PANL
F596 B6141E                            L228                LDA  P0_PANEL_EDIT      A = Panel Edit settings
F599 84C0                                                  ANDA #$C0               Keep top two bits, clear panel edit #
F59B 9A00                                                  ORA  MEM_00             Update panel edit val w./current panel edit #
F59D 7F1FF7                                                CLR  PNL_KEY_CODE       Reset Panel Key Code
F5A0 A79F1FF4                                              STA  [$1FF4]            Fire Tapper
F5A4 CE1400                            REFIX_PROG0         LDU  #$1400
F5A7 C634                                                  LDB  #$34 '4            B = Address of Param 52 = panel edit params
F5A9 BDDCAE                                                JSR  VALDTE_PARAM_2     Check & Reset Param 52 values
F5AC 7EDDF7                                                JMP  PROG_MODIFIED      Indicate Prog 0 changed

F5AF BDDCAE                            CHK_2_SND_PANL      JSR  VALDTE_PARAM_2     Set "Set Param" value
F5B2 0D09                                                  TST  C_INTF_PANL        Check Chroma Interface Panel Commands Setting
F5B4 2601                                                  BNE  C_SET_PARAM        If Chroma Interface Panel Enabled send out "set param" data
F5B6 39                                                    RTS  

F5B7 3402                              C_SET_PARAM         PSHS A
F5B9 86E0                                                  LDA  #$E0               A = "Set param for Instrument 0" Opcode
F5BB BDCD90                                                JSR  C_INF_OUT
F5BE 1F98                                                  TFR  B,A
F5C0 BDCD90                                                JSR  C_INF_OUT          Output Parameter #
F5C3 3502                                                  PULS A
F5C5 7ECD90                                                JMP  C_INF_OUT          Output Parameter Value

F5C8 BDDDF7                            RESTORE_LNK         JSR  PROG_MODIFIED      Show Program Modified Flag
F5CB BDE7B9                            DO_LINK_VOL_ETC     JSR  SETUP_INST01_VOL   Restore Link Program per "Link Type"
F5CE BDDA55                                                JSR  BOARD_ASSIGN
F5D1 7EDE98                                                JMP  PNT_PANL

F5D4 9609                              C_INST_0_VOL        LDA  C_INTF_PANL        Check to see if panel data should be sent out chroma port
F5D6 2601                                                  BNE  UNDEF_PNL_OK       If panel comments not disabled, branch & send data out
F5D8 39                                                    RTS                     else, return

F5D9 8678                              UNDEF_PNL_OK        LDA  #$78 'x            A = $78 = "Inst 0 Vol" Opcode
F5DB BDCD90                                                JSR  C_INF_OUT          Output
F5DE B606A8                                                LDA  INST_0_A_VOL       A = Stored Inst. 0 Volume
F5E1 7ECD90                                                JMP  C_INF_OUT          Output

F5E4 8105                                                  CMPA #$5                Compre A & 5 [COPY FROM B][n] HANDLER
F5E6 2302                                                  BLS  CP_CONTROL_PARAM   If A <= 5, branch control param
F5E8 8B32                                                  ADDA #$32 '2            Else, convert A to a "B" param number
F5EA FE1FFA                            CP_CONTROL_PARAM    LDU  CP_PRG_ADDR        U = Copy Program Address [COPY FROM A][n] HANDLER
F5ED 1F89                                                  TFR  A,B                B = 'param' number to copy
F5EF BDDC69                                                JSR  CHK_PARAM_DATA
F5F2 C132                                                  CMPB #$32 '2
F5F4 2302                                                  BLS  A_PARAM_CP         If B < 32, branch (i.e., A params)
F5F6 C032                                                  SUBB #$32 '2            Else B = B-32
F5F8 D700                              A_PARAM_CP          STB  MEM_00             B -> MEM[00]
F5FA CE1400                                                LDU  #$1400             U = $1400 = base address of programs
F5FD C105                                                  CMPB #$5                Check of panel params / control params
F5FF 2204                                                  BHI  B_PARAM_CP         If B>5, then we have B_params
F601 8DAC                                                  BSR  CHK_2_SND_PANL
F603 2091                                                  BRA  L228

F605 F6141E                            B_PARAM_CP          LDB  P0_PANEL_EDIT      B = Panel edit Mode
F608 2A0A                                                  BPL  L230               If error or edit B, branch
F60A D600                                                  LDB  MEM_00             Else, Edit A or Edit Both - B = MEM[00]
F60C 8DA1                                                  BSR  CHK_2_SND_PANL
F60E F6141E                                                LDB  P0_PANEL_EDIT      B = Panel Edit Vals
F611 58                                                    ASLB                    B = Bx2
F612 2A82                                                  BPL  L228               If Error or Edit A, Branch
F614 D600                              L230                LDB  MEM_00
F616 CB32                                                  ADDB #$32 '2
F618 8D95                                                  BSR  CHK_2_SND_PANL
F61A C032                                                  SUBB #$32 '2
F61C 7EF596                                                JMP  L228

F61F A79F1FF4                                              STA  [$1FF4]            Fire Tapper [SEQ][n] or [PROG][n] HANDLER
F623 F61FF3                                                LDB  PROG_MOD_FLAG      B = PROG_MOD falg
F626 260F                                                  BNE  GO_SEQ_PROG        If PROG_MOD flag <>0, the pgram was modified - branch
F628 B11FF2                                                CMPA CURR_PROG_NUM      Else, progra not modified - compare A w/ current program
F62B 260A                                                  BNE  GO_SEQ_PROG        iF current Prog <> dispalyed prog, go to SEQ prog
F62D DC5A                                                  LDD  SAFE_BUF_NUM       D = Safe Buffer Prog # & Safe Buf Modified Flag
F62F FD1FF2                                                STD  CURR_PROG_NUM      Update Display to show prog in Safe Buffer
F632 8E0241                                                LDX  #$241              X = Base address of safe buffer
F635 201B                                                  BRA  CP_PROG_X_2_P0     Copy Cassette Prog to Program 0

F637 3402                              GO_SEQ_PROG         PSHS A                  SEQ Pedal Pushed
F639 FC1FF2                                                LDD  CURR_PROG_NUM      D = Curr. Program # (and modifed byte)
F63C DD5A                                                  STD  SAFE_BUF_NUM       Store number of curr. prog. num.
F63E 8E1400                                                LDX  #$1400             X = $1400 (base address of prog 0)
F641 CE0241                                                LDU  #$241              U = $0241 = base address of safe buffer
F644 BDDA2C                                                JSR  CP_PROG_X_2_U      Copy Prog 0 to $0241 (i.e., to safe buffer)
F647 3502                                                  PULS A                  Restore Old "A" Value
F649 5F                                                    CLRB                    B = 0
F64A FD1FF2                                                STD  CURR_PROG_NUM
F64D C63B                                                  LDB  #$3B ';            B = $3B
F64F 3D                                                    MUL                     D = Offset to prog. "A" in memory
F650 308B                                                  LEAX D,X                X = Start Address of "A" in memory
F652 CE1400                            CP_PROG_X_2_P0      LDU  #$1400             U = $1400 (base addr. of prog. 0)
F655 BDDA2C                                                JSR  CP_PROG_X_2_U      Copy program "A" to prog. 0 
F658 F61400                                                LDB  P0_LINK_VALS       B = Link Vals
F65B C5C0                                                  BITB #$C0               Check to see if there is some link 
F65D 2605                                                  BNE  DO_SEQ_LNK         If link mode <> "no link" branch 
F65F BDF779                                                JSR  UNDEF_LNK_INST     else, there is no link - undef link
F662 2003                                                  BRA  ACTIV_P0_ONLY

F664 BDF789                            DO_SEQ_LNK          JSR  START_LINK_PRG     There is some link - start up approp. prog.
F667 CE1400                            ACTIV_P0_ONLY       LDU  #$1400             U = $1400
F66A FF0696                                                STU  INST0_DEF_PRG      U -> [0696] -> Address of Prog Controlling Board 0
F66D BDF75D                                                JSR  MKE_PROG_CHNGE
F670 108E0690                                              LDY  #$690
F674 86C0                                                  LDA  #$C0
F676 F61FF2                                                LDB  CURR_PROG_NUM
F679 BDD9CC                                                JSR  FINISH_PROG_DEF
F67C 7F1FF7                                                CLR  PNL_KEY_CODE
F67F BDDA55                                                JSR  BOARD_ASSIGN
F682 FC1FF2                                                LDD  CURR_PROG_NUM
F685 BDDE04                                                JSR  OUTPUT_BIG_PROG
F688 7EE85B                                                JMP  PARAM_EDIT

F68B A79F1FF4                                              STA  [$1FF4]            Fire Tapper [NO LINK][n] HANDLER
F68F F61FF3                                                LDB  PROG_MOD_FLAG      If B <> 0, prog was modified
F692 2615                                                  BNE  MOST_PN_TO_P0      Branch if 'current' program changed
F694 B11FF2                                                CMPA CURR_PROG_NUM      Branch if 'selected' program diff than 'current' prog
F697 2610                                                  BNE  MOST_PN_TO_P0
F699 DC5A                                                  LDD  SAFE_BUF_NUM
F69B FD1FF2                                                STD  CURR_PROG_NUM
F69E 8E0241                                                LDX  #$241              X = Base address of safe buffer
F6A1 CE1400                                                LDU  #$1400             U = address of P0
F6A4 BDDA2C                                                JSR  CP_PROG_X_2_U      Copy Safe Buf Prog. to P0 (current) prog.
F6A7 20BE                                                  BRA  ACTIV_P0_ONLY      Activate P0 only (with no link information, etc.)

F6A9 9700                              MOST_PN_TO_P0       STA  MEM_00             Store A ('n' from NO LINK command) = req. prog.
F6AB FC1FF2                                                LDD  CURR_PROG_NUM      D = Curr. Prog. no. and prog. modif. bit
F6AE DD5A                                                  STD  SAFE_BUF_NUM       Store Current Prog. Details in Safe buffer header
F6B0 8E1400                                                LDX  #$1400
F6B3 CE0241                                                LDU  #$241              U = Base address of safe buffer
F6B6 BDDA2C                                                JSR  CP_PROG_X_2_U      Copy current prog. to safe buffer
F6B9 CE1400                                                LDU  #$1400
F6BC 9600                                                  LDA  MEM_00             A = 'requested' program
F6BE 5F                                                    CLRB                    Clear Prog. Modified Bit.
F6BF FD1FF2                                                STD  CURR_PROG_NUM      Update 'current' program number.
F6C2 C63B                                                  LDB  #$3B ';
F6C4 3D                                                    MUL  
F6C5 308B                                                  LEAX D,X                X = Base address of 'requested' prog.
F6C7 FC1400                                                LDD  P0_LINK_VALS       D = existing (old) link values, incl. xpose stuff
F6CA C430                                                  ANDB #$30 '0            Type of patch = 0, link transpose type kept 
F6CC 3406                                                  PSHS B,A                Save values on stack
F6CE FC141F                                                LDD  P0_LINK_BALNCE     D = Kybd alg, Pnl Link Bal, Kybd Split
F6D1 840F                                                  ANDA #$F                Keep panel link bal, kybd split, reset kybd alg
F6D3 3406                                                  PSHS B,A                Save masked, old values on stack
F6D5 BDDA2C                                                JSR  CP_PROG_X_2_U      Copy 'requested' program to P0
F6D8 B6141F                                                LDA  P0_LINK_BALNCE     A = 'copied' Link Balance data
F6DB 84F0                                                  ANDA #$F0
F6DD AAE0                                                  ORA  ,S+                'or' new link balance with 'orig' link bal
F6DF E6E0                                                  LDB  ,S+                B = 'gated' orig link bal (0)
F6E1 FD141F                                                STD  P0_LINK_BALNCE     Update P0 link balance with 'orig' data
F6E4 F61401                                                LDB  P0_TRNSPOSE        B = 'new' transpose settings
F6E7 C4CF                                                  ANDB #$CF               Clear 'new' link transpose settings
F6E9 A6E0                                                  LDA  ,S+                A = 'orig' Link Type/Link Prog.
F6EB EAE0                                                  ORB  ,S+                B = transpose settings 'or'ed with orig link data
F6ED FD1400                                                STD  P0_LINK_VALS       Store link values back to P0
F6F0 7EF667                                                JMP  ACTIV_P0_ONLY

F6F3 8A80                                                  ORA  #$80               [LINK LOWER][n] HANDLER
F6F5 2006                                                  BRA  MAIN_LINK_WRK

F6F7 8AC0                                                  ORA  #$C0               [LINK UNISON][n] HANLDER
F6F9 2002                                                  BRA  MAIN_LINK_WRK

F6FB 8A40                                                  ORA  #$40 '@            [LINK UPPER][n] HANDLER
F6FD A79F1FF4                          MAIN_LINK_WRK       STA  [$1FF4]            Fire Tapper
F701 7F1FF7                                                CLR  PNL_KEY_CODE
F704 B71400                                                STA  P0_LINK_VALS
F707 BDF789                                                JSR  START_LINK_PRG
F70A BDF5C8                                                JSR  RESTORE_LNK
F70D 7EF5D4                                                JMP  C_INST_0_VOL

F710 A79F1FF4                          STORE_STORE_2       STA  [$1FF4]            Fire Tapper - did a "STORE, STORE" [STORE][n] HANDLER
F714 7F1FF7                                                CLR  PNL_KEY_CODE       Panel Code = 0
F717 3402                                                  PSHS A                  Save a copy of A (Curr. prog #)
F719 C63B                                                  LDB  #$3B ';            B = $3B (length of 1 memory program)
F71B 3D                                                    MUL                     D = length of 1 prog # curr. prog #
F71C CE1400                                                LDU  #$1400             U = $1400 (base address of prog. 0)
F71F 33CB                                                  LEAU D,U                U = start address of current program
F721 F61FF3                                                LDB  PROG_MOD_FLAG      B = Prog. Modified flag
F724 2613                                                  BNE  N_TO_SAFE_P0_2_N   If program modified, update contents of safe buffer 
F726 A6E4                                                  LDA  0,S                Else, program not modified (A = Curr. Prog)
F728 B11FF2                                                CMPA CURR_PROG_NUM
F72B 260C                                                  BNE  N_TO_SAFE_P0_2_N   If Displayed prog <> selected prog. jump.
F72D 3261                                                  LEAS $1,S               Else, we want to restore safe buffer to P0
F72F DC5A                                                  LDD  SAFE_BUF_NUM
F731 FD1FF2                                                STD  CURR_PROG_NUM
F734 8E0241                                                LDX  #$241              X = Base address of safe buffer
F737 2018                                                  BRA  CP_TO_PROG_N       Go do restore of safe to current.

F739 30C4                              N_TO_SAFE_P0_2_N    LEAX 0,U                X = address of currently selected prog.
F73B CE0241                                                LDU  #$241              U = Base address of safe buffer
F73E BDDA2C                                                JSR  CP_PROG_X_2_U      Copy current program to safe/cassette buffer
F741 FC1FF2                                                LDD  CURR_PROG_NUM      D = curr prog no & modified byte
F744 DD5A                                                  STD  SAFE_BUF_NUM       Update Prog # of safe buffer
F746 3384                                                  LEAU 0,X                U = address of currently selected prog
F748 8E1400                                                LDX  #$1400             X = Base addr of P0
F74B 3502                                                  PULS A
F74D 5F                                                    CLRB                    B = 0 (clear modified bit)
F74E FD1FF2                                                STD  CURR_PROG_NUM      Update currently displayed Prog #, clearing mod. bit
F751 BDDA2C                            CP_TO_PROG_N        JSR  CP_PROG_X_2_U      Copy P0 to Prog. N
F754 BDF75D                                                JSR  MKE_PROG_CHNGE
F757 BDDE04                                                JSR  OUTPUT_BIG_PROG
F75A 7EF5CB                                                JMP  DO_LINK_VOL_ETC

F75D 108E0690                          MKE_PROG_CHNGE      LDY  #$690              X = base address of instruments
F761 11A326                            LOOP_INST           CMPU $6,Y               see if instrumetn is defined by current program
F764 2608                                                  BNE  INST_NE_PROG       Branch if Inst 0 is/isn't defined by current prog.
F766 BDD994                                                JSR  INIT_BRD_4_INST
F769 EF26                                                  STU  $6,Y               Update address of defining program
F76B BDD960                                                JSR  INVOKE_PROG
F76E 31A900B8                          INST_NE_PROG        LEAY 184,Y              X = address of "next" instrument
F772 108C0B98                                              CMPY #$B98              See if we've looked at all instruments
F776 23E9                                                  BLS  LOOP_INST          If not, branch
F778 39                                SAME_DEF_PROG       RTS  

F779 108E0748                          UNDEF_LNK_INST      LDY  #$748              Y = Address of instrument 1 (link instrument)
F77D BDD994                                                JSR  INIT_BRD_4_INST    Init Link Instrument
F780 0D09                                                  TST  C_INTF_PANL        See if Chroma Panel Comands are enabled
F782 27F4                                                  BEQ  SAME_DEF_PROG      Branch if panel commands disabled (exit)
F784 86C9                                                  LDA  #$C9               Else send chroma MSG for Undef Instrument 1
F786 7ECD90                                                JMP  C_INF_OUT          Output Chroma data

F789 B61400                            START_LINK_PRG      LDA  P0_LINK_VALS       A = link data
F78C 843F                                                  ANDA #$3F '?            A = link program
F78E C63B                                                  LDB  #$3B ';            B = length of 1 program
F790 3D                                                    MUL                     D = offset to start of link program
F791 CE1400                                                LDU  #$1400             U = address of Prog 0
F794 33CB                                                  LEAU D,U                U = start address of prog "a" (link program)
F796 108E0748                                              LDY  #$748              Y = $748 (address of instrument 1, link instrument      
F79A 11A326                                                CMPU $6,Y               see if it is anew program controlling this instrument   
F79D 27D9                                                  BEQ  SAME_DEF_PROG      If it is the same program, branch (return) 
F79F BDD994                                                JSR  INIT_BRD_4_INST    else
F7A2 EF26                                                  STU  $6,Y               Update defining program
F7A4 BDD960                                                JSR  INVOKE_PROG        fire up new program parameters 
F7A7 86C1                                                  LDA  #$C1               A = $C1
F7A9 F61400                                                LDB  P0_LINK_VALS       B = P0 link vals 
F7AC C43F                                                  ANDB #$3F '?            B= Link program
F7AE 7ED9CC                                                JMP  FINISH_PROG_DEF

F7B1 7F1FF7                                                CLR  PNL_KEY_CODE       Panel Key Code <> 0 [SET SPLIT][n] HANDLER
F7B4 A79F1FF4                                              STA  [$1FF4]            Fire Tapper
F7B8 8132                                                  CMPA #$32 '2            See if A <= 50
F7BA 2504                                                  BCS  SPLT_LT_50         If A < 50, branch
F7BC 6E9FFFFE                                              JMP  [$FFFE]            Else, restart machine

F7C0 3402                              SPLT_LT_50          PSHS A
F7C2 BDDE98                                                JSR  PNT_PANL
F7C5 3502                                                  PULS A
F7C7 812E                                                  CMPA #$2E '.            See if A <= 46
F7C9 2507                                                  BCS  SPLT_LT_46         If A < 46, branch
F7CB 0F0F                                                  CLR  C_INTF_ECHO        else allow echos to interface
F7CD 8BCA                                                  ADDA #$CA               A = A+CA ($2E -> F8, F9, FA, FB)
F7CF 7ECD90                                                JMP  C_INF_OUT          Output single byte responses for SetSplit 46 -> SetSplit 49

F7D2 8123                              SPLT_LT_46          CMPA #$23 '#            $23 = 35 decimal
F7D4 2301                                                  BLS  SET_SPLT_HNDRL     If A <= 35, branch
F7D6 39                                                    RTS  

F7D7 4A                                SET_SPLT_HNDRL      DECA                    A = A-1
F7D8 48                                                    ASLA                    A = Ax2 (threfor if A = 1-Set Split 1, A Now = 0)
F7D9 CEF7DE                                                LDU  #$F7DE             U = base address of set split vector table
F7DC 6ED6                                                  JMP  [A,U]              Jump to Set Split "A" Handler

F7DE F995                              S_SPLT_01           FDB  $F995              Set Split 1 (Link Patch 0) 
F7E0 F981                              S_SPLT_02           FDB  $F981              Set Split 2 (Link Output 0) 
F7E2 F984                              S_SPLT_03           FDB  $F984              Set Split 3 (Link Output 1) 
F7E4 F988                              S_SPLT_04           FDB  $F988              Set Split 4 (Link Output 2) 
F7E6 F98C                              S_SPLT_05           FDB  $F98C              Set Split 5 (Link Output 3) 
F7E8 F825                              S_SPLT_06           FDB  $F825              Set Split 6 (Battery Check)
F7EA F861                              S_SPLT_07           FDB  $F861              Set Split 7 (Kill Bad Boards) 
F7EC DECE                              S_SPLT_08           FDB  $DECE              Set Split 8 (Display Bad Boards) 
F7EE F89C                              S_SPLT_09           FDB  $F89C              Set Split 9 (Tapper On/Off)
F7F0 F8C5                              S_SPLT_10           FDB  $F8C5              Set Split 10 (Cassette Mode) 
F7F2 C945                              S_SPLT_11           FDB  $C945              Set Split 11 (Program 0 Packet) 
F7F4 C948                              S_SPLT_12           FDB  $C948              Set Split 12 (Program 1 Packet) 
F7F6 C94C                              S_SPLT_13           FDB  $C94C              Set Split 13 (Program N Packet) 
F7F8 C940                              S_SPLT_14           FDB  $C940              Set Split 14 (Stop Packet) 
F7FA CD23                              S_SPLT_15           FDB  $CD23              Set Split 15 (Output Subroutine) 
F7FC F8C9                              S_SPLT_16           FDB  $F8C9              Set Split 16 (Chroma Intrface Perform. Disable) 
F7FE F8FF                              S_SPLT_17           FDB  $F8FF              Set Split 17 (Chroma Intrface Perform. Enable) 
F800 C306                              S_SPLT_18           FDB  $C306              Set Split 18 (Chroma Intrface Panel Disable) ($F906 in R14, $C306 14a)
F802 F909                              S_SPLT_19           FDB  $F909              Set Split 19 (Chroma Intrface Panel Enable) 
F804 F910                              S_SPLT_20           FDB  $F910              Set Split 20 (Send Program over Chroma Interface) 
F806 F921                              S_SPLT_21           FDB  $F921              Set Split 21 (Kybd Attack Threshold)
F808 F929                              S_SPLT_22           FDB  $F929              Set Split 22 (Kybd Release Threshold)
F80A F931                              S_SPLT_23           FDB  $F931              Set Split 23 (Kybd Release Slow Rate) 
F80C F939                              S_SPLT_24           FDB  $F939              Set Split 24 (Kybd Release Fast Rate) 
F80E F976                              S_SPLT_25           FDB  $F976              Set Split 25 (Branch Subroutine) 
F810 F957                              S_SPLT_26           FDB  $F957              Set Split 26 (Mute A Channels) 
F812 F95E                              S_SPLT_27           FDB  $F95E              Set Split 27 (Mute B Channels) 
F814 F965                              S_SPLT_28           FDB  $F965              Set Split 28 (Unmute) 
F816 F8B7                              S_SPLT_29           FDB  $F8B7              Set Split 29 (Mute Oscillators)
F818 F941                              S_SPLT_30           FDB  $F941              Set Split 30 (Test LEDs)
F81A F99D                              S_SPLT_31           FDB  $F99D              Set Split 31 (Special Reset) 
F81C F9A4                              S_SPLT_32           FDB  $F9A4              Set Split 32 (Special Reset #2) 
F81E F9AB                              S_SPLT_33           FDB  $F9AB              Set Split 33 (Special Reset #3) 
F820 F9B2                              S_SPLT_34           FDB  $F9B2              Set Split 34 (Chroma Intrface Pressure Disable) 
F822 F9B5                              S_SPLT_35           FDB  $F9B5              Set Split 35 (Chroma Intrface Pressure Enable) 

F824 39                                                    RTS  

F825 8607                              BAT_CHK             LDA  #$7                Set Split 6 (Battery Check) Handler A = $07
F827 B72000                                                STA  RD_ADCI_WR_ADCO    Select Battery ADC Input
F82A B72000                                                STA  RD_ADCI_WR_ADCO    Reselect Battery ADC Input
F82D 863C                                                  LDA  #$3C '<            A = $3C
F82F 4A                                WAIT_BATT           DECA                    A = A - 1
F830 26FD                                                  BNE  WAIT_BATT          Branch to let value be converted
F832 F62008                                                LDB  RD_EOC_WR_SYND     B = EOC Value
F835 2AEE                                                  BPL  BAT_CHK            If Bad conversion, re-request value
F837 9724                                                  STA  LED_DIG4           A = 0, LED_DIG_4 = {blank}
F839 CC4E4F                                                LDD  #$4E4F             D = LED Value = 'CE'
F83C DD20                                                  STD  LED_DIG0           LED_DIG_0 = 'C', LED_DIG_1 = 'E'
F83E CC0E0E                                                LDD  #$E0E              D = LED Value = 'LL'
F841 DD22                                                  STD  LED_DIG2           LED_DIG_2 = 'L', LED_DIG_3 = 'L'
F843 8EFB8B                                                LDX  #$FB8B             X = $FB8B
F846 B62000                                                LDA  RD_ADCI_WR_ADCO    A = ADC Value
F849 C605                                                  LDB  #$5                B = $05
F84B 3D                                                    MUL                     D = ADC Value * 5
F84C A686                                                  LDA  A,X
F84E 8A80                                                  ORA  #$80
F850 9725                                                  STA  LED_DIG5
F852 860A                                                  LDA  #$A
F854 3D                                                    MUL  
F855 A686                                                  LDA  A,X
F857 9726                                                  STA  LED_DIG6
F859 860A                                                  LDA  #$A
F85B 3D                                                    MUL  
F85C A686                                                  LDA  A,X
F85E 9727                                                  STA  LED_DIG7
F860 39                                                    RTS                     Return from Displaying Battery Voltage

F861 108E0690                                              LDY  #$690              Set Split 7 (Kill Bad Boards) Handler Y = base of Inst 0
F865 AEA4                                                  LDX  0,Y                X = address of channel board played by chosen Inst.
F867 2730                                                  BEQ  DISABLE_BRD        If address stored = 0, branch
F869 EE84                              LOOP_BRD            LDU  0,X                else U = address of "next channel" assigned to Inst.
F86B 2706                                                  BEQ  NO_NXT_CHN
F86D 3184                                                  LEAY 0,X
F86F 30C4                                                  LEAX 0,U
F871 20F6                                                  BRA  LOOP_BRD

F873 A607                              NO_NXT_CHN          LDA  $7,X               A = current channel #
F875 840E                                                  ANDA #$E                Drop off last bit (make even #)
F877 108E0690                                              LDY  #$690              Y = Base address of Instruments
F87B FE0696                                                LDU  INST0_DEF_PRG
F87E BDD994                                                JSR  INIT_BRD_4_INST
F881 FF0696                                                STU  INST0_DEF_PRG
F884 108E0034                                              LDY  #$34
F888 AE24                              L232                LDX  $4,Y               X = Address of link instrument channel 
F88A A107                                                  CMPA $7,X               Compare     
F88C 2704                                                  BEQ  L231
F88E 3184                                                  LEAY 0,X
F890 20F6                                                  BRA  L232

F892 EC04                              L231                LDD  $4,X
F894 ED24                                                  STD  $4,Y
F896 BDDA55                                                JSR  BOARD_ASSIGN
F899 7EDECE                            DISABLE_BRD         JMP  BAD_BRD_HNDLR

F89C FC1FF4                                                LDD  WR_TAP_ADDR        Set Split 9 (Tapper On/Off) Handler
F89F 1083200F                                              CMPD #$200F             See if tapper already enabled
F8A3 270B                                                  BEQ  TAP_ENBLD          branch if tapper on
F8A5 CC200F                                                LDD  #$200F             else, tapper off
F8A8 FD1FF4                                                STD  WR_TAP_ADDR        turn tapper on
F8AB A79F1FF4                                              STA  [$1FF4]            Fire Tapper
F8AF 39                                                    RTS  

F8B0 CCFFFF                            TAP_ENBLD           LDD  #$FFFF
F8B3 FD1FF4                                                STD  WR_TAP_ADDR        Turn tapper off
F8B6 39                                                    RTS  

F8B7 1A10                                                  ORCC #$10               Set Split 29 (Mute Oscillators) Handler - Disable chroma port ints
F8B9 962F                                                  LDA  WR_MSCO_IMG        A = MSCO_IMG
F8BB 8A02                                                  ORA  #$2                Turn B1 On
F8BD 972F                                                  STA  WR_MSCO_IMG        Update MSCO_IMG
F8BF B72001                                                STA  RD_MSCI_WR_MSCO    Update real MSCO data (turning oscillators off)
F8C2 1CEF                                                  ANDC #$EF               Enable IRQ (chroma port) interrupts
F8C4 39                                                    RTS  

F8C5 731FF1                                                COM  CASS_TYPE          Set Split 10 (Cassette Mode) Handler
F8C8 39                                                    RTS  

F8C9 0F0A                                                  CLR  C_INTF_PERF        Set Split 16 (Chroma Intrfce Perform. Disable) Handler
F8CB DE64                                                  LDU  CUR_KSTACK_ADR
F8CD 2736                              L235                BEQ  L233
F8CF 86D8                                                  LDA  #$D8
F8D1 E6C4                                                  LDB  0,U
F8D3 8D09                                                  BSR  L234
F8D5 4C                                                    INCA 
F8D6 E641                                                  LDB  1,U    $1
F8D8 8D04                                                  BSR  L234
F8DA EE42                                                  LDU  2,U    $2
F8DC 20EF                                                  BRA  L235

F8DE 3406                              L234                PSHS B,A                Save copy of A & B
F8E0 C4C0                                                  ANDB #$C0
F8E2 C1C0                                                  CMPB #$C0
F8E4 2717                                                  BEQ  L236
F8E6 A661                                                  LDA  $1,S
F8E8 E6C4                                                  LDB  0,U
F8EA C43F                                                  ANDB #$3F '?
F8EC BDD803                                                JSR  L72
F8EF A6E4                                                  LDA  0,S
F8F1 BDCD90                                                JSR  C_INF_OUT
F8F4 1F98                                                  TFR  B,A
F8F6 BDCD90                                                JSR  C_INF_OUT
F8F9 4F                                                    CLRA 
F8FA BDCD90                                                JSR  C_INF_OUT
F8FD 3586                              L236                PULS A,B,PC

F8FF 0F0F                                                  CLR  C_INTF_ECHO        Set Split 17 (Chroma Intrfce Perform. Enable) Handler
F901 8601                                                  LDA  #$1                Allow Chroma output
F903 970A                                                  STA  C_INTF_PERF        Enable Chroma Performance Interface
F905 39                                L233                RTS                     Return

F906 0F09                                                  CLR  C_INTF_PANL        Set Split 18 (Chroma Interface Panel Disable) Handler
F908 39                                                    RTS                     Disable Panel & Return

F909 0F0F                                                  CLR  C_INTF_ECHO        Set Split 19 (Chroma Intrfce Panel Enable) Handler
F90B 8601                                                  LDA  #$1
F90D 9709                                                  STA  C_INTF_PANL        Enable Panel Flag
F90F 39                                                    RTS                     Return

F910 8603                                                  LDA  #$3                Set Split 20 (Send Program over Chroma Intrfce) Handler
F912 BDCD90                                                JSR  C_INF_OUT          Output $03 -> Opcode for "Write Program"
F915 4F                                                    CLRA                    A = 0
F916 BDCD90                                                JSR  C_INF_OUT          Output $00 = Program #0
F919 CE1400                                                LDU  #$1400             U = $1400 = base address of Prog. 0
F91C C63B                                                  LDB  #$3B ';            $3B = length of chroma program
F91E 7ECDFC                                                JMP  PRNT_C_INF_N_BYTE  Output $3B Bytes starting at $1400

F921 9635                                                  LDA  DISP_PARAM_VAL     Set Split 21 (Kybd Attack Threshold) Hndlr - A = curr. param val
F923 841F                                                  ANDA #$1F               Limit to 0 to 31 as a value
F925 B71FFC                                                STA  ATTACK_THRES       Store attack threshold value
F928 39                                                    RTS  

F929 9635                                                  LDA  DISP_PARAM_VAL     Set Split 22 (Kybd Release Threshold) Hndlr - A = curr. param val
F92B 841F                                                  ANDA #$1F               Limit to 0 to 31 as a value
F92D B71FFD                                                STA  RELSE_THRES        Store Release Threshold Value
F930 39                                                    RTS  

F931 9635                                                  LDA  DISP_PARAM_VAL     Set Split 23 (Kybd Release Slow Rate) Hndlr - A = curr. param val
F933 841F                                                  ANDA #$1F               Limit to 0 to 31 as a value
F935 B71FFE                                                STA  REL_SLOW_RATE      Store Release Slow Rate
F938 39                                                    RTS  

F939 9635                                                  LDA  DISP_PARAM_VAL     Set Split 24 (Kybd Release Fast Rate) Hndlr - A - curr. param val
F93B 841F                                                  ANDA #$1F               Limit value between 0 and 31
F93D B71FFF                                                STA  REL_FAST_RATE      Store Release Fast Rate
F940 39                                                    RTS  

F941 CCFFFF                                                LDD  #$FFFF             Set Split 30 (Test LEDs) Handler
F944 FD2006                                                STD  RD_NOTE_WR_LED     Turn all 16 Individual LEDs ON
F947 8E0020                                                LDX  #$20               X = Address of LED Display Digit 0
F94A ED81                                                  STD  ,X++               LED_DIG0 = $FF, LED_DIG1 = $FF
F94C ED81                                                  STD  ,X++               LED_DIG2 = $FF, LED_DIG3 = $FF
F94E ED81                                                  STD  ,X++               LED_DIG4 = $FF, LED_DIG5 = $FF
F950 ED81                                                  STD  ,X++               LED_DIG6 = $FF, LED_DIG7 = $FF
F952 ED81                                                  STD  ,X++               LED_DIG8 = $FF, LED_DIG9 = $FF
F954 ED84                                                  STD  0,X                Turn on all LEDS (Update Image_1 and Image_2)
F956 39                                                    RTS  

F957 BDE7B9                                                JSR  SETUP_INST01_VOL   Set Split 26 (Mute A Channels) Handler
F95A 7F06A8                                                CLR  INST_0_A_VOL
F95D 39                                                    RTS  

F95E BDE7B9                                                JSR  SETUP_INST01_VOL   Set Split 27 (Mute B Channels) Handler
F961 7F0704                                                CLR  INST_0_B_VOL
F964 39                                                    RTS  

F965 BDE7B9                                                JSR  SETUP_INST01_VOL   Set Split 28 (Unmute) Handler
F968 1A10                                                  ORCC #$10               Disable IRQ (chroma port) interrupts
F96A 962F                                                  LDA  WR_MSCO_IMG        A = MSC0 Image
F96C 84FD                                                  ANDA #$FD               Enable Oscillators
F96E 972F                                                  STA  WR_MSCO_IMG        Store Updated Image Byte
F970 B72001                                                STA  RD_MSCI_WR_MSCO    Store Real Hardware Value (i.e., enable osc)
F973 1CEF                                                  ANDC #$EF               Enable IRQ (chroma port) interrupts
F975 39                                                    RTS  

F976 B60140                                                LDA  CASS_BUF_B0        Set Split 25 (Branch Subroutine) Handler
F979 8104                                                  CMPA #$4                If Safe_Buf_B0 = 4, then it is a Subr stored in Safe_Buf_B1
F97B 2701                                                  BEQ  DO_SOFT_SUBR       Branch and do Soft Subroutine
F97D 39                                                    RTS                     Else, exit

F97E 7E0141                            DO_SOFT_SUBR        JMP  CASS_BUF_B1        Start Address of Soft Subroutine in Cassette Buffer

F981 4F                                                    CLRA                    Set Split 2 (Link Output 0) Handler
F982 200A                                                  BRA  LNK_OUTPUT         A = 0, Sum 0 Bus

F984 8601                                                  LDA  #$1                Set Split 3 (Link Output 1) Handler
F986 2006                                                  BRA  LNK_OUTPUT         A = 1, Sum 1 Bus

F988 8602                                                  LDA  #$2                Set Split 4 (Link Output 2) Handler
F98A 2002                                                  BRA  LNK_OUTPUT         A = 2, Sum 2 Bus

F98C 8603                                                  LDA  #$3                Set Split 5 (Link Output 3) Handler
F98E 108E0748                          LNK_OUTPUT          LDY  #$748              A = 3, Sum 3 Bus, Y = Instr. 1
F992 7EE5DF                                                JMP  OUTPUT_SEL

F995 4F                                                    CLRA                    Set Split 1 (Link Patch 0) Handler A = 0
F996 108E0748                                              LDY  #$748              X = address of Link Instrument
F99A 7EE47A                                                JMP  PATCH_HNDLR        Jump to Param 1 (Patch) handler

F99D 8680                                                  LDA  #$80               Set Split 31 (Special Reset) Handler
F99F 9707                                                  STA  RESET_VAL          Reset_Val = $80
F9A1 7EF43F                                                JMP  SPCL_RESET

F9A4 8601                                                  LDA  #$1                Set Split 32 (Special Reset #2) Handler
F9A6 9707                                                  STA  RESET_VAL          Reset_Val = $01
F9A8 7EF43F                                                JMP  SPCL_RESET

F9AB 8681                                                  LDA  #$81               Set Split 33 (Speical Reset #3) Handler
F9AD 9707                                                  STA  RESET_VAL          Reset_Val = $81
F9AF 7EF43F                                                JMP  SPCL_RESET

F9B2 0F08                                                  CLR  C_INTF_PRES        Set Split 34 (Chroma Intrface Pressure Disable) Handler  
F9B4 39                                                    RTS  

F9B5 0F0F                                                  CLR  C_INTF_ECHO        Set Split 35 (Chroma Intrface Pressure Enable) Handler
F9B7 8601                                                  LDA  #$1
F9B9 9708                                                  STA  C_INTF_PRES
F9BB 39                                                    RTS  

F9BC C602                              CP_A_CP_A           LDB  #$2                Enter Copy A mode w/curr. Prog as source [COPY A][n] HANDLER
F9BE 2002                                                  BRA  STOR_CP_MODE

F9C0 C604                              CP_B_CP_B           LDB  #$4                Enter Copy B mode w/curr. Prog as source [COPY B][n] HANDLER
F9C2 F71FF6                            STOR_CP_MODE        STB  COPY_MODE
F9C5 A79F1FF4                                              STA  [$1FF4]            Fire Tapper
F9C9 7F1FF7                                                CLR  PNL_KEY_CODE
F9CC C63B                                                  LDB  #$3B ';
F9CE 3D                                                    MUL  
F9CF C31400                                                ADDD #$1400
F9D2 FD1FFA                                                STD  CP_PRG_ADDR
F9D5 7EDE98                                                JMP  PNT_PANL

F9D8 A79F1FF4                                              STA  [$1FF4]            Fire Tapper [SEQ][n] HANDLER
F9DC B7141D                                                STA  P0_SEQNC_PROG
F9DF CE1400                                                LDU  #$1400
F9E2 B61FF2                                                LDA  CURR_PROG_NUM      A = Current Prog. #
F9E5 C63B                                                  LDB  #$3B ';
F9E7 3D                                                    MUL                     D = Offset to prog. # A
F9E8 33CB                                                  LEAU D,U                U = Base address of current program
F9EA B6141D                                                LDA  P0_SEQNC_PROG
F9ED A7C81D                                                STA  29,U               Store new SEQ program in "current" program
F9F0 B6141D                                                LDA  P0_SEQNC_PROG      ERROR ERROR ERROR? Redundant line?
F9F3 5F                                                    CLRB                    B = 0
F9F4 BDDE04                                                JSR  OUTPUT_BIG_PROG
F9F7 7EDE98                                                JMP  PNT_PANL

F9FA 02                                SINE_DATA_01        FCB  $02                1 Quadrant of Sine Data 
F9FB 05                                SINE_DATA_02        FCB  $05
F9FC 08                                SINE_DATA_03        FCB  $08
F9FD 0B                                SINE_DATA_04        FCB  $0B
F9FE 0E                                SINE_DATA_05        FCB  $0E
F9FF 11                                SINE_DATA_06        FCB  $11
FA00 14                                SINE_DATA_07        FCB  $14
FA01 17                                SINE_DATA_08        FCB  $17
FA02 1A                                SINE_DATA_09        FCB  $1A
FA03 1D                                SINE_DATA_10        FCB  $1D
FA04 20                                SINE_DATA_11        FCB  $20
FA05 23                                SINE_DATA_12        FCB  $23
FA06 26                                SINE_DATA_13        FCB  $26
FA07 29                                SINE_DATA_14        FCB  $29
FA08 2C                                SINE_DATA_15        FCB  $2C
FA09 2F                                SINE_DATA_16        FCB  $2F
FA0A 32                                SINE_DATA_17        FCB  $32
FA0B 35                                SINE_DATA_18        FCB  $35
FA0C 38                                SINE_DATA_19        FCB  $38
FA0D 3A                                SINE_DATA_20        FCB  $3A
FA0E 3D                                SINE_DATA_21        FCB  $3D
FA0F 40                                SINE_DATA_22        FCB  $40
FA10 43                                SINE_DATA_23        FCB  $43
FA11 45                                SINE_DATA_24        FCB  $45
FA12 48                                SINE_DATA_25        FCB  $48
FA13 4A                                SINE_DATA_26        FCB  $4A
FA14 4D                                SINE_DATA_27        FCB  $4D
FA15 4F                                SINE_DATA_28        FCB  $4F
FA16 52                                SINE_DATA_29        FCB  $52
FA17 54                                SINE_DATA_30        FCB  $54
FA18 56                                SINE_DATA_31        FCB  $56
FA19 59                                SINE_DATA_32        FCB  $59
FA1A 5B                                SINE_DATA_33        FCB  $5B
FA1B 5D                                SINE_DATA_34        FCB  $5D
FA1C 5F                                SINE_DATA_35        FCB  $5F
FA1D 61                                SINE_DATA_36        FCB  $61
FA1E 63                                SINE_DATA_37        FCB  $63
FA1F 65                                SINE_DATA_38        FCB  $65
FA20 67                                SINE_DATA_39        FCB  $67
FA21 69                                SINE_DATA_40        FCB  $69
FA22 6A                                SINE_DATA_41        FCB  $6A
FA23 6C                                SINE_DATA_42        FCB  $6C
FA24 6E                                SINE_DATA_43        FCB  $6E
FA25 6F                                SINE_DATA_44        FCB  $6F
FA26 71                                SINE_DATA_45        FCB  $71
FA27 72                                SINE_DATA_46        FCB  $72
FA28 73                                SINE_DATA_47        FCB  $73
FA29 75                                SINE_DATA_48        FCB  $75
FA2A 76                                SINE_DATA_49        FCB  $76
FA2B 77                                SINE_DATA_50        FCB  $77
FA2C 78                                SINE_DATA_51        FCB  $78
FA2D 79                                SINE_DATA_52        FCB  $79
FA2E 7A                                SINE_DATA_53        FCB  $7A
FA2F 7B                                SINE_DATA_54        FCB  $7B
FA30 7C                                SINE_DATA_55        FCB  $7C
FA31 7C                                SINE_DATA_56        FCB  $7C
FA32 7D                                SINE_DATA_57        FCB  $7D
FA33 7D                                SINE_DATA_58        FCB  $7D
FA34 7E                                SINE_DATA_59        FCB  $7E
FA35 7E                                SINE_DATA_60        FCB  $7E
FA36 7F                                SINE_DATA_61        FCB  $7F
FA37 7F                                SINE_DATA_62        FCB  $7F
FA38 7F                                SINE_DATA_63        FCB  $7F
FA39 7F                                SINE_DATA_64        FCB  $7F
FA3A 0300                              CHNL_ADR_00         FDB  $0300
FA3C 0339                              CHNL_ADR_01         FDB  $0339
FA3E 0372                              CHNL_ADR_02         FDB  $0372
FA40 03AB                              CHNL_ADR_03         FDB  $03AB
FA42 03E4                              CHNL_ADR_04         FDB  $03E4
FA44 041D                              CHNL_ADR_05         FDB  $041D
FA46 0456                              CHNL_ADR_06         FDB  $0456
FA48 048F                              CHNL_ADR_07         FDB  $048F
FA4A 04C8                              CHNL_ADR_08         FDB  $04C8
FA4C 0501                              CHNL_ADR_09         FDB  $0501
FA4E 053A                              CHNL_ADR_10         FDB  $053A
FA50 0573                              CHNL_ADR_11         FDB  $0573
FA52 05AC                              CHNL_ADR_12         FDB  $05AC
FA54 05E5                              CHNL_ADR_13         FDB  $05E5
FA56 061E                              CHNL_ADR_14         FDB  $061E
FA58 0657                              CHNL_ADR_15         FDB  $0657              (Maybe never used in this lookup table)
FA5A 1F1F1F1C19161311                  TIME_TO_VEL1        FDB  $1F1F,$1F1C,$1916,$1311 Diff vals in 14a S/W Rev
FA62 0F0D0B0908080707                  TIME_TO_VEL2        FDB  $0F0D,$0B09,$0808,$0707
FA6A 0706060606060505                  TIME_TO_VEL3        FDB  $0706,$0606,$0606,$0505
FA72 0505050505050404                  TIME_TO_VEL4        FDB  $0505,$0505,$0505,$0404
FA7A 040404040404040404040303          TIME_TO_VEL5        FDB  $0404,$0404,$0404,$0404,$0404,$0303
FA86 03030303030303030303020202020202  TIME_TO_VEL6        FDB  $0303,$0303,$0303,$0303,$0303,$0202,$0202,$0202
FA96 02020202020202020202020202020101  TIME_TO_VEL7        FDB  $0202,$0202,$0202,$0202,$0202,$0202,$0202,$0101
FAA6 01010101010101010101010101010101  TIME_TO_VEL8        FDB  $0101,$0101,$0101,$0101,$0101,$0101,$0101,$0101
FAB6 01010101010101010101010101010101  TIME_TO_VEL9        FDB  $0101,$0101,$0101,$0101,$0101,$0101,$0101,$0101
FAC6 01010000000000000000000000000000  TIME_TO_VEL10       FDB  $0101,$0000,$0000,$0000,$0000,$0000,$0000,$0000
FAD6 00000000                          TIME_TO_VEL11       FDB  $0000,$0000
FADA 0000000000000000                  VEL_TO_PRESS_0      FDB  $0000,$0000,$0000,$0000
FAE2 0000000000000000                  VEL_TO_PRESS_1      FDB  $0000,$0000,$0000,$0000
FAEA 0000000000000000                  VEL_TO_PRESS_2      FDB  $0000,$0000,$0000,$0000
FAF2 001020303F3F3F3F                  VEL_TO_PRESS_3      FDB  $0010,$2030,$3F3F,$3F3F
FAFA FF                                ENV_ATK_MOD_0_0     FCB  $FF
FAFB FF                                ENV_ATK_MOD_0_1     FCB  $FF
FAFC FF                                ENV_ATK_MOD_1_0     FCB  $FF
FAFD FF                                ENV_ATK_MOD_1_1     FCB  $FF
FAFE 80                                ENV_ATK_MOD_2_0     FCB  $80
FAFF 00                                ENV_ATK_MOD_2_1     FCB  $00
FB00 69                                ENV_ATK_MOD_3_0     FCB  $69
FB01 CF                                ENV_ATK_MOD_3_1     FCB  $CF
FB02 57                                ENV_ATK_MOD_4_0     FCB  $57
FB03 76                                ENV_ATK_MOD_4_1     FCB  $76
FB04 48                                ENV_ATK_MOD_5_0     FCB  $48
FB05 4C                                ENV_ATK_MOD_5_1     FCB  $4C
FB06 3B                                ENV_ATK_MOD_6_0     FCB  $3B
FB07 C3                                ENV_ATK_MOD_6_1     FCB  $C3
FB08 31                                ENV_ATK_MOD_7_0     FCB  $31
FB09 67                                ENV_ATK_MOD_7_1     FCB  $67
FB0A 28                                ENV_ATK_MOD_8_0     FCB  $28
FB0B D6                                ENV_ATK_MOD_8_1     FCB  $D6
FB0C 21                                ENV_ATK_MOD_9_0     FCB  $21
FB0D C1                                ENV_ATK_MOD_9_1     FCB  $C1
FB0E 1B                                ENV_ATK_MOD_10_0    FCB  $1B
FB0F E7                                ENV_ATK_MOD_10_1    FCB  $E7
FB10 17                                ENV_ATK_MOD_11_0    FCB  $17
FB11 11                                ENV_ATK_MOD_11_1    FCB  $11
FB12 13                                ENV_ATK_MOD_12_0    FCB  $13
FB13 11                                ENV_ATK_MOD_12_1    FCB  $11
FB14 0F                                ENV_ATK_MOD_13_0    FCB  $0F
FB15 C3                                ENV_ATK_MOD_13_1    FCB  $C3
FB16 0D                                ENV_ATK_MOD_14_0    FCB  $0D
FB17 07                                ENV_ATK_MOD_14_1    FCB  $07
FB18 0A                                ENV_ATK_MOD_15_0    FCB  $0A
FB19 C5                                ENV_ATK_MOD_15_1    FCB  $C5
FB1A 08                                ENV_ATK_MOD_16_0    FCB  $08
FB1B E7                                ENV_ATK_MOD_16_1    FCB  $E7
FB1C 07                                ENV_ATK_MOD_17_0    FCB  $07
FB1D 5C                                ENV_ATK_MOD_17_1    FCB  $5C
FB1E 06                                ENV_ATK_MOD_18_0    FCB  $06
FB1F 15                                ENV_ATK_MOD_18_1    FCB  $15
FB20 05                                ENV_ATK_MOD_19_0    FCB  $05
FB21 07                                ENV_ATK_MOD_19_1    FCB  $07
FB22 04                                ENV_ATK_MOD_20_0    FCB  $04
FB23 28                                ENV_ATK_MOD_20_1    FCB  $28
FB24 03                                ENV_ATK_MOD_21_0    FCB  $03
FB25 6F                                ENV_ATK_MOD_21_1    FCB  $6F
FB26 02                                ENV_ATK_MOD_22_0    FCB  $02
FB27 D7                                ENV_ATK_MOD_22_1    FCB  $D7
FB28 02                                ENV_ATK_MOD_23_0    FCB  $02
FB29 59                                ENV_ATK_MOD_23_1    FCB  $59
FB2A 01                                ENV_ATK_MOD_24_0    FCB  $01
FB2B F1                                ENV_ATK_MOD_24_1    FCB  $F1
FB2C 01                                ENV_ATK_MOD_25_0    FCB  $01
FB2D 9B                                ENV_ATK_MOD_25_1    FCB  $9B
FB2E 01                                ENV_ATK_MOD_26_0    FCB  $01
FB2F 53                                ENV_ATK_MOD_26_1    FCB  $53
FB30 01                                ENV_ATK_MOD_27_0    FCB  $01
FB31 19                                ENV_ATK_MOD_27_1    FCB  $19
FB32 00                                ENV_ATK_MOD_28_0    FCB  $00
FB33 E8                                ENV_ATK_MOD_28_1    FCB  $E8
FB34 00                                ENV_ATK_MOD_29_0    FCB  $00
FB35 C0                                ENV_ATK_MOD_29_1    FCB  $C0
FB36 00                                ENV_ATK_MOD_30_0    FCB  $00
FB37 9E                                ENV_ATK_MOD_30_1    FCB  $9E
FB38 00                                ENV_ATK_MOD_31_0    FCB  $00
FB39 83                                ENV_ATK_MOD_31_1    FCB  $83
FB3A FF                                ENV_DCY_MOD_0       FCB  $FF
FB3B FF                                ENV_DCY_MOD_1       FCB  $FF
FB3C 80                                ENV_DCY_MOD_2       FCB  $80
FB3D 69                                ENV_DCY_MOD_3       FCB  $69
FB3E 56                                ENV_DCY_MOD_4       FCB  $56
FB3F 47                                ENV_DCY_MOD_5       FCB  $47
FB40 3A                                ENV_DCY_MOD_6       FCB  $3A
FB41 30                                ENV_DCY_MOD_7       FCB  $30
FB42 27                                ENV_DCY_MOD_8       FCB  $27
FB43 20                                ENV_DCY_MOD_9       FCB  $20
FB44 1A                                ENV_DCY_MOD_10      FCB  $1A
FB45 16                                ENV_DCY_MOD_11      FCB  $16
FB46 12                                ENV_DCY_MOD_12      FCB  $12
FB47 0E                                ENV_DCY_MOD_13      FCB  $0E
FB48 0C                                ENV_DCY_MOD_14      FCB  $0C
FB49 0A                                ENV_DCY_MOD_15      FCB  $0A
FB4A 40                                ENV_DCY_MOD_16      FCB  $40
FB4B 35                                ENV_DCY_MOD_17      FCB  $35
FB4C 2B                                ENV_DCY_MOD_18      FCB  $2B
FB4D 23                                ENV_DCY_MOD_19      FCB  $23
FB4E 1D                                ENV_DCY_MOD_20      FCB  $1D
FB4F 18                                ENV_DCY_MOD_21      FCB  $18
FB50 14                                ENV_DCY_MOD_22      FCB  $14
FB51 10                                ENV_DCY_MOD_23      FCB  $10
FB52 0D                                ENV_DCY_MOD_24      FCB  $0D
FB53 0B                                ENV_DCY_MOD_25      FCB  $0B
FB54 09                                ENV_DCY_MOD_26      FCB  $09
FB55 07                                ENV_DCY_MOD_27      FCB  $07
FB56 06                                ENV_DCY_MOD_28      FCB  $06
FB57 05                                ENV_DCY_MOD_29      FCB  $05
FB58 04                                ENV_DCY_MOD_30      FCB  $04
FB59 03                                ENV_DCY_MOD_31      FCB  $03
FB5A 80                                GLISSANDRO_0        FCB  $80                None
FB5B 80                                GLISSANDRO_1        FCB  $80                Fast
FB5C 55                                GLISSANDRO_2        FCB  $55
FB5D 40                                GLISSANDRO_3        FCB  $40
FB5E 3A                                GLISSANDRO_4        FCB  $3A
FB5F 35                                GLISSANDRO_5        FCB  $35
FB60 30                                GLISSANDRO_6        FCB  $30
FB61 2C                                GLISSANDRO_7        FCB  $2C
FB62 28                                GLISSANDRO_8        FCB  $28
FB63 25                                GLISSANDRO_9        FCB  $25
FB64 22                                GLISSANDRO_10       FCB  $22
FB65 1F                                GLISSANDRO_11       FCB  $1F
FB66 1C                                GLISSANDRO_12       FCB  $1C
FB67 1A                                GLISSANDRO_13       FCB  $1A
FB68 18                                GLISSANDRO_14       FCB  $18
FB69 16                                GLISSANDRO_15       FCB  $16
FB6A 14                                GLISSANDRO_16       FCB  $14
FB6B 13                                GLISSANDRO_17       FCB  $13
FB6C 12                                GLISSANDRO_18       FCB  $12
FB6D 11                                GLISSANDRO_19       FCB  $11
FB6E 10                                GLISSANDRO_20       FCB  $10
FB6F 0F                                GLISSANDRO_21       FCB  $0F
FB70 0E                                GLISSANDRO_22       FCB  $0E
FB71 0D                                GLISSANDRO_23       FCB  $0D
FB72 0C                                GLISSANDRO_24       FCB  $0C
FB73 0B                                GLISSANDRO_25       FCB  $0B
FB74 0A                                GLISSANDRO_26       FCB  $0A
FB75 09                                GLISSANDRO_27       FCB  $09
FB76 08                                GLISSANDRO_28       FCB  $08
FB77 07                                GLISSANDRO_29       FCB  $07
FB78 06                                GLISSANDRO_30       FCB  $06
FB79 05                                GLISSANDRO_31       FCB  $05                Slow
FB7A 10                                KYBD_SWP_A_MOD-8    FCB  $10
FB7B 11                                KYBD_SWP_A_MOD-7    FCB  $11
FB7C 13                                KYBD_SWP_A_MOD-6    FCB  $13
FB7D 15                                KYBD_SWP_A_MOD-5    FCB  $15
FB7E 17                                KYBD_SWP_A_MOD-4    FCB  $17
FB7F 19                                KYBD_SWP_A_MOD-3    FCB  $19
FB80 1B                                KYBD_SWP_A_MOD-2    FCB  $1B
FB81 1D                                KYBD_SWP_A_MOD-1    FCB  $1D
FB82 20                                KYBD_SWP_A_MOD_0    FCB  $20
FB83 23                                KYBD_SWP_A_MOD_1    FCB  $23
FB84 26                                KYBD_SWP_A_MOD_2    FCB  $26
FB85 29                                KYBD_SWP_A_MOD_3    FCB  $29
FB86 2D                                KYBD_SWP_A_MOD_4    FCB  $2D
FB87 31                                KYBD_SWP_A_MOD_5    FCB  $31
FB88 36                                KYBD_SWP_A_MOD_6    FCB  $36
FB89 3B                                KYBD_SWP_A_MOD_7    FCB  $3B
FB8A 40                                KYBD_SWP_A_MOD_8    FCB  $40
FB8B 7E                                LED_CODE_0          FCB  $7E                Seven Segment Display Data Definition (0 = $7E, 1 = $30, etc)
FB8C 30                                LED_CODE_1          FCB  $30
FB8D 6D                                LED_CODE_2          FCB  $6D
FB8E 79                                LED_CODE_3          FCB  $79
FB8F 33                                LED_CODE_4          FCB  $33
FB90 5B                                LED_CODE_5          FCB  $5B
FB91 5F                                LED_CODE_6          FCB  $5F
FB92 70                                LED_CODE_7          FCB  $70
FB93 7F                                LED_CODE_8          FCB  $7F
FB94 7B                                LED_CODE_9          FCB  $7B
FB95 01                                PARAM_LMT_00        FCB  $01
FB96 03                                PARAM_LMT_01        FCB  $03
FB97 07                                PARAM_LMT_02        FCB  $07
FB98 0F                                PARAM_LMT_03        FCB  $0F
FB99 1F                                PARAM_LMT_04        FCB  $1F
FB9A 3F                                PARAM_LMT_05        FCB  $3F
FB9B 7F                                PARAM_LMT_06        FCB  $7F
FB9C FF                                PARAM_LMT_07        FCB  $FF
FB9D 00A3                              SWP_R_0_DAT         FDB  $00A3              Sweep Rate Data for Rate = 0 (Slow)
FB9F 00B0                              SWP_R_1_DAT         FDB  $00B0
FBA1 00BD                              SWP_R_2_DAT         FDB  $00BD
FBA3 00CB                              SWP_R_3_DAT         FDB  $00CB
FBA5 00DB                              SWP_R_4_DAT         FDB  $00DB
FBA7 00EB                              SWP_R_5_DAT         FDB  $00EB
FBA9 00FD                              SWP_R_6_DAT         FDB  $00FD
FBAB 0110                              SWP_R_7_DAT         FDB  $0110
FBAD 0125                              SWP_R_8_DAT         FDB  $0125
FBAF 013B                              SWP_R_9_DAT         FDB  $013B
FBB1 0153                              SWP_R_10_DAT        FDB  $0153
FBB3 016D                              SWP_R_11_DAT        FDB  $016D
FBB5 0188                              SWP_R_12_DAT        FDB  $0188
FBB7 01A6                              SWP_R_13_DAT        FDB  $01A6
FBB9 01C6                              SWP_R_14_DAT        FDB  $01C6
FBBB 01E9                              SWP_R_15_DAT        FDB  $01E9
FBBD 020E                              SWP_R_16_DAT        FDB  $020E
FBBF 0235                              SWP_R_17_DAT        FDB  $0235
FBC1 0260                              SWP_R_18_DAT        FDB  $0260
FBC3 028F                              SWP_R_19_DAT        FDB  $028F
FBC5 02C0                              SWP_R_20_DAT        FDB  $02C0
FBC7 02F6                              SWP_R_21_DAT        FDB  $02F6
FBC9 032F                              SWP_R_22_DAT        FDB  $032F
FBCB 036D                              SWP_R_23_DAT        FDB  $036D
FBCD 03AF                              SWP_R_24_DAT        FDB  $03AF
FBCF 03F7                              SWP_R_25_DAT        FDB  $03F7
FBD1 0444                              SWP_R_26_DAT        FDB  $0444
FBD3 0497                              SWP_R_27_DAT        FDB  $0497
FBD5 04F0                              SWP_R_28_DAT        FDB  $04F0
FBD7 0550                              SWP_R_29_DAT        FDB  $0550
FBD9 05B7                              SWP_R_30_DAT        FDB  $05B7
FBDB 0626                              SWP_R_31_DAT        FDB  $0626
FBDD 069D                              SWP_R_32_DAT        FDB  $069D
FBDF 071D                              SWP_R_33_DAT        FDB  $071D
FBE1 07A7                              SWP_R_34_DAT        FDB  $07A7
FBE3 083C                              SWP_R_35_DAT        FDB  $083C
FBE5 08DC                              SWP_R_36_DAT        FDB  $08DC
FBE7 0988                              SWP_R_37_DAT        FDB  $0988
FBE9 0A41                              SWP_R_38_DAT        FDB  $0A41
FBEB 0B08                              SWP_R_39_DAT        FDB  $0B08
FBED 0BDE                              SWP_R_40_DAT        FDB  $0BDE
FBEF 0CC4                              SWP_R_41_DAT        FDB  $0CC4
FBF1 0DBC                              SWP_R_42_DAT        FDB  $0DBC
FBF3 0EC7                              SWP_R_43_DAT        FDB  $0EC7
FBF5 0FE6                              SWP_R_44_DAT        FDB  $0FE6
FBF7 111A                              SWP_R_45_DAT        FDB  $111A
FBF9 1266                              SWP_R_46_DAT        FDB  $1266
FBFB 13CC                              SWP_R_47_DAT        FDB  $13CC
FBFD 154C                              SWP_R_48_DAT        FDB  $154C
FBFF 16E9                              SWP_R_49_DAT        FDB  $16E9
FC01 18A6                              SWP_R_50_DAT        FDB  $18A6
FC03 1A85                              SWP_R_51_DAT        FDB  $1A85
FC05 1C88                              SWP_R_52_DAT        FDB  $1C88
FC07 1EB2                              SWP_R_53_DAT        FDB  $1EB2
FC09 2105                              SWP_R_54_DAT        FDB  $2105
FC0B 2387                              SWP_R_55_DAT        FDB  $2387
FC0D 2638                              SWP_R_56_DAT        FDB  $2638
FC0F 291E                              SWP_R_57_DAT        FDB  $291E
FC11 2C3C                              SWP_R_58_DAT        FDB  $2C3C
FC13 2F97                              SWP_R_59_DAT        FDB  $2F97
FC15 3333                              SWP_R_60_DAT        FDB  $3333
FC17 3715                              SWP_R_61_DAT        FDB  $3715
FC19 3B43                              SWP_R_62_DAT        FDB  $3B43
FC1B 3FC1                              SWP_R_63_DAT        FDB  $3FC1              Sweep Rate Data for Rate = 63 (Fast)
FC1D 0000                              SWP0_DAT_ADDR       FDB  $0000
FC1F 00                                SWP0_DAT_LGTH       FCB  $00
FC20 0000                              SWP1_DAT_ADDR       FDB  $0000
FC22 00                                SWP1_DAT_LGTH       FCB  $00
FC23 0000                              SWP2_DAT_ADDR       FDB  $0000
FC25 00                                SWP2_DAT_LGTH       FCB  $00
FC26 0000                              SWP3_DAT_ADDR       FDB  $0000
FC28 00                                SWP3_DAT_LGTH       FCB  $00
FC29 0000                              SWP4_DAT_ADDR       FDB  $0000
FC2B 00                                SWP4_DAT_LGTH       FCB  $00
FC2C 0000                              SWP5_DAT_ADDR       FDB  $0000
FC2E 00                                SWP5_DAT_LGTH       FCB  $00
FC2F 0000                              SWP6_DAT_ADDR       FDB  $0000
FC31 00                                SWP6_DAT_LGTH       FCB  $00
FC32 0000                              SWP7_DAT_ADDR       FDB  $0000
FC34 00                                SWP7_DAT_LGTH       FCB  $00
FC35 FC4D                              SWP8_DAT_ADDR       FDB  $FC4D
FC37 02                                SWP8_DAT_LGTH       FCB  $02
FC38 FC4F                              SWP9_DAT_ADDR       FDB  $FC4F
FC3A 03                                SWP9_DAT_LGTH       FCB  $03
FC3B FC52                              SWP10_DAT_ADDR      FDB  $FC52
FC3D 04                                SWP10_DAT_LGTH      FCB  $04
FC3E FC56                              SWP11_DAT_ADDR      FDB  $FC56
FC40 04                                SWP11_DAT_LGTH      FCB  $04
FC41 FC5A                              SWP12_DAT_ADDR      FDB  $FC5A
FC43 06                                SWP12_DAT_LGTH      FCB  $06
FC44 FC60                              SWP13_DAT_ADDR      FDB  $FC60
FC46 06                                SWP13_DAT_LGTH      FCB  $06
FC47 FC66                              SWP14_DAT_ADDR      FDB  $FC66
FC49 08                                SWP14_DAT_LGTH      FCB  $08
FC4A D800                              SWP15_DAT_ADDR      FDB  $D800
FC4C FF                                SWP15_DAT_LGTH      FCB  $FF
FC4D 4000                              SWP_WAVE_8_DAT      FDB  $4000
FC4F 402000                            SWP_WAVE_9_DAT      FCB  $40,$20,$00
FC52 40200020                          SWP_WAVE10_DAT      FDB  $4020,$0020
FC56 402000E0                          SWP_WAVE11_DAT      FDB  $4020,$00E0
FC5A 402000E00020                      SWP_WAVE12_DAT      FDB  $4020,$00E0,$0020
FC60 402000E0C0A0                      SWP_WAVE13_DAT      FDB  $4020,$00E0,$C0A0
FC66 402000E0C0E00020                  SWP_WAVE14_DAT      FDB  $4020,$00E0,$C0E0,$0020

FC6E 0D07                              DO_SPCL_RESET       TST  RESET_VAL          Check Reset Value ($00 on Sys Startup)
FC70 2A15                                                  BPL  PSVE_RESET_VAL     If Reset Val <> 80 or 81, branch
FC72 8E0000                                                LDX  #$0                Else -ve reset value : X = $0000
FC75 CE0300                                                LDU  #$300              U = $0300 = base address of channel 0
FC78 AF44                              INIT_CHAN_N         STX  4,U    $4          Reset channel (set "next" board to $0000)
FC7A 30C4                                                  LEAX 0,U                X = address of "this" board
FC7C 33C90072                                              LEAU 114,U              U = base address of next board
FC80 8C061E                                                CMPX #$61E              Compare against base address for channel 14 (Board 7)
FC83 25F3                                                  BCS  INIT_CHAN_N        If we're not past Ch 14, Branch
FC85 9F38                                                  STX  LNK_INST_ADR       Else, we've done them all
FC87 108E0034                          PSVE_RESET_VAL      LDY  #$34               Y = $0034
FC8B AE24                              L237                LDX  $4,Y               X = Address of Next Board 
FC8D 2724                                                  BEQ  NO_NXT_CHAN        If X = 0, there is no defined next channel, branch
FC8F 7F2008                            MORE_BRD_4INST      CLR  RD_EOC_WR_SYND     Store 0 to Synth Data Latches
FC92 A607                                                  LDA  $7,X               A = current channel number
FC94 44                                                    LSRA                    A = current board #
FC95 8A10                                                  ORA  #$10               Set Bit 4 (i.e., Select STB2 - patch filter items)
FC97 B72009                                                STA  WR_SYNA            Sel STB2 for curr chan, synd already clear; no-op, SUM0, Indep. Chan.
FC9A 8D32                                                  BSR  AUTO_TUNE_CH_X     (Returns A)
FC9C 260F                                                  BNE  GET_NXT_BOARD      Branch if we failed the auto-tune
FC9E 308839                                                LEAX $39,X              Else, A = 0, X = Channel Address of Link Channel
FCA1 8D2B                                                  BSR  AUTO_TUNE_CH_X     Do Autotune for other channel on board
FCA3 3088C7                                                LEAX $C7,X              X = "original" or board address
FCA6 4D                                                    TSTA                    Seeif A = 0
FCA7 2604                                                  BNE  GET_NXT_BOARD      If Auto-tune didn't return 0, we had a bad auto-tune, branch
FCA9 3184                                                  LEAY 0,X                Else this channel tuned, Y = base address of this board
FCAB 20DE                                                  BRA  L237

FCAD AE04                              GET_NXT_BOARD       LDX  $4,X               X = Address of Next Board Assigned to Inst.
FCAF AF24                                                  STX  $4,Y               Update "Address of Last Board to Play this Inst."
FCB1 26DC                                                  BNE  MORE_BRD_4INST     If Address <> 0 (i.e., this is a "next board") branch
FCB3 C640                              NO_NXT_CHAN         LDB  #$40 '@            else we're at end of boards for Inst - B = $40
FCB5 BDFF67                                                JSR  S_H_16_CH          Set/Reset Pitch, Width & Cutoff for all 8 S&H Channels
FCB8 BDDA55                                                JSR  BOARD_ASSIGN       On Power-on invoke this results in no work
FCBB BDDECE                                                JSR  BAD_BRD_HNDLR      On power-on invoke this results in no work
FCBE 863F                                                  LDA  #$3F '?            A = $3F
FCC0 976F                                                  STA  SH_TEMP            Store "A" in TEMP S&H Spot
FCC2 860F                                                  LDA  #$F                A = $F
FCC4 976E                                                  STA  LAST_KEY_ROW       Last Row Number where keypress found
FCC6 962F                                                  LDA  WR_MSCO_IMG        A = Image of WR_MSCO
FCC8 B72001                                                STA  RD_MSCI_WR_MSCO    Store MSC0 Image to H/W MSCO Port (on power up, c-int, k-int, ena osc.)
FCCB 1CAF                                                  ANDC #$AF               Ignore FIRQ & IRQ
FCCD 39                                                    RTS  

FCCE 8680                              AUTO_TUNE_CH_X      LDA  #$80               A = $80 (Centre Value)
FCD0 A78835                                                STA  $35,X              $80 -> RDAC Value for Pitch, X = Address of Channel (Reset RDAC value)
FCD3 A78838                                                STA  $38,X              $80 -> RDAC Value for Cutoff (Reset RDAC value)
FCD6 4F                                                    CLRA                    A = 0
FCD7 5F                                                    CLRB                    B = 0
FCD8 ED8836                                                STD  $36,X              $0000 -> MDAC (MDAC+1) Value for Cutoff (Reset Cutoff value)
FCDB 8617                                                  LDA  #$17               A = $17 (Pulse, LP Filt, Filt Res 0)
FCDD E607                                                  LDB  $7,X               B = Current Channel #
FCDF 54                                                    LSRB                    Push Last bit of Channel # to Carry (B = Current Board #)
FCE0 2402                                                  BCC  EVEN_CHAN          If carry clear, channel number was even - branch
FCE2 CA08                                                  ORB  #$8                else, channel is odd - set bit 4 (select "B" params) (STB1)
FCE4 FD2008                            EVEN_CHAN           STD  RD_EOC_WR_SYND     Set A or B Parms, Wave Shape = Pulse, Filt Res = 0, LP Filt
FCE7 8609                                                  LDA  #$9                A = $09 (0000 1001)
FCE9 B72001                                                STA  RD_MSCI_WR_MSCO    Enable Osc, Ena Output, Turn off Ext. Motor, Ingore Ints.
FCEC CCFFFF                                                LDD  #$FFFF             D = $FFFF
FCEF FD2006                                                STD  RD_NOTE_WR_LED     Turn on all LEDs (Flashable & Otherwise)
FCF2 CC02C0                                                LDD  #$2C0              D = $02C0
FCF5 ED8833                                                STD  $33,X              Store $02C0 as MDAC & MDAC+1 Values for Pitch (Low Note Chk)
FCF8 CC0340                                                LDD  #$340              D = $0340
FCFB BDFF67                            L_PITCH_SHA         JSR  S_H_16_CH          Set Sample & Hold (for A&B voices for all 8-chan)
FCFE 4A                                                    DECA                    A = A - 1
FCFF 26FA                                                  BNE  L_PITCH_SHA        Loop 3 times (don't know why)
FD01 4C                                                    INCA                    A = A + 1 (made A = 1)
FD02 BDFF35                                                JSR  SET_TIMER_A        Set TImer Mode = 1 = SYNTH/64 Timer Mode D= what timer read
FD05 BDFE73                                                JSR  TIMER_LOOKUP       Do Lookup on Timer
FD08 2609                                                  BNE  L_PITCH_TOK        If Y <> 0, branch
FD0A 0D07                                                  TST  RESET_VAL          Else, Assume Broken Channel (Timer Overflow) Check Reset_Val
FD0C 102A0121                                              LBPL TURN_LEDS_OFF      If Reset_Val > 0 (i.e., not special reset), Long Branch
FD10 CCE000                                                LDD  #$E000             else special reset - D = $E000
FD13 DD01                              L_PITCH_TOK         STD  MEM_01             MEM_01 & MEM_02 = Timer lookup for low-pitch settings
FD15 CC0BC0                                                LDD  #$BC0              D = $0BC0 (High Note Check) = 6 octaves higher than low note
FD18 ED8833                                                STD  $33,X              Store $0BC0 to MDAC & MDAC+1 for Pitch
FD1B CC0340                                                LDD  #$340              D = $0340
FD1E BDFF67                            H_PITCH_SHA         JSR  S_H_16_CH
FD21 4A                                                    DECA                    A = A - 1
FD22 26FA                                                  BNE  H_PITCH_SHA        Loop 3 times (do set SMPL_HOLD for 3 groups of items)
FD24 BDFF35                                                JSR  SET_TIMER_A        Go Set Timer D= What timer Read
FD27 BDFE73                                                JSR  TIMER_LOOKUP       Do lookup on timer
FD2A 2609                                                  BNE  H_PITCH_TOK        If X <> 0, branch
FD2C 0D07                                                  TST  RESET_VAL          Else, timer = 0, assume broken channel (timer overlflow)
FD2E 102A00FF                                              LBPL TURN_LEDS_OFF      Branch if Reset Val >= 0 (Flash LEDS Off & Exit)
FD32 CCE000                                                LDD  #$E000             D = $E000
FD35 9301                              H_PITCH_TOK         SUBD MEM_01             D - MEM -> D (D = diff between timer lookup for high f and low f)
FD37 47                                                    ASRA                    Double top bit, lower bit -> carry
FD38 56                                                    RORB 
FD39 BDFE38                                                JSR  CALC_RDAC_AMT      carry -> top bit, bot -> carry (D = D/2)
FD3C 2608                                                  BNE  STORE_P_RDAC       Branch if timer gap not acceptable
FD3E 9607                                                  LDA  RESET_VAL          else, assume broken channel - A = Reset Value
FD40 102A00ED                                              LBPL TURN_LEDS_OFF      Branch if Reset Value >= 0 (i.e., reset val = 00 or 01)
FD44 8680                                                  LDA  #$80               A = $80
FD46 A78835                            STORE_P_RDAC        STA  $35,X              Store A to RDAC Value for Pitch
FD49 CC02C0                                                LDD  #$2C0              D = $02C0
FD4C ED8833                                                STD  $33,X              Store D to MDAC and MDAC+1 Value for Pitch in channel def'n
FD4F CC0340                                                LDD  #$340
FD52 BDFF67                            OTH_PITCH_SHA       JSR  S_H_16_CH
FD55 4A                                                    DECA                    A = A - 1
FD56 26FA                                                  BNE  OTH_PITCH_SHA
FD58 4C                                                    INCA                    A = A + 1
FD59 BDFF35                                                JSR  SET_TIMER_A        Set Timer Mode = 1 = Synth/64
FD5C BDFE73                                                JSR  TIMER_LOOKUP       Do lookup on timer
FD5F 2609                                                  BNE  OTH_PITCH_TOK
FD61 9607                                                  LDA  RESET_VAL          else, timer = 0 ... assume broken channel (timer overflow)
FD63 102A00CA                                              LBPL TURN_LEDS_OFF      Turn LEDs Off
FD67 CCE000                                                LDD  #$E000
FD6A 83D23D                            OTH_PITCH_TOK       SUBD #$D23D             D = D - $D23D
FD6D 2E09                                                  BGT  ADJ_P_RDAC         If no error, branch
FD6F 0D07                                                  TST  RESET_VAL          else, assume broken channel (timer overflow)
FD71 102A00BC                                              LBPL TURN_LEDS_OFF      Turn LEDs Off
FD75 CC2000                                                LDD  #$2000             D = $2000
FD78 C35014                            ADJ_P_RDAC          ADDD #$5014
FD7B BDFF24                                                JSR  D_DIV_3_64         D = (3/64)D
FD7E ED8833                                                STD  $33,X              Store D to MDAC & MDAC+1 Value for Pitch
FD81 860B                                                  LDA  #$B                Mute OSC
FD83 B72001                                                STA  RD_MSCI_WR_MSCO
FD86 4F                                                    CLRA                    A = 0
FD87 5F                                                    CLRB                    B = 0
FD88 FD2006                                                STD  RD_NOTE_WR_LED     Turn all LEDs Off
FD8B 8610                                                  LDA  #$10               A = $10
FD8D E607                                                  LDB  $7,X               B = Channel #
FD8F 54                                                    LSRB                    Shift # right (B = Board #)
FD90 2402                                                  BCC  L238               If carry clear, then it is an even chan.
FD92 CA08                                                  ORB  #$8                Else, was odd channel (B-Param) - Set Bit B3 (B-Board Param)
FD94 FD2008                            L238                STD  RD_EOC_WR_SYND
FD97 CC0680                                                LDD  #$680              D = $0680
FD9A ED8836                                                STD  $36,X              Store MDAC & MDAC + 1 Value for Cutoff
FD9D CC0A40                                                LDD  #$A40              D = $0A40
FDA0 BDFF67                            L_FILT_SHA          JSR  S_H_16_CH
FDA3 4A                                                    DECA                    A = A - 1
FDA4 26FA                                                  BNE  L_FILT_SHA         Loop 10 times
FDA6 BDFF35                                                JSR  SET_TIMER_A        A = 0, set time to "synth" mode
FDA9 BDFE73                                                JSR  TIMER_LOOKUP       do lookup on timer
FDAC 2607                                                  BNE  L_FILT_TOK         If Y <> 0, branch
FDAE 0D07                                                  TST  RESET_VAL          else, timer = 0 ... assume broken channel (timer overflow)
FDB0 2A73                                                  BPL  L239               If Reset Type <> 80 or 81, branch
FDB2 CC6000                                                LDD  #$6000             Else, D = $6000
FDB5 8B60                              L_FILT_TOK          ADDA #$60 '`            A = A + $60
FDB7 DD01                                                  STD  MEM_01             D -> MEM01, MEM02
FDB9 CC0B00                                                LDD  #$B00              D = $0B00
FDBC ED8836                                                STD  $36,X              Store MDAC & MDAC+1 Value for Cutoff
FDBF CC0A40                                                LDD  #$A40              D = $0A40
FDC2 BDFF67                            H_FILT_SHA          JSR  S_H_16_CH
FDC5 4A                                                    DECA 
FDC6 26FA                                                  BNE  H_FILT_SHA
FDC8 BDFF35                                                JSR  SET_TIMER_A        A = 0, set timer to "synth" mode
FDCB BDFE73                                                JSR  TIMER_LOOKUP       do lookup on timer
FDCE 2607                                                  BNE  H_FILT_TOK
FDD0 0D07                                                  TST  RESET_VAL          else, timer = 0, assume broken channel (timer overflow)
FDD2 2A51                                                  BPL  L239
FDD4 CCE000                                                LDD  #$E000             D = $E000
FDD7 9301                              H_FILT_TOK          SUBD MEM_01
FDD9 BDFE38                                                JSR  CALC_RDAC_AMT
FDDC 2606                                                  BNE  STORE_F_RDAC
FDDE 0D07                                                  TST  RESET_VAL          else, assume broken channel (timer overflow)
FDE0 2A43                                                  BPL  L239
FDE2 8680                                                  LDA  #$80               A = $80
FDE4 A78838                            STORE_F_RDAC        STA  $38,X              Store A to RDAC Value for Cutoff
FDE7 CC0B00                                                LDD  #$B00              D = $0B00
FDEA ED8836                                                STD  $36,X              Store D to MDAC & MDAC+1 Value for Cutoff
FDED CC0A40                                                LDD  #$A40
FDF0 BDFF67                            OTH_FILT_SHA        JSR  S_H_16_CH
FDF3 4A                                                    DECA 
FDF4 26FA                                                  BNE  OTH_FILT_SHA
FDF6 BDFF35                                                JSR  SET_TIMER_A        A = 0, set timer to "Synth" mode
FDF9 BDFE73                                                JSR  TIMER_LOOKUP
FDFC 2607                                                  BNE  OTH_FILT_TOK
FDFE 0D07                                                  TST  RESET_VAL          else, assume broken channel (timer overflow)
FE00 2A23                                                  BPL  L239
FE02 CCE000                                                LDD  #$E000
FE05 8391B4                            OTH_FILT_TOK        SUBD #$91B4             D = D - $91B4
FE08 2E07                                                  BGT  ADJ_F_RDAC
FE0A 0D07                                                  TST  RESET_VAL
FE0C 2A17                                                  BPL  L239
FE0E CC2000                                                LDD  #$2000             D = $2000
FE11 BDFF24                            ADJ_F_RDAC          JSR  D_DIV_3_64         D = (3/64)D
FE14 ED8836                                                STD  $36,X              Store D to MDAC & MDAC+1 value for cutoff
FE17 8617                                                  LDA  #$17               A = $17
FE19 E607                                                  LDB  $7,X               B = Channel #
FE1B 54                                                    LSRB 
FE1C 2402                                                  BCC  L240               Branch if "A" param channel
FE1E CA08                                                  ORB  #$8                Else, "B" param channel
FE20 FD2008                            L240                STD  RD_EOC_WR_SYND     Wave Shape = Pulse, LP Filter, Filt Res. 0
FE23 4F                                                    CLRA                    A = 0
FE24 39                                                    RTS                     Return

FE25 8617                              L239                LDA  #$17               A = $17
FE27 E607                                                  LDB  $7,X               B = Channel #
FE29 54                                                    LSRB                    B = Board #
FE2A 2402                                                  BCC  A_PARAM            If carry Clar, than channel was even & we have an A param
FE2C CA08                                                  ORB  #$8                else, we have a "B" param
FE2E FD2008                            A_PARAM             STD  RD_EOC_WR_SYND     Store $17 to WR_SYND = Pulse, Filt Res = 0, LP Filt
FE31 4F                                TURN_LEDS_OFF       CLRA                    A = 0
FE32 5F                                                    CLRB                    B = 0
FE33 FD2006                                                STD  RD_NOTE_WR_LED     Turn LEDs Off
FE36 4A                                                    DECA                    A = A - 1
FE37 39                                                    RTS                     Return

FE38 C30600                            CALC_RDAC_AMT       ADDD #$600              D = D + $0600 (D= difference between two "times" + 0600)
FE3B 2B34                                                  BMI  RDAC_CALC_ERR      If there was more than $600 difference, we have error - exit
FE3D 10830CD0                                              CMPD #$CD0              Compare D w/ $0CD0
FE41 2E2E                                                  BGT  RDAC_CALC_ERR      If D >= $0CD0, we have error - exit
FE43 C35A00                                                ADDD #$5A00             D = D + $05A0
FE46 DD00                                                  STD  MEM_00
FE48 8610                                                  LDA  #$10               A = $10
FE4A 9704                                                  STA  MEM_04             RAM[0004] = $10
FE4C CC9249                                                LDD  #$9249             D = $9249
FE4F DD02                                                  STD  MEM_02
FE51 CC02CC                                                LDD  #$2CC              D = $02CC
FE54 0803                              L242                ASL  MEM_03
FE56 0902                                                  ROL  MEM_02
FE58 59                                                    ROLB 
FE59 49                                                    ROLA 
FE5A 109300                                                CMPD MEM_00
FE5D 2504                                                  BCS  L241
FE5F 9300                                                  SUBD MEM_00
FE61 0C03                                                  INC  MEM_03
FE63 0A04                              L241                DEC  MEM_04
FE65 26ED                                                  BNE  L242
FE67 58                                                    ASLB 
FE68 49                                                    ROLA 
FE69 109300                                                CMPD MEM_00
FE6C 9603                                                  LDA  MEM_03
FE6E 82F6                                                  SBCA #$F6
FE70 39                                                    RTS                     Return RDAC value in "A"

FE71 4F                                RDAC_CALC_ERR       CLRA                    A = 0
FE72 39                                                    RTS                     Exit (return RDAC value in "A")

FE73 3420                              TIMER_LOOKUP        PSHS Y                  D = timer value
FE75 108E0000                                              LDY  #$0                Y = 0
FE79 31A9E000                          SMALLER_TIME        LEAY -8192,Y            Y = $E000
FE7D 271F                                                  BEQ  T_LOOKUP_ERR       If Y = 0, branch (exit)
FE7F 58                                                    ASLB                    Else, shift top bit in to carry (0 into bottom), D = timer val
FE80 49                                                    ROLA                    Carry -> bot, top -> carry (shift all bits of "D" over) (D=Dx2)
FE81 2AF6                                                  BPL  SMALLER_TIME       Branch only if Top Bit = 0 (do not rotate more than 8 times)
FE83 3420                                                  PSHS Y                  Else, save Y
FE85 44                                                    LSRA                    we've shifted 1 too far
FE86 56                                                    RORB                    shift back
FE87 843F                                                  ANDA #$3F '?            Drop off top 2 bits (limit to allowable values)
FE89 48                                                    ASLA 
FE8A 108EFEA2                                              LDY  #$FEA2             Y = $FEA2 = Base address of Lookup Table 
FE8E 31A6                                                  LEAY A,Y                Y = address of item in table
FE90 A623                                                  LDA  $3,Y               A = 2nd byte of "next" byte
FE92 A021                                                  SUBA $1,Y               A = A - 2nd byte of look-up bytes
FE94 3D                                                    MUL                     D = AxB
FE95 1F89                                                  TFR  A,B                A -> B
FE97 4F                                                    CLRA                    A = 0
FE98 E3A4                                                  ADDD 0,Y
FE9A ABE1                                                  ADDA ,S++
FE9C 35A0                                                  PULS Y,PC

FE9E 4F                                T_LOOKUP_ERR        CLRA                    A = 0
FE9F 5F                                                    CLRB                    A = 0
FEA0 35A0                                                  PULS Y,PC

FEA2 000000B7016C021D02CC0379042304CB  TIMER_TBL0          FDB  $0000,$00B7,$016C,$021D,$02CC,$0379,$0423,$04CB
FEB2 0570061306B4075207EF088A092209B9  TIMER_TBL1          FDB  $0570,$0613,$06B4,$0752,$07EF,$088A,$0922,$09B9
FEC2 0A4D0AE00B710C000C8E0D1A0DA40E2D  TIMER_TBL2          FDB  $0A4D,$0AE0,$0B71,$0C00,$0C8E,$0D1A,$0DA4,$0E2D
FED2 0EB40F390FBD104010C1114111BF123C  TIMER_TBL3          FDB  $0EB4,$0F39,$0FBD,$1040,$10C1,$1141,$11BF,$123C
FEE2 12B8133213AC1424149A1510158515F8  TIMER_TBL4          FDB  $12B8,$1332,$13AC,$1424,$149A,$1510,$1585,$15F8
FEF2 166A16DB174B17BA182818951901196C  TIMER_TBL5          FDB  $166A,$16DB,$174B,$17BA,$1828,$1895,$1901,$196C
FF02 19D61A3F1AA71B0E1B751BDA1C3F1CA2  TIMER_TBL6          FDB  $19D6,$1A3F,$1AA7,$1B0E,$1B75,$1BDA,$1C3F,$1CA2
FF12 1D051D671DC91E291E891EE81F461FA3  TIMER_TBL7          FDB  $1D05,$1D67,$1DC9,$1E29,$1E89,$1EE8,$1F46,$1FA3

FF22 2000                                                  BRA  D_DIV_3_64

FF24 47                                D_DIV_3_64          ASRA 
FF25 56                                                    RORB                    D = D/2
FF26 47                                                    ASRA 
FF27 56                                                    RORB                    D = D/2 (now /4)
FF28 47                                                    ASRA 
FF29 56                                                    RORB                    D = D/2 (now /8)
FF2A 47                                                    ASRA 
FF2B 56                                                    RORB                    D = D/2 (now /16)
FF2C 47                                                    ASRA 
FF2D 56                                                    RORB                    D = D/2 (now /32)
FF2E DD01                                                  STD  MEM_01             D/32 -> MEM01 & MEM02
FF30 47                                                    ASRA 
FF31 56                                                    RORB                    D = D/2 (now /64)
FF32 D301                                                  ADDD MEM_01             D/32 + D/64 = 3D/64
FF34 39                                                    RTS  

FF35 B72003                            SET_TIMER_A         STA  RD_TIME_WR_TMOD    Set New Timer Mode (= Synth/64)
FF38 B72003                                                STA  RD_TIME_WR_TMOD    Set New Timer Mode
FF3B CC08C0                                                LDD  #$8C0              D = $08C0
FF3E 8D27                              STILL_TICKING       BSR  S_H_16_CH          Refresh S&H Values
FF40 B52001                                                BITA RD_MSCI_WR_MSCO    Check for Timer Ready
FF43 26F9                                                  BNE  STILL_TICKING      Branch if TRDY = 1 (i.e., branch if timer not ready)
FF45 FC2003                                                LDD  RD_TIME_WR_TMOD    D = Timer Val
FF48 271C                                                  BEQ  DONE_TIMER         If Timer = 0, branch (exit) (probably sick board)
FF4A CC08C0                                                LDD  #$8C0              Else, timer not done yet (board might be OK)
FF4D 8D18                              STILL_TICK_2        BSR  S_H_16_CH          Refresh S&H values for B=C0 = 1100 0000 -FAST
FF4F B52001                                                BITA RD_MSCI_WR_MSCO    Check for Timer Ready
FF52 26F9                                                  BNE  STILL_TICK_2       Branch if timer not ready
FF54 9607                                                  LDA  RESET_VAL          If we're here, timer val should be time since timer restarted
FF56 44                                                    LSRA                    Shift top bit of reset value into carry
FF57 2504                                                  BCS  RESET_EQ_8X        Branch if carry set (i.e., reset val = $8x) - ignore malfunc. chan.
FF59 FC2003                                                LDD  RD_TIME_WR_TMOD    else, D = timer value (good measurement)
FF5C 39                                                    RTS                     Exit

FF5D FC2003                            RESET_EQ_8X         LDD  RD_TIME_WR_TMOD    D = Timer value
FF60 58                                                    ASLB 
FF61 49                                                    ROLA 
FF62 2802                                                  BVC  DONE_TIMER         If we didn't overflow, exit
FF64 4F                                                    CLRA                    A = 0
FF65 5F                                                    CLRB                    B = 0
FF66 39                                DONE_TIMER          RTS                     Exit

FF67 3456                              S_H_16_CH           PSHS U,X,B,A
FF69 3084                                                  LEAX 0,X                X = address of "next" channel assigned to instrument
FF6B 2706                                                  BEQ  NO_NEXT_CH         If no "next channel" is defined, branch
FF6D A607                                                  LDA  $7,X               A = Channel #
FF6F 9700                                                  STA  MEM_00             Store Channel # to MEM_00
FF71 2004                                                  BRA  L243

FF73 86FF                              NO_NEXT_CH          LDA  #$FF               A = $FF
FF75 9700                                                  STA  MEM_00             Store $FF to MEM_00
FF77 8E0300                            L243                LDX  #$300              X = Base address for channel 0
FF7A D76F                                                  STB  SH_TEMP            B = Lower byte of D
FF7C F7200B                            PTCH_WDTH_CUT       STB  WR_SHA             Write "B" to sample and hold decoder ($40 = -FAST, Pitch A)
FF7F 54                                                    LSRB                    shift bottom bit of B to "carry"
FF80 252F                                                  BCS  SHA_0              If carry set, we have SHA0 (width or volume)
FF82 54                                                    LSRB                    Shift next bit of B to carry
FF83 2516                                                  BCS  SHA_1              If carry set, we have SHA_1 (cutoff or volume)
FF85 A607                                                  LDA  $7,X               A = channel #
FF87 9100                                                  CMPA MEM_00             Compare with stored channel # ($FF to start)
FF89 2605                                                  BNE  PITCH_RST          If MEM_00 <> current channel #, branch
FF8B EC8833                                                LDD  $33,X              D = MDAC, MDAC+1 Value for Pitch
FF8E 2003                                                  BRA  PITCH_SET

FF90 CC0FFF                            PITCH_RST           LDD  #$FFF              D = $0FFF = largest val. possible for main DAC's pitch
FF93 FD200C                            PITCH_SET           STD  WR_MDAC            D -> MDAC, MDAC+1 (put 12 bits into Main DAC's input)
FF96 A68835                                                LDA  $35,X              A = channel's RDAC Value for Pitch (previously stored)
FF99 2039                                                  BRA  RDAC_SHA_SET

FF9B A607                              SHA_1               LDA  $7,X               If we're here, we either have cutoff A or Cutoff B, A = Chan #
FF9D 9100                                                  CMPA MEM_00             See if current channel = stored channel
FF9F 2605                                                  BNE  CUTOFF_RST         If not, branch and reset cutoff
FFA1 EC8836                                                LDD  $36,X              D = MDAC, MDAC+1 Value for Cutoff
FFA4 2003                                                  BRA  CUTOFF_SET         Set Cutoff Values

FFA6 CC0FFF                            CUTOFF_RST          LDD  #$FFF              D = $0FFF
FFA9 FD200C                            CUTOFF_SET          STD  WR_MDAC            Store MDAC, MDAC+1 Values to Cutoff
FFAC A68838                                                LDA  $38,X              A = RDAC Value for Cutoff
FFAF 2023                                                  BRA  RDAC_SHA_SET       Set RDAC Values

FFB1 54                                SHA_0               LSRB                    Shift Next Bit to Right
FFB2 250A                                                  BCS  SHA_0_1            If carry set, then SHA1=1, SHA0=1=Volume A or Volume B, branch
FFB4 CC0800                                                LDD  #$800              else we have WidthA or WidthB, D = $0800
FFB7 FD200C                                                STD  WR_MDAC            Store $0800 to MDAC, MDAC+1
FFBA 86FF                                                  LDA  #$FF               A = $FF
FFBC 2016                                                  BRA  RDAC_SHA_SET       Set RDAC and SHA

FFBE A607                              SHA_0_1             LDA  $7,X               A = Channel #
FFC0 9100                                                  CMPA MEM_00             Compare w/ stored channel
FFC2 2605                                                  BNE  VOLUME_RST         Branch if current channel # <> stored channel #
FFC4 CC0FFF                                                LDD  #$FFF              D = $0FFF
FFC7 2003                                                  BRA  VOLUME_SET

FFC9 CC0000                            VOLUME_RST          LDD  #$0                D = $0000
FFCC FD200C                            VOLUME_SET          STD  WR_MDAC            Write 0 into DAC's main input
FFCF 86FF                                                  LDA  #$FF               A = $FF
FFD1 308839                                                LEAX $39,X              X = address of "link" channel (odd #)
FFD4 D66F                              RDAC_SHA_SET        LDB  SH_TEMP            B = Original Value of B ($40 to start)
FFD6 C4BF                                                  ANDB #$BF               Ensure B6 of "B" is set to zero (ensure SHEN on)
FFD8 FD200A                                                STD  WR_RDAC            Write A to RDAC, B to SHA (B starts at Channel 0)
FFDB 8614                                                  LDA  #$14               A = $14
FFDD 4A                                LOOP_20             DECA                    A = A - 1
FFDE 26FD                                                  BNE  LOOP_20            Wait for RDAC and SHA to settle/become stable
FFE0 CA40                                                  ORB  #$40 '@            Set B6 to 1 (ensure we have SHA, not SHEN)
FFE2 F7200B                                                STB  WR_SHA             Latch "B" selection
FFE5 5C                                                    INCB                    B = B + 1
FFE6 2906                                                  BVS  SH_ETC_EXIT        If Overflow Set, branch (i.e., if B = 1000 0000)
FFE8 2704                                                  BEQ  SH_ETC_EXIT        else If B = 0, branch
FFEA D76F                                                  STB  SH_TEMP            Store B to longer_term storage im memory (update old B w/new B)
FFEC 208E                                                  BRA  PTCH_WDTH_CUT      go do width & then cutoff, then do for all 8 SHEN channels

FFEE 35D6                              SH_ETC_EXIT         PULS A,B,X,U,PC

FFF0 20FE                              NMI_ETC_ADDR        BRA  NMI_ETC_ADDR

FFF2 FFF0                              SWI3                FDB  $FFF0
FFF4 FFF0                              SWI2                FDB  $FFF0
FFF6 F0B4                              FIRQ                FDB  $F0B4              -FINT on Proc: Called when KINT keyboard interrupt generated
FFF8 F0D6                              IRQ                 FDB  $F0D6              -IRQ on Proc: Called when data to/from Chroma Port
FFFA FFF0                              SW1                 FDB  $FFF0              
FFFC FFF0                              NMI                 FDB  $FFF0              Non Maskable Interrupt
FFFE F12C                              RESET               FDB  $F12C              H/W Reset - First Line of Code
