home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 28 / amigaformatcd28.iso / +system+ / tools / sound / eagleplayer2.00 / developer / examples / noiseconverters / kurt.s < prev   
Text File  |  1998-02-26  |  2KB  |  101 lines

  1. *-----------------------------------------------------------------------------*
  2. *            Noiseconverter V1.0                      *
  3. *                Kurt                          *
  4. *-----------------------------------------------------------------------------*
  5.             incdir    include:
  6.             include    misc/eagleplayerconverter.i
  7.             include    exec/exec_lib.i
  8.             
  9.     CONVERTERHEADER    TAGS
  10.  
  11.     dc.b    "Noiseconverter-Kurt V1.0",10
  12.     dc.b    "done by Eagleeye/DFT 28.02.97",0
  13.     even
  14.  
  15. Tags:        dc.l    CV_Convertername,Convertername
  16.         dc.l    CV_Convert,Convert
  17.         dc.l    CV_RequestConverter,1
  18.         dc.l    CV_Version,1<<16!0
  19.         dc.l    CV_Creator,Creator
  20.         dc.l    0
  21.  
  22.  
  23. Creator:    dc.b    "???, adapted by DEFECT",0
  24. Convertername:    dc.b    "Kurt",0
  25.         even
  26.  
  27. *-----------------------------------------------------------------------------*
  28. * Input: a0=Adr der Datei
  29. *     d0=Size der Datei
  30. * Output:d0=ConvertSize oder NULL
  31. *     d1=Flags
  32. *     d2=Memsize or NULL
  33. *     a0=ConvertAdr
  34. *     a1=Formatname
  35. *     a2=SamplePtr (für Protrackerclones) oder NULL
  36. Convert:    move.l    a0,a4
  37.         cmp.l    #"KURT",$438(a0)
  38.         bne.s    .Error
  39.         move.l    #"M.K.",$438(a0)
  40.         move.l    d0,d5
  41.  
  42.         bsr.w    BerechPattern
  43.         move.l    d0,d6
  44.  
  45.         move.l    #1024/4,d4        ;are Longwords)
  46.         mulu    d6,d4
  47.         subq.l    #1,d4
  48.         lea    $43c(a4),a1
  49.         lea    Temp(pc),a2
  50.         lea    My_Periods(pc),a3
  51. .Prun_Change:    move.l    (a1),(a2)
  52.         move.b    (a2),d2            ;Samplenummer
  53.         moveq    #0,d3
  54.         move.b    1(a2),d3        ;Nummer des Period-Wertes
  55.         add.w    d3,d3            ;da Worte
  56.         move.w    (a3,d3.w),d3        ;Periode holen
  57.         move.w    d3,(a2)            ;sichern
  58.         move.b    d2,d3
  59.         and.b    #$f0,d2
  60.         or.b    d2,(a2)
  61.         lsl.b    #4,d3
  62.         and.b    #$f0,d3
  63.         or.b    d3,2(a2)
  64.         move.l    (a2),(a1)+
  65.         dbf    d4,.Prun_Change
  66.  
  67.         move.l    a4,a0
  68.         move.l    d5,d0
  69.         moveq    #0,d1
  70.         sub.l    a2,a2
  71.         lea    Convertername(pc),a1
  72.         moveq    #0,d2                ;kein neuer Mem
  73.         tst.l    d0
  74.         rts
  75.  
  76. .Error:        moveq    #0,d0
  77.         rts
  78.  
  79. Temp:        dc.l    0
  80. *-----------------------------------------------------------------------------*
  81. BerechPattern:    movem.l    d1-a6,-(a7)
  82. BerechPattern3:    lea    $3B8(a0),a1        ;Patternnummern
  83.         moveq    #$7F,d2
  84.         moveq    #0,d0
  85. .NR_Check2:
  86.         cmp.b    (A1)+,d0
  87.         bge.s    .hi
  88.         move.b    -1(a1),d0
  89. .hi        dbf    d2,.NR_Check2
  90.         addq.w    #1,d0
  91.         movem.l    (a7)+,d1-a6
  92.         rts
  93.  
  94. My_Periods:
  95. Pro_Myperiods    dc.w    0
  96. ProPC_Periods
  97.     dc.w    856,808,762,720,678,640,604,570,538,508,480,453
  98.     dc.w    428,404,381,360,339,320,302,285,269,254,240,226
  99.     dc.w    214,202,190,180,170,160,151,143,135,127,120,113
  100.     dc.w    $6b,$5f,$55,$50,$47,$477,$2fb,$23b,$11e,0
  101.