home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #2 / Amiga Plus CD - 2004 - No. 02.iso / AmiSoft / Dev / asm / DemoStartUP.lha / DemoStartUPv1.0 / sources / 610.4.asm next >
Encoding:
Assembly Source File  |  2001-05-02  |  62.1 KB  |  2,779 lines

  1.  
  2. ; - [ P61 ] -
  3.  
  4.         xdef    _InitPlayer
  5.         xdef    _StopPlayer
  6.     xdef    _P61_E8
  7.     xdef    _P61_Patt
  8.     xdef    _P61_patternbase
  9.     xdef    _P61_Pos
  10.     xdef    _P61_Master
  11.  
  12. ;APS00000000000000000000000000000000000000000000000000000000000000000000000000000000
  13. * The Player 6.1A - A4000 fixed by NoName/Haujobb^Sector 7
  14. *                   Some Enforcer Hits fixed by Platon42
  15. *
  16. * for Devpac 3, ASM-One, PhxAss and maybe some other assemblers
  17. *
  18. * NEEDS: Default sizes must be words (ASM-One default...)
  19. *        Preferably no optimizations on (the jump table must be word jumps)
  20. *
  21. * Tested with Devpac 3.04 by Guru
  22. * Tested with PhxAss 4.14, Asm-Pro 1.1 and ASM-One 1.29 
  23. *
  24. * Note1: If you have already tailored the 610.2 version to your needs
  25. *        and don't want to do this work again, just apply the
  26. *        3 changes that are marked with ";!!!" to your source!
  27. *
  28. * Note2: INTREQ ($dff09c) must ALWAYS be written twice on A4040/60.
  29. *
  30. * Hi Darken!
  31.                 
  32. example = 0     ;0 = assemble the pure replay
  33.                 ;1 = assemble as an example, "P61.testmod" should be played
  34.  
  35. ;makebin        ;uncomment this and a new binary will be
  36.                 ;AUTO-saved to "ram:610.3.bin_new" (ASM-One only)
  37.  
  38. asmone = 0      ;0 = Devpac, PhxAss and the like
  39.                 ;1 = ASM-One (prints out some infos while assembling)
  40.  
  41.  
  42. ;start = 6      ;Starting position
  43.  
  44. fade  = 1       ;0 = Normal, NO master volume control possible
  45.                 ;1 = Use master volume (P61_Master)
  46.  
  47. jump = 0        ;0 = do NOT include position jump code (P61_SetPosition)
  48.                 ;1 = Include
  49.  
  50. system = 1      ;0 = killer
  51.                 ;1 = friendly
  52.  
  53. CIA = 1         ;0 = CIA disabled
  54.                 ;1 = CIA enabled
  55.  
  56. exec = 1        ;0 = ExecBase destroyed
  57.                 ;1 = ExecBase valid
  58.  
  59. lev6 = 1        ;0 = NonLev6
  60.                 ;1 = Lev6 used
  61.  
  62. opt020 = 1      ;0 = MC680x0 code
  63.                 ;1 = MC68020+ or better
  64.  
  65. channels = 4    ;amount of channels to be played
  66.  
  67. use = -1  ;The Usecode
  68.  
  69.         incdir  include:
  70.         include Player61.i
  71.         ifne    asmone
  72.         include infos.s
  73.         endc
  74.  
  75.         ifne    example
  76.         section Player6.1A,code
  77.  
  78.         movem.l d0-a6,-(sp)
  79.         lea     $dff000,a6
  80.         ifeq    system
  81.         move    $1c(a6),-(sp)
  82.         move    #$7fff,$9a(a6)
  83.         move    2(a6),-(sp)
  84.         move    #$7ff,$96(a6)
  85.         endc
  86.  
  87.         lea     P61_data,a0     ;Module
  88.         sub.l   a1,a1           ;No separate samples
  89. ;       lea     P61_smp,a1      ;Samples
  90.  
  91.         sub.l   a2,a2           ;No packed samples
  92. ;       lea     samples,a2      ;Sample buffer in chip,only for packed samples
  93.         moveq   #0,d0           ;Auto Detect
  94.         bsr     P61_motuuli+P61_InitOffset
  95.  
  96.         tst     d0              ;Went ok?
  97.         bne     P61_exit
  98.  
  99. P61_sync
  100.         ifeq    CIA
  101.         move.l  4(a6),d0
  102.         andi.l  #$1ff00,d0
  103.         cmp.l   #$8100,d0
  104.         bne.b   P61_sync
  105.  
  106. P61_sync2
  107.         move.l  4(a6),d0
  108.         andi.l  #$1ff00,d0
  109.         cmp.l   #$8200,d0
  110.         bne.b   P61_sync2
  111.  
  112.         move    #$fff,$180(a6)
  113.         bsr     P61_motuuli+P61_MusicOffset
  114.         clr     $180(a6)
  115.  
  116.         moveq   #0,d0
  117.         move    6(a6),d0
  118.         sub.l   #$8200,d0
  119.         cmp.l   P61_raster(pc),d0
  120.         ble.b   P61_kosj
  121.         move    d0,P61_raster+2
  122. P61_kosj
  123.         tst     P61_raster2+2
  124.         bne.b   P61_doing
  125.         move    d0,P61_raster2+2
  126.         bra     P61_doneg
  127. P61_doing
  128.         add.l   P61_raster2(pc),d0
  129.         asr.l   #1,d0
  130.         move.l  d0,P61_raster2
  131. P61_doneg
  132.         addq.l  #1,P61_frames
  133.  
  134.         ifne    fade
  135.         btst    #2,$16(a6)
  136.         bne.b   P61_jid
  137.         move    P61_diri(pc),d0
  138.         sub     d0,P61_motuuli+P61_MasterVolume
  139.         bne.b   P61_judo
  140.         neg     P61_diri
  141.         bra.b   P61_jid
  142. P61_judo
  143.         cmp     #64,P61_motuuli+P61_MasterVolume
  144.         bne.b   P61_jid
  145.         neg     P61_diri
  146.         endc
  147.  
  148. P61_jid
  149.         endc
  150.  
  151.         btst    #6,$bfe001
  152.         bne     P61_sync
  153.  
  154. P61_exit
  155.         bsr     P61_motuuli+P61_EndOffset
  156.  
  157.         ifeq    system
  158.         move    (sp)+,d7
  159.         bset    #15,d7
  160.         move    #$7ff,$96(a6)
  161.         move    d7,$96(a6)
  162.  
  163.         move    (sp)+,d7
  164.         bset    #15,d7
  165.         move    #$7fff,$9a(a6)
  166.         move    d7,$9a(a6)
  167.         endc
  168.         movem.l (sp)+,d0-a6
  169.  
  170.         move.l  P61_raster(pc),d0
  171.         move.l  P61_raster2(pc),d1
  172.         move.l  P61_frames(pc),d2
  173.         move.l  P61_positionbase(pc),a0
  174.         move.l  P61_patternbase(pc),a1
  175.         move.l  P61_spos(pc),a2
  176.         rts
  177.  
  178. P61_IRQsave
  179.                 dc      0
  180. P61_DMAsave
  181.                 dc      0
  182. P61_raster
  183.                 dc.l    0
  184. P61_raster2
  185.                 dc.l    0
  186. P61_frames
  187.                 dc.l    0
  188. P61_diri
  189.                 dc      1
  190.         endc
  191. *********************************
  192. *        Player 6.1A ®          *
  193. *      All in one-version       *
  194. *        Version 610.2          *
  195. *   © 1992-95 Jarno Paananen    *
  196. *     All rights reserved       *
  197. * Fix by NoName/Haujobb in 1998 *
  198. *********************************
  199.  
  200.  
  201. ******** START OF BINARY FILE **************
  202.  
  203. P61_motuuli
  204.         bra.w   P61_Init
  205.         ifeq    CIA
  206.         bra.w   P61_Music
  207.         else
  208.         rts
  209.         rts
  210.         endc
  211.         bra.w   P61_End
  212.         rts                             ;no P61_SetRepeat
  213.         rts
  214.         ifne    jump
  215.         bra.w   P61_SetPosition
  216.         else
  217.         rts
  218.         rts
  219.         endc
  220.  
  221. _P61_Master
  222. P61_Master
  223.                 dc      64              ;Master volume (0-64)
  224. P61_Tempo
  225.                 dc      1               ;Use tempo? 0=no,non-zero=yes
  226. P61_Play
  227.                 dc      1               ;Stop flag (0=stop)
  228. _P61_E8
  229. P61_E8
  230.                 dc      0               ;Info nybble after command E8
  231. P61_VBR
  232.                 dc.l    0               ;If you're using non-valid execbase
  233.                                         ;put VBR here! (Otherwise 0 assumed)
  234.                                         ;You can also get VBR from here, if
  235.                                         ;using exec-valid version
  236.  
  237. _P61_Pos
  238. P61_Pos
  239.                 dc      0               ;Current song position
  240. _P61_Patt
  241. P61_Patt
  242.                 dc      0               ;Current pattern
  243. P61_CRow
  244.                 dc      0               ;Current pattern row
  245.  
  246. P61_Temp0Offset
  247.         dc.l    P61_temp0-P61_motuuli
  248. P61_Temp1Offset
  249.         dc.l    P61_temp1-P61_motuuli
  250. P61_Temp2Offset
  251.         dc.l    P61_temp2-P61_motuuli
  252. P61_Temp3Offset
  253.         dc.l    P61_temp3-P61_motuuli
  254.  
  255. P61_getnote     macro
  256.         moveq   #$7e,d0
  257.         and.b   (a5),d0
  258.         beq.b   .nonote
  259.         ifne    P61_vib
  260.         clr.b   P61_VibPos(a5)
  261.         endc
  262.         ifne    P61_tre
  263.         clr.b   P61_TrePos(a5)
  264.         endc
  265.  
  266.         ifne    P61_ft
  267.         add     P61_Fine(a5),d0
  268.         endc
  269.         move    d0,P61_Note(a5)
  270.         move    (a2,d0),P61_Period(a5)
  271.  
  272. .nonote
  273.         endm
  274.  
  275.         ifeq    system
  276.         ifne    CIA
  277. P61_intti
  278.         movem.l d0-a6,-(sp)
  279.         tst.b   $bfdd00
  280.         lea     $dff000,a6
  281.         move    #$2000,$9c(a6)
  282.         move    #$2000,$9c(a6)  ;!!!
  283.         ifne    example
  284.         move    #$fff,$180(a6)
  285.         endc
  286.         bsr     P61_Music
  287.         ifne    example
  288.         move    #0,$180(a6)
  289.         endc
  290.         movem.l (sp)+,d0-a6
  291.         nop
  292.         rte
  293.         endc
  294.         endc
  295.  
  296.         ifne    system
  297. P61_lev6server
  298.         movem.l d2-d7/a2-a6,-(sp)
  299.         lea     P61_timeron(pc),a0
  300.         tst     (a0)
  301.         beq.b   P61_ohi
  302.  
  303.         lea     $dff000,a6
  304.         move    P61_server(pc),d0
  305.         beq.b   P61_musica
  306.         subq    #1,d0
  307.         beq     P61_dmason
  308.         bra     P61_setrepeat
  309.  
  310. P61_musica
  311.         bsr     P61_Music
  312.  
  313. P61_ohi 
  314.         movem.l (sp)+,d2-d7/a2-a6
  315.         moveq   #1,d0
  316.         rts
  317.         endc
  318.  
  319. ;­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  320. ;­ Call P61_Init to initialize the playroutine  ­
  321. ;­ D0 --> Timer detection (for CIA-version)     ­
  322. ;­ A0 --> Address to the module                 ­
  323. ;­ A1 --> Address to samples/0 if in the module ­
  324. ;­ A2 --> Address to sample buffer              ­
  325. ;­ D0 <-- 0 if succeeded                        ­
  326. ;­ A6 <-- $DFF000                               ­
  327. ;­              Uses D0-A6                      ­
  328. ;­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  329.  
  330. _InitPlayer
  331. P61_Init
  332.         cmp.l   #"P61A",(a0)+
  333.         beq.b   .modok
  334.         subq.l  #4,a0
  335.  
  336. .modok
  337.         ifne    CIA
  338.         move    d0,-(sp)
  339.         endc
  340.  
  341.         moveq   #0,d0
  342.         cmp.l   d0,a1
  343.         bne.b   .redirect
  344.  
  345.         move    (a0),d0
  346.         lea     (a0,d0.l),a1
  347. .redirect
  348.         move.l  a2,a6
  349.         lea     8(a0),a2
  350.         moveq   #$40,d0
  351.         and.b   3(a0),d0
  352.         bne.b   .buffer
  353.         move.l  a1,a6
  354.         subq.l  #4,a2
  355. .buffer
  356.  
  357.         lea     P61_cn(pc),a3
  358.         moveq   #$1f,d1
  359.         and.b   3(a0),d1
  360.         move.l  a0,-(sp)
  361.         lea     P61_samples(pc),a4
  362.         subq    #1,d1
  363.         moveq   #0,d4
  364. P61_lopos
  365.         move.l  a6,(a4)+
  366.         move    (a2)+,d4
  367.         bpl.b   P61_kook
  368.         neg     d4
  369.         lea     P61_samples-16(pc),a5
  370.         ifeq    opt020
  371.         asl     #4,d4
  372.         move.l  (a5,d4),d6
  373.         else
  374.         add     d4,d4
  375.         move.l  (a5,d4*8),d6
  376.         endc
  377.         move.l  d6,-4(a4)
  378.         move    4(a5,d4),d4
  379.         sub.l   d4,a6
  380.         sub.l   d4,a6
  381.         bra.b   P61_jatk
  382.  
  383. P61_kook
  384.         move.l  a6,d6
  385.         tst.b   3(a0)
  386.         bpl.b   P61_jatk
  387.  
  388.         tst.b   (a2)
  389.         bmi.b   P61_jatk
  390.  
  391.         move    d4,d0
  392.         subq    #2,d0
  393.         bmi.b   P61_jatk
  394.  
  395.         move.l  a1,a5
  396.         move.b  (a5)+,d2
  397.         sub.b   (a5),d2
  398.         move.b  d2,(a5)+
  399. .loop   sub.b   (a5),d2
  400.         move.b  d2,(a5)+
  401.         sub.b   (a5),d2
  402.         move.b  d2,(a5)+
  403.         dbf     d0,.loop
  404.  
  405. P61_jatk
  406.         move    d4,(a4)+
  407.         moveq   #0,d2
  408.         move.b  (a2)+,d2
  409.         moveq   #0,d3
  410.         move.b  (a2)+,d3
  411.  
  412.         moveq   #0,d0
  413.         move    (a2)+,d0
  414.         bmi.b   .norepeat
  415.  
  416.         move    d4,d5
  417.         sub     d0,d5
  418.         move.l  d6,a5
  419.  
  420.         add.l   d0,a5
  421.         add.l   d0,a5
  422.  
  423.         move.l  a5,(a4)+
  424.         move    d5,(a4)+
  425.         bra.b   P61_gene
  426. .norepeat
  427.         move.l  d6,(a4)+
  428.         move    #1,(a4)+
  429. P61_gene
  430.         move    d3,(a4)+
  431.         moveq   #$f,d0
  432.         and     d2,d0
  433.         mulu    #74,d0
  434.         move    d0,(a4)+
  435.  
  436.         tst     -6(a2)
  437.         bmi.b   .nobuffer
  438.  
  439.         moveq   #$40,d0
  440.         and.b   3(a0),d0
  441.         beq.b   .nobuffer
  442.  
  443.         move    d4,d7
  444.         tst.b   d2
  445.         bpl.b   .copy
  446.  
  447.         subq    #1,d7
  448.         moveq   #0,d5
  449.         moveq   #0,d4
  450. .lo     move.b  (a1)+,d4
  451.         moveq   #$f,d3
  452.         and     d4,d3
  453.         lsr     #4,d4
  454.  
  455.         sub.b   .table(pc,d4),d5
  456.         move.b  d5,(a6)+
  457.         sub.b   .table(pc,d3),d5
  458.         move.b  d5,(a6)+
  459.         dbf     d7,.lo
  460.         bra.b   .kop
  461.  
  462. .copy
  463.         add     d7,d7
  464.         subq    #1,d7
  465. .cob
  466.         move.b  (a1)+,(a6)+
  467.         dbf     d7,.cob
  468.         bra.b   .kop
  469.  
  470. .table
  471.         dc.b    0,1,2,4,8,16,32,64,128,-64,-32,-16,-8,-4,-2,-1
  472.  
  473. .nobuffer
  474.         move.l  d4,d6
  475.         add.l   d6,d6
  476.         add.l   d6,a6
  477.         add.l   d6,a1
  478. .kop
  479.         dbf     d1,P61_lopos
  480.  
  481.         move.l  (sp)+,a0
  482.         and.b   #$7f,3(a0)
  483.  
  484.         move.l  a2,-(sp)
  485.  
  486.         lea     P61_temp0(pc),a1
  487.         lea     P61_temp1(pc),a2
  488.         lea     P61_temp2(pc),a4
  489.         lea     P61_temp3(pc),a5
  490.         moveq   #Channel_Block_SIZE/2-2,d0
  491.  
  492.         moveq   #0,d1
  493. .cl     move    d1,(a1)+
  494.         move    d1,(a2)+
  495.         move    d1,(a4)+
  496.         move    d1,(a5)+
  497.         dbf     d0,.cl
  498.  
  499.         lea     P61_temp0-P61_cn(a3),a1
  500.         lea     P61_emptysample-P61_cn(a3),a2
  501.         moveq   #channels-1,d0
  502. .loo    move.l  a2,P61_Sample(a1)               ;!!!
  503.         lea     Channel_Block_SIZE(a1),a1       ;!!!
  504. ;       move.l  a2,P61_Sample(a2)
  505.         dbf     d0,.loo
  506.  
  507.         move.l  (sp)+,a2
  508.         move.l  a2,P61_positionbase-P61_cn(a3)
  509.  
  510.         moveq   #$7f,d1
  511.         and.b   2(a0),d1
  512.  
  513.         ifeq    opt020
  514.         lsl     #3,d1
  515.         lea     (a2,d1.l),a4
  516.         else
  517.         lea     (a2,d1.l*8),a4
  518.         endc
  519.         move.l  a4,P61_possibase-P61_cn(a3)
  520.  
  521.         move.l  a4,a1
  522.         moveq   #-1,d0
  523. .search
  524.         cmp.b   (a1)+,d0
  525.         bne.b   .search
  526.         move.l  a1,P61_patternbase-P61_cn(a3)   
  527.         move.l  a1,d0
  528.         sub.l   a4,d0
  529.         move    d0,P61_slen-P61_cn(a3)
  530.  
  531.         ifd     start
  532.         lea     start(a4),a4
  533.         endc
  534.  
  535.         moveq   #0,d0
  536.         move.b  (a4)+,d0
  537.         move.l  a4,P61_spos-P61_cn(a3)
  538.         lsl     #3,d0
  539.         add.l   d0,a2
  540.  
  541.         move.l  a1,a4
  542.         moveq   #0,d0   
  543.         move    (a2)+,d0
  544.         lea     (a4,d0.l),a1
  545.         move.l  a1,P61_ChaPos+P61_temp0-P61_cn(a3)
  546.         move    (a2)+,d0
  547.         lea     (a4,d0.l),a1
  548.         move.l  a1,P61_ChaPos+P61_temp1-P61_cn(a3)
  549.         move    (a2)+,d0
  550.         lea     (a4,d0.l),a1
  551.         move.l  a1,P61_ChaPos+P61_temp2-P61_cn(a3)
  552.         move    (a2)+,d0
  553.         lea     (a4,d0.l),a1
  554.         move.l  a1,P61_ChaPos+P61_temp3-P61_cn(a3)
  555.  
  556.         lea     P61_setrepeat(pc),a0
  557.         move.l  a0,P61_intaddr-P61_cn(a3)
  558.  
  559.         move    #63,P61_rowpos-P61_cn(a3)
  560.         move    #6,P61_speed-P61_cn(a3)
  561.         move    #5,P61_speed2-P61_cn(a3)
  562.         clr     P61_speedis1-P61_cn(a3)
  563.  
  564.         ifne    P61_pl
  565.         clr.l   P61_plcount-P61_cn(a3)
  566.         endc
  567.  
  568.         ifne    P61_pde
  569.         clr     P61_pdelay-P61_cn(a3)
  570.         clr     P61_pdflag-P61_cn(a3)
  571.         endc
  572.         clr     (a3)
  573.  
  574.         moveq   #2,d0
  575.         and.b   $bfe001,d0
  576.         move.b  d0,P61_ofilter-P61_cn(a3)
  577.         bset    #1,$bfe001
  578.  
  579.         ifeq    system
  580.         ifne    exec
  581.         move.l  4.w,a6
  582.         moveq   #0,d0
  583.         btst    d0,297(a6)
  584.         beq.b   .no68010
  585.  
  586.         lea     P61_liko(pc),a5
  587.         jsr     -$1e(a6)
  588.  
  589. .no68010
  590.         move.l  d0,P61_VBR-P61_cn(a3)
  591.         endc
  592.  
  593.         move.l  P61_VBR-P61_cn(a3),a0
  594.         lea     $78(a0),a0
  595.         move.l  a0,P61_vektori-P61_cn(a3)
  596.  
  597.         move.l  (a0),P61_oldlev6-P61_cn(a3)
  598.         lea     P61_dmason(pc),a1
  599.         move.l  a1,(a0)
  600.         endc
  601.  
  602.         moveq   #0,d0
  603.         lea     $dff000,a6
  604.         move    d0,$a8(a6)
  605.         move    d0,$b8(a6)
  606.         move    d0,$c8(a6)
  607.         move    d0,$d8(a6)
  608.         move    #$f,$96(a6)
  609.  
  610.         ifeq    system
  611.         lea     P61_dmason(pc),a1
  612.         move.l  a1,(a0)
  613.         move    #$2000,$9a(a6)
  614.         lea     $bfd000,a0
  615.         lea     P61_timers(pc),a1
  616.         move.b  #$7f,$d00(a0)
  617.         move.b  #$10,$e00(a0)
  618.         move.b  #$10,$f00(a0)
  619.         move.b  $400(a0),(a1)+
  620.         move.b  $500(a0),(a1)+
  621.         move.b  $600(a0),(a1)+
  622.         move.b  $700(a0),(a1)
  623.         endc
  624.  
  625.         ifeq    system!CIA
  626.         move.b  #$82,$d00(a0)
  627.         endc
  628.  
  629.         ifne    CIA
  630.         move    (sp)+,d0
  631.         subq    #1,d0
  632.         beq.b   P61_ForcePAL
  633.         subq    #1,d0
  634.         beq.b   P61_NTSC
  635.         ifne    exec
  636.         move.l  4.w,a1
  637.         cmp.b   #60,$213(a1)    ;PowerSupplyFrequency
  638.         beq.b   P61_NTSC
  639.         endc
  640. P61_ForcePAL
  641.         move.l  #1773447,d0     ;PAL
  642.         bra.b   P61_setcia
  643. P61_NTSC
  644.         move.l  #1789773,d0     ;NTSC
  645. P61_setcia
  646.         move.l  d0,P61_timer-P61_cn(a3)
  647.         divu    #125,d0
  648.         move    d0,P61_thi2-P61_cn(a3)
  649.         sub     #$1f0*2,d0
  650.         move    d0,P61_thi-P61_cn(a3)
  651.  
  652.         ifeq    system
  653.         move    P61_thi2-P61_cn(a3),d0
  654.         move.b  d0,$400(a0)
  655.         lsr     #8,d0
  656.         move.b  d0,$500(a0)
  657.         lea     P61_intti(pc),a1
  658.         move.l  a1,P61_tintti-P61_cn(a3)
  659.         move.l  P61_vektori(pc),a2
  660.         move.l  a1,(a2)
  661.         move.b  #$83,$d00(a0)
  662.         move.b  #$11,$e00(a0)
  663.         endc
  664.         endc
  665.  
  666.         ifeq    system
  667.         move    #$e000,$9a(a6)
  668.         moveq   #0,d0
  669.         rts
  670.  
  671.         ifne    exec
  672. P61_liko
  673.         dc.l    $4E7A0801               ;MOVEC  VBR,d0
  674.         rte
  675.         endc
  676.         endc
  677.  
  678.         ifne    system
  679.         move.l  a6,-(sp)
  680.  
  681.         ifne    CIA
  682.         clr     P61_server-P61_cn(a3)
  683.         else
  684.         move    #1,P61_server-P61_cn(a3)
  685.         endc
  686.  
  687.         move.l  4.w,a6
  688.         moveq   #-1,d0
  689.         jsr     -$14a(a6)
  690.         move.b  d0,P61_sigbit-P61_cn(a3)
  691.         bmi     P61_err
  692.  
  693.         lea     P61_allocport(pc),a1
  694.         move.l  a1,P61_portti-P61_cn(a3)
  695.         move.b  d0,15(a1)
  696.         move.l  a1,-(sp)
  697.         suba.l  a1,a1
  698.         jsr     -$126(a6)
  699.         move.l  (sp)+,a1
  700.         move.l  d0,16(a1)
  701.         lea     P61_reqlist(pc),a0
  702.         move.l  a0,(a0)
  703.         addq.l  #4,(a0)
  704.         clr.l   4(a0)
  705.         move.l  a0,8(a0)
  706.  
  707.  
  708.         lea     P61_dat(pc),a1
  709.         move.l  a1,P61_reqdata-P61_cn(a3)
  710.         lea     P61_allocreq(pc),a1
  711.         lea     P61_audiodev(pc),a0
  712.         moveq   #0,d0
  713.         moveq   #0,d1
  714.         jsr     -$1bc(a6)
  715.         tst.l   d0
  716.         bne     P61_err
  717.         st.b    P61_audioopen-P61_cn(a3)
  718.  
  719.         lea     P61_timerint(pc),a1
  720.         move.l  a1,P61_timerdata-P61_cn(a3)
  721.         lea     P61_lev6server(pc),a1
  722.         move.l  a1,P61_timerdata+8-P61_cn(a3)
  723.  
  724.         moveq   #0,d3
  725.         lea     P61_cianame(pc),a1
  726. P61_openciares
  727.         moveq   #0,d0
  728.         move.l  4.w,a6
  729.         jsr     -$1f2(a6)
  730.         move.l  d0,P61_ciares-P61_cn(a3)
  731.         beq.b   P61_err
  732.         move.l  d0,a6
  733.         lea     P61_timerinterrupt(pc),a1
  734.         moveq   #0,d0
  735.         jsr     -6(a6)
  736.         tst.l   d0
  737.         beq.b   P61_gottimer
  738.         addq.l  #4,d3
  739.         lea     P61_timerinterrupt(pc),a1
  740.         moveq   #1,d0
  741.         jsr     -6(a6)
  742.         tst.l   d0
  743.         bne.b   P61_err
  744.  
  745. P61_gottimer
  746.         lea     P61_craddr+8(pc),a6
  747.         move.l  P61_ciaaddr(pc,d3),d0
  748.         move.l  d0,(a6)
  749.         sub     #$100,d0
  750.         move.l  d0,-(a6)
  751.         moveq   #2,d3
  752.         btst    #9,d0
  753.         bne.b   P61_timerB
  754.         subq.b  #1,d3
  755.         add     #$100,d0
  756. P61_timerB
  757.         add     #$900,d0
  758.         move.l  d0,-(a6)
  759.         move.l  d0,a0
  760.         and.b   #%10000000,(a0)
  761.         move.b  d3,P61_timeropen-P61_cn(a3)
  762.         moveq   #0,d0
  763.         ifne    CIA
  764.         move.l  P61_craddr+4(pc),a1
  765.         move.b  P61_tlo(pc),(a1)
  766.         move.b  P61_thi(pc),$100(a1)
  767.         endc
  768.         or.b    #$19,(a0)
  769.         st      P61_timeron-P61_cn(a3)
  770. P61_pois
  771.         move.l  (sp)+,a6
  772.         rts
  773.  
  774. P61_err moveq   #-1,d0
  775.         bra.b   P61_pois
  776.         rts
  777.  
  778. P61_ciaaddr
  779.         dc.l    $bfd500,$bfd700
  780.         endc
  781.  
  782. ;­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  783. ;­      Call P61_End to stop the music          ­
  784. ;­   A6 --> Customchip baseaddress ($DFF000)    ­
  785. ;­              Uses D0/D1/A0/A1/A3             ­
  786. ;­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  787.  
  788. _StopPlayer
  789.         move.l  #$dff000,a6
  790. P61_End
  791.         moveq   #0,d0
  792.         move    d0,$a8(a6)
  793.         move    d0,$b8(a6)
  794.         move    d0,$c8(a6)
  795.         move    d0,$d8(a6)
  796.         move    #$f,$96(a6)
  797.  
  798.         and.b   #~2,$bfe001
  799.         move.b  P61_ofilter(pc),d0
  800.         or.b    d0,$bfe001
  801.  
  802.         ifeq    system
  803.         move    #$2000,$9a(a6)
  804.         move.l  P61_vektori(pc),a0
  805.         move.l  P61_oldlev6(pc),(a0)
  806.         lea     $bfd000,a0
  807.         lea     P61_timers(pc),a1
  808.         move.b  (a1)+,$400(a0)
  809.         move.b  (a1)+,$500(a0)
  810.         move.b  (a1)+,$600(a0)
  811.         move.b  (a1)+,$700(a0)
  812.         move.b  #$10,$e00(a0)
  813.         move.b  #$10,$f00(a0)
  814.  
  815.         else
  816.  
  817.         clr     P61_timeron-P61_cn(a3)
  818.         move.l  a6,-(sp)
  819.         lea     P61_cn(pc),a3
  820.         moveq   #0,d0
  821.         move.b  P61_timeropen(pc),d0
  822.         beq.b   P61_rem1
  823.         move.l  P61_ciares(pc),a6
  824.         lea     P61_timerinterrupt(pc),a1
  825.         subq.b  #1,d0
  826.         jsr     -12(a6)
  827. P61_rem1
  828.         move.l  4.w,a6
  829.         tst.b   P61_audioopen-P61_cn(a3)
  830.         beq.b   P61_rem2
  831.         lea     P61_allocreq(pc),a1
  832.         jsr     -$1c2(a6)
  833.         clr.b   P61_audioopen-P61_cn(a3)
  834. P61_rem2
  835.         moveq   #0,d0
  836.         move.b  P61_sigbit(pc),d0
  837.         bmi.b   P61_rem3
  838.         jsr     -$150(a6)
  839.         st      P61_sigbit-P61_cn(a3)
  840. P61_rem3
  841.         move.l  (sp)+,a6
  842.         endc
  843.         rts
  844.  
  845.         ifne    fade
  846. P61_mfade
  847.         move    P61_Master(pc),d0
  848.         move    P61_temp0+P61_Shadow(pc),d1
  849.         mulu    d0,d1
  850.         lsr     #6,d1
  851.         move    d1,$a8(a6)
  852.  
  853.         ifgt    channels-1
  854.         move    P61_temp1+P61_Shadow(pc),d1
  855.         mulu    d0,d1
  856.         lsr     #6,d1
  857.         move    d1,$b8(a6)
  858.         endc
  859.  
  860.         ifgt    channels-2
  861.         move    P61_temp2+P61_Shadow(pc),d1
  862.         mulu    d0,d1
  863.         lsr     #6,d1
  864.         move    d1,$c8(a6)
  865.         endc
  866.  
  867.         ifgt    channels-3
  868.         move    P61_temp3+P61_Shadow(pc),d1
  869.         mulu    d0,d1
  870.         lsr     #6,d1
  871.         move    d1,$d8(a6)
  872.         endc
  873.         rts
  874.         endc
  875.         
  876.  
  877. ;­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  878. ;­ Call P61_SetPosition to jump to a specific   ­
  879. ;­            position in the song.             ­
  880. ;­ D0.l --> Position                            ­
  881. ;­ Starts from the beginning if out of limits.  ­
  882. ;­              Uses A0/A1/A3/D0-D3             ­
  883. ;­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  884.  
  885.         ifne    jump
  886. P61_SetPosition
  887.         lea     P61_cn(pc),a3
  888.         ifne    P61_pl
  889.         clr     P61_plflag-P61_cn(a3)
  890.         endc
  891.         moveq   #0,d1
  892.         move.b  d0,d1
  893.         move.l  d1,d0
  894.         cmp     P61_slen-P61_cn(a3),d0
  895.         blo.b   .e
  896.         moveq   #0,d0
  897. .e      move    d0,P61_Pos-P61_cn(a3)
  898.         add.l   P61_possibase(pc),d0
  899.         move.l  d0,P61_spos-P61_cn(a3)
  900.  
  901.         moveq   #64,d0
  902.         move    d0,P61_rowpos-P61_cn(a3)
  903.         clr     P61_CRow-P61_cn(a3)
  904.         move.l  P61_spos(pc),a1
  905.         move.l  P61_patternbase(pc),a0
  906.         addq    #1,P61_Pos-P61_cn(a3)
  907.         move.b  (a1)+,d0
  908.         move.l  a1,P61_spos-P61_cn(a3)
  909.         move.l  P61_positionbase(pc),a1
  910.         move    d0,P61_Patt-P61_cn(a3)
  911.         lsl     #3,d0
  912.         add.l   d0,a1
  913.         movem   (a1),d0-d3
  914.         lea     (a0,d0.l),a1
  915.         move    d1,d0
  916.         move.l  a1,P61_ChaPos+P61_temp0-P61_cn(a3)
  917.         lea     (a0,d0.l),a1
  918.         move.l  a1,P61_ChaPos+P61_temp1-P61_cn(a3)
  919.         move    d2,d0
  920.         lea     (a0,d0.l),a1
  921.         move.l  a1,P61_ChaPos+P61_temp2-P61_cn(a3)
  922.         move    d3,d0
  923.         add.l   d0,a0
  924.         move.l  a0,P61_ChaPos+P61_temp3-P61_cn(a3)
  925.         rts
  926.         endc
  927.  
  928. ;­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  929. ;­ Call P61_Music every frame to play the music ­
  930. ;­        _NOT_ if CIA-version is used!         ­
  931. ;­ A6 --> Customchip baseaddress ($DFF000)      ­
  932. ;­              Uses A0-A5/D0-D7                ­
  933. ;­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  934.  
  935. P61_Music
  936.         lea     P61_cn(pc),a3
  937.  
  938.         tst     P61_Play-P61_cn(a3)
  939.         bne.b   P61_ohitaaa
  940.         ifne    CIA
  941.         ifne    system
  942.         move.l  P61_craddr+4(pc),a0
  943.         move.b  P61_tlo2(pc),(a0)
  944.         move.b  P61_thi2(pc),$100(a0)
  945.         endc
  946.         endc
  947.         rts
  948.  
  949. P61_ohitaaa
  950.         ifne    fade
  951.         pea     P61_mfade(pc)
  952.         endc
  953.  
  954.         moveq   #Channel_Block_SIZE,d6
  955.         moveq   #16,d7
  956.  
  957.         move    (a3),d4
  958.         addq    #1,d4
  959.         cmp     P61_speed(pc),d4
  960.         beq     P61_playtime
  961.  
  962.         move    d4,(a3)
  963.  
  964. P61_delay
  965.         ifne    CIA
  966.         ifne    system
  967.         move.l  P61_craddr+4(pc),a0
  968.         move.b  P61_tlo2(pc),(a0)
  969.         move.b  P61_thi2(pc),$100(a0)
  970.         endc
  971.         endc
  972.  
  973.         lea     P61_temp0(pc),a5
  974.         lea     $a0(a6),a4
  975.  
  976.         moveq   #channels-1,d5
  977. P61_lopas
  978.         tst     P61_OnOff(a5)
  979.         beq     P61_contfxdone
  980.         moveq   #$f,d0
  981.         and     (a5),d0
  982.         ifeq    opt020
  983.         add     d0,d0
  984.         move    P61_jtab2(pc,d0),d0
  985.         else
  986.         move    P61_jtab2(pc,d0*2),d0
  987.         endc
  988.         jmp     P61_jtab2(pc,d0)
  989.  
  990. P61_jtab2
  991.         dc      P61_contfxdone-P61_jtab2
  992.  
  993.         ifne    P61_pu
  994.         dc      P61_portup-P61_jtab2
  995.         else
  996.         dc      P61_contfxdone-P61_jtab2
  997.         endc
  998.  
  999.         ifne    P61_pd
  1000.         dc      P61_portdwn-P61_jtab2
  1001.         else
  1002.         dc      P61_contfxdone-P61_jtab2
  1003.         endc
  1004.  
  1005.         ifne    P61_tp
  1006.         dc      P61_toneport-P61_jtab2
  1007.         else
  1008.         dc      P61_contfxdone-P61_jtab2
  1009.         endc
  1010.  
  1011.         ifne    P61_vib
  1012.         dc      P61_vib2-P61_jtab2
  1013.         else
  1014.         dc      P61_contfxdone-P61_jtab2
  1015.         endc
  1016.  
  1017.         ifne    P61_tpvs
  1018.         dc      P61_tpochvslide-P61_jtab2
  1019.         else
  1020.         dc      P61_contfxdone-P61_jtab2
  1021.         endc
  1022.  
  1023.         ifne    P61_vbvs
  1024.         dc      P61_vibochvslide-P61_jtab2
  1025.         else
  1026.         dc      P61_contfxdone-P61_jtab2
  1027.         endc
  1028.  
  1029.         ifne    P61_tre
  1030.         dc      P61_tremo-P61_jtab2
  1031.         else
  1032.         dc      P61_contfxdone-P61_jtab2
  1033.         endc
  1034.  
  1035.         ifne    P61_arp
  1036.         dc      P61_arpeggio-P61_jtab2
  1037.         else
  1038.         dc      P61_contfxdone-P61_jtab2
  1039.         endc
  1040.  
  1041.         dc      P61_contfxdone-P61_jtab2
  1042.  
  1043.         ifne    P61_vs
  1044.         dc      P61_volslide-P61_jtab2
  1045.         else
  1046.         dc      P61_contfxdone-P61_jtab2
  1047.         endc
  1048.  
  1049.         dc      P61_contfxdone-P61_jtab2
  1050.         dc      P61_contfxdone-P61_jtab2
  1051.         dc      P61_contfxdone-P61_jtab2
  1052.  
  1053.         ifne    P61_ec
  1054.         dc      P61_contecommands-P61_jtab2
  1055.         else
  1056.         dc      P61_contfxdone-P61_jtab2
  1057.         endc
  1058.         dc      P61_contfxdone-P61_jtab2
  1059.  
  1060.         ifne    P61_ec
  1061. P61_contecommands
  1062.         move.b  P61_Info(a5),d0
  1063.         and     #$f0,d0
  1064.         lsr     #3,d0
  1065.         move    P61_etab2(pc,d0),d0
  1066.         jmp     P61_etab2(pc,d0)
  1067.  
  1068. P61_etab2
  1069.         dc      P61_contfxdone-P61_etab2
  1070.  
  1071.         ifne    P61_fsu
  1072.         dc      P61_fineup2-P61_etab2
  1073.         else
  1074.         dc      P61_contfxdone-P61_etab2
  1075.         endc
  1076.  
  1077.         ifne    P61_fsd
  1078.         dc      P61_finedwn2-P61_etab2
  1079.         else
  1080.         dc      P61_contfxdone-P61_etab2
  1081.         endc
  1082.  
  1083.         dc      P61_contfxdone-P61_etab2
  1084.         dc      P61_contfxdone-P61_etab2
  1085.  
  1086.         dc      P61_contfxdone-P61_etab2
  1087.         dc      P61_contfxdone-P61_etab2
  1088.  
  1089.         dc      P61_contfxdone-P61_etab2
  1090.         dc      P61_contfxdone-P61_etab2
  1091.  
  1092.         ifne    P61_rt
  1093.         dc      P61_retrig-P61_etab2
  1094.         else
  1095.         dc      P61_contfxdone-P61_etab2
  1096.         endc
  1097.  
  1098.         ifne    P61_fvu
  1099.         dc      P61_finevup2-P61_etab2
  1100.         else
  1101.         dc      P61_contfxdone-P61_etab2
  1102.         endc
  1103.  
  1104.         ifne    P61_fvd
  1105.         dc      P61_finevdwn2-P61_etab2
  1106.         else
  1107.         dc      P61_contfxdone-P61_etab2
  1108.         endc
  1109.  
  1110.         ifne    P61_nc
  1111.         dc      P61_notecut-P61_etab2
  1112.         else
  1113.         dc      P61_contfxdone-P61_etab2
  1114.         endc
  1115.  
  1116.         ifne    P61_nd
  1117.         dc      P61_notedelay-P61_etab2
  1118.         else
  1119.         dc      P61_contfxdone-P61_etab2
  1120.         endc
  1121.  
  1122.         dc      P61_contfxdone-P61_etab2
  1123.         dc      P61_contfxdone-P61_etab2
  1124.         endc
  1125.  
  1126.         ifne    P61_fsu
  1127. P61_fineup2
  1128.         tst     (a3)
  1129.         bne     P61_contfxdone
  1130.         moveq   #$f,d0
  1131.         and.b   P61_Info(a5),d0
  1132.         sub     d0,P61_Period(a5)
  1133.         moveq   #113,d0
  1134.         cmp     P61_Period(a5),d0
  1135.         ble.b   .jup
  1136.         move    d0,P61_Period(a5)
  1137. .jup    move    P61_Period(a5),6(a4)
  1138.         bra     P61_contfxdone
  1139.         endc
  1140.  
  1141.         ifne    P61_fsd
  1142. P61_finedwn2
  1143.         tst     (a3)
  1144.         bne     P61_contfxdone
  1145.         moveq   #$f,d0
  1146.         and.b   P61_Info(a5),d0
  1147.         add     d0,P61_Period(a5)
  1148.         cmp     #856,P61_Period(a5)
  1149.         ble.b   .jup
  1150.         move    #856,P61_Period(a5)
  1151. .jup    move    P61_Period(a5),6(a4)
  1152.         bra     P61_contfxdone
  1153.         endc
  1154.  
  1155.         ifne    P61_fvu
  1156. P61_finevup2
  1157.         tst     (a3)
  1158.         bne     P61_contfxdone
  1159.         moveq   #$f,d0
  1160.         and.b   P61_Info(a5),d0
  1161.         add     d0,P61_Volume(a5)
  1162.         moveq   #64,d0
  1163.         cmp     P61_Volume(a5),d0
  1164.         bge.b   .jup
  1165.         move    d0,P61_Volume(a5)
  1166. .jup    move    P61_Volume(a5),8(a4)
  1167.         bra     P61_contfxdone
  1168.         endc
  1169.  
  1170.         ifne    P61_fvd
  1171. P61_finevdwn2
  1172.         tst     (a3)
  1173.         bne     P61_contfxdone
  1174.         moveq   #$f,d0
  1175.         and.b   P61_Info(a5),d0
  1176.         sub     d0,P61_Volume(a5)
  1177.         bpl.b   .jup
  1178.         clr     P61_Volume(a5)
  1179. .jup    move    P61_Volume(a5),8(a4)
  1180.         bra     P61_contfxdone
  1181.         endc
  1182.  
  1183.         ifne    P61_nc
  1184. P61_notecut
  1185.         moveq   #$f,d0
  1186.         and.b   P61_Info(a5),d0
  1187.         cmp     (a3),d0
  1188.         bne     P61_contfxdone
  1189.         ifeq    fade
  1190.         clr     8(a4)
  1191.         else
  1192.         clr     P61_Shadow(a5)
  1193.         endc
  1194.         clr     P61_Volume(a5)
  1195.         bra     P61_contfxdone
  1196.         endc
  1197.  
  1198.         ifne    P61_nd
  1199. P61_notedelay
  1200.         moveq   #$f,d0
  1201.         and.b   P61_Info(a5),d0
  1202.         cmp     (a3),d0
  1203.         bne     P61_contfxdone
  1204.  
  1205.         moveq   #$7e,d0
  1206.         and.b   (a5),d0
  1207.         beq     P61_contfxdone
  1208.         move    P61_DMABit(a5),d0
  1209.         move    d0,$96(a6)
  1210.         or      d0,P61_dma-P61_cn(a3)
  1211.         move.l  P61_Sample(a5),a1               ;* Trigger *
  1212.         move.l  (a1)+,(a4)+                     ;Pointer
  1213.         move    (a1),(a4)+                      ;Length
  1214.         move    P61_Period(a5),(a4)
  1215.         subq.l  #6,a4
  1216.  
  1217.         ifeq    system
  1218.         lea     P61_dmason(pc),a1
  1219.         move.l  P61_vektori(pc),a0
  1220.         move.l  a1,(a0)
  1221.         move.b  #$f0,$bfd600
  1222.         move.b  #$01,$bfd700
  1223.         move.b  #$19,$bfdf00
  1224.         else
  1225.         move    #1,P61_server-P61_cn(a3)
  1226.         move.l  P61_craddr+4(pc),a1
  1227.         move.b  #$f0,(a1)
  1228.         move.b  #1,$100(a1)
  1229.         endc
  1230.         bra     P61_contfxdone
  1231.         endc
  1232.  
  1233.         ifne    P61_rt
  1234. P61_retrig
  1235.         subq    #1,P61_RetrigCount(a5)
  1236.         bne     P61_contfxdone
  1237.         move    P61_DMABit(a5),d0
  1238.         move    d0,$96(a6)
  1239.         or      d0,P61_dma-P61_cn(a3)
  1240.         move.l  P61_Sample(a5),a1               ;* Trigger *
  1241.         move.l  (a1)+,(a4)                      ;Pointer
  1242.         move    (a1),4(a4)                      ;Length
  1243.  
  1244.         ifeq    system
  1245.         lea     P61_dmason(pc),a1
  1246.         move.l  P61_vektori(pc),a0
  1247.         move.l  a1,(a0)
  1248.         move.b  #$f0,$bfd600
  1249.         move.b  #$01,$bfd700
  1250.         move.b  #$19,$bfdf00
  1251.         else
  1252.         move    #1,P61_server-P61_cn(a3)
  1253.         move.l  P61_craddr+4(pc),a1
  1254.         move.b  #$f0,(a1)
  1255.         move.b  #1,$100(a1)
  1256.         endc
  1257.  
  1258.         moveq   #$f,d0
  1259.         and.b   P61_Info(a5),d0
  1260.         move    d0,P61_RetrigCount(a5)
  1261.         bra     P61_contfxdone
  1262.         endc
  1263.  
  1264.         ifne    P61_arp
  1265. P61_arplist
  1266.  dc.b 0,1,-1,0,1,-1,0,1,-1,0,1,-1,0,1,-1,0,1,-1,0,1,-1,0,1,-1,0,1,-1,0,1,-1,0,1
  1267.  
  1268. P61_arpeggio
  1269.         move    (a3),d0
  1270.         move.b  P61_arplist(pc,d0),d0
  1271.         beq.b   .arp0
  1272.         bmi.b   .arp1
  1273.  
  1274.         move.b  P61_Info(a5),d0
  1275.         lsr     #4,d0
  1276.         bra.b   .arp3
  1277.  
  1278. .arp0
  1279.         move    P61_Note(a5),d0
  1280.         move    P61_periods(pc,d0),6(a4)
  1281.         bra     P61_contfxdone
  1282.  
  1283. .arp1
  1284.         moveq   #$f,d0
  1285.         and.b   P61_Info(a5),d0
  1286.  
  1287. .arp3
  1288.         add     d0,d0
  1289.         add     P61_Note(a5),d0
  1290.         move    P61_periods(pc,d0),6(a4)
  1291.         bra     P61_contfxdone
  1292.         endc
  1293.  
  1294. P61_periods
  1295.         ifne    P61_ft
  1296.         incbin  periods
  1297.         else
  1298.         incbin  periods.nft
  1299.         endc
  1300.  
  1301.         ifne    P61_vs
  1302. P61_volslide
  1303.         move.b  P61_Info(a5),d0
  1304.         sub.b   d0,P61_Volume+1(a5)
  1305.         bpl.b   .test
  1306.         clr     P61_Volume(a5)
  1307.         ifeq    fade
  1308.         clr     8(a4)
  1309.         else
  1310.         clr     P61_Shadow(a5)
  1311.         endc
  1312.         bra     P61_contfxdone
  1313. .test
  1314.         moveq   #64,d0
  1315.         cmp     P61_Volume(a5),d0
  1316.         bge.b   .ncs
  1317.         move    d0,P61_Volume(a5)
  1318.         ifeq    fade
  1319.         move    d0,8(a4)
  1320.         else
  1321.         move    d0,P61_Shadow(a5)
  1322.         endc
  1323.         bra.b   P61_contfxdone
  1324. .ncs
  1325.         ifeq    fade
  1326.         move    P61_Volume(a5),8(a4)
  1327.         else
  1328.         move    P61_Volume(a5),P61_Shadow(a5)
  1329.         endc
  1330.         bra.b   P61_contfxdone
  1331.         endc
  1332.  
  1333.         ifne    P61_tpvs
  1334. P61_tpochvslide
  1335.         move.b  P61_Info(a5),d0
  1336.         sub.b   d0,P61_Volume+1(a5)
  1337.         bpl.b   .test
  1338.         clr     P61_Volume(a5)
  1339.         ifeq    fade
  1340.         clr     8(a4)
  1341.         else
  1342.         clr     P61_Shadow(a5)
  1343.         endc
  1344.         bra.b   P61_toneport
  1345. .test
  1346.         moveq   #64,d0
  1347.         cmp     P61_Volume(a5),d0
  1348.         bge.b   .ncs
  1349.         move    d0,P61_Volume(a5)
  1350. .ncs
  1351.         ifeq    fade
  1352.         move    P61_Volume(a5),8(a4)
  1353.         else
  1354.         move    P61_Volume(a5),P61_Shadow(a5)
  1355.         endc
  1356.         endc
  1357.  
  1358.         ifne    P61_tp
  1359. P61_toneport
  1360.         move    P61_ToPeriod(a5),d0
  1361.         beq.b   P61_contfxdone
  1362.         move    P61_TPSpeed(a5),d1
  1363.         cmp     P61_Period(a5),d0
  1364.         blt     .topoup
  1365.  
  1366.         add     d1,P61_Period(a5)
  1367.         cmp     P61_Period(a5),d0
  1368.         bgt.b   .setper
  1369.         move    d0,P61_Period(a5)
  1370.         clr     P61_ToPeriod(a5)
  1371.         move    d0,6(a4)
  1372.         bra     P61_contfxdone
  1373.  
  1374. .topoup
  1375.         sub     d1,P61_Period(a5)
  1376.         cmp     P61_Period(a5),d0
  1377.         blt.b   .setper
  1378.         move    d0,P61_Period(a5)
  1379.         clr     P61_ToPeriod(a5)
  1380. .setper
  1381.         move    P61_Period(a5),6(a4)
  1382.         else
  1383.         nop
  1384.         endc
  1385.  
  1386. P61_contfxdone
  1387.         ifne    P61_il
  1388.         bsr     P61_funk2
  1389.         endc
  1390.  
  1391.         add.l   d6,a5
  1392.         add.l   d7,a4
  1393.         dbf     d5,P61_lopas
  1394.  
  1395.         cmp     P61_speed2(pc),d4
  1396.         beq.b   P61_preplay
  1397.         rts
  1398.  
  1399.         ifne    P61_pu
  1400. P61_portup
  1401.         moveq   #0,D0
  1402.         move.b  P61_Info(a5),d0
  1403.         sub     d0,P61_Period(a5)
  1404.         moveq   #113,d0
  1405.         cmp     P61_Period(a5),d0
  1406.         ble.b   .skip
  1407.         move    d0,P61_Period(a5)
  1408.         move    d0,6(a4)
  1409.         bra.b   P61_contfxdone
  1410. .skip
  1411.         move    P61_Period(a5),6(a4)
  1412.         bra.b   P61_contfxdone
  1413.         endc
  1414.  
  1415.         ifne    P61_pd
  1416. P61_portdwn
  1417.         moveq   #0,d0
  1418.         move.b  P61_Info(a5),d0
  1419.         add     d0,P61_Period(a5)
  1420.         cmp     #856,P61_Period(a5)
  1421.         ble.b   .skip
  1422.         move    #856,d0
  1423.         move    d0,P61_Period(a5)
  1424.         move    d0,6(a4)
  1425.         bra.b   P61_contfxdone
  1426. .skip
  1427.         move    P61_Period(a5),6(a4)
  1428.         bra.b   P61_contfxdone
  1429.         endc
  1430.  
  1431.         ifne    P61_pde
  1432. P61_return
  1433.         rts
  1434.  
  1435. P61_preplay
  1436.         tst     P61_pdflag-P61_cn(a3)
  1437.         bne.b   P61_return
  1438.         else
  1439. P61_preplay
  1440.         endc
  1441.  
  1442.         lea     P61_temp0(pc),a5
  1443.         lea     P61_samples-16(pc),a0
  1444.  
  1445.         moveq   #channels-1,d5
  1446. P61_loaps
  1447.         ifne    P61_pl
  1448.         lea     P61_TData(a5),a1
  1449.         move    2(a5),(a1)+
  1450.         move.l  P61_ChaPos(a5),(a1)+
  1451.         move.l  P61_TempPos(a5),(a1)+
  1452.         move    P61_TempLen(a5),(a1)
  1453.         endc
  1454.  
  1455.         move.b  P61_Pack(a5),d0
  1456.         and.b   #$3f,d0
  1457.         beq.b   P61_takeone
  1458.  
  1459.         tst.b   P61_Pack(a5)
  1460.         bmi.b   .keepsame
  1461.  
  1462.         subq.b  #1,P61_Pack(a5)
  1463.         clr     P61_OnOff(a5)                   ; Empty row
  1464.         add.l   d6,a5
  1465.         dbf     d5,P61_loaps
  1466.         rts
  1467.  
  1468. .keepsame
  1469.         subq.b  #1,P61_Pack(a5)
  1470.         bra     P61_dko
  1471.  
  1472. P61_takeone
  1473.         tst.b   P61_TempLen+1(a5)
  1474.         beq.b   P61_takenorm
  1475.  
  1476.         subq.b  #1,P61_TempLen+1(a5)
  1477.         move.l  P61_TempPos(a5),a2
  1478.  
  1479. P61_jedi
  1480.         move.b  (a2)+,d0
  1481.         moveq   #%01100000,d1
  1482.         and.b   d0,d1
  1483.         cmp.b   #%01100000,d1
  1484.         bne.b   .all
  1485.  
  1486.         moveq   #%01110000,d1
  1487.         and.b   d0,d1
  1488.         cmp.b   #%01110000,d1
  1489.         bne.b   .cmd
  1490.  
  1491.         moveq   #%01111000,d1
  1492.         and.b   d0,d1
  1493.         cmp.b   #%01111000,d1
  1494.         bne.b   .note
  1495.  
  1496. .empty
  1497.         clr     P61_OnOff(a5)                   ; Empty row
  1498.         clr     (a5)+
  1499.         clr.b   (a5)+
  1500.         tst.b   d0
  1501.         bpl.b   .ex
  1502.         move.b  (a2)+,(a5)                      ; Compression info
  1503.         bra.b   .ex
  1504.  
  1505. .all
  1506.         move.b  d0,(a5)+
  1507.         ifeq    opt020
  1508.         move.b  (a2)+,(a5)+
  1509.         move.b  (a2)+,(a5)+
  1510.         else
  1511.         move    (a2)+,(a5)+
  1512.         endc
  1513.         tst.b   d0
  1514.         bpl.b   .ex
  1515.         move.b  (a2)+,(a5)                      ; Compression info
  1516.         bra.b   .ex
  1517.  
  1518. .cmd
  1519.         moveq   #$f,d1
  1520.         and     d0,d1
  1521.         move    d1,(a5)+                        ; cmd
  1522.         move.b  (a2)+,(a5)+                     ; info
  1523.         tst.b   d0
  1524.         bpl     .ex
  1525.         move.b  (a2)+,(a5)                      ; Compression info
  1526.         bra.b   .ex
  1527.  
  1528. .note
  1529.         moveq   #7,d1
  1530.         and     d0,d1
  1531.         lsl     #8,d1
  1532.         move.b  (a2)+,d1
  1533.         lsl     #4,d1
  1534.         move    d1,(a5)+
  1535.         clr.b   (a5)+   
  1536.         tst.b   d0
  1537.         bpl.b   .ex
  1538.         move.b  (a2)+,(a5)                      ; Compression info
  1539. .ex
  1540.         subq.l  #3,a5
  1541.         move.l  a2,P61_TempPos(a5)
  1542.         bra     P61_dko
  1543.  
  1544.  
  1545. P61_takenorm
  1546.         move.l  P61_ChaPos(a5),a2
  1547.  
  1548.         move.b  (a2)+,d0
  1549.         moveq   #%01100000,d1
  1550.         and.b   d0,d1
  1551.         cmp.b   #%01100000,d1
  1552.         bne.b   .all
  1553.  
  1554.         moveq   #%01110000,d1
  1555.         and.b   d0,d1
  1556.         cmp.b   #%01110000,d1
  1557.         bne.b   .cmd
  1558.  
  1559.         moveq   #%01111000,d1
  1560.         and.b   d0,d1
  1561.         cmp.b   #%01111000,d1
  1562.         bne.b   .note
  1563.  
  1564. .empty
  1565.         clr     P61_OnOff(a5)                   ; Empty row
  1566.         clr     (a5)+
  1567.         clr.b   (a5)+
  1568.         tst.b   d0
  1569.         bpl.b   .proccomp
  1570.         move.b  (a2)+,(a5)                      ; Compression info
  1571.         bra.b   .proccomp
  1572.  
  1573.  
  1574. .all
  1575.         move.b  d0,(a5)+
  1576.         ifeq    opt020
  1577.         move.b  (a2)+,(a5)+
  1578.         move.b  (a2)+,(a5)+
  1579.         else
  1580.         move    (a2)+,(a5)+
  1581.         endc
  1582.         tst.b   d0
  1583.         bpl.b   .proccomp
  1584.         move.b  (a2)+,(a5)                      ; Compression info
  1585.         bra.b   .proccomp
  1586.  
  1587. .cmd
  1588.         moveq   #$f,d1
  1589.         and     d0,d1
  1590.         move    d1,(a5)+                        ; cmd
  1591.         move.b  (a2)+,(a5)+                     ; info
  1592.         tst.b   d0
  1593.         bpl     .proccomp
  1594.         move.b  (a2)+,(a5)                      ; Compression info
  1595.         bra.b   .proccomp
  1596.  
  1597. .note
  1598.         moveq   #7,d1
  1599.         and     d0,d1
  1600.         lsl     #8,d1
  1601.         move.b  (a2)+,d1
  1602.         lsl     #4,d1
  1603.         move    d1,(a5)+
  1604.         clr.b   (a5)+   
  1605.         tst.b   d0
  1606.         bpl.b   .proccomp
  1607.         move.b  (a2)+,(a5)                      ; Compression info
  1608.  
  1609. .proccomp
  1610.         subq.l  #3,a5
  1611.         move.l  a2,P61_ChaPos(a5)
  1612.  
  1613.         tst.b   d0
  1614.         bpl.b   P61_dko
  1615.  
  1616.         move.b  3(a5),d0
  1617.         move.b  d0,d1
  1618.         and     #%11000000,d1
  1619.         beq.b   P61_dko                         ; Empty datas
  1620.         cmp.b   #%10000000,d1
  1621.         beq.b   P61_dko                         ; Same datas
  1622.  
  1623.         clr.b   3(a5)
  1624.         and     #$3f,d0
  1625.         move.b  d0,P61_TempLen+1(a5)
  1626.  
  1627.         cmp.b   #%11000000,d1
  1628.         beq.b   .bit16                          ; 16-bit
  1629.  
  1630.         moveq   #0,d0                           ; 8-bit
  1631.         move.b  (a2)+,d0
  1632.         move.l  a2,P61_ChaPos(a5)
  1633.         sub.l   d0,a2
  1634.         bra     P61_jedi
  1635.  
  1636. .bit16
  1637.         moveq   #0,d0
  1638.         ifeq    opt020
  1639.         move.b  (a2)+,d0
  1640.         lsl     #8,d0
  1641.         move.b  (a2)+,d0
  1642.         else
  1643.         move    (a2)+,d0
  1644.         endc
  1645.  
  1646.         move.l  a2,P61_ChaPos(a5)
  1647.         sub.l   d0,a2
  1648.         bra     P61_jedi
  1649.  
  1650.  
  1651. P61_dko
  1652.         st      P61_OnOff(a5)
  1653.         move    (a5),d0
  1654.         and     #$1f0,d0
  1655.         beq     .koto
  1656.         lea     (a0,d0),a1
  1657.         move.l  a1,P61_Sample(a5)
  1658.         ifne    P61_ft
  1659.         move.l  P61_SampleVolume(a1),P61_Volume(a5)
  1660.         else
  1661.         move    P61_SampleVolume(a1),P61_Volume(a5)
  1662.         endc
  1663.         ifne    P61_il
  1664.         move.l  P61_RepeatOffset(a1),P61_Wave(a5)
  1665.         endc
  1666.         ifne    P61_sof
  1667.         clr     P61_Offset(a5)
  1668.         endc
  1669.  
  1670. .koto
  1671.         add.l   d6,a5
  1672.         dbf     d5,P61_loaps
  1673.         rts
  1674.  
  1675. P61_playtime
  1676.         clr     (a3)
  1677.  
  1678.         ifne    P61_pde
  1679.         tst     P61_pdelay-P61_cn(a3)
  1680.         beq     .djdj
  1681.         subq    #1,P61_pdelay-P61_cn(a3)
  1682.         bne     P61_delay
  1683.         tst     P61_speedis1-P61_cn(a3)
  1684.         bne     P61_delay
  1685.         clr     P61_pdflag-P61_cn(a3)
  1686.         bra     P61_delay
  1687. .djdj
  1688.         clr     P61_pdflag-P61_cn(a3)
  1689.         endc
  1690.  
  1691.         tst     P61_speedis1-P61_cn(a3)
  1692.         beq.b   .mo
  1693.         bsr     P61_preplay
  1694.  
  1695. .mo
  1696.         lea     P61_temp0(pc),a5
  1697.         lea     $a0(a6),a4
  1698.  
  1699.         ifeq    system
  1700.         lea     P61_dmason(pc),a1
  1701.         move.l  P61_vektori(pc),a0
  1702.         move.l  a1,(a0)
  1703.         move.b  #$f0,$bfd600
  1704.         move.b  #$01,$bfd700
  1705.         move.b  #$19,$bfdf00
  1706.         else
  1707.         move    #1,P61_server-P61_cn(a3)
  1708.         move.l  P61_craddr+4(pc),a1
  1709.         move.b  #$f0,(a1)
  1710.         move.b  #1,$100(a1)
  1711.         endc
  1712.  
  1713.         lea     P61_periods(pc),a2
  1714.  
  1715.         moveq   #0,d4
  1716.         moveq   #channels-1,d5
  1717. P61_los
  1718.         tst     P61_OnOff(a5)
  1719.         beq.b   P61_nocha
  1720.  
  1721.         moveq   #$f,d0
  1722.         and     (a5),d0
  1723.         lea     P61_jtab(pc),a1
  1724.         add     d0,d0
  1725.         add.l   d0,a1
  1726.         add     (a1),a1
  1727.         jmp     (a1)
  1728.  
  1729. P61_fxdone
  1730.         moveq   #$7e,d0
  1731.         and.b   (a5),d0
  1732.         beq.b   P61_nocha
  1733.         ifne    P61_vib
  1734.         clr.b   P61_VibPos(a5)
  1735.         endc
  1736.         ifne    P61_tre
  1737.         clr.b   P61_TrePos(a5)
  1738.         endc
  1739.  
  1740.         ifne    P61_ft
  1741.         add     P61_Fine(a5),d0
  1742.         endc
  1743.         move    d0,P61_Note(a5)
  1744.         move    (a2,d0),P61_Period(a5)
  1745.  
  1746. P61_zample
  1747.         ifne    P61_sof
  1748.         tst     P61_Offset(a5)
  1749.         bne     P61_pek
  1750.         endc
  1751.  
  1752.         or      P61_DMABit(a5),d4
  1753.         move    d4,$96(a6)
  1754.         move.l  P61_Sample(a5),a1               ;* Trigger *
  1755.         move.l  (a1)+,(a4)                      ;Pointer
  1756.         move    (a1),4(a4)                      ;Length
  1757.  
  1758. P61_nocha
  1759.         ifeq    fade
  1760.         move.l  P61_Period(a5),6(a4)
  1761.         else
  1762.         move    P61_Period(a5),6(a4)
  1763.         move    P61_Volume(a5),P61_Shadow(a5)
  1764.         endc
  1765.  
  1766. P61_skip
  1767.         ifne    P61_il
  1768.         bsr     P61_funk2
  1769.         endc
  1770.  
  1771.         add.l   d6,a5
  1772.         add.l   d7,a4
  1773.         dbf     d5,P61_los
  1774.  
  1775.         move.b  d4,P61_dma+1-P61_cn(a3)
  1776.  
  1777.         ifne    P61_pl
  1778.         tst.b   P61_plflag+1-P61_cn(a3)
  1779.         beq.b   P61_ohittaa
  1780.  
  1781.         lea     P61_temp0(pc),a1
  1782.         lea     P61_looppos(pc),a0
  1783.         moveq   #channels-1,d0
  1784. .talt
  1785.         move.b  1(a0),3(a1)
  1786.         addq.l  #2,a0
  1787.         move.l  (a0)+,P61_ChaPos(a1)
  1788.         move.l  (a0)+,P61_TempPos(a1)
  1789.         move    (a0)+,P61_TempLen(a1)
  1790.         add.l   d6,a1
  1791.         dbf     d0,.talt
  1792.  
  1793.         move    P61_plrowpos(pc),P61_rowpos-P61_cn(a3)
  1794.         clr.b   P61_plflag+1-P61_cn(a3)
  1795.         moveq   #63,d0
  1796.         sub     P61_rowpos-P61_cn(a3),d0
  1797.         move    d0,P61_CRow-P61_cn(a3)
  1798.         rts
  1799.         endc
  1800.  
  1801. P61_ohittaa
  1802.         subq    #1,P61_rowpos-P61_cn(a3)
  1803.         bmi.b   P61_nextpattern
  1804.         moveq   #63,d0
  1805.         sub     P61_rowpos-P61_cn(a3),d0
  1806.         move    d0,P61_CRow-P61_cn(a3)
  1807.         rts
  1808.  
  1809. P61_nextpattern
  1810.         ifne    P61_pl
  1811.         clr     P61_plflag-P61_cn(a3)
  1812.         endc
  1813.         move.l  P61_patternbase(pc),a4
  1814.         moveq   #63,d0
  1815.         move    d0,P61_rowpos-P61_cn(a3)
  1816.         clr     P61_CRow-P61_cn(a3)
  1817.         move.l  P61_spos(pc),a1
  1818.         addq    #1,P61_Pos-P61_cn(a3)
  1819.         move.b  (a1)+,d0
  1820.         bpl.b   P61_dk
  1821.         move.l  P61_possibase(pc),a1
  1822.         move.b  (a1)+,d0
  1823.         clr     P61_Pos-P61_cn(a3)
  1824. P61_dk
  1825.         move.l  a1,P61_spos-P61_cn(a3)
  1826.         move    d0,P61_Patt-P61_cn(a3)
  1827.         lsl     #3,d0
  1828.         move.l  P61_positionbase(pc),a1
  1829.         add.l   d0,a1
  1830.  
  1831.         move    (a1)+,d0
  1832.         lea     (a4,d0.l),a2
  1833.         move.l  a2,P61_ChaPos+P61_temp0-P61_cn(a3)
  1834.         move    (a1)+,d0
  1835.         lea     (a4,d0.l),a2
  1836.         move.l  a2,P61_ChaPos+P61_temp1-P61_cn(a3)
  1837.         move    (a1)+,d0
  1838.         lea     (a4,d0.l),a2
  1839.         move.l  a2,P61_ChaPos+P61_temp2-P61_cn(a3)
  1840.         move    (a1),d0
  1841.         add.l   d0,a4
  1842.         move.l  a4,P61_ChaPos+P61_temp3-P61_cn(a3)
  1843.         rts
  1844.  
  1845.         ifne    P61_tp
  1846. P61_settoneport
  1847.         move.b  P61_Info(a5),d0
  1848.         beq.b   P61_toponochange
  1849.         move.b  d0,P61_TPSpeed+1(a5)
  1850. P61_toponochange
  1851.         moveq   #$7e,d0
  1852.         and.b   (a5),d0
  1853.         beq     P61_nocha
  1854.         add     P61_Fine(a5),d0
  1855.         move    d0,P61_Note(a5)
  1856.         move    (a2,d0),P61_ToPeriod(a5)
  1857.         bra     P61_nocha
  1858.         endc
  1859.  
  1860.         ifne    P61_sof
  1861. P61_sampleoffse
  1862.         moveq   #0,d1
  1863.         move    #$ff00,d1
  1864.         and     2(a5),d1
  1865.         bne.b   .deq
  1866.         move    P61_LOffset(a5),d1
  1867. .deq
  1868.         move    d1,P61_LOffset(a5)
  1869.         add     d1,P61_Offset(a5)
  1870.  
  1871.         moveq   #$7e,d0
  1872.         and.b   (a5),d0
  1873.         beq     P61_nocha
  1874.  
  1875.         move    P61_Offset(a5),d2
  1876.         add     d1,P61_Offset(a5)               ; THIS IS A PT-FEATURE!
  1877.         move    d2,d1
  1878.  
  1879.         ifne    P61_vib
  1880.         clr.b   P61_VibPos(a5)
  1881.         endc
  1882.         ifne    P61_tre
  1883.         clr.b   P61_TrePos(a5)
  1884.         endc
  1885.  
  1886.         ifne    P61_ft
  1887.         add     P61_Fine(a5),d0
  1888.         endc
  1889.         move    d0,P61_Note(a5)
  1890.         move    (a2,d0),P61_Period(a5)
  1891.         bra.b   P61_hup
  1892.  
  1893. P61_pek
  1894.         moveq   #0,d1
  1895.         move    P61_Offset(a5),d1
  1896. P61_hup
  1897.         or      P61_DMABit(a5),d4
  1898.         move    d4,$96(a6)
  1899.         move.l  P61_Sample(a5),a1               ;* Trigger *
  1900.         move.l  (a1)+,d0
  1901.         add.l   d1,d0
  1902.         move.l  d0,(a4)                         ;Pointer
  1903.         lsr     #1,d1
  1904.         move    (a1),d0
  1905.         sub     d1,d0
  1906.         bpl.b   P61_offok
  1907.         move.l  -4(a1),(a4)                     ;Pointer is over the end
  1908.         moveq   #1,d0
  1909. P61_offok
  1910.         move    d0,4(a4)                        ;Length
  1911.         bra     P61_nocha
  1912.         endc
  1913.  
  1914.         ifne    P61_vl
  1915. P61_volum
  1916.         move.b  P61_Info(a5),P61_Volume+1(a5)
  1917.         bra     P61_fxdone
  1918.         endc
  1919.  
  1920.         ifne    P61_pj
  1921. P61_posjmp
  1922.         moveq   #0,d0
  1923.         move.b  P61_Info(a5),d0
  1924.         cmp     P61_slen-P61_cn(a3),d0
  1925.         blo.b   .e
  1926.         moveq   #0,d0
  1927. .e      move    d0,P61_Pos-P61_cn(a3)
  1928.         add.l   P61_possibase(pc),d0
  1929.         move.l  d0,P61_spos-P61_cn(a3)
  1930.         endc
  1931.  
  1932.         ifne    P61_pb
  1933. P61_pattbreak
  1934.         moveq   #64,d0
  1935.         move    d0,P61_rowpos-P61_cn(a3)
  1936.         clr     P61_CRow-P61_cn(a3)
  1937.         move.l  P61_spos(pc),a1
  1938.         move.l  P61_patternbase(pc),a0
  1939.         addq    #1,P61_Pos-P61_cn(a3)
  1940.         move.b  (a1)+,d0
  1941.         bpl.b   P61_dk2
  1942.         move.l  P61_possibase(pc),a1
  1943.         move.b  (a1)+,d0
  1944.         clr     P61_Pos-P61_cn(a3)
  1945. P61_dk2
  1946.         move.l  a1,P61_spos-P61_cn(a3)
  1947.         move.l  P61_positionbase(pc),a1
  1948.         move    d0,P61_Patt-P61_cn(a3)
  1949.         lsl     #3,d0
  1950.         add.l   d0,a1
  1951.         movem   (a1),d0-d3
  1952.         lea     (a0,d0.l),a1
  1953.         move    d1,d0
  1954.         move.l  a1,P61_ChaPos+P61_temp0-P61_cn(a3)
  1955.         lea     (a0,d0.l),a1
  1956.         move.l  a1,P61_ChaPos+P61_temp1-P61_cn(a3)
  1957.         move    d2,d0
  1958.         lea     (a0,d0.l),a1
  1959.         move.l  a1,P61_ChaPos+P61_temp2-P61_cn(a3)
  1960.         move    d3,d0
  1961.         add.l   d0,a0
  1962.         move.l  a0,P61_ChaPos+P61_temp3-P61_cn(a3)
  1963.         bra     P61_fxdone
  1964.         endc
  1965.  
  1966.         ifne    P61_vib
  1967. P61_vibrato
  1968.         move.b  P61_Info(a5),d0
  1969.         beq     P61_fxdone
  1970.         move.b  d0,d1
  1971.         move.b  P61_VibCmd(a5),d2
  1972.         and.b   #$f,d0
  1973.         beq.b   P61_vibskip
  1974.         and.b   #$f0,d2
  1975.         or.b    d0,d2
  1976. P61_vibskip
  1977.         and.b   #$f0,d1
  1978.         beq.b   P61_vibskip2
  1979.         and.b   #$f,d2
  1980.         or.b    d1,d2
  1981. P61_vibskip2
  1982.         move.b  d2,P61_VibCmd(a5)
  1983.         bra     P61_fxdone
  1984.         endc
  1985.  
  1986.         ifne    P61_tre
  1987. P61_settremo
  1988.         move.b  P61_Info(a5),d0
  1989.         beq     P61_fxdone
  1990.         move.b  d0,d1
  1991.         move.b  P61_TreCmd(a5),d2
  1992.         moveq   #$f,d3
  1993.         and.b   d3,d0
  1994.         beq.b   P61_treskip
  1995.         and.b   #$f0,d2
  1996.         or.b    d0,d2
  1997. P61_treskip
  1998.         and.b   #$f0,d1
  1999.         beq.b   P61_treskip2
  2000.         and.b   d3,d2
  2001.         or.b    d1,d2
  2002. P61_treskip2
  2003.         move.b  d2,P61_TreCmd(a5)
  2004.         bra     P61_fxdone
  2005.         endc
  2006.  
  2007.         ifne    P61_ec
  2008. P61_ecommands
  2009.         move.b  P61_Info(a5),d0
  2010.         and.b   #$f0,d0
  2011.         lsr     #3,d0
  2012.         move    P61_etab(pc,d0),d0
  2013.         jmp     P61_etab(pc,d0)
  2014.  
  2015. P61_etab
  2016.         ifne    P61_fi
  2017.         dc      P61_filter-P61_etab
  2018.         else
  2019.         dc      P61_fxdone-P61_etab
  2020.         endc
  2021.  
  2022.         ifne    P61_fsu
  2023.         dc      P61_fineup-P61_etab
  2024.         else
  2025.         dc      P61_fxdone-P61_etab
  2026.         endc
  2027.  
  2028.         ifne    P61_fsd
  2029.         dc      P61_finedwn-P61_etab
  2030.         else
  2031.         dc      P61_fxdone-P61_etab
  2032.         endc
  2033.  
  2034.         dc      P61_fxdone-P61_etab
  2035.         dc      P61_fxdone-P61_etab
  2036.  
  2037.         ifne    P61_sft
  2038.         dc      P61_setfinetune-P61_etab
  2039.         else
  2040.         dc      P61_fxdone-P61_etab
  2041.         endc
  2042.  
  2043.         ifne    P61_pl
  2044.         dc      P61_patternloop-P61_etab
  2045.         else
  2046.         dc      P61_fxdone-P61_etab
  2047.         endc
  2048.  
  2049.         dc      P61_fxdone-P61_etab
  2050.  
  2051.         ifne    P61_timing
  2052.         dc      P61_sete8-P61_etab
  2053.         else
  2054.         dc      P61_fxdone-P61_etab
  2055.         endc
  2056.  
  2057.         ifne    P61_rt
  2058.         dc      P61_setretrig-P61_etab
  2059.         else
  2060.         dc      P61_fxdone-P61_etab
  2061.         endc
  2062.  
  2063.         ifne    P61_fvu
  2064.         dc      P61_finevup-P61_etab
  2065.         else
  2066.         dc      P61_fxdone-P61_etab
  2067.         endc
  2068.  
  2069.         ifne    P61_fvd
  2070.         dc      P61_finevdwn-P61_etab
  2071.         else
  2072.         dc      P61_fxdone-P61_etab
  2073.         endc
  2074.  
  2075.         dc      P61_fxdone-P61_etab
  2076.  
  2077.         ifne    P61_nd
  2078.         dc      P61_ndelay-P61_etab
  2079.         else
  2080.         dc      P61_fxdone-P61_etab
  2081.         endc
  2082.  
  2083.         ifne    P61_pde
  2084.         dc      P61_pattdelay-P61_etab
  2085.         else
  2086.         dc      P61_fxdone-P61_etab
  2087.         endc
  2088.  
  2089.         ifne    P61_il
  2090.         dc      P61_funk-P61_etab
  2091.         else
  2092.         dc      P61_fxdone-P61_etab
  2093.         endc
  2094.         endc
  2095.  
  2096.         ifne    P61_fi
  2097. P61_filter
  2098.         move.b  P61_Info(a5),d0
  2099.         and.b   #$fd,$bfe001
  2100.         or.b    d0,$bfe001
  2101.         bra     P61_fxdone
  2102.         endc
  2103.  
  2104.         ifne    P61_fsu
  2105. P61_fineup
  2106.         P61_getnote
  2107.  
  2108.         moveq   #$f,d0
  2109.         and.b   P61_Info(a5),d0
  2110.         sub     d0,P61_Period(a5)
  2111.         moveq   #113,d0
  2112.         cmp     P61_Period(a5),d0
  2113.         ble.b   .jup
  2114.         move    d0,P61_Period(a5)
  2115. .jup
  2116.         moveq   #$7e,d0
  2117.         and.b   (a5),d0
  2118.         bne     P61_zample
  2119.         bra     P61_nocha
  2120.         endc
  2121.  
  2122.         ifne    P61_fsd
  2123. P61_finedwn
  2124.         P61_getnote
  2125.  
  2126.         moveq   #$f,d0
  2127.         and.b   P61_Info(a5),d0
  2128.         add     d0,P61_Period(a5)
  2129.         cmp     #856,P61_Period(a5)
  2130.         ble.b   .jup
  2131.         move    #856,P61_Period(a5)
  2132. .jup    moveq   #$7e,d0
  2133.         and.b   (a5),d0
  2134.         bne     P61_zample
  2135.         bra     P61_nocha
  2136.         endc
  2137.  
  2138.         ifne    P61_sft
  2139. P61_setfinetune
  2140.         moveq   #$f,d0
  2141.         and.b   P61_Info(a5),d0
  2142.         ifeq    opt020
  2143.         add     d0,d0
  2144.         move    P61_mulutab(pc,d0),P61_Fine(a5)
  2145.         else
  2146.         move    P61_mulutab(pc,d0*2),P61_Fine(a5)
  2147.         endc
  2148.         bra     P61_fxdone
  2149.  
  2150. P61_mulutab
  2151.         dc      0,74,148,222,296,370,444,518,592,666,740,814,888,962,1036,1110
  2152.         endc
  2153.  
  2154.         ifne    P61_pl
  2155. P61_patternloop
  2156.         moveq   #$f,d0
  2157.         and.b   P61_Info(a5),d0
  2158.         beq.b   P61_setloop
  2159.  
  2160.         tst.b   P61_plflag-P61_cn(a3)
  2161.         bne.b   P61_noset
  2162.  
  2163.         move    d0,P61_plcount-P61_cn(a3)
  2164.         st.b    P61_plflag-P61_cn(a3)
  2165. P61_noset
  2166.         tst     P61_plcount-P61_cn(a3)
  2167.         bne.b   P61_looppaa
  2168.         clr.b   P61_plflag-P61_cn(a3)
  2169.         bra     P61_fxdone
  2170.         
  2171. P61_looppaa
  2172.         st.b    P61_plflag+1-P61_cn(a3)
  2173.         subq    #1,P61_plcount-P61_cn(a3)
  2174.         bra     P61_fxdone
  2175.  
  2176. P61_setloop
  2177.         tst.b   P61_plflag-P61_cn(a3)
  2178.         bne     P61_fxdone
  2179.         move    P61_rowpos(pc),P61_plrowpos-P61_cn(a3)
  2180.         lea     P61_temp0+P61_TData(pc),a1
  2181.         lea     P61_looppos(pc),a0
  2182.         moveq   #channels-1,d0
  2183. .talt
  2184.         move.l  (a1)+,(a0)+
  2185.         move.l  (a1)+,(a0)+
  2186.         move.l  (a1),(a0)+
  2187.         subq.l  #8,a1
  2188.         add.l   d6,a1
  2189.         dbf     d0,.talt
  2190.         bra     P61_fxdone
  2191.         endc
  2192.  
  2193.         ifne    P61_fvu
  2194. P61_finevup
  2195.         moveq   #$f,d0
  2196.         and.b   P61_Info(a5),d0
  2197.         add     d0,P61_Volume(a5)
  2198.         moveq   #64,d0
  2199.         cmp     P61_Volume(a5),d0
  2200.         bge     P61_fxdone
  2201.         move    d0,P61_Volume(a5)
  2202.         bra     P61_fxdone
  2203.         endc
  2204.  
  2205.         ifne    P61_fvd
  2206. P61_finevdwn
  2207.         moveq   #$f,d0
  2208.         and.b   P61_Info(a5),d0
  2209.         sub     d0,P61_Volume(a5)
  2210.         bpl     P61_fxdone
  2211.         clr     P61_Volume(a5)
  2212.         bra     P61_fxdone
  2213.         endc
  2214.  
  2215.         ifne    P61_timing
  2216. P61_sete8
  2217.         moveq   #$f,d0
  2218.         and.b   P61_Info(a5),d0
  2219.         move    d0,P61_E8-P61_cn(a3)
  2220.         bra     P61_fxdone
  2221.         endc
  2222.  
  2223.         ifne    P61_rt
  2224. P61_setretrig
  2225.         moveq   #$f,d0
  2226.         and.b   P61_Info(a5),d0
  2227.         move    d0,P61_RetrigCount(a5)
  2228.         bra     P61_fxdone
  2229.         endc
  2230.  
  2231.         ifne    P61_nd
  2232. P61_ndelay
  2233.         moveq   #$7e,d0
  2234.         and.b   (a5),d0
  2235.         beq     P61_skip
  2236.         ifne    P61_vib
  2237.         clr.b   P61_VibPos(a5)
  2238.         endc
  2239.         ifne    P61_tre
  2240.         clr.b   P61_TrePos(a5)
  2241.         endc
  2242.         ifne    P61_ft
  2243.         add     P61_Fine(a5),d0
  2244.         endc
  2245.         move    d0,P61_Note(a5)
  2246.         move    (a2,d0),P61_Period(a5)
  2247.         ifeq    fade
  2248.         move    P61_Volume(a5),8(a4)
  2249.         else
  2250.         move    P61_Volume(a5),P61_Shadow(a5)
  2251.         endc
  2252.         bra     P61_skip
  2253.         endc
  2254.  
  2255.         ifne    P61_pde
  2256. P61_pattdelay
  2257.         moveq   #$f,d0
  2258.         and.b   P61_Info(a5),d0
  2259.         move    d0,P61_pdelay-P61_cn(a3)
  2260.         st      P61_pdflag-P61_cn(a3)
  2261.         bra     P61_fxdone
  2262.         endc
  2263.  
  2264.         ifne    P61_sd
  2265. P61_cspeed
  2266.         moveq   #0,d0
  2267.         move.b  P61_Info(a5),d0
  2268.  
  2269.         ifne    CIA
  2270.         tst     P61_Tempo-P61_cn(a3)
  2271.         beq.b   P61_VBlank
  2272.         cmp.b   #32,d0
  2273.         bhs.b   P61_STempo
  2274.         endc
  2275.  
  2276. P61_VBlank
  2277.         cmp.b   #1,d0
  2278.         beq.b   P61_jkd
  2279.  
  2280.         move.b  d0,P61_speed+1-P61_cn(a3)
  2281.         subq.b  #1,d0
  2282.         move.b  d0,P61_speed2+1-P61_cn(a3)
  2283.         clr     P61_speedis1-P61_cn(a3)
  2284.         bra     P61_fxdone
  2285.  
  2286. P61_jkd
  2287.         move.b  d0,P61_speed+1-P61_cn(a3)
  2288.         move.b  d0,P61_speed2+1-P61_cn(a3)
  2289.         st      P61_speedis1-P61_cn(a3)
  2290.         bra     P61_fxdone
  2291.  
  2292.  
  2293.         ifne    CIA
  2294. P61_STempo
  2295.         move.l  P61_timer(pc),d1
  2296.         divu    d0,d1
  2297.         move    d1,P61_thi2-P61_cn(a3)
  2298.         sub     #$1f0*2,d1
  2299.         move    d1,P61_thi-P61_cn(a3)
  2300.  
  2301.         ifeq    system
  2302.         move    P61_thi2-P61_cn(a3),d1
  2303.         move.b  d1,$bfd400
  2304.         lsr     #8,d1
  2305.         move.b  d1,$bfd500
  2306.         endc
  2307.  
  2308.         bra     P61_fxdone
  2309.         endc
  2310.         endc
  2311.  
  2312.  
  2313.  
  2314.         ifne    P61_vbvs
  2315. P61_vibochvslide
  2316.         move.b  P61_Info(a5),d0
  2317.         sub.b   d0,P61_Volume+1(a5)
  2318.         bpl.b   P61_test62
  2319.         clr     P61_Volume(a5)
  2320.         ifeq    fade
  2321.         clr     8(a4)
  2322.         else
  2323.         clr     P61_Shadow(a5)
  2324.         endc
  2325.         bra.b   P61_vib2
  2326. P61_test62
  2327.         moveq   #64,d0
  2328.         cmp     P61_Volume(a5),d0
  2329.         bge.b   .ncs2
  2330.         move    d0,P61_Volume(a5)
  2331. .ncs2
  2332.         ifeq    fade
  2333.         move    P61_Volume(a5),8(a4)
  2334.         else
  2335.         move    P61_Volume(a5),P61_Shadow(a5)
  2336.         endc
  2337.         endc
  2338.  
  2339.         ifne    P61_vib
  2340. P61_vib2
  2341.         move    #$f00,d0
  2342.         move    P61_VibCmd(a5),d1
  2343.         and     d1,d0
  2344.         lsr     #3,d0
  2345.  
  2346.         lsr     #2,d1
  2347.         and     #$1f,d1
  2348.         add     d1,d0
  2349.  
  2350.         move    P61_Period(a5),d1
  2351.         moveq   #0,d2
  2352.         move.b  P61_vibtab(pc,d0),d2
  2353.  
  2354.         tst.b   P61_VibPos(a5)
  2355.         bmi.b   .vibneg
  2356.         add     d2,d1
  2357.         bra.b   P61_vib4
  2358.  
  2359. .vibneg sub     d2,d1
  2360.  
  2361. P61_vib4
  2362.         move    d1,6(a4)
  2363.         move.b  P61_VibCmd(a5),d0
  2364.         lsr.b   #2,d0
  2365.         and     #$3c,d0
  2366.         add.b   d0,P61_VibPos(a5)
  2367.         bra     P61_contfxdone
  2368.         endc
  2369.  
  2370.         ifne    P61_tre
  2371. P61_tremo
  2372.         move    #$f00,d0
  2373.         move    P61_TreCmd(a5),d1
  2374.         and     d1,d0
  2375.         lsr     #3,d0
  2376.         
  2377.         lsr     #2,d1
  2378.         and     #$1f,d1
  2379.         add     d1,d0
  2380.  
  2381.         move    P61_Volume(a5),d1
  2382.         moveq   #0,d2
  2383.         move.b  P61_vibtab(pc,d0),d2
  2384.  
  2385.         tst.b   P61_TrePos(a5)
  2386.         bmi.b   .treneg
  2387.         add     d2,d1
  2388.         cmp     #64,d1
  2389.         ble.b   P61_tre4
  2390.         moveq   #64,d1
  2391.         bra.b   P61_tre4
  2392.  
  2393. .treneg
  2394.         sub     d2,d1
  2395.         bpl.b   P61_tre4
  2396.         moveq   #0,d1
  2397. P61_tre4
  2398.         ifeq    fade
  2399.         move    d1,8(a4)
  2400.         else
  2401.         move    d1,P61_Shadow(a5)
  2402.         endc
  2403.  
  2404.         move.b  P61_TreCmd(a5),d0
  2405.         lsr.b   #2,d0
  2406.         and     #$3c,d0
  2407.         add.b   d0,P61_TrePos(a5)
  2408.         bra     P61_contfxdone
  2409.         endc
  2410.  
  2411.         ifne    P61_vib!P61_tre
  2412. P61_vibtab
  2413.         incbin  vibtab
  2414.         endc
  2415.  
  2416.         ifne    P61_il
  2417. P61_funk
  2418.         moveq   #$f,d0
  2419.         and.b   P61_Info(a5),d0
  2420.         move.b  d0,P61_Funkspd(a5)
  2421.         bra     P61_fxdone
  2422.  
  2423. P61_funk2
  2424.         moveq   #0,d0
  2425.         move.b  P61_Funkspd(a5),d0
  2426.         beq.b   P61_funkend
  2427.         move.b  P61_FunkTable(pc,d0),d0
  2428.         add.b   d0,P61_Funkoff(a5)
  2429.         bpl.b   P61_funkend
  2430.         clr.b   P61_Funkoff(a5)
  2431.  
  2432.         move.l  P61_Sample(a5),a1
  2433.         move.l  P61_RepeatOffset(a1),d1
  2434.         move    P61_RepeatLength(a1),d0
  2435.         add.l   d0,d0
  2436.         add.l   d1,d0
  2437.         move.l  P61_Wave(a5),a0
  2438.         addq.l  #1,a0
  2439.         cmp.l   d0,a0
  2440.         blo.b   P61_funkok
  2441.         move.l  d1,a0
  2442. P61_funkok
  2443.         move.l  a0,P61_Wave(a5)
  2444.         not.b   (a0)
  2445. P61_funkend
  2446.         rts
  2447.  
  2448. P61_FunkTable
  2449.         dc.b 0,5,6,7,8,10,11,13,16,19,22,26,32,43,64,128
  2450.         endc
  2451.  
  2452. P61_jtab
  2453.         dc      P61_fxdone-*
  2454.         dc      P61_fxdone-*
  2455.         dc      P61_fxdone-*
  2456.  
  2457.         ifne    P61_tp
  2458.         dc      P61_settoneport-*
  2459.         else
  2460.         dc      P61_fxdone-*
  2461.         endc
  2462.  
  2463.         ifne    P61_vib
  2464.         dc      P61_vibrato-*
  2465.         else
  2466.         dc      P61_fxdone-*
  2467.         endc
  2468.  
  2469.         ifne    P61_tpvs
  2470.         dc      P61_toponochange-*
  2471.         else
  2472.         dc      P61_fxdone-*
  2473.         endc
  2474.  
  2475.         dc      P61_fxdone-*
  2476.  
  2477.         ifne    P61_tre
  2478.         dc      P61_settremo-*
  2479.         else
  2480.         dc      P61_fxdone-*
  2481.         endc
  2482.  
  2483.         dc      P61_fxdone-*
  2484.  
  2485.         ifne    P61_sof
  2486.         dc      P61_sampleoffse-*
  2487.         else
  2488.         dc      P61_fxdone-*
  2489.         endc
  2490.         dc      P61_fxdone-*
  2491.  
  2492.         ifne    P61_pj
  2493.         dc      P61_posjmp-*
  2494.         else
  2495.         dc      P61_fxdone-*
  2496.         endc
  2497.  
  2498.         ifne    P61_vl
  2499.         dc      P61_volum-*
  2500.         else
  2501.         dc      P61_fxdone-*
  2502.         endc
  2503.  
  2504.         ifne    P61_pb
  2505.         dc      P61_pattbreak-*
  2506.         else
  2507.         dc      P61_fxdone-*
  2508.         endc
  2509.  
  2510.         ifne    P61_ec
  2511.         dc      P61_ecommands-*
  2512.         else
  2513.         dc      P61_fxdone-*
  2514.         endc
  2515.         
  2516.         ifne    P61_sd
  2517.         dc      P61_cspeed-*
  2518.         else
  2519.         dc      P61_fxdone-*
  2520.         endc
  2521.  
  2522.  
  2523. P61_dmason
  2524.         ifeq    system
  2525.         tst.b   $bfdd00
  2526.         move    #$2000,$dff09c
  2527.         move    #$2000,$dff09c  ;!!!
  2528.         move.b  #$19,$bfdf00
  2529.         move.l  a0,-(sp)
  2530.         move.l  P61_vektori(pc),a0
  2531.         move.l  P61_intaddr(pc),(a0)
  2532.         move.l  (sp)+,a0
  2533.         move    P61_dma(pc),$dff096
  2534.         nop
  2535.         rte
  2536.  
  2537.         else
  2538.  
  2539.         move    P61_dma(pc),$96(a6)
  2540.         lea     P61_server(pc),a3
  2541.         addq    #1,(a3)
  2542.         move.l  P61_craddr(pc),a0
  2543.         move.b  #$19,(a0)
  2544.         bra     P61_ohi
  2545.         endc
  2546.  
  2547.  
  2548. P61_setrepeat
  2549.         ifeq    system
  2550.         tst.b   $bfdd00
  2551.         movem.l a0/a1,-(sp)
  2552.         lea     $dff0a0,a1
  2553.         move    #$2000,-4(a1)
  2554.         move    #$2000,-4(a1)   ;!!!
  2555.         else
  2556.         lea     $a0(a6),a1
  2557.         endc
  2558.  
  2559.         move.l  P61_Sample+P61_temp0(pc),a0
  2560.         addq.l  #6,a0
  2561.         move.l  (a0)+,(a1)+
  2562.         move    (a0),(a1)
  2563.  
  2564.         ifgt    channels-1
  2565.         move.l  P61_Sample+P61_temp1(pc),a0
  2566.         addq.l  #6,a0
  2567.         move.l  (a0)+,12(a1)
  2568.         move    (a0),16(a1)
  2569.         endc
  2570.         
  2571.         ifgt    channels-2
  2572.         move.l  P61_Sample+P61_temp2(pc),a0
  2573.         addq.l  #6,a0
  2574.         move.l  (a0)+,28(a1)
  2575.         move    (a0),32(a1)
  2576.         endc
  2577.  
  2578.         ifgt    channels-3
  2579.         move.l  P61_Sample+P61_temp3(pc),a0
  2580.         addq.l  #6,a0
  2581.         move.l  (a0)+,44(a1)
  2582.         move    (a0),48(a1)
  2583.         endc
  2584.  
  2585.         ifne    system
  2586.         ifne    CIA
  2587.         lea     P61_server(pc),a3
  2588.         clr     (a3)
  2589.         move.l  P61_craddr+4(pc),a0
  2590.         move.b  P61_tlo(pc),(a0)
  2591.         move.b  P61_thi(pc),$100(a0)
  2592.         endc
  2593.         bra     P61_ohi
  2594.         endc
  2595.  
  2596.         ifeq    system
  2597.         ifne    CIA
  2598.         move.l  P61_vektori(pc),a0
  2599.         move.l  P61_tintti(pc),(a0)
  2600.         endc
  2601.         movem.l (sp)+,a0/a1
  2602.         nop
  2603.         rte
  2604.         endc
  2605.  
  2606. P61_temp0
  2607.         dcb.b   Channel_Block_SIZE-2,0
  2608.         dc      1
  2609.  
  2610. P61_temp1
  2611.         dcb.b   Channel_Block_SIZE-2,0
  2612.         dc      2
  2613.  
  2614. P61_temp2
  2615.         dcb.b   Channel_Block_SIZE-2,0
  2616.         dc      4
  2617.  
  2618. P61_temp3
  2619.         dcb.b   Channel_Block_SIZE-2,0
  2620.         dc      8
  2621.  
  2622. P61_cn
  2623.         dc      0
  2624. P61_dma         
  2625.         dc      $8200
  2626. P61_rowpos
  2627.         dc      0
  2628. P61_slen
  2629.         dc      0
  2630. P61_speed
  2631.         dc      0
  2632. P61_speed2
  2633.         dc      0
  2634. P61_speedis1
  2635.         dc      0
  2636. P61_spos
  2637.         dc.l    0
  2638.  
  2639.         ifeq    system
  2640. P61_vektori
  2641.         dc.l    0
  2642. P61_oldlev6
  2643.         dc.l    0
  2644.         endc
  2645.  
  2646. P61_ofilter
  2647.         dc      0
  2648. P61_timers
  2649.         dc.l    0
  2650.  
  2651.         ifne    CIA
  2652. P61_tintti
  2653.         dc.l    0
  2654. P61_thi
  2655.         dc.b    0
  2656. P61_tlo 
  2657.         dc.b    0
  2658. P61_thi2
  2659.         dc.b    0
  2660. P61_tlo2
  2661.         dc.b    0
  2662. P61_timer
  2663.         dc.l    0
  2664.         endc
  2665.  
  2666.         ifne    P61_pl
  2667. P61_plcount
  2668.         dc      0
  2669. P61_plflag
  2670.         dc      0
  2671. P61_plreset
  2672.         dc      0
  2673. P61_plrowpos
  2674.         dc      0
  2675. P61_looppos
  2676.         dcb.b   12*channels,0
  2677.         endc
  2678.  
  2679.         ifne    P61_pde
  2680. P61_pdelay
  2681.         dc      0
  2682. P61_pdflag
  2683.         dc      0
  2684.         endc
  2685.  
  2686. P61_samples
  2687.         dcb.b   16*31,0
  2688. P61_emptysample
  2689.         dcb.b   16,0
  2690. P61_positionbase
  2691.         dc.l    0
  2692. P61_possibase
  2693.         dc.l    0
  2694. _P61_patternbase
  2695. P61_patternbase
  2696.         dc.l    0
  2697. P61_intaddr
  2698.         dc.l    0
  2699.  
  2700.         ifne    system
  2701. P61_server
  2702.         dc      0
  2703. P61_miscbase
  2704.         dc.l    0
  2705. P61_audioopen
  2706.         dc.b    0
  2707. P61_sigbit
  2708.         dc.b    -1
  2709. P61_ciares
  2710.         dc.l    0
  2711. P61_craddr
  2712.         dc.l    0,0,0
  2713. P61_dat
  2714.         dc      $f00
  2715. P61_timerinterrupt
  2716.         dc      0,0,0,0,127
  2717. P61_timerdata
  2718.         dc.l    0,0,0
  2719. P61_timeron
  2720.         dc      0
  2721. P61_allocport
  2722.         dc.l    0,0
  2723.         dc.b    4,0
  2724.         dc.l    0
  2725.         dc.b    0,0
  2726.         dc.l    0
  2727. P61_reqlist
  2728.         dc.l    0,0,0
  2729.         dc.b    5,0
  2730.  
  2731. P61_allocreq
  2732.     dc.l    0,0
  2733.     dc      127
  2734.     dc.l    0
  2735.  
  2736. P61_portti
  2737.     dc.l    0
  2738.     dc      68
  2739.     dc.l    0,0,0
  2740.     dc      0
  2741. P61_reqdata
  2742.     dc.l    0
  2743.     dc.l    1,0,0,0,0,0,0
  2744.         dc      0
  2745. P61_audiodev
  2746.         dc.b    'audio.device',0
  2747.  
  2748. P61_cianame
  2749.         dc.b    'ciab.resource',0
  2750. P61_timeropen
  2751.         dc.b    0
  2752. P61_timerint
  2753.         dc.b    'P61_TimerInterrupt',0,0
  2754.         endc
  2755. P61_etu
  2756.  
  2757. ******** END OF BINARY FILE **************
  2758.  
  2759.         ifne    example
  2760.         section chip,data_c
  2761. ;P61_data
  2762. ;       incbin  "P61.testmod"
  2763. ;P61_smp        incbin  "ram:SMP.fields of green"
  2764.  
  2765. ;       section smp,bss_c
  2766. ;samples
  2767.         ;ds.b   $10000          ;uncomment if you have packed samples
  2768.                                 ;and insert sample buffer length
  2769.                                 ;also go to the line where samples
  2770.                                 ;is loaded into a2 and uncomment it
  2771.         endc
  2772.         
  2773.         ifne    asmone
  2774.         ifd     makebin
  2775.         auto    wb ram:610.3.bin_new\P61_motuuli\P61_etu\
  2776.         endc
  2777.         endc
  2778.  
  2779.