Index: alcyon/sqexec.s
===================================================================
--- alcyon/sqexec.s	(revision 7bf3856f4ff505a2174d89c937caf328029e3574)
+++ alcyon/sqexec.s	(revision 7bf3856f4ff505a2174d89c937caf328029e3574)
@@ -0,0 +1,1179 @@
+.globl _io_time
+.globl _io_lcd
+.globl _io_ser
+.globl _io_midi
+.globl _io_disk
+.globl _io_tone
+.globl _io_leds
+.globl _io_kbrd
+.globl _lcd_a0
+.globl _lcd_a1
+.globl _io_vreg
+.globl _io_vraw
+.globl _io_vram
+.globl _io_fpu
+.globl _v_regs
+.globl _v_odtab
+.globl _v_actab
+.globl _v_ct0
+.globl _v_gt1
+.globl _v_score
+.globl _v_cgtab
+.globl _v_curs0
+.globl _v_curs1
+.globl _v_curs2
+.globl _v_curs3
+.globl _v_curs4
+.globl _v_curs5
+.globl _v_curs6
+.globl _v_curs7
+.globl _v_tcur
+.globl _v_kbobj
+.globl _v_lnobj
+.globl _v_win0
+.globl _v_cur
+.globl _fc_sw
+.globl _fc_val
+.globl _stmptr
+.globl _defptr
+.globl _patches
+.globl _defents
+.globl _seqtab
+.globl _seqflag
+.globl _seqline
+.globl _seqstim
+.globl _seqtime
+.globl _sregval
+.globl _trstate
+.globl _timers
+.globl _trgtab
+.globl _curslin
+.globl _dsp_ok
+.globl _ndisp
+.globl _seqdupd
+.globl _obj10
+.globl _cg3
+.globl _ptefifo
+.globl _seqdspn
+.comm _seqdspn,2
+.globl _rtab
+.data
+_rtab:
+.dc.w $0
+.dc.w $1
+.dc.w $3
+.dc.w $7
+.dc.w $F
+.dc.w $1F
+.dc.w $3F
+.dc.w $3F
+.dc.w $3F
+.dc.w $3F
+.globl _evaltv
+.text
+_evaltv:
+~~evaltv:
+~dat=R7
+link R14,#0
+movem.l R6-R7,-(sp)
+*line 71
+move 8(R14),R7
+*line 71
+clr R0
+move R7,R0
+and #3840,R0
+bra L3
+*line 72
+L4:
+*line 73
+*line 74
+*line 75
+clr R0
+move R7,R0
+and #255,R0
+lsl #1,R0
+swap R0
+clr R0
+swap R0
+move.l R0,R8
+move.l #_sregval,R9
+clr R0
+move 0(R8,R9.l),R0
+bra L1
+*line 76
+L5:
+*line 77
+*line 78
+*line 79
+clr R0
+move R7,R0
+and #255,R0
+bra L1
+*line 80
+L6:
+*line 81
+*line 82
+*line 83
+clr R0
+bra L1
+*line 84
+L7:
+*line 85
+*line 86
+*line 87
+jsr _rand24
+clr R1
+move R7,R1
+and #255,R1
+lsl #1,R1
+swap R1
+clr R1
+swap R1
+add.l #_rtab,R1
+move.l R1,R9
+move (R9),R1
+and R1,R0
+bra L1
+*line 88
+L8:
+*line 89
+*line 90
+*line 91
+clr R0
+bra L1
+bra L2
+L3:tst R0
+beq L4
+cmp #256,R0
+beq L5
+cmp #512,R0
+beq L6
+cmp #768,R0
+beq L7
+bra L8
+L2:L1:tst.l (sp)+
+movem.l (sp)+,R7-R7
+unlk R14
+rts
+.globl _dosqact
+.text
+_dosqact:
+~~dosqact:
+~act=R7
+~dat=R6
+~seq=8
+link R14,#0
+movem.l R2-R7,-(sp)
+~obj=R5
+~val=R4
+~sv=R3
+*line 112
+move 10(R14),R7
+*line 112
+move 12(R14),R6
+*line 112
+move R7,R5
+and #-256,R5
+lsr #8,R5
+*line 113
+move R6,R4
+and #255,R4
+*line 115
+clr R0
+move R7,R0
+and #255,R0
+bra L11
+*line 116
+L12:
+*line 117
+*line 118
+*line 119
+clr R0
+bra L9
+*line 120
+L13:
+*line 121
+*line 122
+*line 123
+move R6,(sp)
+and #8191,(sp)
+move.l #_ptefifo,-(sp)
+jsr _putwq
+addq.l #4,sp
+*line 124
+clr R0
+bra L9
+*line 125
+L14:
+*line 126
+*line 127
+*line 128
+move R6,(sp)
+or #-32768,(sp)
+move.l #_ptefifo,-(sp)
+jsr _putwq
+addq.l #4,sp
+*line 129
+clr R0
+bra L9
+*line 130
+L15:
+*line 131
+*line 132
+*line 133
+move R6,(sp)
+and #8191,(sp)
+move.l #_ptefifo,-(sp)
+jsr _putwq
+addq.l #4,sp
+*line 134
+move R6,(sp)
+or #-32768,(sp)
+move.l #_ptefifo,-(sp)
+jsr _putwq
+addq.l #4,sp
+*line 135
+clr R0
+bra L9
+*line 136
+L16:
+*line 137
+*line 138
+*line 139
+*line 140
+clr R0
+move R6,R0
+and #8191,R0
+move R0,R8
+move.l #_trgtab,R9
+tst.b 0(R8,R9.l)
+beq L17
+*line 140
+clr R0
+bra L9
+*line 141
+bra L18
+L17:
+*line 142
+move #1,R0
+bra L9
+L18:
+*line 143
+*line 144
+L19:
+*line 145
+*line 146
+*line 147
+clr R0
+move R4,R0
+lsl #1,R0
+swap R0
+clr R0
+swap R0
+add.l #_trstate,R0
+move.l R0,R8
+move #1,(R8)
+*line 148
+move R4,(sp)
+or #4352,(sp)
+move.l #_ptefifo,-(sp)
+jsr _putwq
+addq.l #4,sp
+*line 149
+move #1,R0
+clr R1
+move R4,R1
+asl R1,R0
+or R0,_seqdupd
+*line 150
+clr R0
+bra L9
+*line 151
+L20:
+*line 152
+*line 153
+*line 154
+clr R0
+move R4,R0
+lsl #1,R0
+swap R0
+clr R0
+swap R0
+add.l #_trstate,R0
+move.l R0,R8
+clr (R8)
+*line 155
+move #1,R0
+clr R1
+move R4,R1
+asl R1,R0
+or R0,_seqdupd
+*line 156
+clr R0
+bra L9
+*line 157
+L21:
+*line 158
+*line 159
+*line 160
+clr R0
+move R4,R0
+lsl #1,R0
+swap R0
+clr R0
+swap R0
+move.l R0,R8
+move.l #_trstate,R9
+tst 0(R8,R9.l)
+beq L10000
+clr R0
+bra L10002
+L10000:move #1,R0
+L10002:clr R1
+move R4,R1
+lsl #1,R1
+swap R1
+clr R1
+swap R1
+add.l #_trstate,R1
+move.l R1,R9
+move R0,(R9)
+*line 161
+*line 162
+*line 163
+clr R0
+move R4,R0
+lsl #1,R0
+swap R0
+clr R0
+swap R0
+move.l R0,R8
+move.l #_trstate,R9
+tst 0(R8,R9.l)
+beq L22
+*line 163
+move R4,(sp)
+or #4352,(sp)
+move.l #_ptefifo,-(sp)
+jsr _putwq
+addq.l #4,sp
+*line 164
+L22:
+*line 165
+move #1,R0
+clr R1
+move R4,R1
+asl R1,R0
+or R0,_seqdupd
+*line 166
+clr R0
+bra L9
+*line 167
+L23:
+*line 168
+*line 169
+*line 170
+clr R0
+move R4,R0
+lsl #1,R0
+swap R0
+clr R0
+swap R0
+move.l R0,R8
+move.l #_trstate,R9
+tst 0(R8,R9.l)
+beq L10003
+clr R0
+bra L10005
+L10003:move #1,R0
+L10005:bra L9
+*line 171
+*line 172
+L24:
+*line 173
+*line 174
+*line 175
+move R6,(sp)
+jsr _evaltv
+move R0,-(sp)
+clr R0
+move R5,R0
+lsl #1,R0
+swap R0
+clr R0
+swap R0
+add.l #_sregval,R0
+move.l R0,R8
+move (sp)+,(R8)
+*line 176
+move #1,R0
+clr R1
+move R5,R1
+asl R1,R0
+or R0,_seqdupd
+*line 177
+clr R0
+bra L9
+*line 178
+L25:
+*line 179
+*line 180
+*line 181
+*line 181
+clr R0
+move R6,R0
+and #-4096,R0
+beq L26
+*line 182
+*line 183
+clr R0
+move R5,R0
+lsl #1,R0
+swap R0
+clr R0
+swap R0
+add.l #_sregval,R0
+move.l R0,R8
+move (R8),R3
+move R6,(sp)
+jsr _evaltv
+sub R0,R3
+*line 184
+*line 185
+*line 186
+tst R3
+bge L27
+*line 186
+clr R3
+*line 187
+L27:
+*line 188
+clr R0
+move R5,R0
+lsl #1,R0
+swap R0
+clr R0
+swap R0
+add.l #_sregval,R0
+move.l R0,R8
+move R3,(R8)
+*line 189
+bra L28
+L26:
+*line 190
+*line 191
+*line 192
+move R6,(sp)
+jsr _evaltv
+move R0,R3
+clr R0
+move R5,R0
+lsl #1,R0
+swap R0
+clr R0
+swap R0
+add.l #_sregval,R0
+move.l R0,R8
+move (R8),R0
+add R0,R3
+*line 193
+*line 194
+*line 195
+cmp #99,R3
+ble L29
+*line 195
+move #99,R3
+*line 196
+L29:
+*line 197
+clr R0
+move R5,R0
+lsl #1,R0
+swap R0
+clr R0
+swap R0
+add.l #_sregval,R0
+move.l R0,R8
+move R3,(R8)
+*line 198
+L28:
+*line 199
+*line 200
+*line 201
+move #1,R0
+clr R1
+move R5,R1
+asl R1,R0
+or R0,_seqdupd
+*line 202
+clr R0
+bra L9
+*line 203
+L30:
+*line 204
+*line 205
+*line 206
+move R6,(sp)
+jsr _evaltv
+move R0,R4
+*line 207
+*line 208
+*line 209
+clr R0
+move R5,R0
+lsl #1,R0
+swap R0
+clr R0
+swap R0
+add.l #_sregval,R0
+move.l R0,R8
+cmp (R8),R4
+bne L31
+*line 209
+clr R0
+bra L9
+*line 210
+bra L32
+L31:
+*line 211
+move #1,R0
+bra L9
+L32:
+*line 212
+L33:
+*line 213
+*line 214
+*line 215
+move R6,(sp)
+jsr _evaltv
+move R0,R4
+*line 216
+*line 217
+*line 218
+clr R0
+move R5,R0
+lsl #1,R0
+swap R0
+clr R0
+swap R0
+add.l #_sregval,R0
+move.l R0,R8
+cmp (R8),R4
+bls L34
+*line 218
+clr R0
+bra L9
+*line 219
+bra L35
+L34:
+*line 220
+move #1,R0
+bra L9
+L35:
+*line 221
+L36:
+*line 222
+*line 223
+*line 224
+move R6,(sp)
+jsr _evaltv
+move R0,R4
+*line 225
+*line 226
+*line 227
+clr R0
+move R5,R0
+lsl #1,R0
+swap R0
+clr R0
+swap R0
+add.l #_sregval,R0
+move.l R0,R8
+cmp (R8),R4
+bcc L37
+*line 227
+clr R0
+bra L9
+*line 228
+bra L38
+L37:
+*line 229
+move #1,R0
+bra L9
+L38:
+*line 230
+*line 231
+L39:
+*line 232
+*line 233
+*line 234
+*line 235
+clr R0
+move 8(R14),R0
+lsl #1,R0
+swap R0
+clr R0
+swap R0
+move.l R0,R8
+move.l #_seqstim,R9
+clr R0
+move 0(R8,R9.l),R0
+and #8191,R0
+move R0,R8
+move.l #_trgtab,R9
+tst.b 0(R8,R9.l)
+beq L40
+*line 235
+clr R0
+bra L9
+*line 236
+bra L41
+L40:
+*line 237
+move #1,R0
+bra L9
+L41:
+*line 238
+L42:
+*line 239
+*line 240
+*line 241
+clr R0
+move 8(R14),R0
+lsl #1,R0
+swap R0
+clr R0
+swap R0
+add.l #_seqline,R0
+move.l R0,R8
+move R6,(R8)
+*line 242
+clr R0
+move 8(R14),R0
+lsl #1,R0
+swap R0
+clr R0
+swap R0
+add.l #_seqtime,R0
+move.l R0,R8
+clr R1
+move R6,R1
+mulu #14,R1
+add.l #_seqtab,R1
+move.l R1,R9
+move (R9),(R8)
+*line 243
+clr R0
+move 8(R14),R0
+lsl #1,R0
+swap R0
+clr R0
+swap R0
+add.l #_seqflag,R0
+move.l R0,R8
+or #16384,(R8)
+*line 244
+*line 245
+move #1,R0
+clr R1
+move 8(R14),R1
+asl R1,R0
+or R0,_seqdupd
+*line 246
+move #-1,R0
+bra L9
+*line 247
+*line 248
+L43:
+*line 249
+L44:
+*line 250
+*line 251
+*line 252
+clr R0
+move 8(R14),R0
+lsl #1,R0
+swap R0
+clr R0
+swap R0
+add.l #_seqflag,R0
+move.l R0,R8
+clr (R8)
+*line 253
+clr R0
+move 8(R14),R0
+lsl #1,R0
+swap R0
+clr R0
+swap R0
+add.l #_seqtime,R0
+move.l R0,R8
+clr (R8)
+*line 254
+*line 255
+move #1,R0
+clr R1
+move 8(R14),R1
+asl R1,R0
+or R0,_seqdupd
+*line 256
+move #-1,R0
+bra L9
+*line 257
+bra L10
+L11:cmp #16,R0
+bhi L44
+asl #2,R0
+move R0,R8
+add.l #L45,R8
+move.l (R8),R8
+jmp (R8)
+.data
+L45:.dc.l L12
+.dc.l L13
+.dc.l L14
+.dc.l L15
+.dc.l L16
+.dc.l L19
+.dc.l L20
+.dc.l L21
+.dc.l L23
+.dc.l L24
+.dc.l L30
+.dc.l L33
+.dc.l L36
+.dc.l L39
+.dc.l L42
+.dc.l L43
+.dc.l L25
+.text
+L10:L9:tst.l (sp)+
+movem.l (sp)+,R3-R7
+unlk R14
+rts
+.globl _sqexec
+.text
+_sqexec:
+~~sqexec:
+~seq=R7
+link R14,#0
+movem.l R2-R7/R13-R13,-(sp)
+~act=R6
+~dat=R5
+~line=R4
+~sp=R13
+~rc=R3
+*line 277
+move 8(R14),R7
+*line 277
+clr R0
+move R7,R0
+lsl #1,R0
+swap R0
+clr R0
+swap R0
+add.l #_seqline,R0
+move.l R0,R8
+move (R8),R4
+*line 278
+clr R0
+move R4,R0
+mulu #14,R0
+move.l R0,R13
+add.l #_seqtab,R13
+*line 280
+move 2(R13),R6
+*line 281
+move 4(R13),R5
+*line 283
+move R5,(sp)
+move R6,-(sp)
+move R7,-(sp)
+jsr _dosqact
+addq.l #4,sp
+move R0,R3
+*line 291
+*line 292
+cmp #1,R3
+beq L47
+*line 293
+*line 294
+cmp #-1,R3
+beq L46
+*line 295
+*line 296
+move 6(R13),R6
+*line 297
+move 8(R13),R5
+*line 299
+move R5,(sp)
+move R6,-(sp)
+move R7,-(sp)
+jsr _dosqact
+addq.l #4,sp
+move R0,R3
+*line 307
+*line 308
+cmp #1,R3
+beq L48
+*line 309
+*line 310
+cmp #-1,R3
+beq L46
+*line 311
+L47:
+*line 312
+*line 313
+move 10(R13),R6
+*line 314
+move 12(R13),R5
+*line 316
+move R5,(sp)
+move R6,-(sp)
+move R7,-(sp)
+jsr _dosqact
+addq.l #4,sp
+move R0,R3
+*line 324
+*line 325
+cmp #-1,R3
+beq L46
+*line 326
+L48:
+*line 327
+*line 328
+*line 329
+*line 330
+clr R0
+move R7,R0
+lsl #1,R0
+swap R0
+clr R0
+swap R0
+add.l #_seqline,R0
+move.l R0,R8
+add #1,(R8)
+move (R8),R0
+cmp #1000,R0
+blo L49
+*line 330
+clr R0
+move R7,R0
+lsl #1,R0
+swap R0
+clr R0
+swap R0
+add.l #_seqline,R0
+move.l R0,R8
+clr (R8)
+*line 331
+L49:
+*line 332
+clr R0
+move R7,R0
+lsl #1,R0
+swap R0
+clr R0
+swap R0
+add.l #_seqtime,R0
+move.l R0,R8
+clr R1
+move R7,R1
+lsl #1,R1
+swap R1
+clr R1
+swap R1
+add.l #_seqline,R1
+move.l R1,R9
+clr R1
+move (R9),R1
+mulu #14,R1
+add.l #_seqtab,R1
+move.l R1,R9
+move (R9),(R8)
+*line 333
+clr R0
+move R7,R0
+lsl #1,R0
+swap R0
+clr R0
+swap R0
+add.l #_seqflag,R0
+move.l R0,R8
+or #16384,(R8)
+*line 341
+move #1,R0
+clr R1
+move R7,R1
+asl R1,R0
+or R0,_seqdupd
+L46:tst.l (sp)+
+movem.l (sp)+,R3-R7/R13-R13
+unlk R14
+rts
+.globl _seqproc
+.text
+_seqproc:
+~~seqproc:
+link R14,#-66
+movem.l R4-R7/R13-R13,-(sp)
+~oldsr=R7
+~seq=R6
+~dspn=R5
+~fp=R13
+~linbuf=-66
+*line 360
+*line 360
+tst 6+_timers
+bne L51
+*line 361
+*line 362
+clr R6
+bra L54
+L55:
+*line 363
+*line 364
+clr R0
+move R6,R0
+lsl #1,R0
+swap R0
+clr R0
+swap R0
+move.l R0,R13
+add.l #_seqflag,R13
+*line 365
+*line 366
+*line 367
+clr R0
+move (R13),R0
+and #-16384,R0
+cmp #-16384,R0
+bne L56
+*line 368
+*line 369
+*line 369
+clr R0
+move R6,R0
+lsl #1,R0
+swap R0
+clr R0
+swap R0
+move.l R0,R8
+move.l #_seqtime,R9
+tst 0(R8,R9.l)
+beq L57
+*line 370
+*line 371
+*line 372
+clr R0
+move R6,R0
+lsl #1,R0
+swap R0
+clr R0
+swap R0
+add.l #_seqtime,R0
+move.l R0,R8
+sub #1,(R8)
+bne L58
+*line 372
+and #-16385,(R13)
+*line 373
+L58:bra L59
+L57:
+*line 374
+*line 375
+*line 376
+and #-16385,(R13)
+L59:
+*line 377
+*line 378
+L56:L53:
+*line 362
+add #1,R6
+L54:
+*line 362
+cmp #16,R6
+blo L55
+L52:
+*line 379
+*line 380
+*line 381
+move #9984,(sp)
+jsr _setsr
+move R0,R7
+*line 382
+move #10,6+_timers
+*line 383
+move R7,(sp)
+jsr _setsr
+*line 384
+*line 385
+L51:
+*line 386
+clr R6
+bra L62
+L63:
+*line 387
+*line 388
+clr R0
+move R6,R0
+lsl #1,R0
+swap R0
+clr R0
+swap R0
+move.l R0,R8
+move.l #_seqflag,R9
+clr R0
+move 0(R8,R9.l),R0
+and #-16384,R0
+cmp #-32768,R0
+bne L64
+*line 388
+move R6,(sp)
+jsr _sqexec
+*line 389
+*line 390
+L64:L61:
+*line 386
+add #1,R6
+L62:
+*line 386
+cmp #16,R6
+blo L63
+L60:
+*line 391
+*line 391
+cmp #1,_ndisp
+beq L10006
+cmp #3,_ndisp
+bne L65
+L10006:tst _dsp_ok
+beq L65
+tst _seqdupd
+beq L65
+*line 392
+*line 397
+*line 398
+*line 398
+move #1,R0
+move _seqdspn,R1
+asl R1,R0
+and _seqdupd,R0
+beq L66
+*line 399
+*line 400
+move _seqdspn,R5
+*line 401
+*line 402
+*line 403
+clr R0
+move 10+_v_regs,R0
+and #384,R0
+beq L67
+*line 403
+clr (sp)
+jsr _vbank
+*line 404
+L67:
+*line 405
+*line 406
+*line 407
+*line 408
+move R5,R8
+add.l R8,R8
+move.l #_trstate,R9
+move 0(R8,R9.l),(sp)
+add #48,(sp)
+move R5,R8
+add.l R8,R8
+move.l #_sregval,R9
+move 0(R8,R9.l),-(sp)
+move R5,R8
+add.l R8,R8
+move.l #_seqline,R9
+move 0(R8,R9.l),-(sp)
+move.l #L68,-(sp)
+move.l R14,-(sp)
+add.l #-66,(sp)
+jsr _sprintf
+adda.l #12,sp
+*line 409
+*line 410
+*line 411
+move.l #_cg3,(sp)
+move #14,-(sp)
+move #14,-(sp)
+move.l R14,-(sp)
+add.l #-66,(sp)
+move #1,-(sp)
+move R5,-(sp)
+move #2,-(sp)
+move #1,-(sp)
+move #16,-(sp)
+move.l _obj10,-(sp)
+jsr _vvputsv
+adda.l #22,sp
+*line 412
+*line 413
+*line 414
+move R5,(sp)
+add #1,(sp)
+move.l #L69,-(sp)
+move.l R14,-(sp)
+add.l #-66,(sp)
+jsr _sprintf
+addq.l #8,sp
+*line 415
+*line 416
+*line 417
+*line 418
+*line 419
+move.l #_cg3,(sp)
+move #14,-(sp)
+move #14,-(sp)
+move.l R14,-(sp)
+add.l #-66,(sp)
+move #2,-(sp)
+move R5,-(sp)
+move #2,-(sp)
+move R5,R8
+add.l R8,R8
+move.l #_seqflag,R9
+clr R0
+move 0(R8,R9.l),R0
+and #-32768,R0
+beq L10007
+move #6,-(sp)
+bra L10009
+L10007:move #1,-(sp)
+L10009:move #16,-(sp)
+move.l _obj10,-(sp)
+jsr _vvputsv
+adda.l #22,sp
+*line 424
+*line 425
+move #1,R0
+move R5,R1
+asl R1,R0
+not R0
+and R0,_seqdupd
+*line 426
+*line 427
+L66:
+*line 428
+*line 429
+add #1,_seqdspn
+move _seqdspn,R0
+cmp #15,R0
+ble L70
+*line 429
+clr _seqdspn
+L70:
+*line 430
+L65:L50:tst.l (sp)+
+movem.l (sp)+,R5-R7/R13-R13
+unlk R14
+rts
+.data
+L68:.dc.b $20,$20,$20,$20,$25,$30,$33,$64,$20,$25,$30,$32,$64,$20,$25,$63,$20,$0
+L69:.dc.b $25,$30,$32,$64,$0
