http://GameProgrammer.Com

Programming

GP Mailing List
     Thread Index
     Date Index

ATXGPSIG List
     Thread Index
     Date Index

Google
>

Home

Wise2Food



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

adlib/sb detection



hi everybody

i would just like to know: how can i test for an adlib/sb card under dos?
and also under windows? i have some information for programming it under
dos, but i cant get it working, basically my code is something like this:

	outportb(0x388, 0x4);
	outportb(0x389, 0x60);
	outportb(0x388, 0x4);
	outportb(0x389, 0x80);
	outportb(0x388, 0x2);
	outportb(0x389, 0xff);
	outportb(0x388, 0x4);
	outportb(0x389, 0x21);
	stat1 = inport(0x388);
	delay(80);
	stat2 = inport(0x388);
	outportb(0x388, 0x4);
	outportb(0x389, 0x60);
	outportb(0x388, 0x4);
	outportb(0x389, 0x80);
	if (stat1 & 0xe0 == 0x0 && stat2 & 0xe0 == 0xc0) {
	    /* card detected */
	} else {
	    /* card not detected */
	}

when i use this code, it always tells me that theres no card detected,
even though i tried it on both a machine with a card, and on one without a
card. can somebody please help me out?

cheers

dave

ps i tried writing it in pascal and assembly as well, and i couldnt get it
working either. dont know maybe im just stupid :-)). or my docs are
faulty :-)).

=================================================================
The GameProgrammer.Com mailing list is for the open discussion
of any topic related to the art, science, and business of
programming games. This list is especially tolerant of beginners.
We were all beginners once

To SUBSCRIBE or UNSUBSCRIBE please visit:
http://gameprogrammer.com/mailinglist.html