EMU10K1 DSP Documentation
-------------------------

Most of the following information was obtained by trial-and-error.

Use it at your own risk!

Please send any comments, corrections or additions to
<dkoukola@atrey.karlin.mff.cuni.cz>.


Instruction Format
------------------

        31    23       20 19     10 9       0
   0   |                 |    X    |    Y    |
   1   |     |  opcode   |    R    |    A    |
     

Opcodes
-------

   0x0 (MAC) : R = A + (X * Y >> 31)   ; saturation
   0x1 (MAC) : R = A + (-X * Y >> 31)  ; saturation
   0x2 (MAC) : R = A + (X * Y >> 31)   ; wraparound
   0x3 (MAC) : R = A + (-X * Y >> 31)  ; wraparound
   0x4 (MACINT) : R = A + X * Y  ; saturation
   0x5 (MACINT) : R = A + X * Y  ; wraparound (31-bit)
   0x6 (ACC3) : R = A + X + Y  ; saturation
   0x7 (MACMV) : R = A, acc += X * Y >> 31
   0x8 (ANDXOR) : R = (A & X) ^ Y
   0x9 (TSTNEG) : R = (A >= Y) ? X : ~X
   0xa (LIMIT) : R = (A >= Y) ? X : Y
   0xb (LIMIT): R = (A < Y) ? X : Y
   0xc (LOG) : ...
   0xd (EXP) : ...
   0xe (INTERP) : R = A + (X * (Y - A) >> 31)  ; saturation
   0xf (SKIP) : ...


Operands
--------

   0x00n : FX send bus
   0x010 : in0 l (digital output of the AC '97 codec
   0x011 : in0 r   the source is the recording source)
   0x012 : in1 l (S/PDIF CD digital in on card)
   0x013 : in1 r
   0x014 : in2 l (mic?)
   0x015 : in2 r
   0x016 : in3 l (LiveDrive -- TOSLink Optical In)
   0x017 : in3 r
   0x018 : in4 l (LiveDrive -- Line/Mic In 1)
   0x019 : in4 r
   0x01a : in5 l (LiveDrive -- Coaxial S/PDIF Input)
   0x01b : in5 r
   0x01c : in6 l (LiveDrive -- Line/Mic In 2)
   0x01d : in6 r
   0x020 : out0 l (AC '97 codec)
   0x021 : out0 r
   0x022 : out1 l (LiveDrive -- TOSLink Optical Out)
   0x023 : out1 r
   0x024 : out2 l (?)
   0x025 : out2 r
   0x026 : out3 l (LiveDrive -- headphone out)
   0x027 : out3 r
   0x028 : out4 l (rear channel)
   0x029 : out4 r
   0x02a : out5 l (ADC recording buffer)
   0x02b : out5 r
   0x02c : out6 (microphone recording buffer)

   0x040 : 00000000
   0x041 : 00000001
   0x042 : 00000002
   0x043 : 00000003
   0x044 : 00000004
   0x045 : 00000008
   0x046 : 00000010
   0x047 : 00000020
   0x048 : 00000100
   0x049 : 00010000
   0x04a : 00080000
   0x04b : 10000000
   0x04c : 20000000
   0x04d : 40000000
   0x04e : 80000000
   0x04f : 7fffffff
   0x050 : ffffffff
   0x051 : fffffffe
   0x052 : c0000000
   0x053 : 4f1bbcdc
   0x054 : 5a7ef9db
   0x055 : 00100000 (?)

   0x056 : accumulator
   0x057 : condition code register
   0x058 : noise source
   0x059 : noise source

   0x1nn : general purpose registers
   0x2nn : tank memory data registers
   0x3nn : tank memory address registers (0x380-0x39f external TRAM)


   Input/Output details:

   out4, rear channel:
	stereo analog output on the back of the card.

   out5, ADC recording buffer:
	 what your record when the AC97 recording buffer is selected.
	(16 bit only, stereo/mono, variable samplingrate)

   out6, microphone recording buffer:
	what your record when the MIC recording buffer is selected.
	(16 bit only, mono only, 8000Hz only)


  References:
	see manuals.txt
