[4f508e6] | 1 | | ------------------------------------------------------------------------------
|
---|
| 2 | | seexec.s -- score event execution driver
|
---|
| 3 | | Version 40 -- 1988-10-06 -- D.N. Lynx Crowe
|
---|
| 4 |
|
---|
[84c0125] | 5 | | struct s_entry *
|
---|
[4f508e6] | 6 | | se_exec(ep, sd)
|
---|
[84c0125] | 7 | | struct s_entry *ep;
|
---|
[4f508e6] | 8 | | short sd;
|
---|
| 9 |
|
---|
| 10 | | Executes the event at 'ep', scrolling in direction 'sd'.
|
---|
| 11 |
|
---|
| 12 | | ------------------------------------------------------------------------------
|
---|
[f40a309] | 13 | .text
|
---|
[4f508e6] | 14 |
|
---|
[8325447] | 15 | .xdef se_exec
|
---|
[4f508e6] | 16 |
|
---|
[f40a309] | 17 | .xdef BadEvnt
|
---|
[4f508e6] | 18 |
|
---|
[8325447] | 19 | .xdef xevent
|
---|
| 20 |
|
---|
| 21 | .xref asgvce
|
---|
| 22 | .xref clkset
|
---|
| 23 | .xref getasg
|
---|
| 24 | .xref gettun
|
---|
| 25 | .xref procpfl
|
---|
| 26 | .xref selscor
|
---|
| 27 | .xref setdyn
|
---|
| 28 | .xref setloc
|
---|
| 29 | .xref setsv
|
---|
| 30 | .xref settmpo
|
---|
| 31 | .xref settune
|
---|
| 32 | .xref setv2gi
|
---|
| 33 |
|
---|
| 34 | .xref anrs
|
---|
| 35 | .xref var2src
|
---|
| 36 | .xref curasg
|
---|
| 37 | .xref curintp
|
---|
| 38 | .xref cursect
|
---|
| 39 | .xref grpmode
|
---|
| 40 | .xref grpstat
|
---|
| 41 | .xref ins2grp
|
---|
| 42 | .xref nxtflag
|
---|
| 43 | .xref recsw
|
---|
| 44 | .xref s_trns
|
---|
| 45 | .xref trgtab
|
---|
| 46 | .xref varmode
|
---|
| 47 | .xref vce2grp
|
---|
| 48 | .xref vce2trg
|
---|
| 49 | .xref veltab
|
---|
[4f508e6] | 50 |
|
---|
[f40a309] | 51 | .page
|
---|
[4f508e6] | 52 |
|
---|
| 53 | | parameter offsets
|
---|
| 54 | | -----------------
|
---|
| 55 | P_EP = 8 | WORD - 'ep' parameter offset
|
---|
| 56 | P_SD = 12 | WORD - 'sd' parameter offset
|
---|
| 57 |
|
---|
| 58 | | event structure offsets -- MUST match score.h definitions
|
---|
| 59 | | ----------------------- ------------------------------
|
---|
| 60 | | offset length
|
---|
| 61 | | ------ ------
|
---|
| 62 | E_TIME = 0 | LONG
|
---|
| 63 | E_SIZE = 4 | BYTE
|
---|
| 64 | E_TYPE = 5 | BYTE
|
---|
| 65 | E_DATA1 = 6 | BYTE
|
---|
| 66 | E_NOTE = 6 | BYTE
|
---|
| 67 | E_DATA2 = 7 | BYTE
|
---|
| 68 | E_GROUP = 7 | BYTE
|
---|
| 69 | E_BAK = 8 | LONG
|
---|
| 70 | E_FWD = 12 | LONG
|
---|
| 71 | E_DN = 16 | LONG
|
---|
| 72 | E_VEL = 16 | WORD
|
---|
| 73 | E_DATA4 = 18 | WORD
|
---|
| 74 | E_UP = 20 | LONG
|
---|
| 75 | E_LFT = 24 | LONG
|
---|
| 76 | E_RGT = 28 | LONG
|
---|
| 77 |
|
---|
| 78 | | Miscellaneous constants
|
---|
| 79 | | -----------------------
|
---|
| 80 | N_ETYPES = 25 | number of event types
|
---|
| 81 |
|
---|
| 82 | M_KSTATE = 0x01 | keys status bit
|
---|
| 83 | N_KSTATE = 0xFE | keys status bit complement
|
---|
| 84 |
|
---|
| 85 | D_BAK = 1 | code for backward scrolling
|
---|
| 86 |
|
---|
| 87 | LCL_PRT = 2 | 0-origin local port number
|
---|
| 88 | LCL_PCH = 0x1080 | port and channel for trigger
|
---|
| 89 |
|
---|
[f40a309] | 90 | .page
|
---|
[4f508e6] | 91 |
|
---|
| 92 | | A few words about se_exec:
|
---|
| 93 |
|
---|
| 94 | | se_exec has to be very fast, so it's written in assembly language,
|
---|
| 95 | | rather than C, which is usually pretty good, but not quite good enough
|
---|
| 96 | | for this application. The faster this routine runs, the higher the
|
---|
| 97 | | tempo we can keep up with. If this code is fast enough, we end up
|
---|
| 98 | | hardware limited by the timer.
|
---|
| 99 |
|
---|
[8325447] | 100 | se_exec: link a6,#0 | link stack frames
|
---|
[4f508e6] | 101 | movea.l P_EP(a6),a0 | get event pointer 'ep' into a0
|
---|
[3370595] | 102 | move.l a0,xevent | save in xevent
|
---|
[4f508e6] | 103 | move.b E_TYPE(a0),d1 | get event type into d1.W
|
---|
| 104 | andi.w #0x007F,d1 | ... and mask off new-data flag
|
---|
| 105 | cmp.b #N_ETYPES,d1 | see if it's valid
|
---|
| 106 | blt sexc1 | jump if it is
|
---|
| 107 |
|
---|
| 108 | BadEvnt: move.l a0,d0 | setup to return pointer we got
|
---|
| 109 | bra done | exit
|
---|
| 110 |
|
---|
[3370595] | 111 | exexit: movea.l xevent,a0 | point at next event
|
---|
[4f508e6] | 112 | move.l E_FWD(a0),d0 | ...
|
---|
| 113 |
|
---|
| 114 | done: unlk a6 | done -- unlink stack frames
|
---|
| 115 | rts | return to caller
|
---|
| 116 |
|
---|
| 117 | sexc1: lea sextab,a1 | get base of dispatch table
|
---|
| 118 | lsl.w #2,d1 | multiplty event by 4 for index
|
---|
| 119 | movea.l 0(a1,d1.W),a2 | get address of event routine
|
---|
| 120 | jmp (a2) | jump to event execution routine
|
---|
| 121 |
|
---|
| 122 | | On entry, the individual execution routines only depend on a0 pointing at the
|
---|
| 123 | | event they were dispatched for.
|
---|
| 124 |
|
---|
| 125 | | The usual C function register usage conventions apply:
|
---|
| 126 |
|
---|
| 127 | | d0..d2 and a0..a2 are used for scratch, and are not preserved.
|
---|
| 128 |
|
---|
| 129 | | d3..d6 and a3..a5 are register variables, and are preserved.
|
---|
| 130 | | a6 = frame pointer, a7 = stack pointer, and are preserved.
|
---|
| 131 |
|
---|
[f40a309] | 132 | .page
|
---|
[4f508e6] | 133 |
|
---|
| 134 | | exnbeg -- execute note begin
|
---|
| 135 | | ------ ------------------
|
---|
| 136 | | If things need to be sped up, we could incorporate the functions of
|
---|
| 137 | | asgvce() here, rather than calling it. asgvce() could also be re-written in
|
---|
| 138 | | assembly language to make it a shade faster.
|
---|
| 139 |
|
---|
| 140 | exnbeg: cmpi.w #D_BAK,P_SD(a6) | check direction
|
---|
| 141 | beq nendex | if backward, treat as note end
|
---|
| 142 |
|
---|
| 143 | nbegex: clr.w d1 | clear d1
|
---|
| 144 | move.b E_GROUP(a0),d1 | get group number
|
---|
[84c0125] | 145 | add.w d1,d1 | ... * 2
|
---|
[8325447] | 146 | lea grpstat,a1 | point at grpstat
|
---|
[4f508e6] | 147 | tst.w 0(a1,d1.W) | see if group is enabled
|
---|
| 148 | beq exexit | done if not
|
---|
| 149 |
|
---|
| 150 | move.b E_NOTE(a0),d1 | d1 = note number nn (0..127)
|
---|
| 151 | move.w #LCL_PCH,d2 | put port and channel in d2
|
---|
| 152 | add.w d1,d2 | d2 = trg
|
---|
[8325447] | 153 | lea trgtab,a1 | point at trgtab[trg]
|
---|
[4f508e6] | 154 | move.b 0(a1,d2.W),d0 | ...
|
---|
| 155 | or.b #M_KSTATE,d0 | set trigger table entry on
|
---|
| 156 | move.b d0,0(a1,d2.W) | ...
|
---|
[8325447] | 157 | lea veltab,a1 | point at veltab
|
---|
[4f508e6] | 158 | add.w d2,d2 | ...
|
---|
| 159 | move.w E_VEL(a0),0(a1,d2.W) | put velocity in veltab
|
---|
| 160 | move.w E_VEL(a0),-(a7) | put velocity on the stack
|
---|
| 161 | move.w d1,-(a7) | put note number on the stack
|
---|
| 162 | move.w #1,-(a7) | put channel on the stack
|
---|
| 163 | move.w #LCL_PRT,-(a7) | put port on the stack
|
---|
| 164 | move.b E_GROUP(a0),d1 | d1 = group number (0..11)
|
---|
| 165 | move.w d1,-(a7) | put group number on the stack
|
---|
[8325447] | 166 | jsr asgvce | start the note
|
---|
[4f508e6] | 167 | add.l #10,a7 | clean up the stack
|
---|
| 168 | bra exexit | done
|
---|
| 169 |
|
---|
[f40a309] | 170 | .page
|
---|
[4f508e6] | 171 |
|
---|
| 172 | | exnend -- execute note end
|
---|
| 173 | | ------ ----------------
|
---|
| 174 | | If things need to be sped up, we could incorporate the functions of
|
---|
| 175 | | procpfl() here, rather than calling it. procpfl() could also be re-written in
|
---|
| 176 | | assembly language to make it a shade faster.
|
---|
| 177 |
|
---|
| 178 | exnend: cmpi.w #D_BAK,P_SD(a6) | check direction
|
---|
| 179 | beq nbegex | if backward, treat as beginning
|
---|
| 180 |
|
---|
| 181 | nendex: clr.w d1 | clear d1
|
---|
| 182 | move.b E_GROUP(a0),d1 | get group number
|
---|
[84c0125] | 183 | add.w d1,d1 | ... * 2
|
---|
[8325447] | 184 | lea grpstat,a1 | point at grpstat
|
---|
[4f508e6] | 185 | tst.w 0(a1,d1.W) | check group status
|
---|
| 186 | beq exexit | done if disabled
|
---|
| 187 |
|
---|
| 188 | move.b E_NOTE(a0),d1 | d1 = note number nn (0..127)
|
---|
| 189 | move.w #LCL_PCH,d2 | put port and channel in d2
|
---|
[84c0125] | 190 | add.w d1,d2 | d2 = trg * 2
|
---|
[4f508e6] | 191 | add.w d2,d2 | ...
|
---|
[8325447] | 192 | lea trgtab,a1 | set trigger table entry off
|
---|
[4f508e6] | 193 | move.b 0(a1,d2.W),d0 | ...
|
---|
| 194 | and.b #N_KSTATE,d0 | ...
|
---|
| 195 | move.b d0,0(a1,d2.W) | ...
|
---|
| 196 | bne exexit | done if note still active
|
---|
| 197 |
|
---|
[f40a309] | 198 | .page
|
---|
[4f508e6] | 199 |
|
---|
| 200 | lsr.w #1,d2 | adjust d2
|
---|
| 201 | clr.w d1 | set loop index
|
---|
[8325447] | 202 | lea vce2trg,a2 | point at vce2trg table
|
---|
[4f508e6] | 203 |
|
---|
| 204 | exnend1: cmp.w (a2),d2 | see if this voice uses trg
|
---|
| 205 | bne exnend2 | jump if not
|
---|
| 206 |
|
---|
| 207 | move.w #-1,(a2) | set entry to -1
|
---|
| 208 | move.l a2,-(a7) | save a2 on stack
|
---|
| 209 | move.w d1,-(a7) | save d1 on stack
|
---|
| 210 | move.w d2,-(a7) | save d2 on stack
|
---|
[8325447] | 211 | lea vce2grp,a1 | put group on stack
|
---|
[4f508e6] | 212 | move.w d1,d0 | ...
|
---|
| 213 | add.w d0,d0 | ...
|
---|
| 214 | move.w 0(a1,d0.W),-(a7) | ...
|
---|
| 215 | move.w d2,-(a7) | put trg on stack
|
---|
[8325447] | 216 | jsr procpfl | process sustained voices
|
---|
[4f508e6] | 217 | addq.l #4,a7 | clean up stack
|
---|
| 218 | move.w (a7)+,d2 | restore d2
|
---|
| 219 | move.w (a7)+,d1 | restore d1
|
---|
| 220 | movea.l (a7)+,a2 | restore a2
|
---|
| 221 |
|
---|
| 222 | exnend2: addq.l #2,a2 | point at next vce2trg entry
|
---|
| 223 | addq.w #1,d1 | loop until all are checked
|
---|
| 224 | cmp.w #12,d1 | ...
|
---|
| 225 | bne exnend1 | ...
|
---|
| 226 |
|
---|
| 227 | bra exexit | done
|
---|
| 228 |
|
---|
[f40a309] | 229 | .page
|
---|
[4f508e6] | 230 |
|
---|
| 231 | | exsbgn -- execute section begin
|
---|
| 232 | | ------ ---------------------
|
---|
| 233 | exsbgn: clr.w d0 | get section number
|
---|
| 234 | move.b E_DATA1(a0),d0 | ...
|
---|
[8325447] | 235 | move.w d0,cursect | set section number
|
---|
[4f508e6] | 236 | bra exexit | done
|
---|
| 237 |
|
---|
| 238 | | exasgn -- execute assignment event
|
---|
| 239 | | ------ ------------------------
|
---|
| 240 | exasgn: clr.w d0 | get assignment
|
---|
| 241 | move.b E_DATA1(a0),d0 | ...
|
---|
| 242 | move.w d0,-(a7) | getasg(curasg = asgn)
|
---|
[8325447] | 243 | move.w d0,curasg | ...
|
---|
| 244 | jsr getasg | ...
|
---|
[4f508e6] | 245 | tst.w (a7)+ | ...
|
---|
| 246 | bra exexit | done
|
---|
| 247 |
|
---|
| 248 | | extune -- execute tuning event
|
---|
| 249 | | ------ --------------------
|
---|
| 250 | extune: clr.w d0 | get tuning
|
---|
| 251 | move.b E_DATA1(a0),d0 | ...
|
---|
| 252 | move.w d0,-(a7) | gettun(tuning)
|
---|
[8325447] | 253 | jsr gettun | ...
|
---|
[4f508e6] | 254 | tst.w (a7)+ | ...
|
---|
| 255 | bra exexit | done
|
---|
| 256 |
|
---|
| 257 | | extrns -- execute transposition event
|
---|
| 258 | | ------ ---------------------------
|
---|
| 259 | extrns: clr.w d0 | get group number
|
---|
| 260 | move.b E_DATA1(a0),d0 | ...
|
---|
| 261 | add.w d0,d0 | ... as an index in d0
|
---|
[8325447] | 262 | lea grpstat,a1 | check grpstat[grp]
|
---|
[4f508e6] | 263 | tst.w 0(a1,d0.W) | ...
|
---|
| 264 | beq exexit | done if disabled
|
---|
| 265 |
|
---|
[8325447] | 266 | lea s_trns,a1 | set group transposition
|
---|
[4f508e6] | 267 | move.w E_LFT(a0),0(a1,d0.W) | ...
|
---|
[8325447] | 268 | jsr settune | ...
|
---|
[4f508e6] | 269 | bra exexit | done
|
---|
| 270 |
|
---|
[f40a309] | 271 | .page
|
---|
[4f508e6] | 272 |
|
---|
| 273 | | extmpo -- execute tempo event
|
---|
| 274 | | ------ -------------------
|
---|
| 275 | extmpo: clr.w d0 | get tempo
|
---|
| 276 | move.b E_DATA1(a0),d0 | ...
|
---|
| 277 | move.w d0,-(a7) | settmpo(tempo)
|
---|
[8325447] | 278 | jsr settmpo | ...
|
---|
[4f508e6] | 279 | tst.w (a7)+ | ...
|
---|
| 280 | bra exexit | done
|
---|
| 281 |
|
---|
| 282 | | exstop -- execute stop event
|
---|
| 283 | | ------ ------------------
|
---|
| 284 | exstop: clr.w -(a7) | stop the clock
|
---|
[8325447] | 285 | jsr clkset | ...
|
---|
[4f508e6] | 286 | tst.w (a7)+ | ...
|
---|
| 287 | bra exexit | that's all, folks
|
---|
| 288 |
|
---|
| 289 | | exintp -- execute interpolate event
|
---|
| 290 | | ------ -------------------------
|
---|
[8325447] | 291 | exintp: move.w E_DATA1(a0),curintp | set interpolate value
|
---|
[4f508e6] | 292 | bra exexit | done
|
---|
| 293 |
|
---|
[f40a309] | 294 | .page
|
---|
[4f508e6] | 295 |
|
---|
| 296 | | exinst -- execute instrument change event
|
---|
| 297 | | ------ -------------------------------
|
---|
| 298 | exinst: clr.w d0 | get group number
|
---|
| 299 | move.b E_DATA1(a0),d0 | ... in d0
|
---|
| 300 | add.w d0,d0 | ... as a word offset
|
---|
[8325447] | 301 | lea grpstat,a1 | check grpstat[grp]
|
---|
[4f508e6] | 302 | tst.w 0(a1,d0.W) | ...
|
---|
| 303 | beq exexit | done if not enabled
|
---|
| 304 |
|
---|
[8325447] | 305 | lea ins2grp,a1 | point at ins2grp[]
|
---|
[4f508e6] | 306 | clr.w d0 | get instrument number
|
---|
| 307 | move.b E_DATA2(a0),d0 | ... in d0
|
---|
| 308 | clr.w d1 | get group number
|
---|
| 309 | move.b E_DATA1(a0),d1 | ... in d1
|
---|
| 310 | move.w d1,-(a7) | put group number on stack
|
---|
| 311 | add.w d1,d1 | make d1 a word pointer
|
---|
| 312 | move.w 0(a1,d1.W),d2 | get ins2grp[group]
|
---|
| 313 | and.w #0xFF00,d2 | mask off GTAG1..GTAG8
|
---|
| 314 | or.w d0,d2 | OR in new instrument number
|
---|
| 315 | move.w d2,0(a1,d1.W) | set ins2grp[group]
|
---|
[8325447] | 316 | jsr setv2gi | setv2gi(group)
|
---|
[4f508e6] | 317 | tst.w (a7)+ | clean up stack
|
---|
| 318 | bra exexit | done
|
---|
| 319 |
|
---|
[f40a309] | 320 | .page
|
---|
[4f508e6] | 321 |
|
---|
| 322 | | exdyn -- execute dynamics event
|
---|
| 323 | | ----- ----------------------
|
---|
| 324 | exdyn: clr.w d0 | get group number
|
---|
| 325 | move.b E_DATA1(a0),d0 | ... in d0
|
---|
| 326 | add.w d0,d0 | ... as a word offset
|
---|
[8325447] | 327 | lea grpstat,a1 | check grpstat[grp]
|
---|
[4f508e6] | 328 | tst.w 0(a1,d0.W) | ...
|
---|
| 329 | beq exexit | done if not enabled
|
---|
| 330 |
|
---|
| 331 | clr.w d0 | get dynamics
|
---|
| 332 | move.b E_DATA2(a0),d0 | ... in d0
|
---|
| 333 | clr.w d1 | get group number
|
---|
| 334 | move.b E_DATA1(a0),d1 | ... in d1
|
---|
| 335 | move.w d0,-(a7) | setdyn(group, dyn)
|
---|
| 336 | move.w d1,-(a7) | ...
|
---|
[8325447] | 337 | jsr setdyn | ...
|
---|
[4f508e6] | 338 | adda.l #4,a7 | clean up stack
|
---|
| 339 | bra exexit | done
|
---|
| 340 |
|
---|
| 341 | | exlocn -- execute location event
|
---|
| 342 | | ------ ----------------------
|
---|
| 343 | exlocn: clr.w d0 | get group number
|
---|
| 344 | move.b E_DATA1(a0),d0 | ... in d0
|
---|
| 345 | add.w d0,d0 | ... as a word offset
|
---|
[8325447] | 346 | lea grpstat,a1 | check grpstat[grp]
|
---|
[4f508e6] | 347 | tst.w 0(a1,d0.W) | ...
|
---|
| 348 | beq exexit | done if not enabled
|
---|
| 349 |
|
---|
| 350 | clr.w d0 | get location
|
---|
| 351 | move.b E_DATA2(a0),d0 | ... in d0
|
---|
| 352 | clr.w d1 | get group number
|
---|
| 353 | move.b E_DATA1(a0),d1 | ... in d1
|
---|
| 354 | move.w d0,-(a7) | setloc(group, loc)
|
---|
| 355 | move.w d1,-(a7) | ...
|
---|
[8325447] | 356 | jsr setloc | ...
|
---|
[4f508e6] | 357 | adda.l #4,a7 | clean up stack
|
---|
| 358 | bra exexit | done
|
---|
| 359 |
|
---|
[f40a309] | 360 | .page
|
---|
[4f508e6] | 361 |
|
---|
| 362 | | exanrs -- execute analog resolution event
|
---|
| 363 | | ------ -------------------------------
|
---|
| 364 | exanrs: move.b E_DATA1(a0),d0 | get group number
|
---|
| 365 | andi.w #0x000F,d0 | ... in d0
|
---|
| 366 | add.w d0,d0 | ... as a word offset
|
---|
[8325447] | 367 | lea grpstat,a1 | check grpstat[grp]
|
---|
[4f508e6] | 368 | tst.w 0(a1,d0.W) | ...
|
---|
| 369 | beq exexit | done if not enabled
|
---|
| 370 |
|
---|
| 371 | clr.w d1 | get variable / group numbers
|
---|
| 372 | move.b E_DATA1(a0),d1 | ...
|
---|
| 373 | add.w d1,d1 | convert to word index
|
---|
| 374 | clr.w d0 | get resolution
|
---|
| 375 | move.b E_DATA2(a0),d0 | ... in d0
|
---|
[8325447] | 376 | lea anrs,a1 | point at resolution table base
|
---|
[4f508e6] | 377 | move.w d0,0(a1,d1.W) | save resolution in table
|
---|
| 378 | bra exexit | done
|
---|
| 379 |
|
---|
| 380 | | exanvl -- execute analog value event
|
---|
| 381 | | ------ --------------------------
|
---|
| 382 | exanvl: move.b E_DATA1(a0),d0 | get group number
|
---|
| 383 | andi.w #0x000F,d0 | ... in d0
|
---|
| 384 | add.w d0,d0 | ... as a word offset
|
---|
[8325447] | 385 | lea grpstat,a1 | check grpstat[grp]
|
---|
[4f508e6] | 386 | tst.w 0(a1,d0.W) | ...
|
---|
| 387 | beq exexit | done if not enabled
|
---|
| 388 |
|
---|
| 389 | move.w E_DN(a0),-(a7) | put value on stack
|
---|
| 390 | clr.w d2 | get variable / group numbers
|
---|
| 391 | move.b E_DATA1(a0),d2 | ... into d2
|
---|
| 392 | move.w d2,d1 | extract group number
|
---|
| 393 | andi.w #0x000F,d1 | ... into d1
|
---|
| 394 | lsr.w #3,d2 | extract variable number
|
---|
| 395 | andi.w #0x001E,d2 | ... as a word index in d2
|
---|
[8325447] | 396 | lea var2src,a1 | point at variable map
|
---|
[4f508e6] | 397 | move.w 0(a1,d2.W),-(a7) | put source number on stack
|
---|
| 398 | move.w d1,-(a7) | put group number on stack
|
---|
[8325447] | 399 | jsr setsv | setsv(group, src, val)
|
---|
[4f508e6] | 400 | adda.l #6,a7 | clean up stack
|
---|
| 401 | bra exexit | done
|
---|
| 402 |
|
---|
| 403 | | exnext -- next score
|
---|
| 404 | | ------ ----------
|
---|
[8325447] | 405 | exnext: move.w #1,nxtflag | set next score flag
|
---|
[4f508e6] | 406 | bra exexit | done
|
---|
| 407 |
|
---|
[f40a309] | 408 | .page
|
---|
[4f508e6] | 409 |
|
---|
| 410 | | expnch -- execute punch in/out
|
---|
| 411 | | ------ --------------------
|
---|
[8325447] | 412 | expnch: tst.w recsw | recording ?
|
---|
[4f508e6] | 413 | beq exexit | ignore if not
|
---|
| 414 |
|
---|
| 415 | tst.w E_DATA1(a0) | punch in ?
|
---|
| 416 | bne expnch5 | jump if so
|
---|
| 417 |
|
---|
| 418 | | punch out
|
---|
| 419 |
|
---|
[8325447] | 420 | lea grpmode,a1 | setup for group modes
|
---|
[4f508e6] | 421 | move.w #11,d0 | ...
|
---|
| 422 |
|
---|
| 423 | expnch0: cmpi.w #2,(a1) | in record mode ?
|
---|
| 424 | bne expnch1 | jump if not
|
---|
| 425 |
|
---|
| 426 | clr.w (a1) | set to play mode
|
---|
| 427 |
|
---|
| 428 | expnch1: addq.l #2,a1 | point at next entry
|
---|
| 429 | dbra d0,expnch0 | loop through all groups
|
---|
| 430 |
|
---|
[8325447] | 431 | lea varmode,a1 | setup for variable modes
|
---|
[4f508e6] | 432 | move.w #5,d1 | set variable count
|
---|
| 433 |
|
---|
| 434 | expnch4: clr.w d0 | clear offset
|
---|
| 435 |
|
---|
| 436 | expnch2: cmpi.w #2,0(a1,d0.W) | in record mode ?
|
---|
| 437 | bne expnch3 | jump if not
|
---|
| 438 |
|
---|
| 439 | clr.w 0(a1,d0.W) | set to play mode
|
---|
| 440 |
|
---|
| 441 | expnch3: addq.w #2,d0 | update offset
|
---|
| 442 | cmpi.w #24,d0 | check for final group
|
---|
| 443 | bne expnch2 | loop through all groups
|
---|
| 444 |
|
---|
| 445 | add.l #32,a1 | point at next variable
|
---|
| 446 | dbra d1,expnch4 | loop through all variables
|
---|
| 447 |
|
---|
[f40a309] | 448 | bra exexit
|
---|
[4f508e6] | 449 |
|
---|
[f40a309] | 450 | .page
|
---|
[4f508e6] | 451 |
|
---|
| 452 | | punch in
|
---|
| 453 |
|
---|
[8325447] | 454 | expnch5: lea grpmode,a1 | setup for group modes
|
---|
[4f508e6] | 455 | move.w #11,d0 | ...
|
---|
| 456 |
|
---|
| 457 | expnch6: cmpi.w #1,(a1) | in standby mode ?
|
---|
| 458 | bne expnch7 | jump if not
|
---|
| 459 |
|
---|
| 460 | move.w #2,(a1) | set to record mode
|
---|
| 461 |
|
---|
| 462 | expnch7: addq.l #2,a1 | point at next entry
|
---|
| 463 | dbra d0,expnch6 | loop through all groups
|
---|
| 464 |
|
---|
[8325447] | 465 | lea varmode,a1 | setup for variable modes
|
---|
[4f508e6] | 466 | move.w #5,d1 | set variable count
|
---|
| 467 |
|
---|
| 468 | expnch10: clr.w d0 | clear offset
|
---|
| 469 |
|
---|
| 470 | expnch8: cmpi.w #1,0(a1,d0.W) | in standby mode ?
|
---|
| 471 | bne expnch9 | jump if not
|
---|
| 472 |
|
---|
| 473 | move.w #2,0(a1,d0.W) | set to record mode
|
---|
| 474 |
|
---|
| 475 | expnch9: addq.w #2,d0 | update offset
|
---|
| 476 | cmpi.w #24,d0 | check for final group
|
---|
| 477 | bne expnch8 | loop through all groups
|
---|
| 478 |
|
---|
| 479 | adda.l #32,a1 | point at next variable
|
---|
| 480 | dbra d1,expnch10 | loop through all variables
|
---|
| 481 |
|
---|
[f40a309] | 482 | bra exexit
|
---|
[4f508e6] | 483 |
|
---|
[f40a309] | 484 | .page
|
---|
[4f508e6] | 485 |
|
---|
| 486 | | sextab -- score execution dispatch table -- MUST match score.h definitions
|
---|
| 487 | | ------ ----------------------------------------------------------------
|
---|
[4cfe69a] | 488 | sextab: .dc.l exexit | 0 null
|
---|
| 489 | .dc.l exexit | 1 score begin
|
---|
| 490 | .dc.l exsbgn | 2 section begin
|
---|
| 491 | .dc.l exexit | 3 section end
|
---|
| 492 | .dc.l exinst | 4 instrument change
|
---|
| 493 | .dc.l exnbeg | 5 note begin
|
---|
| 494 | .dc.l exnend | 6 note end
|
---|
| 495 | .dc.l exstop | 7 stop
|
---|
| 496 | .dc.l exintp | 8 interpolate
|
---|
| 497 | .dc.l extmpo | 9 tempo
|
---|
| 498 | .dc.l extune | 10 tuning
|
---|
| 499 | .dc.l exexit | 11 group status
|
---|
| 500 | .dc.l exlocn | 12 location
|
---|
| 501 | .dc.l exdyn | 13 dynamics
|
---|
| 502 | .dc.l exanvl | 14 analog value
|
---|
| 503 | .dc.l exanrs | 15 analog resolution
|
---|
| 504 | .dc.l exasgn | 16 I/O assign
|
---|
| 505 | .dc.l extrns | 17 transposition
|
---|
| 506 | .dc.l exexit | 18 repeat
|
---|
| 507 | .dc.l expnch | 19 punch in/out
|
---|
| 508 | .dc.l exexit | 20 -unused- (polyphonic pressure)
|
---|
| 509 | .dc.l exexit | 21 score end
|
---|
| 510 | .dc.l exexit | 22 -unused- (channel pressure)
|
---|
| 511 | .dc.l exexit | 23 bar marker
|
---|
| 512 | .dc.l exnext | 24 next score
|
---|
[4f508e6] | 513 |
|
---|
[f40a309] | 514 | .bss
|
---|
[4f508e6] | 515 |
|
---|
| 516 | | Variable storage areas
|
---|
| 517 | | ----------------------
|
---|
| 518 | | globals:
|
---|
| 519 | | --------
|
---|
[3370595] | 520 | xevent: .ds.l 1 | next event pointer
|
---|
[4f508e6] | 521 |
|
---|
[f40a309] | 522 | .end
|
---|