TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: PETER VAN HERTUM
from: CRAIG HART
date: 1997-03-14 09:06:00
subject: Detect SoundBlaster`s DMA

Yo..
 PH> CH> You simply try all DMA channels and IRQ's until you find the one 
hat
 PH> CH> works. some psuedo code:
 PH> CH> for dma=0 to 7 do for irq = 0 to 15 do play a 1 byte sample using
 PH> CH> DMA so that an irq is triggered. did our ISR go off? no : try next
 PH> CH> values yes : OK we have the settings!! end.
 PH> Don't I have to know the port address for that ?
 PH> Let's say you don't know which port the SB uses... Can I TRY to play
 PH> a (one byte) sample on all the IRQ's,DMA's and PORTs no matter what
 PH> device is using them ? What if there is a videocard or something
 PH> using them ? How will it react ?
You find the port address without needing to know the DMA or IRQ.
basicly, you do this (In Pascal..sorry!) :
sbaddr=$210;
sbfound:=false;
repeat
  port[sbaddr+$6]:=1;                    { reset SB, must be set for 10ms }
  delay(10);
  port[sbaddr+$6]:=0;
  i:=0;
  repeat                                 { look for "data ready" flag }
    inc(i);
  until (port[sbaddr+$e] and $80=$80) or (i=1000);
  if i<1000                               { look for signature data ($AA)}
  begin
    i:=0;
    repeat
      inc(i);
    until (port[sbaddr+$a]:=$aa) or (i=1000);   {  read data port }
    if i<1000 then sbfound:=true;
  end;
  if not sbfound then sbaddr:=sbaddr + $10;    { next addr to test }
until sbaddr>$280 or sbfound;                   { sb address range 210 - 280 

if sbfound is now true, then sbaddr = the I/O port of the SB. You can now go 
looking for DMA and IRQ's, issue DSP commands, etc etc.
       Craig
--- FMail/386 1.0g
---------------
* Origin: Communications Barrier BBS (03) 9585 1112, 24hrs (3:632/533)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.