===========================================================================
Packet: ROMEO
Date: 08-24-93 (12:43)             Number: 1982
From: Bernie Pallek                Refer#: NONE
  To: All                           Recvd: NO
Subj: [1/3] GUS Programming          Conf: (26) 80xxx
---------------------------------------------------------------------------
<=- Gravis Ultrasound programming, part 1/3 -=>

(This long message has been divided into 3 parts).
The Gravis Ultrasound is a powerful sound card, but it
lacks some equally powerful documentation, and this is the
best stuff I could find... so far:

First off, the default base looks like this:  Base dw 220h

----- Delay -----
@DELAY = (in byte 300h)*7

Notes: All this function does is give a short idle wait for the card
       to do whatever processing it needs to.

----- Peek Data Byte -----
  out BASE+103h, 43h
  out BASE+104h, low word address
  out BASE+103h, 44h
  out BASE+105h, high byte address
  in  BASE+107h, INBYTE

Notes: The card's memory can be from 00000h to fffffh.  INBYTE is the
       byte value returned from the card that was at that memory location.

----- Poke Data Byte -----
  out BASE+103h, 43h
  out BASE+104h, low word address
  out BASE+103h, 44h
  out BASE+105h, high byte address
  out BASE+107h, OUTBYTE


----- Probe Ultra Sound -----
  out BASE+103h, 4Ch
  out BASE+105h, 0
  @DELAY
  @DELAY
  out BASE+103h, 4Ch
  out BASE+105h, 1
  Poke Data Byte   Loc:   0h, Byte: AA    ; Don't think this HAS to be an AA.
  Poke Data Byte   Loc: 100h, Byte: 55    ; Don't think this is needed.
  Peek Data Byte   Loc:   0h
  Store Byte
  out BASE+103h, 4Ch
  out BASE+105h, 0
  Restore Byte
  Is it AA?  If so, then we have found a GUS.

----- Test for amount of memory installed on UltraSound -----
  Poke Data Byte   Loc: 40000h, Byte: AA
  Peek Data Byte   Loc: 40000h
  Is it an AA?  If not, then there is 256k of DRAM.  Exit.
  Poke Data Byte   Loc: 80000h, Byte: AA
  Peek Data Byte   Loc: 80000h
  Is it an AA?  If not, then there is 512k of DRAM.  Exit.
  Poke Data Byte   Loc: C0000h, Byte: AA
  Peek Data Byte   Loc: C0000h
  Is it an AA?  If not, then there is 768k of DRAM.  Exit.
  Poke Data Byte   Loc: 0FFFFFh, Byte: AA
  Peek Data Byte   Loc: 0FFFFFh
  Is it an AA?  If not, then there is 1024k of DRAM.  Exit.

Notes: Poke these bytes on the boundaries of 256k, 512k, 768k, and 1024k.
       If the memory isn't there, then it won't return what is poked.

<=- end of 1/3, continued in next message -=>


--- Maximus 2.01wb
 * Origin: * idiot savant * +1 416 935 6628 * (1:247/128)
