home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.graphics:9493 comp.os.msdos.programmer:9128
- Path: sparky!uunet!spool.mu.edu!sdd.hp.com!swrinde!network.ucsd.edu!cogsci!crl!hartung
- From: hartung@crl.ucsd.edu (Jeff Hartung)
- Newsgroups: comp.graphics,comp.os.msdos.programmer
- Subject: S3 86C911 graphics chip identification
- Keywords: VGA SVGA S3 chip identification graphics card IBM MSDOS
- Message-ID: <1565@cogsci.ucsd.EDU>
- Date: 7 Sep 92 16:27:21 GMT
- Sender: news@cogsci.ucsd.EDU
- Organization: University of California, San Diego
- Lines: 108
-
-
- Hi. Can anyone verify whether or not this is the best method to identify the
- S3 86C911 chip? The documentation I have from S3 says that the CRT controller
- register at index value 30h is a "Chip ID/Rev Register" and has a fixed
- value of 81h. It seems to work on my card (Orchid F1280) just fine, but I am
- wondering if there is some better way to do this?
-
- ---------------------------------CUT HERE---------------------------------
- #pragma inline
- #include <dos.h>
-
- #define TRUE 1
- #define FALSE 0
-
- #define MISC 0x3CC /* Miscelaneous output control register */
- #define S3R0 0x30 /* S3 Chip ID/Rev. Register */
- #define S3R8 0x38 /* S3 Register Lock 1 CRTC index (0x48 to unlock) */
- #define S3R9 0x39 /* S3 Register Lock 2 CRTC index (0xa5 to unlock) */
-
- int CRTA, CRTD; /* CRTC index and CRTC register */
- unsigned char S3 = FALSE;
-
- int is_s3(void)
- {
- int value;
-
- unlock_s3(); /* Unlock access to S3 CRTC Registers */
-
- outportb(CRTA, S3R0);
- value = inportb(CRTD);
-
- lock_s3(); /* Relock access to S3 CRTC Registers */
-
- getch();
- if (value == 0x81) return 1;
- else return 0;
- }
-
- void unlock_s3(void)
- {
- asm {
- mov dx,CRTA
- mov al,S3R8
- out dx,al
- inc dx
- mov al,0x48
- out dx,al
- dec dx
- mov al,S3R9
- out dx,al
- inc dx
- mov al,0xa5
- out dx,al
- }
- }
-
- void lock_s3(void)
- {
- asm {
- mov dx,CRTA
- mov al,S3R8
- out dx,al
- inc dx
- mov al,0x84
- out dx,al
- dec dx
- mov al,S3R9
- out dx,al
- inc dx
- mov al,0x42
- out dx,al
- }
- }
-
- void main(int argc, char *argv[])
- {
-
- if (inport(MISC) & 1) CRTA = 0x3d4; /* Color monitor */
- else CRTA = 0x3b4; /* Monochrome monitor */
- CRTD = CRTA + 1;
-
- S3 = is_s3();
- }
- ---------------------------------CUT HERE---------------------------------
-
- Thanks,
-
- --Jeff Hartung--
- Disclaimer: My opinions only, etc., etc., BLAH! BLAH! BLAH!...
- InterNet - hartung@crl.ucsd.edu BITNET - hartung@ucsd
- UUCP - ucsd!crl.ucsd.edu!hartung
- Newsgroups: comp.graphics
- Subject: Re: Quadratic Bezier curve
- Summary:
- Expires:
- References: <Meessen-040992120427@130.104.58.7> <douglas.715814265@willow.cs.scarolina.edu>
- Sender:
- Followup-To:
- Distribution:
- Organization: University of California, San Diego
- Keywords:
-
-
- --
- --Jeff Hartung--
- Disclaimer: My opinions only, etc., etc., BLAH! BLAH! BLAH!...
- InterNet - hartung@crl.ucsd.edu BITNET - hartung@ucsd
- UUCP - ucsd!crl.ucsd.edu!hartung
-