home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 113 / EnigmaAmiga113CD.iso / software / sviluppo / glquake_src / snd_int68k.s < prev    next >
Encoding:
Text File  |  2000-01-30  |  1.7 KB  |  79 lines

  1. *
  2. * Copyright (C) 1996-1997 Id Software, Inc.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation; either version 2
  7. * of the License, or (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12. *
  13. * See the GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  18. *
  19.  
  20. **
  21. ** Audio Interrupt routine
  22. **
  23. ** used for M68k as well as for PowerPC
  24. ** written by Frank Wille <frank@phoenix.owl.de>
  25. **
  26.  
  27.   incdir  "StormC:ASM-Include/"
  28.  
  29.     include    "devices/timer.i"
  30.     include "hardware/custom.i"
  31.     include    "hardware/intbits.i"
  32.  
  33. CUSTOM        equ    $dff000
  34. GetSysTime    equ    -66
  35.  
  36. ; a1 = IntData
  37. ; Offset 0:    *TimerBase
  38. ; Offset 4:    *FirstTime2
  39. ; Offset 8:    *aud_start_time
  40.  
  41.  
  42.     code
  43.  
  44.     xdef    _AudioIntCode
  45.     xdef    AudioIntCode
  46. _AudioIntCode:
  47. AudioIntCode:
  48.     movem.l    a4-a6,-(sp)
  49.     fsave   -(sp)
  50.     fmovem.x fp0-fp2,-(sp)
  51.     move.w    CUSTOM+intreqr,d0
  52.     and.w    #INTF_AUD0|INTF_AUD1|INTF_AUD2|INTF_AUD3,d0
  53.     move.w    d0,CUSTOM+intreq
  54.     move.l    a1,a5
  55.     move.l    (a5)+,a6        ; TimerBase
  56.     lea    TVstruct(pc),a0
  57.     jsr    GetSysTime(a6)
  58.     move.l    (a5)+,a1
  59.     move.l    TV_SECS(a0),d0
  60.     sub.l    (a1),d0            ; - FirstTime2
  61.     fmove.l    d0,fp0
  62.     move.l    TV_MICRO(a0),d1
  63.     fmove.l    d1,fp1
  64.     fmove.l    #1000000,fp2
  65.     fdiv    fp2,fp1
  66.     move.l    (a5),a0
  67.     fadd    fp1,fp0
  68.     fmove.d    fp0,(a0)
  69.     fmovem.x (sp)+,fp0-fp2
  70.     frestore (sp)+
  71.     movem.l    (sp)+,a4-a6
  72.     moveq    #0,d0
  73.     rts
  74.  
  75.  
  76.     cnop    0,8
  77. TVstruct:
  78.     dcb.b    TV_SIZE,0
  79.