home *** CD-ROM | disk | FTP | other *** search
/ MACD 9 / MACD9.iso / Varia / Player6.1A / Source / 610.4.asm next >
Encoding:
Assembly Source File  |  1998-05-11  |  41.3 KB  |  2,740 lines

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