4 * C to ASM conversion done by Martin Blom
(lcs@lysator.liu.se
) 1995-12-16.
6 *************************************************************************
7 ** $VER
: 0.19_BETA dad_audio.h
(95.11.15) **
8 ** dad_audio.device include file BETA by Johan Nyblom
**
9 ** email
: nyblom@mother.ludd.luth.se
**
10 ** All this knowledge has been found by reverse engineering
, **
11 ** guessing and the use of devmon. It has NOTHING to do with
**
12 ** Digital Audio Design
, the makers of wavetools hardware
**
14 ** I am not responsible for any damage anyone does with this stuff
:) **
15 ** just so that you know
, this is EXTREMELY shaky knowledge.
**
16 ** Ye have been forewarned
! **
17 *************************************************************************
19 include exec
/io.i
* std DEVICE commands and structures
*
21 * Standard device commands
, listed for easy access.
22 * CMD_INVALID
0 Invalid Command
23 * CMD_RESET
1 Reset device to orig.state
24 * CMD_READ
2 Read from device
25 * CMD_WRITE
3 Write to device
26 * CMD_UPDATE
4 Process buffer
27 * CMD_CLEAR
5 Clear all buffers
28 * CMD_STOP
6 Insert pause
29 * CMD_START
7 Continue after pause
30 * CMD_FLUSH
8 Stop current task
33 *************************************************************************
35 ** dad_audio.device
**
37 *************************************************************************
39 ** CMD_READ standard device command
40 ** io_Data
= Longword Aligned.
41 ** data is read into the address in io_Data.
42 ** io_Offset
= -1, it worls with Offset
=0 but dad_audio.device
43 ** returns offset
=-1 so why not use it from the start
,
44 ** besides WaveTools
(software
) uses Offset
-1 so...
46 ** Result
: buffer is read to address
,
47 ** io_Actual
= bytes read
50 ** DataFormat is
LONG( WORD
(left
) , WORD
(right
))
57 ** dad_audio.device commandon
60 DADCMD_BUFFER EQU
(CMD_NONSTD
+0)
61 DAD_BUFFER_SETUP EQU
0
62 DAD_BUFFER_SWITCH EQU
-1
64 ** Call with Offset to determine usage
,
65 ** Offset
= DAD_ BUFFER_SWITCH
66 ** Result
: io_Actual
= number of bytes in presampled buffer.
68 ** Offset
= DAD_BUFFER_SETUP
69 ** Result
: io_Actual is set to first sampling length
(ie max internal buffer size
)
70 ** usually
8084 but it could differ with another hardware setup.
73 ** Suppose the card has
2 onboard buffes
, these buffers are
8084 bytes each.
74 ** 1. Setup onboard buffers
, returning maximum size in bytes.
(8084)
75 ** 2. Next read from the card to a buffer MEMF_24BITDMA or
76 ** MEMF_CHIP if you are gonna dump it do disk
,
77 ** the card starts sampling into buffer1 and let me read it when it is full
,
78 ** while the card continues to sample into buffer2.
79 ** 3. I am done reading and now switches buffers with the buffer command
,
80 ** buffer2 is frozen. and sampling to buffer
1 starts
,
81 ** io_Actual is the length the card managed to sample into buffer2.
82 ** io_Error
= -128 if overflow
(or some error
) happened.
83 ** 4. I read from card
, getting my data from buffer2 this time.
84 ** Then it starts over at
3.
89 DADCMD_OUTPUTDAMP EQU
(CMD_NONSTD
+2)
90 DADCONST_MAXDAMP EQU
31 * value from dad_audio.device
*
92 ** Set damping on output
, io_Data
= Damping
93 ** The maximum is
31 which gives no sound out and minimum is
0, integer steps.
94 ** all other except flags and command should be zero
98 DADCMD_INPUTGAIN EQU
(CMD_NONSTD
+3)
99 DADCONST_MAXGAIN EQU
15
101 ** Set gain on input
, io_Data
= gain
102 ** Maximum
= 15, minimum
= 0 integer steps
106 DADCMD_REPLAYFREQ EQU
(CMD_NONSTD
+4)
108 ** set playback frequency io_Data
= Frequency.
109 ** You can only use a couple of frequencies
110 ** see below DADFREQ_
*
114 DADCMD_INIT1 EQU
(CMD_NONSTD
+5)
116 ** This is called by WaveTools
(sampling software
)
117 ** with all values
= 0 except command
,
118 ** upon return io_Data
= an address which is later used
119 ** in the set buffer command. I dont know what this is about
120 ** maybe it is auto buffer allocation. Maybe it is base address of the
121 ** hardware dma zone or something. But since you can set your own bufferspace
,
126 DADCMD_MUTE EQU
(CMD_NONSTD
+6)
128 ** Mute Internal channels output
129 ** io_Data
= 0 turns sound off
130 ** io_Data
= 1 turns them on
134 DADCMD_SAMPLEFREQ EQU
(CMD_NONSTD
+7)
136 ** set sampling frequency io_Data
= frequency
137 ** I checked dad_audio.device and it did no real checking of the
138 ** frequency
, maybe it is linked to replay frequency.
142 DADCMD_SMPTE EQU
(CMD_NONSTD
+15)
144 ** SMPTE port init
, E
=-1 if hardware is not there.
145 ** I cant check anything more because I havent got the hardware
:(
149 DADCMD_INIT2 EQU
(CMD_NONSTD
+17)
151 ** This is an interresting command
, it is called with
152 ** io_Data
= (DADF_SET | DADF_INIT
) (ie. $
80000001) by wavetools
153 ** prior to setting frequency
,damping and such.
154 ** I dont know what it is
, could be internal status bits or something.
159 dc.b
"dad_audio.device",0
168 DADF_INIT EQU
(1<<0) * $
00000001 *
169 DADF_SETFLAG EQU
(1<<31) * $
80000000 *
175 DADFREQ_48000 EQU
48000 * These values are checked for in dad_audio.device
*
176 DADFREQ_44100 EQU
44100 * I guess they are the only frequencys alowed
*
177 DADFREQ_32000 EQU
32000 * they are valid for both sampling and playback
*
178 DADFREQ_29400 EQU
29400
179 DADFREQ_24000 EQU
24000
180 DADFREQ_22050 EQU
22050
181 DADFREQ_19200 EQU
19200
182 DADFREQ_17640 EQU
17640