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