PowerWAVE
Functional Specification

( DM1001/FS )

Issue 5
26 Sep 1999

Authors

Andy Pierson
David Lenthall

ESP Music

Introduction

The DMI 50 PowerWAVE card is a MIDI and Sampling card. The following documentation is for the SWI interface provided for the Sampling facilities.

This new version of the module has new SWIs to replace most of the original SWIs. The new module can also detect more than one DMI card and handle sample and playback to any of the installed cards at the same time. To specify which card is being called a driver number is allocated to each installed card. The driver numbers start at 0.

Entries to the SWIs which have both Left and Right parameters can use -1 for either of the entries to indicate that these entries should not be changed.

SWI Interface

PowerWAVE_AudioOn - &4AA41

Turn the audio output on.

On entry
R1 = Driver
On exit
Interrupts
Interrupt status is undefined
Fast interrupts are enabled
Processor mode
Processor is in SVC mode
Re-entrancy
SWI is not re-entrant

PowerWAVE_AudioOff - &4AA42

Turn the audio output off.

On entry
R1 = Driver
On exit
Interrupts
Interrupt status is undefined
Fast interrupts are enabled
Processor mode
Processor is in SVC mode
Re-entrancy
SWI is not re-entrant

PowerWAVE_WriteCODEC - &4AA44

Write to a CODEC register.

On entry
R0 = Register / Driver
Bits 0-4 = Register number
Bits 5-7 = Driver number
R1 = Value to write
On exit
Interrupts
Interrupt status is undefined
Fast interrupts are enabled
Processor mode
Processor is in SVC mode
Re-entrancy
SWI is not re-entrant

PowerWAVE_ReadCODEC - &4AA45

Read a CODEC register.

On entry
R0 = Register / Driver :
Bits 0-4 = Register number
Bits 5-7 = Driver number
On exit
R1 = Value
Interrupts
Interrupt status is undefined
Fast interrupts are enabled
Processor mode
Processor is in SVC mode
Re-entrancy
SWI is not re-entrant

PowerWAVE_Volume - &4AA5A

Set or read the current volume of an audio channel.

On entry
R0 = Function code : 0 = Read, 1 = Write
R1 = Driver
R2 = Channel :
0 = Output
1 = Aux1
2 = Aux2
3 = Monitor (Digital mix)
4 = Input
R3 = Left volume } (0 - 255, though see note below)   [ only required if R0 = 1 ]
R4 = Right volume
On exit
R3 = Current left volume } (0 - 255)   [ if R0 = 0, on entry ]
R4 = Current right volume
Interrupts
Interrupt status is undefined
Fast interrupts are enabled
Processor mode
Processor is in SVC mode
Re-entrancy
SWI is not re-entrant

Note

Although the volume values always have the range 0 - 255, the number of discrete values used depends on the particular audio channel (as specified in R2) that is being addressed :

ChannelValues
0 (Output)64
1 (Aux1)32
2 (Aux2)32
3 (Monitor)256Note that only the left stereo channel is used. When reading the value, the value returned for the right channel is always the same as that for the left channel.
4 (Input)16

PowerWAVE_Enable - &4AA5B

Set or read the current mute setting of an audio channel.

On entry
R0 = Function code : 0 = Read, 1 = Write
R1 = Driver
R2 = Channel (see note below) :
0 = Output
1 = Aux1
2 = Aux2
3 = Monitor (Digital mix)
R3 = Left mute } (0=Mute, 1=Enable)   [ only required if R0 = 1 ]
R4 = Right mute
On exit
R3 = Current left mute } (0=Mute, 1=Enable)   [ if R0 = 0, on entry ]
R4 = Current right mute
Interrupts
Interrupt status is undefined
Fast interrupts are enabled
Processor mode
Processor is in SVC mode
Re-entrancy
SWI is not re-entrant

Note

It is not possible to mute / enable the Input channel.

Only the left stereo channel is used in the case of the Monitor audio channel. When reading the value, the value returned for the right channel is always the same as that for the left channel.

PowerWAVE_MICGain - &4AA5C

Set or read the current MIC Gain setting.

On entry
R0 = Function code : 0 = Read, 1 = Write
R1 = Driver
R2 = not used
R3 = Left gain
R4 = Right gain
On exit
R3 = Current left gain
R4 = Current right gain
Interrupts
Interrupt status is undefined
Fast interrupts are enabled
Processor mode
Processor is in SVC mode
Re-entrancy
SWI is not re-entrant

PowerWAVE_SelectInput - &4AA5D

Set or read the input selection (source).

On entry
R0 = Function code : 0 = Read, 1 = Write
R1 = Driver
R2 = Left source } (see note below)   [ only required if R0 = 1 ]
<0 to not affect this channel
R3 = Right source
On exit
R2 = Current left source } (0 - 3, see note below)   [ if R0 = 0, on entry ]
R3 = Current right source
Interrupts
Interrupt status is undefined
Fast interrupts are enabled
Processor mode
Processor is in SVC mode
Re-entrancy
SWI is not re-entrant

Note

The sources (in R2 and R3) are coded as follows :

0 = Line
1 = Aux1
2 = MIC
3 = Monitor (Digital mix)

PowerWAVE_SampleRate - &4AA5E

Set or read the sample rate setting.

The structure of this SWI is based on the Linear Handler Sound_SampleRate SWI.

On entry
R0 = Function code :
0 = Read number of rates
1 = Read current sample rate index
2 = Convert sample rate index to sample rate
3 = Set sample rate
Bits 8-31 = Driver number
R1 = Sample rate index   [ only required if R0 = 2 or R0 = 3 ]
On exit

If function code is 0 :
R1 = Total number of available rates

If function code is 1 :
R1 = Index of current rate
R2 = Current sample rate

If function code is 2 :
R2 = Rate value

If function code is 3 :
R1 = Previous index
R2 = Previous rate

Interrupts
Interrupt status is undefined
Fast interrupts are enabled
Processor mode
Processor is in SVC mode
Re-entrancy
SWI is not re-entrant

PowerWAVE_SampleType - &4AA5F

Set or read the sample type.

On entry
R0 = Function code : 0 = Read, 1 = Write
R1 = Driver
R2 = Channels (1 = Mono, 2 = Stereo)
R3 = Data type :
0 = Linear 8 bit
1 = mu-Law 8 bit
2 = Linear 16 bit
3 = A-Law 8 bit
On exit
R2 = Current channels
R3 = Current type
Interrupts
Interrupt status is undefined
Fast interrupts are enabled
Processor mode
Processor is in SVC mode
Re-entrancy
SWI is not re-entrant

PowerWAVE_LinearHandler - &4AA60

Install or remove a linear handler playback routine.

The structure of this SWI is based on the Sound_LinearHandler SWI.

On entry
R0 = Function code :
Bit 0 : 0 = Read current handler, 1 = Install a new handler
Bits 1-31 = Driver number
R1 = Code address, or 0 to remove handler
R2 = Parameter
On exit
R1 = Current handler
R3 = Current parameter
Interrupts
Interrupt status is undefined
Fast interrupts are enabled
Processor mode
Processor is in SVC mode
Re-entrancy
SWI is not re-entrant

Use

Refer to the section on Linear Handler and Record Handler Call Parameters.

PowerWAVE_RecordHandler - &4AA61

Install or remove a linear handler record routine.

The structure of this SWI is based on the Sound_LinearHandler SWI.

On entry
R0 = Function code :
Bit 0 : 0 = Read current handler, 1 = Install a new handler
Bits 1-31 = Driver number
R1 = Code address, or 0 to remove handler
R2 = Parameter
On exit
R1 = Current handler
R3 = Current parameter
Interrupts
Interrupt status is undefined
Fast interrupts are enabled
Processor mode
Processor is in SVC mode
Re-entrancy
SWI is not re-entrant

Use

Refer to the section on Linear Handler and Record Handler Call Parameters.

PowerWAVE_SoundDriver - &4AA63

Install PowerWAVE into the SoundDriver record module.

On entry
R1 = Driver
On exit
Interrupts
Interrupt status is undefined
Fast interrupts are enabled
Processor mode
Processor is in SVC mode
Re-entrancy
SWI is not re-entrant

Linear Handler and Record Handler Call Parameters

Each handler is passed a buffer to fill (playback) or full of data to store (record) with the registers set as follows :

R0 = Parameter (usually the module R12 value)
R1 = Base address of buffer to fill/record
R2 = End of buffer
R3 = Flags :
For playback this is set to 2, indicating that the buffer is silent
For record this is set to the current driver number
R4 = sample frequency in 22.10 fixed point

Relevant SWIs

Deprecated SWIs

A considerable number of the original SWIs provided by this module are now obsolete. Hence the following SWIs should be considered to be deprecated, and should no longer be used.

DeprecatedUse instead
PowerWAVE_Reset&4AA40 --
PowerWAVE_Hardware&4AA43 --
PowerWAVE_CalibrateCODEC&4AA46 --
PowerWAVE_SetSampleRate&4AA47 PowerWAVE_SampleRate&4AA5E
PowerWAVE_GetAvailableRates&4AA48 PowerWAVE_SampleRate&4AA5E
PowerWAVE_GrabSystemOutput&4AA49 --
PowerWAVE_FreeSystemOutput&4AA4A --
PowerWAVE_StartPlaybackFIFO&4AA4B PowerWAVE_LinearHandler&4AA60
PowerWAVE_StartRecordFIFO&4AA4C PowerWAVE_RecordHandler&4AA61
PowerWAVE_StopPlaybackFIFO&4AA4D PowerWAVE_LinearHandler&4AA60
PowerWAVE_StopRecordFIFO&4AA4E PowerWAVE_RecordHandler&4AA61
PowerWAVE_GetBufferInfo&4AA4F

PowerWAVE_LinearHandler

or

PowerWAVE_RecordHandler

&4AA60

or

&4AA61

PowerWAVE_GetBufferStatus&4AA50
PowerWAVE_SetBufferStatus&4AA51
PowerWAVE_GetBufferCurrent&4AA52
PowerWAVE_ResetForPlaystart&4AA53 --
PowerWAVE_ResetForRecordstart&4AA54 --
PowerWAVE_Debug&4AA55 --
PowerWAVE_RecordBuffer&4AA56 PowerWAVE_RecordHandler&4AA61
PowerWAVE_StartRecording&4AA57 PowerWAVE_RecordHandler&4AA61
PowerWAVE_PlaybackBuffer&4AA58 PowerWAVE_LinearHandler&4AA60
PowerWAVE_StartPlayback&4AA59 PowerWAVE_LinearHandler&4AA60