home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 113 / EnigmaAmiga113CD.iso / software / sviluppo / quake_src / snd_int68klc.s < prev    next >
Text File  |  2000-06-17  |  2KB  |  87 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 PPC systems with a LC040 or LC060 CPU
  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. IEEEDPFlt    equ    -36
  28. IEEEDPAdd    equ    -66
  29. IEEEDPDiv    equ    -84
  30.  
  31.  
  32. ; a1 = IntData
  33. ; Offset 0:    *TimerBase
  34. ; Offset 4:    *FirstTime2
  35. ; Offset 8:    *aud_start_time
  36. ; Offset 12:    *MathIeeeDoubBasBase
  37.  
  38.  
  39.     code
  40.  
  41.     xdef    _AudioIntCodeNoFPU
  42.     xdef    AudioIntCodeNoFPU
  43. _AudioIntCodeNoFPU:
  44. AudioIntCodeNoFPU:
  45.     movem.l    d2-d5/a4-a6,-(sp)
  46.     move.w    CUSTOM+intreqr,d0
  47.     and.w    #INTF_AUD0|INTF_AUD1|INTF_AUD2|INTF_AUD3,d0
  48.     move.w    d0,CUSTOM+intreq
  49.     move.l    a1,a5
  50.     move.l    (a5)+,a6        ; TimerBase
  51.     lea    TVstruct(pc),a0
  52.     move.l    a0,a4
  53.     jsr    GetSysTime(a6)
  54.     move.l    (a5)+,a1
  55.     move.l    TV_SECS(a4),d0
  56.     sub.l    (a1),d0            ; - FirstTime2
  57.     move.l    (a5)+,a0
  58.     move.l    (a5),a6            ; MathIeeeDoubBasBase
  59.     move.l    a0,a5            ; *aud_start_time
  60.     jsr    IEEEDPFlt(a6)
  61.     move.l    d0,d4
  62.     move.l    d1,d5
  63.     move.l    TV_MICRO(a4),d0
  64.     jsr    IEEEDPFlt(a6)
  65.     movem.l    double1M(pc),d2-d3
  66.     jsr    IEEEDPDiv(a6)        ; TV_MICRO / 1000000.0
  67.     move.l    d4,d2
  68.     move.l    d5,d3
  69.     jsr    IEEEDPAdd(a6)        ; + TV_SECS
  70.     movem.l    d0-d1,(a5)        ; -> *aud_start_time
  71.     movem.l    (sp)+,d2-d5/a4-a6
  72.     moveq    #0,d0
  73.     rts
  74.  
  75.  
  76.     cnop    0,8
  77. double1M:
  78.     dc.l    $412e8480,$00000000    ; 1000000.0
  79. TVstruct:
  80.     dcb.b    TV_SIZE,0
  81.