1 ; Modified to compile
with snma
2 ; compile
: snma wavetools_audio
.s OBJ AHI
/wavetools
.audio
3 ; (have snma create executables
)
16 include macros
.i
; general macros
21 include utility
/utility
.i
22 include utility
/hooks
.i
24 ; Library Vector Offsets
25 include lvo
/exec_lib
.i
27 include lvo
/utility_lib
.i
30 include libraries
/ahi_sub
.i
31 include devices
/dad_audio
.i
32 include lvo
/ahi_sub_lib
.i
35 STRUCTURE wtBase
,LIB_SIZE
45 ; * wavetools
(private) ahiac_DriverData points to this structure
.
50 BYTE wt_RecMasterSignal
52 BYTE wt_RecSlaveSignal
68 LONG wt_InputVolume
; through put volume?
69 LONG wt_OutputVolume
; replay volume
80 FPTR wt_PlayerEntry
;wt_PlayerHook
->h_Entry
86 FPTR wt_MixEntry
;wt_MixHook
->h_Entry
88 APTR wt_DMAbuffer
;current buffer
89 APTR wt_DMAlength
;length
91 LABEL wavetools_SIZEOF
103 dc
.b
"wavetools 2.11"
124 DC
.B VERSION
;version
131 LibName
: dc
.b
"wavetools.audio",0
134 utilName
: UTILITYNAME
150 dc
.l AHIsub_AllocAudio
151 dc
.l AHIsub_FreeAudio
160 dc
.l AHIsub_SetEffect
161 dc
.l AHIsub_LoadSound
162 dc
.l AHIsub_UnloadSound
164 dc
.l AHIsub_HardwareControl
168 INITBYTE LN_TYPE
,NT_LIBRARY
169 INITLONG LN_NAME
,LibName
170 INITBYTE LIB_FLAGS
,LIBF_SUMUSED
!LIBF_CHANGED
171 INITWORD LIB_VERSION
,VERSION
172 INITWORD LIB_REVISION
,REVISION
173 INITLONG LIB_IDSTRING
,IDString
177 ;movem
.l d1
/a0
/a1
/a5
/a6
,-(sp
)
180 move
.l a6
,wtb_SysLib
(a5
)
181 move
.l a0
,wtb_SegList
(a5
)
185 move
.l d0
,wtb_DosLib
(a5
)
187 ALERT AG_OpenLib
!AO_DOSLib
194 move
.l d0
,wtb_UtilLib
(a5
)
196 ALERT AG_OpenLib
!AO_UtilityLib
202 ;movem
.l
(sp
)+,d1
/a0
/a1
/a5
/a6
207 addq
.w #
1,LIB_OPENCNT
(a6
)
208 bclr
.b #LIBB_DELEXP
,wtb_Flags
(a6
)
214 subq
.w #
1,LIB_OPENCNT
(a6
)
216 btst
.b #LIBB_DELEXP
,wtb_Flags
(a6
)
223 ;movem
.l d1
/d2
/a0
/a1
/a5
/a6
,-(sp
)
224 mpush d1
/d2
/a0
/a1
/a5
/a6
226 move
.l wtb_SysLib
(a5
),a6
227 tst
.w LIB_OPENCNT
(a5
)
229 bset
.b #LIBB_DELEXP
,wtb_Flags
(a5
)
233 move
.l wtb_DosLib
(a5
),a1
235 move
.l wtb_UtilLib
(a5
),a1
238 move
.l wtb_SegList
(a5
),d2
244 move
.w LIB_NEGSIZE
(a5
),d0
246 add
.w LIB_POSSIZE
(a5
),d0
250 ;movem
.l
(sp
)+,d1
/d2
/a0
/a1
/a5
/a6
252 mpop d1
/d2
/a0
/a1
/a5
/a6
259 ;* result
= AHIsub_AllocAudio
( tagList
, AudioCtrl
);
265 move
.l wtb_SysLib
(a5
),a6
267 move
.l #wavetools_SIZEOF
,d0
268 move
.l #MEMF_PUBLIC|MEMF_CLEAR
,d1
270 move
.l d0
,ahiac_DriverData
(a2
)
271 beq
.w
.error_nowavetools
274 ;* try allocate dad_audio
.device
301 bne
.w
.error_nodevice
303 move
.l #
-1,wt_daddev
(a3
)
304 move
.b #
-1,wt_MasterSignal
(a3
)
305 move
.b #
-1,wt_SlaveSignal
(a3
)
306 move
.l a2
,wt_AudioCtrlP
(a3
) ;player Hook
307 move
.l a2
,wt_AudioCtrlM
(a3
) ;mixer Hook
309 ;* find closest frequency
310 move
.l ahiac_MixFreq
(a2
),d0
312 move
.l d0
,ahiac_MixFreq
(a2
) ;store actual freq
315 move
.l #MEMF_PUBLIC
!MEMF_CLEAR
,d1
317 move
.l d0
,wt_SoftInt
(a3
)
318 beq
.b
.error_nointmem
321 move
.b #NT_INTERRUPT
,LN_TYPE
(a0
)
323 move
.l a1
,LN_NAME
(a0
)
324 lea SoftInt_Dummy
(pc
),a1
325 move
.l a1
,IS_CODE
(a0
)
326 lea wt_SoftIntData
(a3
),a1
327 move
.l a1
,IS_DATA
(a0
)
329 ;* Set default output volume
330 move
.l #$
10000,wt_OutputVolume
(a3
)
332 moveq #AHISF_CANRECORD|AHISF_KNOWSTEREO|AHISF_MIXING|AHISF_TIMING
,d0
340 moveq #AHISF_ERROR
,d0
379 ;* AHIsub_FreeAudio
( AudioCtrl
);
386 move
.l wtb_SysLib
(a5
),a6
388 move
.l ahiac_DriverData
(a2
),d0
392 move
.l wt_SoftInt
(a3
),a1
396 move
.l ahiac_DriverData
(a2
),a1
397 clr
.l ahiac_DriverData
(a2
)
406 ;* AHIsub_Disable
( AudioCtrl
);
412 move
.l wtb_SysLib
(a5
),a6
413 call Forbid
; Lame
, but it works
.
417 ;* AHIsub_Enable
( AudioCtrl
);
423 move
.l wtb_SysLib
(a5
),a6
424 call Permit
; Lame
, but it works
.
428 ;* error
= AHIsub_Start
( Flags
, AudioCtrl
);
435 move
.l wtb_SysLib
(a5
),a6
436 move
.l ahiac_DriverData
(a2
),a3
445 call AHIsub_Update
;fill variables
448 move
.l ahiac_BuffSize
(a2
),d0
449 move
.l #MEMF_PUBLIC|MEMF_CLEAR
,d1
451 move
.l d0
,wt_Mixbuffer
(a3
)
452 beq
.b
.error_nomixmem
454 move
.l ahiac_MaxBuffSamples
(a2
),d0
455 lsl
.l #
2,d0
;16bit
+Stereo
457 move
.l #MEMF_24BITDMA
!MEMF_PUBLIC|MEMF_CLEAR
,d1
459 move
.l d0
,wt_DMAbuffer1
(a3
)
460 beq
.b
.error_nodmamem
463 move
.l #MEMF_24BITDMA
!MEMF_PUBLIC|MEMF_CLEAR
,d1
465 move
.l d0
,wt_DMAbuffer2
(a3
)
466 beq
.b
.error_nodmamem
473 btst #AHISB_RECORD
,d7
478 moveq #AHISF_PLAY|AHISF_RECORD
,d0
499 ;* create audio playback process
502 move
.b d0
,wt_MasterSignal
(a3
)
504 beq
.w
.error_nosignal
507 move
.l d0
,wt_MasterTask
(a3
)
509 ;* This
is just a trick to make it possible to send the slave an argument
.
511 move
.l #MEMF_PUBLIC|MEMF_CLEAR
,d1
514 beq
.b
.error_noaudioproc
524 move
.l a2
,.audioctrl
(a1
)
525 lea
.codestart
(a1
),a0
528 move
.l wt_SoftInt
(a3
),a0
529 move
.l ahiac_Flags
(a2
),d0
530 and.l #AHIACF_STEREO
,d0
532 move
.l #SoftInt_Stereo
,IS_CODE
(a0
)
535 move
.l #SoftInt_Mono
,IS_CODE
(a0
)
542 move
.l wtb_DosLib
(a5
),a6
545 move
.l d0
,wt_SlaveTask
(a3
)
546 beq
.b
.error_noaudioproc
548 ; Wait
for slave to allocate
and store a signal
(or die
if error
).
549 move
.l wtb_SysLib
(a5
),a6
551 move
.b wt_MasterSignal
(a3
),d1
570 .codestart EQU
*-.kicker
571 lea
.kicker
(pc
),a1
;a1 points to allocated kicker
572 .audioctrl EQU
*+2-.kicker
573 ;lea Dummy
,a2
;a2 points to current AudioCtrl structure
574 dc
.w $
45F9
; ADDED
: opcode
(LEA xxx
,a2
)
576 ;jmp audioproc_play
; ADDED
: (PC
) on lea Dummy
... and jmp audio
...
577 dc
.w $
4EF9
; ADDED
: opcode
(jmp
)
578 dc
.l audioproc_play
; absolute
582 ;* create audio
record process
585 move
.b d0
,wt_RecMasterSignal
(a3
)
587 beq
.b
.error_nosignal
590 move
.l d0
,wt_RecMasterTask
(a3
)
592 ;* This
is just a trick to make it possible to send the slave an argument
.
594 move
.l #MEMF_PUBLIC|MEMF_CLEAR
,d1
597 beq
.b
.error_noaudioproc
607 move
.l a2
,.audioctrl
(a1
)
608 lea
.codestart
(a1
),a0
615 move
.l wtb_DosLib
(a5
),a6
618 move
.l d0
,wt_RecSlaveTask
(a3
)
619 beq
.b
.error_noaudioproc
621 ; Wait
for slave to allocate
and store a signal
(or die
if error
).
622 move
.l wtb_SysLib
(a5
),a6
624 move
.b wt_RecMasterSignal
(a3
),d1
644 .codestart EQU
*-.kicker
645 lea
.kicker
(pc
),a1
;a1 points to allocated kicker
646 .audioctrl EQU
*+2-.kicker
647 ;lea Dummy
(PC
),a2
;a2 points to current AudioCtrl structure
648 dc
.w $
45F9
; ADDED
: opcode
(LEA xx
,a2
)
650 dc
.w $
4EF9
; ADDED
: opcode
(jmp
)
651 dc
.l audioproc_record
; absolute
652 ;jmp audioproc_record
659 ;* AHIsub_Update
( flags
, audioctrl
);
665 call AHIsub_Disable
;make sure we don
't get an interrupt
666 ;while updating our local variables
667 move
.l ahiac_DriverData
(a2
),a3
669 move
.l ahiac_PlayerFunc
(a2
),a0
670 move
.l a0
,wt_PlayerHook
(a3
)
671 move
.l h_Entry
(a0
),wt_PlayerEntry
(a3
)
673 move
.l ahiac_BuffSamples
(a2
),d0
674 move
.l d0
,wt_LoopTimes
(a3
) ;See audioproc
.
676 move
.l d0
,wt_DMAlength
(a3
)
678 move
.l ahiac_MixerFunc
(a2
),a0
679 move
.l a0
,wt_MixHook
(a3
)
680 move
.l h_Entry
(a0
),wt_MixEntry
(a3
)
689 ;* AHIsub_Stop
(Flags
, AudioCtrl
);
696 move
.l wtb_SysLib
(a5
),a6
697 move
.l ahiac_DriverData
(a2
),a3
699 move
.l d0
,d7
;save flags
703 ; Signal slave to quit
704 move
.l wt_SlaveTask
(a3
),d0
708 move
.b wt_SlaveSignal
(a3
),d1
711 ; Wait
for slave to die
713 move
.b wt_MasterSignal
(a3
),d1
718 move
.b wt_MasterSignal
(a3
),d0
;-1 is ok
719 move
.b #
-1,wt_MasterSignal
(a3
)
722 move
.l wt_DMAbuffer1
(a3
),d0
726 clr
.l wt_DMAbuffer1
(a3
)
728 move
.l wt_DMAbuffer2
(a3
),d0
732 clr
.l wt_DMAbuffer2
(a3
)
734 move
.l wt_Mixbuffer
(a3
),d0
738 clr
.l wt_Mixbuffer
(a3
)
742 btst #AHISB_RECORD
,d7
745 ; Signal
record slave to quit
746 move
.l wt_RecSlaveTask
(a3
),d0
750 move
.b wt_RecSlaveSignal
(a3
),d1
753 ; Wait
for record slave to die
755 move
.b wt_RecMasterSignal
(a3
),d1
760 move
.b wt_RecMasterSignal
(a3
),d0
;-1 is ok
761 move
.b #
-1,wt_RecMasterSignal
(a3
)
775 moveq #AHIS_UNKNOWN
,d0
779 ;* d1 wt_OutputVolume
782 ;* d0 Wavetools outout damp value
784 ;* translate linear to wavetools output damp value
786 moveq #DADCONST_MAXDAMP
,d0
;DADCONST_MAXDAMP
787 lea
.volumelist
(pc
),a0
794 and.l #DADCONST_MAXDAMP
,d0
;just security
799 dc
.l
1,2,3,4,6,8,12,16,23,33,46,66,93,131,185,261,369,521,735,1039
800 dc
.l
1467,2072,2927,4135,5841,8250,11654,16462,23253,32846,46396
806 ; translate linear gain to wavetools gain
810 ; d0 Wavetools input Gain Value
812 ; moveq #
0,d0
; no gain
813 ; lea
.gainlist
(pc
),a0
816 ; bls
.b
.exit ; use the larger value
817 ; add
.l #
1,d0
; increase gain
820 ; and.l #DADCONST_MAXGAIN
,d0
;just security
822 ; Just made the database half size
825 dc
.l
1,3,8,16,33,66,131,261,521,1039
826 dc
.l
2072,4135,8250,16462,32846
832 ; translate linear gain to wavetools gain
836 ; d0 Wavetools input Gain Value
838 ; search list
for a value larger than the suggested value
839 ; start search
with lowest possible value
($
10000)
841 moveq #
0,d0
; start
with no gain
842 lea
.posboundaries
(pc
),a0
;
845 ble
.b
.exit ; use the larger
/equal value
846 add
.l #
1,d0
; increase gain
847 cmp
.l #
15,d0
; max value
is 15
848 bls
.b
.loop ; jump
if less than
15
850 and.l #DADCONST_MAXGAIN
,d0
;just security
853 ;From toccata drivern
15 Feb
1997, 16 values
855 dc
.l
65536,77889,92572,110022,130761,155410,184705,219522,260903
856 dc
.l
310084,368536,438005,520570,618699,735326,873936
860 ;* AHIsub_GetAttr
( attribute
, argument
, default
, taglist
, audioctrl
);
869 cmp
.l #AHIDB_Frequencies
,d0
874 cmp
.l #AHIDB_Frequency
,d0
882 cmp
.l #AHIDB_Index
,d0
895 cmp
.l #AHIDB_Author
,d0
901 cmp
.l #AHIDB_Copyright
,d0
903 lea
.copyright
(pc
),a0
907 cmp
.l #AHIDB_Version
,d0
913 cmp
.l #AHIDB_MaxRecordSamples
,d0
914 bne
.b
.not_maxrecsamples
915 move
.l #DMA_LENGTH
,d0
918 cmp
.l #AHIDB_Realtime
,d0
923 cmp
.l #AHIDB_Record
,d0
928 cmp
.l #AHIDB_FullDuplex
,d0
929 bne
.b
.not_fullduplex
933 cmp
.l #AHIDB_Inputs
,d0
938 cmp
.l #AHIDB_Input
,d0
940 lea
.line
(pc
),a0
;only one source
944 cmp
.l #AHIDB_Outputs
,d0
949 cmp
.l #AHIDB_Output
,d0
951 lea
.line
(pc
),a0
;only one destination
955 cmp
.l #AHIDB_MinMonitorVolume
,d0
960 cmp
.l #AHIDB_MaxMonitorVolume
,d0
965 cmp
.l #AHIDB_MinOutputVolume
,d0
970 cmp
.l #AHIDB_MaxOutputVolume
,d0
975 cmp
.l #AHIDB_MaxInputGain
,d0
;NEW 06 Jan
1997
976 bne
.b
.not_maxgain
;BUGFIX
15 Feb
1997
977 move
.l #$
000d55d0
,d0
; 13.335<<16 == +22.5 dB
980 cmp
.l #AHIDB_MinInputGain
,d0
;NEW 06 Jan
1997
982 move
.l #$
10000,d0
;NEW 15 Feb
1997
986 ;* Unknown attribute
, return default
.
991 dc
.b
"Martin 'Leviticus' Blom",0
993 dc
.b
"Public Domain",0
999 ;* AHIsub_HardwareControl
( attribute
, argument
, audioctrl
);
1002 AHIsub_HardwareControl
:
1003 cmp
.l #AHIC_MonitorVolume
,d0
1004 bne
.b
.dontsetmonvol
1005 move
.l ahiac_DriverData
(a2
),a1
1006 move
.l d1
,wt_InputVolume
(a1
)
1009 cmp
.l #AHIC_MonitorVolume_Query
,d0
1010 bne
.b
.dontgetmonvol
1011 move
.l ahiac_DriverData
(a2
),a1
1012 move
.l wt_InputVolume
(a1
),d0
1015 cmp
.l #AHIC_OutputVolume
,d0
1017 move
.l ahiac_DriverData
(a2
),a1
1018 move
.l d1
,wt_OutputVolume
(a1
)
1021 cmp
.l #AHIC_OutputVolume_Query
,d0
1023 move
.l ahiac_DriverData
(a2
),a1
1024 move
.l wt_OutputVolume
(a1
),d0
1027 cmp
.l #AHIC_InputGain
,d0
1029 move
.l ahiac_DriverData
(a2
),a1
1030 move
.l d1
,wt_InputGain
(a1
)
1033 cmp
.l #AHIC_InputGain_Query
,d0
1035 move
.l ahiac_DriverData
(a2
),a1
1036 move
.l wt_InputGain
(a1
),d0
1045 ;*****************************************************************************
1048 ;* a1 ptr to
'kicker'
1051 move
.l ahiac_DriverData
(a2
),a5
1057 move
.b d0
,wt_SlaveSignal
(a5
)
1059 beq
.w
.error_nosignal
1061 ;* allocate dad_audio
.device
1063 move
.l d0
,wt_dadport
(a5
)
1066 moveq #IOSTD_SIZE
,d0
1068 call CreateIORequest
1069 move
.l d0
,wt_dadioreq
(a5
)
1070 beq
.w
.error_noioreq
1074 move
.l wt_dadioreq
(a5
),a1
1077 move
.l d0
,wt_daddev
(a5
)
1078 bne
.w
.error_nodaddev
1080 ;* initialize the board
1081 move
.l wt_dadioreq
(a5
),a1
1082 move
.l #DADF_SETFLAG|DADF_INIT
,IO_DATA
(a1
)
1085 move
.w #DADCMD_INIT2
,IO_COMMAND
(a1
)
1088 move
.l wt_dadioreq
(a5
),a1
1089 move
.l ahiac_MixFreq
(a2
),IO_DATA
(a1
)
1092 move
.w #DADCMD_REPLAYFREQ
,IO_COMMAND
(a1
)
1095 move
.l wt_MasterTask
(a5
),a1
1097 move
.b wt_MasterSignal
(a5
),d1
1099 call Signal
;Tell master we
're alive
and kicking
!
1103 move
.l wt_OutputVolume
(a5
),d1
;default
is $
10000 (see alloc
function)
1105 move
.l wt_dadioreq
(a5
),a1
1106 move
.l d0
,IO_DATA
(a1
)
1109 move
.w #DADCMD_OUTPUTDAMP
,IO_COMMAND
(a1
)
1114 move
.l wt_DMAbuffer1
(a5
),wt_DMAbuffer
(a5
)
1117 move
.l wt_DMAbuffer2
(a5
),wt_DMAbuffer
(a5
)
1120 move
.l wt_SoftInt
(a5
),a1
1123 move
.l wt_dadioreq
(a5
),a1
1129 move
.b wt_SlaveSignal
(a5
),d1
1133 move
.l wt_dadioreq
(a5
),a1
1134 move
.l wt_DMAbuffer
(a5
),IO_DATA
(a1
)
1135 move
.l wt_DMAlength
(a5
),IO_LENGTH
(a1
)
1137 move
.w #CMD_WRITE
,IO_COMMAND
(a1
)
1138 call DoIO
; changed SendIO to DoIO
1145 clr
.l wt_SlaveTask
(a5
)
1147 move
.b wt_SlaveSignal
(a5
),d0
;-1 is ok
1148 move
.b #
-1,wt_SlaveSignal
(a5
)
1154 move
.l wt_dadioreq
(a5
),a1
1155 move
.l #DADCONST_MAXDAMP
,IO_DATA
(a1
) ;zero volume
1158 move
.w #DADCMD_OUTPUTDAMP
,IO_COMMAND
(a1
)
1161 move
.l wt_dadioreq
(a5
),a1
1162 move
.l #
-1,wt_daddev
(a5
)
1165 move
.l wt_dadioreq
(a5
),a0
1166 clr
.l wt_dadioreq
(a5
)
1167 call DeleteIORequest
1169 move
.l wt_dadport
(a5
),a0
1170 clr
.l wt_dadport
(a5
)
1173 move
.l wt_MasterTask
(a5
),a1
1175 move
.b wt_MasterSignal
(a5
),d1
1192 movem
.l
(a5
)+,a0
/a1
/a2
/a3
1193 jsr
(a3
) ;call Player Hook
1194 movem
.l
(a5
),d0
/a0
/a1
/a2
/a3
/a5
1195 jsr
(a3
) ;call Mixer Hook
1197 ;* transfer buffer
(unrolled
)
1214 ;* a1 wt_SoftIntData
1219 movem
.l
(a5
)+,a0
/a1
/a2
/a3
1220 jsr
(a3
) ;call Player Hook
1221 movem
.l
(a5
),d0
/a0
/a1
/a2
/a3
/a5
1222 jsr
(a3
) ;call Mixer Hook
1224 ;* transfer buffer
(unrolled
)
1237 ;* a1 ptr to
'kicker'
1240 move
.l ahiac_DriverData
(a2
),a5
1246 move
.b d0
,wt_RecSlaveSignal
(a5
)
1250 moveq #AHIRecordMessage_SIZEOF
,d0
1251 move
.l #MEMF_24BITDMA|MEMF_PUBLIC|MEMF_CLEAR
,d1
1253 move
.l d0
,wt_RecordMsg
(a5
)
1256 ;* allocate dad_audio
.device
1258 move
.l d0
,wt_recdadport
(a5
)
1261 moveq #IOSTD_SIZE
,d0
1263 call CreateIORequest
1264 move
.l d0
,wt_recdadioreq
(a5
)
1269 move
.l wt_recdadioreq
(a5
),a1
1272 move
.l d0
,wt_recdaddev
(a5
)
1275 ;* initialize the board
1276 move
.l wt_recdadioreq
(a5
),a1
1277 move
.l #DADF_SETFLAG|DADF_INIT
,IO_DATA
(a1
)
1280 move
.w #DADCMD_INIT2
,IO_COMMAND
(a1
)
1283 move
.l wt_recdadioreq
(a5
),a1
1284 move
.l ahiac_MixFreq
(a2
),IO_DATA
(a1
)
1287 move
.w #DADCMD_SAMPLEFREQ
,IO_COMMAND
(a1
)
1290 move
.l wt_recdadioreq
(a5
),a1
1291 move
.l ahiac_MixFreq
(a2
),IO_DATA
(a1
)
1294 move
.w #DADCMD_REPLAYFREQ
,IO_COMMAND
(a1
)
1298 move
.l wt_recdadioreq
(a5
),a1
1299 move
.l wt_InputGain
(a5
),d1
1300 bsr lineargain2decibel
;translate gain value
1301 move
.l d0
,IO_DATA
(a1
)
1304 move
.w #DADCMD_INPUTGAIN
,IO_COMMAND
(a1
)
1307 move
.l wt_recdadioreq
(a5
),a1
1310 move
.l #DAD_BUFFER_SETUP
,IO_OFFSET
(a1
)
1311 move
.w #DADCMD_BUFFER
,IO_COMMAND
(a1
)
1313 ; Hardcoded value used
, since ahi
.device must know the size
1314 ;of the
record buffer
.
1316 move
.l #DMA_LENGTH
*4,d7
1318 move
.l #MEMF_CLEAR|MEMF_CHIP|MEMF_PUBLIC
,d1
1320 move
.l d0
,wt_RecBuffer
(a5
)
1323 move
.l wt_RecMasterTask
(a5
),a1
1325 move
.b wt_RecMasterSignal
(a5
),d1
1327 call Signal
;Tell Master we
're alive
and kicking
!
1331 move
.l wt_InputVolume
(a5
),d1
1333 move
.l wt_recdadioreq
(a5
),a1
1334 move
.l d0
,IO_DATA
(a1
)
1337 move
.w #DADCMD_OUTPUTDAMP
,IO_COMMAND
(a1
)
1341 move
.l wt_recdadioreq
(a5
),a1
1342 move
.l wt_RecBuffer
(a5
),IO_DATA
(a1
)
1343 move
.l d7
,IO_LENGTH
(a1
)
1344 move
.l #
-1,IO_OFFSET
(a1
)
1345 move
.w #CMD_READ
,IO_COMMAND
(a1
)
1346 call DoIO
;copy internal buffer to RecBuffer
1348 move
.l wt_recdadioreq
(a5
),a1
1350 move
.l IO_ACTUAL
(a1
),IO_LENGTH
(a1
)
1351 move
.l #DAD_BUFFER_SWITCH
,IO_OFFSET
(a1
)
1352 move
.w #DADCMD_BUFFER
,IO_COMMAND
(a1
)
1353 call DoIO
;swap internal buffers
1356 move
.l ahiac_SamplerFunc
(a2
),a0
1357 move
.l h_Entry
(a0
),a3
1358 move
.l wt_RecordMsg
(a5
),a1
1359 move
.l wt_RecBuffer
(a5
),ahirm_Buffer
(a1
)
1362 move
.l d0
,ahirm_Length
(a1
)
1363 move
.l #AHIST_S16S
,ahirm_Type
(a1
)
1370 move
.b wt_RecSlaveSignal
(a5
),d1
1374 move
.l wt_RecBuffer
(a5
),d0
1377 clr
.l wt_RecBuffer
(a5
)
1380 clr
.l wt_RecSlaveTask
(a5
)
1382 move
.b wt_RecSlaveSignal
(a5
),d0
;-1 is ok
1383 move
.b #
-1,wt_RecSlaveSignal
(a5
)
1386 tst
.l wt_recdaddev
(a5
)
1389 move
.l wt_recdadioreq
(a5
),a1
1390 move
.l #
-1,wt_recdaddev
(a5
)
1393 move
.l wt_recdadioreq
(a5
),a0
1394 clr
.l wt_recdadioreq
(a5
)
1395 call DeleteIORequest
1397 move
.l wt_recdadport
(a5
),a0
1398 clr
.l wt_recdadport
(a5
)
1401 move
.l wt_RecMasterTask
(a5
),a1
1403 move
.b wt_RecMasterSignal
(a5
),d1