home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / falcon / program / jagdem_s / sound / dsplay2.s < prev   
Text File  |  1994-03-31  |  4KB  |  145 lines

  1. * This is a good DSP module player! It can also work from the vbl
  2. ; interrupt, but we only found out about that after we finished
  3. ; this demo!
  4.  
  5. ;DSP MOD replay routine written by bITmASTER of BSW
  6. ;This is source code for Devpack 3
  7. ;Additional code by Dusan
  8.  
  9. ;TEST                ;< uncomment to test this code by itself
  10.  
  11.                 opt D+
  12.  
  13.  
  14. iera            equ $fffffa07           ;Interrupt-Enable-Register A
  15. ierb            equ $fffffa09           ;                                                               B
  16. imra            equ $fffffa13
  17. isra            equ $fffffa0f
  18. isrb            equ $fffffa11
  19. tacr            equ $fffffa19
  20. tbcr            equ $fffffa1b
  21. tadr            equ $fffffa1f
  22. tbdr            equ $fffffa21
  23. tccr            equ $fffffa1d
  24. tcdr            equ $fffffa23
  25. aer             equ $fffffa03
  26. STColor         equ $ffff8240
  27. FColor          equ $ffff9800
  28. vbl             equ $70
  29. timer_int       equ $0120
  30. timer_c_int     equ $0114
  31.  
  32. ym_select       equ $ffff8800
  33. ym_write        equ $ffff8802
  34. ym_read         equ $ffff8800
  35.  
  36. vbaselow        equ $ffff820d
  37. vbasemid        equ $ffff8203
  38. vbasehigh       equ $ffff8201
  39. vcountlow       equ $ffff8209
  40. vcountmid       equ $ffff8207
  41. vcounthigh      equ $ffff8205
  42. linewid         equ $ffff820f
  43. hscroll         equ $ffff8265
  44.  
  45. keyctl          equ $fffffc00
  46. keybd           equ $fffffc02
  47.  
  48. DspHost         equ $ffffa200
  49. HostIntVec      equ $03fc
  50.  
  51. PCookies        equ $05a0
  52.  
  53.     IFD    TEST
  54.     lea    module,a6
  55.     pea    muson
  56.     move    #38,-(sp)
  57.     trap    #14
  58.     addq.l    #6,sp
  59.     move    #1,-(sp)
  60.     trap    #1
  61.     addq.l    #2,sp
  62.     pea    musoff
  63.     move    #38,-(sp)
  64.     trap    #14
  65.     addq.l    #6,sp
  66.     clr    -(sp)
  67.     trap    #1
  68.     ENDC
  69.  
  70. muson    lea     mod_player,a0
  71.         bsr     .reloziere
  72.         moveq   #1,d0
  73.         move.l    a6,a0
  74.         bsr     mod_player+28       ;ein
  75.     bsr    .setints
  76.     rts
  77.  
  78. .reloziere    move.l  2(a0),d0        ;Relozieren
  79.                 add.l   6(a0),d0
  80.                 add.l   14(a0),d0
  81.                 adda.l  #$1c,a0
  82.                 move.l  a0,d1
  83.                 movea.l a0,a1
  84.                 movea.l a1,a2
  85.                 adda.l  d0,a1
  86.                 move.l  (a1)+,d0
  87.                 adda.l  d0,a2
  88.                 add.l   d1,(a2)
  89.                 clr.l   d0
  90. .L000A        move.b  (a1)+,d0
  91.                 beq     .L000C
  92.                 cmp.b   #1,d0
  93.                 beq     .L000B
  94.                 adda.l  d0,a2
  95.                 add.l   d1,(a2)
  96.                 bra     .L000A
  97. .L000B        adda.l  #$fe,a2
  98.                 bra     .L000A
  99. .L000C        rts
  100.  
  101. .setints    lea     SaveArea,a0
  102.                 move.l  timer_int.w,(a0)+
  103.                 move.b  tbcr.w,(a0)+
  104.                 move.b  tbdr.w,(a0)+
  105.                 move.b  #246,tbdr.w
  106.                 move.b  #7,tbcr.w
  107.                 move.l  #.timer_b,timer_int.w
  108.                 bset    #0,imra.w
  109.                 bset    #0,iera.w
  110.         bclr    #3,$fffffa17.w
  111.                 rts
  112.  
  113. .timer_b:
  114.         IFD    TEST
  115.         neg    $ffff8240.w
  116.         ENDC
  117.             movem.l d0-a6,-(sp)
  118.                 bsr     mod_player+28+8
  119.                 movem.l (sp)+,d0-a6
  120. ;                bclr    #0,$fffffa0f.w
  121.         IFD    TEST
  122.         neg    $ffff8240.w
  123.         ENDC
  124.                 rte
  125.  
  126. musoff    bsr    .retints
  127.         bsr     mod_player+28+4     ;aus
  128.     rts
  129.  
  130. .retints    bclr    #0,iera.w
  131.                 bclr    #0,imra.w
  132.         bset    #3,$fffffa17.w
  133.                 lea     SaveArea,a0
  134.                 move.l  (a0)+,timer_int.w
  135.                 move.b  (a0)+,tbcr.w
  136.                 move.b  (a0)+,tbdr.w
  137.                 rts
  138.  
  139. SaveArea:       ds.b 6
  140.  
  141. mod_player    incbin    a:\sound\dsp_mod.bsw
  142.  
  143.     IFD    TEST
  144. module    incbin    adrenal2a.mod
  145.     ENDC