Index: alcyon/wheel.s
===================================================================
--- alcyon/wheel.s	(revision 7bf3856f4ff505a2174d89c937caf328029e3574)
+++ alcyon/wheel.s	(revision 7bf3856f4ff505a2174d89c937caf328029e3574)
@@ -0,0 +1,2355 @@
+.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 _ebflag
+.globl _ebuf
+.globl _curfet
+.globl _cfetp
+.globl _infetp
+.globl _timers
+.globl _M_error
+.comm _M_error,2
+.globl _M_state
+.comm _M_state,2
+.globl _M_oldbs
+.comm _M_oldbs,2
+.globl _M_strng
+.comm _M_strng,32
+.globl _msctrl
+.comm _msctrl,2
+.globl _msflag
+.comm _msflag,2
+.globl _msrtag
+.comm _msrtag,2
+.globl _msxres
+.comm _msxres,2
+.globl _msyres
+.comm _msyres,2
+.globl _msxmov
+.comm _msxmov,2
+.globl _msymov
+.comm _msymov,2
+.globl _msxdiv
+.comm _msxdiv,2
+.globl _msydiv
+.comm _msydiv,2
+.globl _tkboth
+.comm _tkboth,2
+.globl _txdiv
+.comm _txdiv,2
+.globl _tydiv
+.comm _tydiv,2
+.globl _tkxdvr
+.data
+_tkxdvr:
+.dc.w $4
+.globl _tkydvr
+.data
+_tkydvr:
+.dc.w $6
+.globl _tkhdvr
+.data
+_tkhdvr:
+.dc.w $6
+.globl _tkvdvr
+.data
+_tkvdvr:
+.dc.w $6
+.globl _msxgdv
+.data
+_msxgdv:
+.dc.w $1
+.dc.w $1
+.dc.w $1
+.dc.w $1
+.dc.w $1
+.dc.w $1
+.dc.w $1
+.dc.w $1
+.dc.w $1
+.dc.w $1
+.dc.w $1
+.dc.w $1
+.dc.w $1
+.globl _msygdv
+.data
+_msygdv:
+.dc.w $2
+.dc.w $2
+.dc.w $2
+.dc.w $2
+.dc.w $2
+.dc.w $2
+.dc.w $2
+.dc.w $2
+.dc.w $2
+.dc.w $2
+.dc.w $2
+.dc.w $2
+.dc.w $2
+.globl _curmove
+.globl _cx_upd
+.globl _cy_upd
+.globl _xy_dn
+.globl _xy_up
+.globl _e_key
+.globl _m_key
+.globl _x_key
+.globl _asig
+.globl _astat
+.globl _aval
+.globl _chtime
+.globl _chwait
+.globl _clkctl
+.globl _clkrun
+.globl _cmfirst
+.globl _cmtype
+.globl _ctrsw
+.globl _curhold
+.globl _cvtime
+.globl _cvwait
+.globl _cxrate
+.globl _cxval
+.globl _cyrate
+.globl _cyval
+.globl _msctrl
+.globl _msflag
+.globl _msxdiv
+.globl _msydiv
+.globl _nchwait
+.globl _ncvwait
+.globl _ndisp
+.globl _ss_ptsw
+.globl _ss_sqsw
+.globl _stccol
+.globl _stcrow
+.globl _swback
+.globl _swctrl
+.globl _swdelta
+.globl _swdir
+.globl _swfiin
+.globl _swflag
+.globl _swlast
+.globl _swndx
+.globl _swstop
+.globl _swthr
+.globl _swtime
+.globl _swwait
+.globl _tkback
+.globl _tkctrl
+.globl _tkrmin
+.globl _tkthr
+.globl _tktime
+.globl _tkwait
+.globl _trkball
+.globl _txfiin
+.globl _txflag
+.globl _txlast
+.globl _tyfiin
+.globl _tyflag
+.globl _tylast
+.globl _txstop
+.globl _tystop
+.globl _vtccol
+.globl _vtcrow
+.globl _vtpcol
+.globl _vtprow
+.globl _xkstat
+.globl _ykstat
+.globl _swcount
+.globl _swrate
+.globl _swrmin
+.globl _swtemp
+.globl _cratex
+.globl _cratey
+.globl _sigtab
+.globl _swfifo
+.globl _txfifo
+.globl _tyfifo
+.globl _swrtab
+.data
+_swrtab:
+.dc.l $0
+.dc.l $800
+.dc.l $1000
+.dc.l $1800
+.dc.l $2000
+.dc.l $2800
+.dc.l $3000
+.dc.l $3800
+.dc.l $4000
+.dc.l $4800
+.dc.l $5000
+.dc.l $5800
+.dc.l $6000
+.dc.l $6800
+.dc.l $7000
+.dc.l $7800
+.dc.l $8000
+.dc.l $8800
+.dc.l $9000
+.dc.l $9800
+.dc.l $A000
+.dc.l $A800
+.dc.l $B000
+.dc.l $B800
+.dc.l $C000
+.dc.l $C800
+.dc.l $D000
+.dc.l $D800
+.dc.l $E000
+.dc.l $E800
+.dc.l $F000
+.dc.l $F800
+.dc.l $10000
+.dc.l $10800
+.dc.l $11000
+.dc.l $11800
+.dc.l $12000
+.dc.l $12800
+.dc.l $13000
+.dc.l $13800
+.dc.l $14000
+.dc.l $14800
+.dc.l $15000
+.dc.l $15800
+.dc.l $16000
+.dc.l $16800
+.dc.l $17000
+.dc.l $17800
+.dc.l $18000
+.dc.l $18800
+.dc.l $19000
+.dc.l $19800
+.dc.l $1A000
+.dc.l $1A800
+.dc.l $1B000
+.dc.l $1B800
+.dc.l $1C000
+.dc.l $1C800
+.dc.l $1D000
+.dc.l $1D800
+.dc.l $1E000
+.dc.l $1E800
+.dc.l $1F000
+.dc.l $1F800
+.dc.l $20000
+.dc.l $20800
+.dc.l $21000
+.dc.l $21800
+.dc.l $22000
+.dc.l $22800
+.dc.l $23000
+.dc.l $23800
+.dc.l $24000
+.dc.l $24800
+.dc.l $25000
+.dc.l $25800
+.dc.l $26000
+.dc.l $26800
+.dc.l $27000
+.dc.l $27800
+.dc.l $28000
+.dc.l $28800
+.dc.l $29000
+.dc.l $29800
+.dc.l $2A000
+.dc.l $2A800
+.dc.l $2B000
+.dc.l $2B800
+.dc.l $2C000
+.dc.l $2C800
+.dc.l $2D000
+.dc.l $2D800
+.dc.l $2E000
+.dc.l $2E800
+.dc.l $2F000
+.dc.l $2F800
+.dc.l $30000
+.dc.l $30800
+.dc.l $31000
+.dc.l $31800
+.dc.l $32000
+.dc.l $32800
+.dc.l $33000
+.dc.l $33800
+.dc.l $34000
+.dc.l $34800
+.dc.l $35000
+.dc.l $35800
+.dc.l $36000
+.dc.l $36800
+.dc.l $37000
+.dc.l $37800
+.dc.l $38000
+.dc.l $38800
+.dc.l $39000
+.dc.l $39800
+.dc.l $3A000
+.dc.l $3A800
+.dc.l $3B000
+.dc.l $3B800
+.dc.l $3C000
+.dc.l $3C800
+.dc.l $3D000
+.dc.l $3D800
+.dc.l $3E000
+.dc.l $3E800
+.dc.l $3F000
+.dc.l $3F800
+.globl _MouseRT
+.text
+_MouseRT:
+~~MouseRT:
+~t=8
+link R14,#-6
+~oldi=-2
+*line 238
+move #4,(sp)
+jsr _setipl
+move R0,-2(R14)
+*line 240
+move 8(R14),10+_timers
+*line 242
+move -2(R14),(sp)
+jsr _setipl
+L1:unlk R14
+rts
+.globl _MouseRD
+.text
+_MouseRD:
+~~MouseRD:
+~str=8
+~nc=12
+~nt=14
+link R14,#-8
+~tc=-4
+*line 265
+move 14(R14),R0
+muls #500,R0
+move.l R0,-4(R14)
+*line 267
+bra L5
+L4:
+*line 268
+*line 269
+*line 269
+clr (sp)
+move #1,-(sp)
+jsr _trap13
+addq.l #2,sp
+tst.l R0
+beq L6
+*line 270
+*line 271
+move.l 8(R14),-(sp)
+clr -(sp)
+move #2,-(sp)
+jsr _trap13
+addq.l #4,sp
+ext.w R0
+move.l (sp)+,R8
+move.b R0,(R8)
+add.l #1,8(R14)
+*line 272
+move.l 8(R14),R8
+clr.b (R8)
+*line 273
+sub #1,12(R14)
+*line 274
+bra L7
+L6:
+*line 275
+*line 276
+*line 277
+*line 278
+move.l -4(R14),R0
+sub.l #$1,-4(R14)
+tst.l R0
+bgt L8
+*line 278
+move #-1,R0
+bra L2
+L8:L7:
+*line 279
+L5:
+*line 280
+tst 12(R14)
+bgt L4
+L3:
+*line 282
+clr R0
+bra L2
+L2:unlk R14
+rts
+.globl _MouseWR
+.text
+_MouseWR:
+~~MouseWR:
+~str=8
+link R14,#0
+movem.l R6-R7,-(sp)
+~c=R7
+*line 301
+bra L12
+L11:
+*line 302
+move R7,(sp)
+clr -(sp)
+move #3,-(sp)
+jsr _trap13
+addq.l #4,sp
+L12:
+*line 302
+move.l 8(R14),R8
+move.b (R8),R0
+ext.w R0
+move R0,R7
+and #255,R7
+clr R0
+move R7,R0
+add.l #1,8(R14)
+tst R0
+bne L11
+L10:L9:tst.l (sp)+
+movem.l (sp)+,R7-R7
+unlk R14
+rts
+.globl _MouseFL
+.text
+_MouseFL:
+~~MouseFL:
+~tc=8
+link R14,#-8
+~flushed=-4
+*line 320
+clr.l -4(R14)
+*line 322
+clr _M_state
+*line 323
+clr _msflag
+*line 324
+clr _msctrl
+*line 326
+bra L16
+L15:
+*line 327
+*line 328
+clr (sp)
+move #2,-(sp)
+jsr _trap13
+addq.l #2,sp
+*line 329
+add.l #$1,-4(R14)
+*line 330
+*line 331
+*line 331
+sub #1,8(R14)
+bgt L17
+*line 332
+*line 336
+*line 337
+*line 338
+move #-1,R0
+bra L13
+*line 339
+L17:L16:
+*line 340
+clr (sp)
+move #1,-(sp)
+jsr _trap13
+addq.l #2,sp
+tst.l R0
+bne L15
+L14:
+*line 347
+clr R0
+bra L13
+L13:unlk R14
+rts
+.globl _MouseWK
+.text
+_MouseWK:
+~~MouseWK:
+link R14,#-6
+~tries=-2
+*line 364
+clr _M_error
+*line 365
+clr _M_oldbs
+*line 366
+clr _M_state
+*line 370
+move #192,(sp)
+move #70,-(sp)
+move #-1,-(sp)
+clr -(sp)
+clr -(sp)
+move #1,-(sp)
+jsr _trap14
+adda.l #10,sp
+*line 372
+*line 372
+move #1024,(sp)
+jsr _MouseFL
+tst R0
+beq L19
+*line 373
+*line 374
+move #1,_M_error
+*line 375
+*line 379
+*line 380
+*line 381
+move #-1,R0
+bra L18
+*line 382
+*line 383
+L19:
+*line 384
+clr -2(R14)
+bra L22
+L23:
+*line 385
+*line 386
+move.l #L24,(sp)
+jsr _MouseWR
+*line 387
+*line 388
+*line 388
+move #2,(sp)
+move #2,-(sp)
+move.l #_M_strng,-(sp)
+jsr _MouseRD
+addq.l #6,sp
+tst R0
+beq L25
+*line 389
+*line 390
+move #3,_M_error
+*line 391
+bra L26
+L25:
+*line 392
+*line 392
+move.l #_M_strng,(sp)
+move.l #L27,-(sp)
+jsr _strcmp
+addq.l #4,sp
+tst R0
+beq L28
+*line 393
+*line 394
+move #4,_M_error
+*line 395
+*line 396
+*line 397
+move #1024,(sp)
+jsr _MouseFL
+tst R0
+beq L29
+*line 397
+move #1,_M_error
+*line 398
+L29:bra L30
+L28:
+*line 399
+*line 400
+*line 401
+clr _M_error
+*line 402
+move #2000,(sp)
+jsr _MouseRT
+*line 403
+*line 407
+*line 408
+clr R0
+bra L18
+L30:L26:
+*line 409
+L21:
+*line 384
+add #1,-2(R14)
+L22:
+*line 384
+cmp #10,-2(R14)
+blt L23
+L20:
+*line 417
+move #-1,R0
+bra L18
+L18:unlk R14
+rts
+.globl _MouseEX
+.text
+_MouseEX:
+~~MouseEX:
+~str=8
+link R14,#-10
+~oldi=-2
+~msc=-4
+~mst=-6
+*line 441
+clr _M_error
+*line 443
+*line 443
+move.l 8(R14),R8
+btst #6,(R8)
+bne L32
+*line 444
+*line 445
+*line 446
+move #1024,(sp)
+jsr _MouseFL
+tst R0
+beq L33
+*line 446
+move #1,_M_error
+*line 447
+bra L34
+L33:
+*line 448
+move #2,_M_error
+L34:
+*line 449
+*line 450
+clr _M_state
+*line 451
+move #2000,(sp)
+jsr _MouseRT
+*line 452
+*line 456
+*line 457
+bra L31
+*line 458
+*line 459
+*line 460
+L32:
+*line 461
+move.l 8(R14),R8
+move.b (R8),R0
+ext.w R0
+and #48,R0
+move R0,-6(R14)
+*line 462
+move _M_oldbs,R0
+clr R1
+move -6(R14),R1
+eor R1,R0
+move R0,-4(R14)
+*line 463
+move -6(R14),_M_oldbs
+*line 465
+*line 465
+tst -4(R14)
+beq L35
+*line 466
+*line 467
+*line 467
+btst #4,-3(R14)
+beq L36
+*line 468
+*line 469
+clr R0
+move -6(R14),R0
+and #16,R0
+lsr #4,R0
+move R0,_astat
+*line 470
+move.l _m_key,R8
+jsr (R8)
+*line 471
+*line 472
+L36:
+*line 473
+*line 473
+btst #5,-3(R14)
+beq L37
+*line 474
+*line 475
+clr R0
+move -6(R14),R0
+and #32,R0
+lsr #5,R0
+move R0,_astat
+*line 476
+move.l _e_key,R8
+jsr (R8)
+*line 477
+L37:
+*line 478
+*line 479
+L35:
+*line 480
+*line 480
+tst _ss_ptsw
+bne L10000
+tst _ss_sqsw
+beq L38
+L10000:*line 481
+*line 482
+clr _cxrate
+*line 483
+clr _cyrate
+bra L31
+*line 484
+*line 485
+*line 486
+*line 487
+*line 488
+*line 489
+L38:
+*line 490
+move.l 8(R14),R8
+move.b 1(R8),R0
+ext.w R0
+move.l 8(R14),R9
+move.b (R9),R1
+ext.w R1
+and #3,R1
+asl #6,R1
+or R1,R0
+move R0,_msxmov
+*line 492
+*line 493
+btst #7,1+_msxmov
+beq L39
+*line 493
+or #-128,_msxmov
+*line 494
+L39:
+*line 495
+move _msxres,R0
+add R0,_msxmov
+*line 497
+move.l 8(R14),R8
+move.b 2(R8),R0
+ext.w R0
+move.l 8(R14),R9
+move.b (R9),R1
+ext.w R1
+and #12,R1
+asl #4,R1
+add R1,R0
+move R0,_msymov
+*line 499
+*line 500
+btst #7,1+_msymov
+beq L40
+*line 500
+or #-128,_msymov
+*line 501
+L40:
+*line 502
+move _msyres,R0
+add R0,_msymov
+*line 504
+move _ndisp,R8
+add #1,R8
+add.l R8,R8
+add.l #_msxgdv,R8
+move (R8),_msxdiv
+*line 505
+move _ndisp,R8
+add #1,R8
+add.l R8,R8
+add.l #_msygdv,R8
+move (R8),_msydiv
+*line 509
+*line 510
+cmp #1,_msxdiv
+ble L41
+*line 510
+move _msxmov,R0
+ext.l R0
+divs _msxdiv,R0
+move R0,_cxrate
+*line 511
+bra L42
+L41:
+*line 512
+move _msxmov,_cxrate
+L42:
+*line 514
+*line 515
+cmp #1,_msydiv
+ble L43
+*line 515
+move _msymov,R0
+ext.l R0
+divs _msydiv,R0
+move R0,_cyrate
+*line 516
+bra L44
+L43:
+*line 517
+move _msymov,_cyrate
+L44:
+*line 521
+*line 522
+cmp #1,_msxdiv
+ble L45
+*line 522
+move _msxmov,R0
+ext.l R0
+divs _msxdiv,R0
+swap R0
+move R0,_msxres
+*line 523
+bra L46
+L45:
+*line 524
+clr _msxres
+L46:
+*line 526
+*line 527
+cmp #1,_msydiv
+ble L47
+*line 527
+move _msymov,R0
+ext.l R0
+divs _msydiv,R0
+swap R0
+move R0,_msyres
+*line 528
+bra L48
+L47:
+*line 529
+clr _msyres
+L48:
+*line 534
+*line 535
+tst _cxrate
+bne L10001
+tst _cyrate
+beq L31
+L10001:*line 536
+*line 537
+move #1,_msctrl
+*line 538
+clr _cmfirst
+*line 539
+clr _trkball
+*line 541
+clr _cvtime
+*line 542
+clr _ncvwait
+*line 543
+clr _chtime
+*line 544
+clr _nchwait
+*line 545
+clr _curhold
+*line 547
+*line 548
+tst _msflag
+bne L49
+*line 548
+move.l _xy_dn,R8
+jsr (R8)
+*line 549
+L49:
+*line 550
+move #4,(sp)
+jsr _setipl
+move R0,-2(R14)
+*line 551
+move #125,8+_timers
+*line 552
+move -2(R14),(sp)
+jsr _setipl
+*line 554
+move #1,_msflag
+L31:unlk R14
+rts
+.globl _MouseIN
+.text
+_MouseIN:
+~~MouseIN:
+~c=8
+link R14,#-4
+*line 569
+and #255,8(R14)
+*line 576
+*line 576
+tst _M_state
+blt L51
+cmp #3,_M_state
+bge L51
+*line 577
+*line 578
+move 8(R14),R0
+move.l #_M_strng,R9
+move _M_state,R10
+add.l R10,R9
+move.b R0,(R9)
+*line 579
+*line 580
+*line 580
+cmp #2,_M_state
+bne L52
+*line 581
+*line 582
+move.l #_M_strng,(sp)
+jsr _MouseEX
+*line 583
+clr _M_state
+*line 584
+bra L53
+L52:
+*line 585
+*line 586
+*line 587
+add #1,_M_state
+L53:
+*line 588
+*line 589
+L51:L50:unlk R14
+rts
+.globl _wheel
+.text
+_wheel:
+~~wheel:
+link R14,#0
+movem.l R5-R7,-(sp)
+~i=R7
+~oldi=R6
+*line 658
+*line 658
+tst _astat
+beq L55
+*line 659
+*line 660
+*line 660
+tst _swflag
+bne L56
+*line 661
+*line 662
+*line 663
+*line 664
+move #1,_swflag
+*line 665
+clr _swctrl
+*line 666
+clr _swfiin
+*line 667
+move _aval,_swlast
+*line 668
+move _swwait,_swstop
+*line 669
+clr.l _swcount
+*line 670
+*line 671
+clr R7
+bra L59
+L60:
+*line 672
+move R7,R8
+add.l R8,R8
+add.l #_swfifo,R8
+move _aval,(R8)
+L58:
+*line 671
+add #1,R7
+L59:
+*line 671
+cmp #100,R7
+blt L60
+L57:
+*line 672
+*line 673
+*line 674
+bra L61
+L56:
+*line 675
+*line 676
+*line 677
+*line 677
+tst _swstop
+bne L62
+*line 678
+*line 679
+move _swlast,R0
+sub _aval,R0
+move R0,_swdelta
+*line 680
+*line 681
+*line 681
+move _swdelta,R0
+cmp _swthr,R0
+blt L63
+*line 682
+*line 683
+*line 684
+*line 685
+cmp #6,_clkctl
+beq L10002
+cmp #6,_clkctl
+beq L64
+tst _clkrun
+bne L64
+L10002:*line 686
+*line 687
+*line 688
+*line 689
+move _swdelta,R0
+ext.l R0
+divs _swthr,R0
+ext.l R0
+move.l R0,_swtemp
+*line 690
+move #4,(sp)
+jsr _setipl
+move R0,R6
+*line 691
+move.l _swtemp,R0
+add.l R0,_fc_val
+*line 692
+*line 693
+*line 694
+move.l _fc_val,R0
+cmp.l #$ffffff,R0
+blt L65
+*line 694
+move.l #$ffffff,_fc_val
+*line 695
+L65:
+*line 696
+move R6,(sp)
+jsr _setipl
+*line 697
+move _aval,_swlast
+*line 698
+*line 699
+L64:bra L66
+L63:
+*line 700
+*line 700
+tst _swdelta
+bge L10003
+move _swdelta,R0
+neg R0
+bra L10005
+L10003:move _swdelta,R0
+L10005:move R0,_swdelta
+cmp _swthr,R0
+blt L67
+*line 701
+*line 702
+*line 703
+*line 704
+cmp #6,_clkctl
+beq L10006
+cmp #6,_clkctl
+beq L68
+tst _clkrun
+bne L68
+L10006:*line 705
+*line 706
+*line 707
+*line 708
+move _swdelta,R0
+ext.l R0
+divs _swthr,R0
+ext.l R0
+move.l R0,_swtemp
+*line 709
+move #4,(sp)
+jsr _setipl
+move R0,R6
+*line 710
+move.l _swtemp,R0
+sub.l R0,_fc_val
+*line 711
+*line 712
+*line 713
+tst.l _fc_val
+bge L69
+*line 713
+clr.l _fc_val
+*line 714
+L69:
+*line 715
+move R6,(sp)
+jsr _setipl
+*line 716
+move _aval,_swlast
+*line 717
+L68:
+*line 718
+*line 719
+L67:L66:bra L70
+L62:
+*line 720
+*line 721
+*line 722
+move _aval,_swlast
+*line 723
+sub #1,_swstop
+L70:
+*line 724
+L61:
+*line 725
+*line 726
+*line 727
+bra L71
+L55:
+*line 728
+*line 729
+*line 730
+move _aval,_swlast
+*line 731
+clr _swflag
+*line 732
+clr _swctrl
+*line 733
+*line 734
+*line 735
+*line 736
+cmp #6,_clkctl
+beq L10007
+cmp #6,_clkctl
+beq L72
+tst _clkrun
+bne L72
+L10007:*line 737
+*line 738
+move _swfiin,R0
+sub _swback,R0
+move R0,_swndx
+*line 739
+*line 740
+*line 741
+tst _swndx
+bge L73
+*line 741
+add #100,_swndx
+*line 742
+L73:
+*line 743
+move _swndx,R8
+add.l R8,R8
+move.l #_swfifo,R9
+move 0(R8,R9.l),R0
+sub _swlast,R0
+ext.l R0
+move.l R0,_swrate
+*line 744
+*line 745
+*line 745
+move.l _swrate,R0
+cmp.l _swrmin,R0
+ble L74
+*line 746
+*line 747
+clr _swdir
+*line 748
+move.l _swrate,R8
+sub.l _swrmin,R8
+add.l R8,R8
+add.l R8,R8
+add.l #_swrtab,R8
+move.l (R8),_swrate
+*line 749
+move #1,_swctrl
+*line 750
+bra L75
+L74:
+*line 751
+*line 751
+tst.l _swrate
+bge L10008
+move.l _swrate,R0
+neg.l R0
+bra L10010
+L10008:move.l _swrate,R0
+L10010:move.l R0,_swrate
+cmp.l _swrmin,R0
+ble L76
+*line 752
+*line 753
+move #1,_swdir
+*line 754
+move.l _swrate,R8
+sub.l _swrmin,R8
+add.l R8,R8
+add.l R8,R8
+add.l #_swrtab,R8
+move.l (R8),_swrate
+*line 755
+move #1,_swctrl
+*line 756
+bra L77
+L76:
+*line 757
+*line 758
+*line 759
+clr.l _swrate
+L77:L75:
+*line 760
+*line 761
+L72:L71:L54:tst.l (sp)+
+movem.l (sp)+,R6-R7
+unlk R14
+rts
+.globl _txyup
+.text
+_txyup:
+~~txyup:
+link R14,#0
+movem.l R3-R7,-(sp)
+~txndx=R7
+~tyndx=R6
+~txrate=R5
+~tyrate=R4
+*line 783
+clr _tkboth
+*line 785
+clr _txdiv
+*line 786
+clr _tydiv
+*line 788
+*line 789
+move _txfiin,R7
+sub _tkback,R7
+bge L79
+*line 789
+add #100,R7
+*line 790
+L79:
+*line 791
+move R7,R8
+add.l R8,R8
+add.l #_txfifo,R8
+move (R8),R5
+sub _txlast,R5
+*line 798
+*line 799
+cmp _tkrmin,R5
+blt L80
+*line 799
+move.l _cratex,R8
+move R5,R9
+sub _tkrmin,R9
+add.l R9,R9
+move 0(R8,R9.l),R0
+neg R0
+move R0,_cxrate
+bra L81
+L80:
+*line 800
+*line 801
+tst R5
+bge L10011
+move R5,R0
+neg R0
+bra L10013
+L10011:move R5,R0
+L10013:move R0,R5
+move R5,R0
+cmp _tkrmin,R0
+blt L82
+*line 801
+move R5,R8
+sub _tkrmin,R8
+add.l R8,R8
+add.l _cratex,R8
+move (R8),_cxrate
+*line 802
+bra L83
+L82:
+*line 803
+clr _cxrate
+L83:L81:
+*line 807
+*line 808
+move _tyfiin,R6
+sub _tkback,R6
+bge L84
+*line 808
+add #100,R6
+*line 809
+L84:
+*line 810
+move R6,R8
+add.l R8,R8
+add.l #_tyfifo,R8
+move (R8),R4
+sub _tylast,R4
+*line 817
+*line 818
+cmp _tkrmin,R4
+blt L85
+*line 818
+move R4,R8
+sub _tkrmin,R8
+add.l R8,R8
+add.l _cratey,R8
+move (R8),_cyrate
+bra L86
+L85:
+*line 819
+*line 820
+tst R4
+bge L10014
+move R4,R0
+neg R0
+bra L10016
+L10014:move R4,R0
+L10016:move R0,R4
+move R4,R0
+cmp _tkrmin,R0
+blt L87
+*line 820
+move.l _cratey,R8
+move R4,R9
+sub _tkrmin,R9
+add.l R9,R9
+move 0(R8,R9.l),R0
+neg R0
+move R0,_cyrate
+*line 821
+bra L88
+L87:
+*line 822
+clr _cyrate
+L88:L86:
+*line 824
+*line 824
+tst _cxrate
+bne L89
+tst _cyrate
+bne L89
+*line 825
+*line 826
+clr _tkctrl
+*line 827
+move.l _xy_up,R8
+jsr (R8)
+*line 828
+bra L90
+L89:
+*line 829
+*line 830
+*line 831
+move #1,_tkctrl
+L90:L78:tst.l (sp)+
+movem.l (sp)+,R4-R7
+unlk R14
+rts
+.globl _txydn
+.text
+_txydn:
+~~txydn:
+link R14,#0
+movem.l R6-R7,-(sp)
+~i=R7
+*line 861
+move #1,_tkboth
+*line 862
+move.l _xy_dn,R8
+jsr (R8)
+*line 864
+clr _tkctrl
+*line 865
+clr _cxrate
+*line 866
+clr _cyrate
+*line 868
+clr _txfiin
+*line 869
+clr _tyfiin
+*line 871
+clr R7
+bra L94
+L95:
+*line 872
+*line 873
+move R7,R8
+add.l R8,R8
+add.l #_txfifo,R8
+move _txlast,(R8)
+*line 874
+move R7,R8
+add.l R8,R8
+add.l #_tyfifo,R8
+move _tylast,(R8)
+L93:
+*line 871
+add #1,R7
+L94:
+*line 871
+cmp #100,R7
+blt L95
+L92:L91:tst.l (sp)+
+movem.l (sp)+,R7-R7
+unlk R14
+rts
+.globl _txstd
+.text
+_txstd:
+~~txstd:
+link R14,#0
+movem.l R2-R7,-(sp)
+~i=R7
+~oldcx=R6
+~oldi=R5
+~txdelta=R4
+~txcdvr=R3
+*line 896
+move #1,_trkball
+*line 897
+clr _cmfirst
+*line 898
+move _tktime,_chtime
+*line 899
+move _tktime,_nchwait
+*line 900
+move _tktime,_chwait
+*line 905
+tst _cmtype
+bne L10017
+move _tkthr,R0
+bra L10019
+L10017:move _tkhdvr,R0
+L10019:move R0,R3
+*line 907
+*line 907
+tst _astat
+beq L97
+*line 908
+*line 909
+*line 909
+tst _txflag
+bne L98
+*line 910
+*line 911
+*line 912
+*line 913
+move #1,_txflag
+*line 914
+move _tkwait,_txstop
+*line 915
+move _aval,_txlast
+*line 916
+*line 917
+*line 918
+tst _tyflag
+beq L99
+tst _tkboth
+bne L99
+*line 918
+jsr _txydn
+*line 919
+*line 920
+*line 921
+L99:bra L100
+L98:
+*line 922
+*line 923
+*line 924
+*line 924
+tst _txstop
+bgt L101
+*line 925
+*line 926
+move _txlast,R4
+sub _aval,R4
+*line 927
+move _cxval,R6
+*line 928
+*line 929
+*line 929
+cmp R3,R4
+blt L102
+*line 930
+*line 931
+*line 932
+*line 933
+move R4,R0
+ext.l R0
+divs R3,R0
+neg R0
+move R0,_cxrate
+*line 934
+*line 935
+move.l _cx_upd,R8
+jsr (R8)
+*line 936
+*line 937
+*line 938
+cmp _cxval,R6
+beq L103
+*line 938
+move.l _curmove,R8
+jsr (R8)
+*line 939
+L103:
+*line 940
+move _aval,_txlast
+*line 941
+clr _cxrate
+*line 942
+bra L104
+L102:
+*line 943
+*line 943
+tst R4
+bge L10020
+move R4,R0
+neg R0
+bra L10022
+L10020:move R4,R0
+L10022:move R0,R4
+move R4,R0
+cmp R0,R3
+bgt L105
+*line 944
+*line 945
+*line 946
+*line 947
+move R4,R0
+ext.l R0
+divs R3,R0
+move R0,_cxrate
+*line 948
+*line 949
+move.l _cx_upd,R8
+jsr (R8)
+*line 950
+*line 951
+*line 952
+cmp _cxval,R6
+beq L106
+*line 952
+move.l _curmove,R8
+jsr (R8)
+*line 953
+L106:
+*line 954
+move _aval,_txlast
+*line 955
+clr _cxrate
+*line 956
+*line 957
+L105:L104:bra L107
+L101:
+*line 958
+*line 959
+*line 960
+move _aval,_txlast
+*line 961
+sub #1,_txstop
+L107:
+*line 962
+L100:
+*line 963
+*line 964
+*line 965
+bra L108
+L97:
+*line 966
+*line 967
+*line 968
+move _aval,_txlast
+*line 969
+clr _txflag
+*line 970
+*line 971
+*line 972
+tst _tyflag
+bne L109
+*line 972
+jsr _txyup
+L109:L108:L96:tst.l (sp)+
+movem.l (sp)+,R3-R7
+unlk R14
+rts
+.globl _tystd
+.text
+_tystd:
+~~tystd:
+link R14,#0
+movem.l R2-R7,-(sp)
+~i=R7
+~oldcy=R6
+~oldi=R5
+~tydelta=R4
+~tycdvr=R3
+*line 989
+move #1,_trkball
+*line 990
+clr _cmfirst
+*line 991
+move _tktime,_cvtime
+*line 992
+move _tktime,_ncvwait
+*line 993
+move _tktime,_cvwait
+*line 997
+tst _cmtype
+bne L10023
+move _tkthr,R0
+bra L10025
+L10023:move _tkvdvr,R0
+L10025:move R0,R3
+*line 999
+*line 999
+tst _astat
+beq L111
+*line 1000
+*line 1001
+*line 1001
+tst _tyflag
+bne L112
+*line 1002
+*line 1003
+*line 1004
+*line 1005
+move #1,_tyflag
+*line 1006
+move _tkwait,_tystop
+*line 1007
+move _aval,_tylast
+*line 1008
+*line 1009
+*line 1010
+tst _txflag
+beq L113
+tst _tkboth
+bne L113
+*line 1010
+jsr _txydn
+*line 1011
+*line 1012
+L113:bra L114
+L112:
+*line 1013
+*line 1014
+*line 1015
+*line 1015
+tst _tystop
+bgt L115
+*line 1016
+*line 1017
+move _tylast,R4
+sub _aval,R4
+*line 1018
+move _cyval,R6
+*line 1019
+*line 1020
+*line 1020
+cmp R3,R4
+blt L116
+*line 1021
+*line 1022
+*line 1023
+*line 1024
+move R4,R0
+ext.l R0
+divs R3,R0
+move R0,_cyrate
+*line 1025
+*line 1026
+move.l _cy_upd,R8
+jsr (R8)
+*line 1027
+*line 1028
+*line 1029
+cmp _cyval,R6
+beq L117
+*line 1029
+move.l _curmove,R8
+jsr (R8)
+*line 1030
+L117:
+*line 1031
+move _aval,_tylast
+*line 1032
+clr _cyrate
+*line 1033
+bra L118
+L116:
+*line 1034
+*line 1034
+tst R4
+bge L10026
+move R4,R0
+neg R0
+bra L10028
+L10026:move R4,R0
+L10028:move R0,R4
+move R4,R0
+cmp R0,R3
+bgt L119
+*line 1035
+*line 1036
+*line 1037
+*line 1038
+move R4,R0
+ext.l R0
+divs R3,R0
+neg R0
+move R0,_cyrate
+*line 1039
+*line 1040
+move.l _cy_upd,R8
+jsr (R8)
+*line 1041
+*line 1042
+*line 1043
+cmp _cyval,R6
+beq L120
+*line 1043
+move.l _curmove,R8
+jsr (R8)
+*line 1044
+L120:
+*line 1045
+move _aval,_tylast
+*line 1046
+clr _cyrate
+*line 1047
+*line 1048
+L119:L118:bra L121
+L115:
+*line 1049
+*line 1050
+*line 1051
+move _aval,_tylast
+*line 1052
+sub #1,_tystop
+L121:
+*line 1053
+L114:
+*line 1054
+*line 1055
+*line 1056
+bra L122
+L111:
+*line 1057
+*line 1058
+*line 1059
+move _aval,_tylast
+*line 1060
+clr _tyflag
+*line 1061
+*line 1062
+*line 1063
+tst _txflag
+bne L123
+*line 1063
+jsr _txyup
+L123:L122:L110:tst.l (sp)+
+movem.l (sp)+,R3-R7
+unlk R14
+rts
+.globl _curproc
+.text
+_curproc:
+~~curproc:
+link R14,#-4
+movem.l R3-R7,-(sp)
+~i=R7
+~cxprev=R6
+~cyprev=R5
+~oldcx=-2
+~oldcy=-4
+~oldi=R4
+*line 1084
+move 2+_timers,_chwait
+*line 1085
+move 4+_timers,_cvwait
+*line 1087
+*line 1087
+tst _trkball
+beq L125
+*line 1088
+*line 1089
+*line 1089
+tst _txflag
+beq L126
+tst _chwait
+bgt L126
+*line 1090
+*line 1091
+*line 1092
+*line 1093
+move _txfiin,R8
+add.l R8,R8
+add.l #_txfifo,R8
+move 220+_sigtab,(R8)
+*line 1094
+*line 1097
+*line 1098
+*line 1099
+*line 1100
+add #1,_txfiin
+move _txfiin,R0
+cmp #100,R0
+blt L127
+*line 1100
+clr _txfiin
+L127:
+*line 1101
+*line 1102
+L126:
+*line 1103
+*line 1103
+tst _tyflag
+beq L128
+tst _cvwait
+bgt L128
+*line 1104
+*line 1105
+*line 1106
+*line 1107
+move _tyfiin,R8
+add.l R8,R8
+add.l #_tyfifo,R8
+move 224+_sigtab,(R8)
+*line 1108
+*line 1111
+*line 1112
+*line 1113
+*line 1114
+add #1,_tyfiin
+move _tyfiin,R0
+cmp #100,R0
+blt L129
+*line 1114
+clr _tyfiin
+L129:
+*line 1115
+L128:
+*line 1116
+*line 1117
+*line 1118
+*line 1119
+*line 1120
+L125:
+*line 1121
+*line 1121
+clr (sp)
+move #1,-(sp)
+jsr _trap13
+addq.l #2,sp
+tst.l R0
+beq L130
+*line 1122
+*line 1123
+clr (sp)
+move #2,-(sp)
+jsr _trap13
+addq.l #2,sp
+move R0,(sp)
+jsr _MouseIN
+*line 1124
+*line 1125
+move #2000,(sp)
+jsr _MouseRT
+*line 1126
+*line 1127
+*line 1128
+*line 1129
+L130:
+*line 1130
+*line 1130
+tst _cvwait
+bgt L131
+*line 1131
+*line 1132
+*line 1133
+tst _ss_ptsw
+beq L132
+*line 1133
+move _ss_ptsw,(sp)
+jsr _smy_up
+*line 1134
+L132:
+*line 1135
+*line 1136
+tst _ss_sqsw
+beq L133
+*line 1136
+move _ss_sqsw,(sp)
+jsr _sqy_up
+L133:
+*line 1137
+*line 1138
+L131:
+*line 1139
+*line 1140
+tst _msctrl
+bne L10029
+tst _cvwait
+ble L10029
+tst _chwait
+bgt L134
+L10029:*line 1141
+*line 1142
+*line 1142
+tst _msctrl
+bne L10030
+tst _tkctrl
+bne L10030
+tst _xkstat
+beq L135
+tst _ykstat
+beq L135
+L10030:*line 1143
+*line 1144
+move _cxrate,-2(R14)
+*line 1145
+move _cyrate,-4(R14)
+*line 1146
+move _cxval,R6
+*line 1147
+move _cyval,R5
+*line 1148
+move _vtcrow,_vtprow
+*line 1149
+move _vtccol,_vtpcol
+*line 1150
+*line 1151
+*line 1152
+tst _msctrl
+bne L136
+*line 1152
+jsr _cmfix
+*line 1153
+*line 1154
+*line 1155
+L136:
+*line 1156
+*line 1157
+tst _cxrate
+beq L137
+tst _msctrl
+bne L10031
+tst _chwait
+bgt L137
+L10031:*line 1157
+move.l _cx_upd,R8
+jsr (R8)
+*line 1158
+L137:
+*line 1159
+*line 1160
+tst _cyrate
+beq L138
+tst _msctrl
+bne L10032
+tst _cvwait
+bgt L138
+L10032:*line 1160
+move.l _cy_upd,R8
+jsr (R8)
+*line 1161
+L138:
+*line 1162
+move -2(R14),_cxrate
+*line 1163
+move -4(R14),_cyrate
+*line 1164
+*line 1165
+*line 1166
+*line 1167
+*line 1168
+cmp _cxval,R6
+bne L10033
+cmp _cyval,R5
+bne L10033
+move _vtprow,R0
+cmp _vtcrow,R0
+bne L10033
+move _vtpcol,R0
+cmp _vtccol,R0
+beq L139
+L10033:*line 1169
+*line 1170
+move.l _curmove,R8
+jsr (R8)
+*line 1171
+*line 1172
+*line 1172
+tst _ebflag
+beq L140
+*line 1173
+*line 1174
+*line 1174
+tst.l _curfet
+beq L141
+*line 1175
+*line 1176
+*line 1176
+move.l _curfet,(sp)
+move _stccol,-(sp)
+move _stcrow,-(sp)
+jsr _infield
+addq.l #4,sp
+tst R0
+beq L142
+*line 1177
+*line 1178
+*line 1179
+tst.l _cfetp
+beq L143
+move.l _cfetp,R0
+cmp.l _infetp,R0
+beq L143
+*line 1180
+*line 1181
+move.l _cfetp,R8
+move 6(R8),-(sp)
+move.l _cfetp,R8
+move.l 16(R8),R8
+jsr (R8)
+addq.l #2,sp
+*line 1182
+clr _ebflag
+*line 1183
+*line 1184
+L143:bra L144
+L142:
+*line 1185
+*line 1186
+*line 1187
+*line 1188
+tst.l _cfetp
+beq L145
+*line 1188
+move.l _cfetp,R8
+move 6(R8),-(sp)
+move.l _cfetp,R8
+move.l 16(R8),R8
+jsr (R8)
+addq.l #2,sp
+*line 1189
+L145:
+*line 1190
+clr _ebflag
+L144:
+*line 1191
+*line 1192
+bra L146
+L141:
+*line 1193
+*line 1194
+*line 1195
+clr _ebflag
+L146:
+*line 1196
+*line 1197
+L140:
+*line 1198
+L139:
+*line 1199
+L135:
+*line 1200
+*line 1201
+*line 1202
+*line 1203
+*line 1204
+L134:
+*line 1205
+*line 1205
+tst _msflag
+beq L147
+tst 8+_timers
+bne L147
+*line 1206
+*line 1207
+move.l _xy_up,R8
+jsr (R8)
+*line 1208
+*line 1209
+clr _msflag
+*line 1210
+*line 1211
+L147:
+*line 1212
+clr _msctrl
+*line 1217
+*line 1217
+tst 10+_timers
+bne L148
+*line 1218
+*line 1219
+*line 1220
+tst _M_state
+beq L149
+*line 1220
+*line 1221
+move #1024,(sp)
+jsr _MouseFL
+tst R0
+beq L150
+*line 1221
+move #1,_M_error
+*line 1222
+L150:L149:
+*line 1223
+clr _M_state
+*line 1224
+move #2000,(sp)
+jsr _MouseRT
+*line 1225
+*line 1229
+*line 1230
+*line 1231
+*line 1232
+*line 1233
+*line 1234
+*line 1235
+L148:
+*line 1236
+*line 1236
+tst _cvwait
+bgt L151
+*line 1237
+*line 1238
+move _ncvwait,_cvwait
+*line 1239
+move _cvtime,_ncvwait
+*line 1240
+*line 1241
+move #4,(sp)
+jsr _setipl
+move R0,R4
+*line 1242
+move _cvwait,4+_timers
+*line 1243
+move R4,(sp)
+jsr _setipl
+*line 1244
+*line 1245
+*line 1246
+L151:
+*line 1247
+*line 1247
+tst _chwait
+bgt L152
+*line 1248
+*line 1249
+move _nchwait,_chwait
+*line 1250
+move _chtime,_nchwait
+*line 1251
+*line 1252
+move #4,(sp)
+jsr _setipl
+move R0,R4
+*line 1253
+move _chwait,2+_timers
+*line 1254
+move R4,(sp)
+jsr _setipl
+*line 1255
+*line 1256
+*line 1257
+*line 1258
+*line 1259
+L152:
+*line 1260
+*line 1260
+tst _timers
+bne L153
+*line 1261
+*line 1262
+*line 1262
+tst _swflag
+beq L154
+*line 1263
+*line 1264
+move _swfiin,R8
+add.l R8,R8
+add.l #_swfifo,R8
+move 236+_sigtab,(R8)
+*line 1265
+*line 1266
+*line 1267
+add #1,_swfiin
+move _swfiin,R0
+cmp #100,R0
+blt L155
+*line 1267
+clr _swfiin
+L155:
+*line 1268
+*line 1269
+L154:
+*line 1270
+*line 1270
+tst _swctrl
+beq L156
+*line 1271
+*line 1272
+move.l _swcount,R0
+add.l _swrate,R0
+move.l R0,_swtemp
+*line 1273
+move.l _swtemp,R0
+and.l #$ffff,R0
+move.l R0,_swcount
+*line 1274
+move.l #$10,R1
+move.l _swtemp,R0
+asr.l R1,R0
+move.l R0,_swtemp
+*line 1275
+*line 1276
+*line 1276
+tst _swdir
+bne L157
+*line 1277
+*line 1278
+move #4,(sp)
+jsr _setipl
+move R0,R4
+*line 1279
+move.l _swtemp,R0
+add.l R0,_fc_val
+*line 1280
+*line 1281
+*line 1281
+move.l _fc_val,R0
+cmp.l #$ffffff,R0
+blt L158
+*line 1282
+*line 1283
+clr _swctrl
+*line 1284
+move.l #$ffffff,_fc_val
+*line 1285
+*line 1286
+L158:
+*line 1287
+move R4,(sp)
+jsr _setipl
+*line 1288
+bra L159
+L157:
+*line 1289
+*line 1290
+*line 1291
+move #4,(sp)
+jsr _setipl
+move R0,R4
+*line 1292
+move.l _swtemp,R0
+sub.l R0,_fc_val
+*line 1293
+*line 1294
+*line 1294
+tst.l _fc_val
+bge L160
+*line 1295
+*line 1296
+clr _swctrl
+*line 1297
+clr.l _fc_val
+*line 1298
+*line 1299
+L160:
+*line 1300
+move R4,(sp)
+jsr _setipl
+L159:
+*line 1301
+*line 1302
+*line 1303
+*line 1304
+L156:
+*line 1305
+*line 1305
+tst _swflag
+bne L10034
+tst _swctrl
+beq L161
+L10034:*line 1306
+*line 1307
+move #4,(sp)
+jsr _setipl
+move R0,R4
+*line 1308
+move _swtime,_timers
+*line 1309
+move R4,(sp)
+jsr _setipl
+*line 1310
+L161:
+*line 1311
+L153:L124:tst.l (sp)+
+movem.l (sp)+,R4-R7
+unlk R14
+rts
+.globl _tkinit
+.text
+_tkinit:
+~~tkinit:
+link R14,#-4
+*line 1325
+clr _trkball
+*line 1326
+clr _txflag
+*line 1327
+clr _tyflag
+*line 1328
+clr _tkctrl
+*line 1329
+clr _tkboth
+*line 1331
+move #100,(sp)
+clr -(sp)
+move.l #_txfifo,-(sp)
+jsr _memsetw
+addq.l #6,sp
+*line 1332
+clr _txfiin
+*line 1334
+move #100,(sp)
+clr -(sp)
+move.l #_tyfifo,-(sp)
+jsr _memsetw
+addq.l #6,sp
+*line 1335
+clr _tyfiin
+L162:unlk R14
+rts
+.data
+L24:.dc.b $74,$0
+L27:.dc.b $56,$4F,$0
