QSound 180 degree virtual audio for the Atari Jaguar
----------------------------------------------------

		QSound Labs Inc.,
		2748 - 37 Ave N.E.
		Calgary, AB, Canada
		T1Y 5L3

		(403) 291-2492
		fax: (403) 250 - 1521

***
QSound is a patented technology.  It's use on the Atari Jaguar system
is restricted to, and subject to, the licencing agreement signed with
Atari.  All third parties interested in using QSound in Jaguar 
applications should check with Atari regarding this licencing
agreement.
***

QSound gives you access to 180 degrees of space around the listener using
a standard stereo setup.  For TV applications, the speakers should be
positioned like:

			|----------------|
                        |     TV         |
                        |                |
                 |----| |                | |----|
                 |spk |	|    front       | | spk|
		 |____|	 \______________/  |____|

	1) facing straight forward
	2) at the front of the TV, and at the same depth
	3) at the same height

QSound pan positions are numbered from 0 (far left) to 32 (far right).
Several different sounds can be panned through the QSound process.  The
current implementation allows up to eight mono voices to be processed.  The
processing relies on a known sample period:  this module assumes 20800 Hz,
which means #19 should be written into the SCLK register.  (#18, approximating
22050 Hz, also works with this module).

The Q1 module exports the following symbols:
	QSPan	-- to pan a given voice 
	QSound	-- to do the QSound processing
			(QSound = QSPan + $36 (hex))

QSPan need only be called when a voice changes pan position.
QSound should be called every sample period in which at least 
	one QSound voice is active.

The results of a call to QSound can be mixed with other stereo results before
being written to the DAC -- the QSound effects will remain in the mixed
result.

The details are as follows:

	QSPan
 	-----
	  input:
		r20 = return address
		r21 = voice to pan ( 0 through 7 )
		r22 = new pan position ( 0 through 32 ($20))
	  output:
		none

	  registers:
		uses r20 through r24

	  notes:
		takes about 25 instructions

	  example:
	   ;;
		movei	#QSPan,r5
		movei	#Panned,r20		; return address for QSPan
		movei	#0,r21			; pan voice 0
		jump	T,(r5)
		movei	#$20,r22		; pan position 32 - hard right
	     Panned: 				
           ;;


	QSound
	------
	 input
		r16 = return address
		r17 = number of QSound voices to process (1 to 8)
		r18 -> input sample for each voice:  
			* consequtive 32 bit values
			* bottom 16 bits represent input for each voice

	 output
		r20 = left output (32 bits)
		r22 = right output (32 bits)

	 registers:
		uses r12 through r27

	 notes:
		about 150 + 25*num_voices instructions.

	 example:
	  ;;
		...				; copy 16 bit inputs to #samples

		movei	#After,r16		; return address for QSound
		movei	#1,r17			; number of voices
		movei	#QSound,r5
		jump	T,(r5)			; call QSound
		move	#samples,r18		; r18 -> input samples, no spike
	     After:	
		shrq	#16,r20			; outputs in 16 bits for DAC
		shrq	#16,r22

		...				; output to DAC

	    samples:		; up to 8 consequtive 32 bit locations
		.dc.l 0		; voice 1 data
		.dc.l 0		; voice 2 data
		.dc.l 0		; voice 3 data
		.dc.l 0		; voice 4 data
		.dc.l 0		; voice 5 data
		.dc.l 0		; voice 6 data
		.dc.l 0		; voice 7 data
		.dc.l 0		; voice 8 data
	  ;;

