home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 113 / EnigmaAmiga113CD.iso / software / sviluppo / quake_src / snd_int68k.s < prev    next >
Text File  |  2000-06-17  |  2KB  |  77 lines

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