/
SDL_mintaudio_it.S
125 lines (98 loc) · 2.82 KB
1
2
/*
SDL - Simple DirectMedia Layer
3
Copyright (C) 1997-2012 Sam Lantinga
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Sam Lantinga
slouken@libsdl.org
*/
/*
Audio interrupts
26
Patrice Mandin, Didier Méquignon
27
28
29
30
*/
.text
31
32
.globl _SDL_MintAudio_XbiosInterruptMeasureClock
.globl _SDL_MintAudio_clocktics
33
34
35
36
37
.globl _SDL_MintAudio_XbiosInterrupt
.globl _SDL_MintAudio_Dma8Interrupt
.globl _SDL_MintAudio_StfaInterrupt
38
.globl _SDL_MintAudio_num_its
39
40
41
42
/*--- Xbios interrupt vector to measure Falcon external clock ---*/
_SDL_MintAudio_XbiosInterruptMeasureClock: /* 1 mS */
43
44
/* state DMA sound */
45
46
47
48
#if defined(__mcoldfire__)
movel d0,sp@-
moveql #0,d0
49
btst d0,0xFFFF8901:w
50
#else
51
btst #0,0xFFFF8901:w
52
#endif
53
54
55
beqs SDL_MintAudio_EndIntMeasure
addql #1,_SDL_MintAudio_clocktics
SDL_MintAudio_EndIntMeasure:
56
57
/* Clear service bit */
58
59
#if defined(__mcoldfire__)
moveql #5,d0
60
bclr d0,0xFFFFFA0F:w
61
62
63
movel sp@+,d0
#else
64
bclr #5,0xFFFFFA0F:w
65
#endif
66
67
rte
68
69
70
/*--- Interrupt vectors ---*/
/* Xbios, DMA 8 bits: need to set ISR on MFP */
/* STFA: do not touch MFP */
71
72
73
_SDL_MintAudio_XbiosInterrupt:
_SDL_MintAudio_Dma8Interrupt:
74
75
76
77
78
79
#if defined(__mcoldfire__)
lea sp@(-12),sp
moveml d0-d1/a0,sp@
#else
moveml d0-d1/a0,sp@-
#endif
80
81
/* Clear service bit, so other MFP interrupts can work */
82
83
84
85
#if defined(__mcoldfire__)
moveql #5,d0
bclr d0,0xfffffa0f:w
#else
86
bclr #5,0xfffffa0f:w
87
#endif
88
89
_SDL_MintAudio_StfaInterrupt:
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
move.l _SDL_MintAudio_num_its,d0
addql #1,d0
move.l d0,_SDL_MintAudio_num_its
cmp.l #5,d0
bmi.s _SDL_MintAudio_nosilence
move.l _SDL_MintAudio_itbuffer,d1
beq.s _SDL_MintAudio_nosilence
move.l d1,a0
move.l _SDL_MintAudio_itbuflen,d0
move.l _SDL_MintAudio_itsilence,d1
_SDL_MintAudio_fillsilence:
move.l d1,a0@+
subq.l #1,d0
bpl.s _SDL_MintAudio_fillsilence
_SDL_MintAudio_nosilence:
#if defined(__mcoldfire__)
moveml sp@,d0-d1/a0
lea sp@(12),sp
#else
moveml sp@+,d0-d1/a0
#endif
115
rte
116
117
.bss
118
119
120
121
.even
.comm _SDL_MintAudio_clocktics,4
.comm _SDL_MintAudio_num_its,4
122
123
124
125
.comm _SDL_MintAudio_itbuffer,4 /* Audio DMA buffer */
.comm _SDL_MintAudio_itbuflen,4 /* Length in longword */
.comm _SDL_MintAudio_itsilence,4 /* Silence value */