home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 28 / amigaformatcd28.iso / +system+ / tools / sound / eagleplayer2.00 / developer / examples / noiseconverters / examples.s next >
Text File  |  1998-02-26  |  3KB  |  118 lines

  1. *-----------------------------------------------------------------------------*
  2. *            Noiseconverter V1.0                      *
  3. *-----------------------------------------------------------------------------*
  4.             incdir    include:
  5.             include    misc/eagleplayerconverter.i
  6.             include    exec/exec_lib.i
  7.             
  8.     CONVERTERHEADER    TAGS
  9.  
  10.     dc.b    "Noiseconverter-Example V1.0",10
  11.     dc.b    "done by Eagleeye/DFT 28.02.97",0
  12.     even
  13.  
  14. Tags:        dc.l    CV_Convertername,Convertername
  15.         dc.l    CV_Convert,Convert
  16.         dc.l    CV_RequestConverter,1
  17.         dc.l    CV_Version,1<<16!0
  18.         dc.l    CV_Next,EXAM2
  19.         dc.l    0
  20.  
  21.  
  22. Convertername:    dc.b    "Example",0
  23. Formatname:    dc.b    "Noissi",0
  24.         even
  25.  
  26. *-----------------------------------------------------------------------------*
  27. * Input: a0=Adr der Datei
  28. *     d0=Size der Datei
  29. * Output:d0=ConvertSize oder NULL
  30. *     d1=Flags
  31. *     d2=Memsize
  32. *     a0=ConvertAdr
  33. *     a1=Formatname
  34. *     a2=SamplePtr (für Protrackerclones) oder NULL
  35. Convert:    move.l    a0,a3
  36.         cmp.l    #"EXAM",$438(a3)
  37.         bne.s    .Error
  38.         move.l    d0,d4
  39.         move.l    #$10001,d1
  40.         add.l    #SecurityMem,d0            ;Memdrauf muss sein!!!
  41.         move.l    4,a6
  42.         jsr    _LVOAllocMem(a6)
  43.         tst.l    d0
  44.         beq.s    .Error
  45.         move.l    d0,a4
  46.         move.l    d0,a1
  47.         move.l    d4,d1
  48. .CopyIt:    move.b    (a3)+,(a1)+
  49.         subq.l    #1,d1
  50.         bne.s    .CopyIt
  51.         move.l    a4,a0
  52.         move.l    #"M.K.",$438(a4)
  53.         move.l    d4,d0
  54.         move.l    d4,d2
  55.         add.l    #SecurityMem,d2
  56.         moveq    #0,d1
  57.         sub.l    a2,a2
  58.         lea    Formatname(pc),a1
  59.         tst.l    d0
  60.         rts
  61.  
  62. .Error:        moveq    #0,d0
  63.         rts
  64.  
  65. *-----------------------------------------------------------------------------*
  66. *-----------------------------------------------------------------------------*
  67. *-----------------------------------------------------------------------------*
  68. Exam2:        dc.l    CV_Convertername,Convertername2
  69.         dc.l    CV_Convert,Convert2
  70.         dc.l    CV_RequestConverter,1
  71.         dc.l    CV_Version,1<<16!1
  72.         dc.l    0
  73.  
  74.  
  75. Convertername2:    dc.b    "Example2",0
  76. Formatname2:    dc.b    "Noissi2",0
  77.         even
  78.  
  79.  
  80. *-----------------------------------------------------------------------------*
  81. * Input: a0=Adr der Datei
  82. *     d0=Size der Datei
  83. * Output:d0=ConvertSize oder NULL
  84. *     d1=Flags
  85. *     d2=Memsize
  86. *     a0=ConvertAdr
  87. *     a1=Formatname
  88. *     a2=SamplePtr (für Protrackerclones) oder NULL
  89. Convert2:    move.l    a0,a3
  90.         cmp.l    #"EXA2",$438(a3)
  91.         bne.s    .Error
  92.         move.l    d0,d4
  93.         move.l    #$10001,d1
  94.         add.l    #SecurityMem,d0            ;Memdrauf muss sein!!!
  95.         move.l    4,a6
  96.         jsr    _LVOAllocMem(a6)
  97.         tst.l    d0
  98.         beq.s    .Error
  99.         move.l    d0,a4
  100.         move.l    d0,a1
  101.         move.l    d4,d1
  102. .CopyIt:    move.b    (a3)+,(a1)+
  103.         subq.l    #1,d1
  104.         bne.s    .CopyIt
  105.         move.l    a4,a0
  106.         move.l    #"M.K.",$438(a4)
  107.         move.l    d4,d0
  108.         move.l    d4,d2
  109.         add.l    #SecurityMem,d2
  110.         moveq    #0,d1
  111.         sub.l    a2,a2
  112.         lea    Formatname2(pc),a1
  113.         tst.l    d0
  114.         rts
  115.  
  116. .Error:        moveq    #0,d0
  117.         rts
  118.