'=========================================================================== ' Subject: DETECT VIDEO CARD Date: Unknown Date (00:00) ' Author: Peter Norton Code: QB, PDS ' Keys: DETECT,VIDEO,CARD Packet: GRAPHICS.ABC '=========================================================================== DECLARE FUNCTION GetVideoCard$ () TYPE RegType ax AS INTEGER bx AS INTEGER cx AS INTEGER dx AS INTEGER bp AS INTEGER si AS INTEGER di AS INTEGER flags AS INTEGER END TYPE DECLARE SUB INTERRUPT (IntNo AS INTEGER, InRegs AS RegType, OutRegs AS RegType) CLS PRINT "Your video card is a "; GetVideoCard$ END FUNCTION GetVideoCard$ REM This function returns a 3-letter string: "MDA" (monochrome adapter card) REM "CGA" (color graphics adapter), "EGA" (enhanced graphics adapter), REM "PGA" (professional graphics adapter), "VGA" (variable graphics array) DIM InRegs AS RegType, OutRegs AS RegType InRegs.ax = &H1A00 CALL INTERRUPT(&H10, InRegs, OutRegs) IF (OutRegs.ax AND &HFF) = &H1A THEN Code = OutRegs.bx AND &HFF SELECT CASE Code CASE 1 GetVideoCard$ = "MDA" CASE 2 GetVideoCard$ = "CGA" CASE 4 TO 5 GetVideoCard$ = "EGA" CASE 6 GetVideoCard$ = "PGA" CASE 7 TO 8 GetVideoCard$ = "VGA" END SELECT EXIT FUNCTION ELSE InRegs.ax = &H1200 InRegs.bx = &H10 CALL INTERRUPT(&H10, InRegs, OutRegs) IF (OutRegs.bx AND &HFF) <> &H10 THEN GetVideoCard$ = "EGA" EXIT FUNCTION ELSE InRegs.ax = &HF00 CALL INTERRUPT(&H10, InRegs, OutRegs) IF (OutRegs.ax AND &HFF) = 7 THEN GetVideoCard$ = "MDA" EXIT FUNCTION ELSE GetVideoCard$ = "CGA" EXIT FUNCTION END IF END IF END IF END FUNCTION