home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Sound / Tracker / OKTALYZER1.57.DMS / in.adf / sources / example1.s < prev    next >
Encoding:
Text File  |  1993-08-01  |  2.3 KB  |  115 lines

  1. ; link 
  2. ; This is only for my Rexx® Macro
  3. *************************************************************************
  4. *                                    *
  5. *              Oktalyzer PlayRoutine 1 Example            *
  6. *                                    *
  7. *************************************************************************
  8.  
  9.         oldsyntax
  10.  
  11. ; All Coding by A.Sander
  12.  
  13. ; Warning: No Audio Channels will be allocated. Any other Audio access 
  14. ; could be dangerous!
  15.  
  16. ; In case of any implementation Problems call Germany 08106/5729 (after 6 p.m.).
  17.  
  18. ; xLINK example1.o okplay1.o to example1
  19.  
  20.         xref    OK_Init
  21.         xref    OK_Play
  22.         xref    OK_Stop
  23.  
  24. ; Definition of External Buffers ----------------------------------------
  25.  
  26.         rsreset
  27. P1_Routines:    rs.b    $a81c            ;   Constant !
  28. P1_Pointers:    rs.l    36
  29. P1_Lengths:    rs.w    36
  30. P1_Len:        rs.b    0
  31.  
  32.         section    c,code
  33.  
  34. Play1:        lea    Music,a0        ;   Init
  35.         lea    Play1RoutBuff,a1
  36.         jsr    OK_Init
  37.  
  38.         move.l    (4).w,a6        ;   Get ExecBase
  39.  
  40.         sub.l    a1,a1
  41.         jsr    -294(a6)        ;   (FindTask)
  42.         move.l    d0,MyTask
  43.  
  44.         moveq    #-1,d0
  45.         jsr    -330(a6)        ;   (AllocSignal)
  46.         move.w    d0,SigBit
  47.         moveq    #0,d1
  48.         bset    d0,d1
  49.         move.l    d1,SigMask
  50.  
  51.         moveq    #5,d0        ;   Add a vertical blank int
  52.         lea    VBIInt(pc),a1
  53.         move.l    #VBICode,18(a1)
  54.         jsr    -168(a6)    ;   (AddIntServer)
  55.  
  56.         move.l    SigMask(pc),d0    ;   Wait for Signal
  57.         jsr    -318(a6)    ;   (Wait)
  58.  
  59.         lea    VBIInt(pc),a1
  60.         moveq    #5,d0
  61.         jsr    -174(a6)    ;   (RemIntServer)
  62.  
  63.         move.w    SigBit(pc),d0
  64.         jsr    -336(a6)    ;   (FreeSignal)
  65.  
  66.         jsr    OK_Stop
  67.  
  68.         moveq    #0,d0        ;==>Return Code OK
  69.         rts
  70.  
  71. ; Data ------------------------------------------------------------------
  72.  
  73. SigBit:        ds.w    1
  74. SigMask:    ds.l    1
  75. MyTask:        ds.l    1
  76.  
  77. ; My vertical Blank Interrupt Structure ---------------------------------
  78.  
  79. VBIInt:        ds.l    2
  80.         dc.b    2,127            ;   Should be at begin of List
  81.         ds.l    3
  82.  
  83. ; My vertical Blank Interrupt -------------------------------------------
  84.  
  85. VBICode:    movem.l    d0-d7/a0-a6,-(sp)    ;   Save All
  86.  
  87.         jsr    OK_Play
  88.  
  89.         btst    #6,$bfe001
  90.         bne.s    .cont
  91.         btst    #2,$dff016
  92.         bne.s    .cont
  93.  
  94.         move.l    MyTask(pc),a1
  95.         move.l    SigMask(pc),d0
  96.         move.l    (4).w,a6        ;   Get ExecBase
  97.         jsr    -324(a6)        ;   (Signal)
  98.  
  99. .cont:        movem.l    (sp)+,d0-d7/a0-a6
  100.         lea    $dff000,a0        ;--> Shitty GFXBASE BUG!
  101.         moveq    #0,d0
  102.         rts
  103.  
  104. ; Routine-Buffer for PlayRout 1 - (build up in OK_Init) -----------------
  105.  
  106.         section    b,bss
  107.  
  108. Play1RoutBuff:    ds.b    P1_Len
  109.  
  110.         section    dc,data,chip    ;   data_c in Devpac
  111.  
  112. Music:        incbin    OKTALYZER:OK-SONGS/tar-demo-song1
  113.  
  114.         end
  115.