8 include exec
/execbase
.i
10 include libraries
/ahi_sub
.i
11 include utility
/hooks
.i
13 include lvo
/exec_lib
.i
17 XDEF _intAHIsub_Disable
18 XDEF _intAHIsub_Enable
19 XDEF _intAHIsub_SetVol
20 XDEF _intAHIsub_SetFreq
21 XDEF _intAHIsub_SetSound
22 XDEF _intAHIsub_SetEffect
23 XDEF _intAHIsub_LoadSound
24 XDEF _intAHIsub_UnloadSound
26 XDEF _InstallUglyInterruptHack
27 XDEF _UninstallUglyInterruptHack
33 XDEF _PlayAndRecordIntMono
36 XDEF _PlayAndRecordIntStereo
42 AURAL EQU $a20000
; Left DA
/AD
43 AURAR EQU $a20002
; Right DA
/AD
45 *******************************************************************************
48 * a2 struct AHI_AudioCtrl
57 * a2 struct AHI_AudioCtrl
70 _intAHIsub_UnloadSound
:
71 moveq #AHIS_UNKNOWN
,d0
75 *******************************************************************************
78 * a1 Interrupt code to install
80 _InstallUglyInterruptHack
:
89 lea a_IntLocalData
(a2
),a0
99 move
.w AttnFlags
(a6
),d0
105 tst
.l a_OldLevel6Int
(a2
)
107 move
.l $
78(a0
),a_OldLevel6Int
(a2
)
111 call CacheClearU
; Flush
all caches
117 _UninstallUglyInterruptHack
:
119 tst
.l a_OldLevel6Int
(a2
)
123 move
.w AttnFlags
(a6
),d0
129 move
.l a_OldLevel6Int
(a2
),$
78(a0
)
142 ; These functions are optimized
for speed
, not compability
.
145 move
.w #INTF_EXTER
,CUSTOM
+INTREQ
;Clear interrupt flag
146 tst
.b CIAB
+ciaicr
;Clear
151 move
.w #INTF_EXTER
,CUSTOM
+INTREQ
;Clear interrupt flag
152 tst
.b CIAB
+ciaicr
;Clear
154 move
.l #$C0DECAFE
,a0
;Modified by InstallUglyInterruptHack
()
155 move
.l
(a0
),a1
;MixBufferPtr
158 move
.l a1
,(a0
)+ ;Update pointer
164 * Our mixing buffer
is now empty
, switch to the
new one
and Cause
()
169 move
.l #$ABADC0DE
,a0
;Modified by InstallUglyInterruptHack
()
170 move
.l a_MixBuffer2
(a0
),a1
171 move
.l a_MixBuffer1
(a0
),a_MixBuffer2
(a0
)
172 move
.l a1
,a_MixBuffer1
(a0
)
173 move
.l a1
,a_MixBufferPtr
(a0
)
175 move
.l a_SoftInt
(a0
),a1
182 _PlayAndRecordIntMono
:
185 _PlayAndRecordIntStereo
:
187 move
.w #INTF_EXTER
,CUSTOM
+INTREQ
;Clear interrupt flag
188 * btst #CIAICRB_TA
,CIAB
+ciaicr
;Check
if Timer A
is the source
, clear
190 tst
.b CIAB
+ciaicr
;Clear
192 move
.w $dff006
,$dff180
197 move
.w $dff006
,$dff182