DEFINT A-Z '========================================================================== 'Sample program just to show how function works and what its return values 'are. Annotated MASM source code attached. ' 'You will note that function states whether MSHERC.COM is installed or not 'This is important, because without MSHERC.COM, SCREEN 3 graphics can not 'be performed (shareware packages are available to overcome this). 'The function is designed to return information that could be fed 'blindly into SCREEN function if you used ABS(VIDEOSTAT%). ' 'Copyright 1990, Copr. 1990 Sidney J. Kelly, All Rights Reserved ' '========================================================================== 'returns information concerning adapter and display 'ignores HERC emulation modes of VGA/EGA adapters when attached to a 'color adapter because QBASIC does too DECLARE FUNCTION VIDEOSTAT% () 'if INCOLOR returns -1 then have a color adapter, ' if 0 then have a monochrome adapter. Cannot be fooled by HERC ' CGA emulation programs, but will follow VGA/EGA color adapters ' HERC emulation modes DECLARE FUNCTION INCOLOR% () VidMode = VIDEOSTAT% 'select pleasing background IF INCOLOR% THEN BackGrd = 1 'use a blue background LOCATE , , , 6, 7 'Pleasant cursor size ELSE BackGrd = 0 'use a black background LOCATE , , , 12, 13 'Pleasant cursor size END IF 'adjust background for possibility of single color CGA displays SELECT CASE VidMode% CASE -2 BackGrd = 0 CASE 4 BackGrd = 0 CASE ELSE END SELECT COLOR 7, BackGrd CLS LOCATE 3, 1 PRINT "You have a "; SELECT CASE VidMode% CASE 13 PRINT "color VGA"; CASE 11 PRINT "color MCGA"; CASE 10 PRINT "monochrome EGA, VGA or MCGA"; CASE 9 PRINT "color EGA with EGD"; CASE 8 PRINT "color EGA w/ EGD w/ 64KB memory"; CASE 4 PRINT "AT&T CGA"; CASE 3 PRINT "Hercules (w/graphics support) mono"; CASE 2 PRINT "CGA"; CASE 0 PRINT "normal mono"; CASE -2 PRINT "COMPAQ CGA"; CASE -3 PRINT "Hercules w/o graphics support (install MSHERC.COM)"; CASE -8 PRINT "EGA with CGA with 64KB memory"; CASE -9 PRINT "EGA with CGA"; CASE -11 PRINT "MCGA with EGA"; CASE ELSE PRINT "unknown"; END SELECT PRINT " display." PRINT "INCOLOR reports that you have a "; IF INCOLOR% THEN PRINT "color mode adapter." ELSE PRINT "mono mode adapter." END IF PRINT PRINT "Copyright 1990, Copr. 1990 Sidney J. Kelly, All Rights Reserved" END