/* Read video display adapter manufacturer info from adapter ROM */ /* Display blank line */ Say /* Check for command line parameters (none required) */ Parse arg strArgs If strArgs <> "" Then Call Syntax /* Disable unwanted screen output */ "@ECHO OFF" Trace Off /* Initialize variables */ rxCrLf = X2C( 0D0A ) strDbg = "D C000:0040" || rxCrLf || "D C000:00C0" || rxCrLf || "Q" strRom = "" /* Define temporary file names */ Parse Source . . strSrc . filDbg = SubStr( strSrc, 1, LastPos( ".", strSrc ) ) || "dbg" filRom = SubStr( strSrc, 1, LastPos( ".", strSrc ) ) || "rom" /* Create temporary Debug script */ Call LineOut filDbg, strDbg Call LineOut filDbg /* Read video ROM using Debug script and store info in temporary file */ "DEBUG < " || filDbg || " > " || filRom /* Read video ROM info from temporary file and store in string */ Call LineIn filRom, 1, 0 Do Until Lines( filRom ) = 0 strRom = strRom || SubStr( LineIn( filRom ), 62 ) End /* Close temporary files */ Call LineOut filDbg Call LineOut filRom /* Delete temporary files */ "DEL " || filDbg || " > NUL" "DEL " || filRom || " > NUL" /* Cut everything from string before the first "word" */ strRom = StripString( 1, strRom ) /* Convert string to array of chars */ Do i = 1 by 1 To Length( strRom ) chrRom.0 = i chrRom.i = SubStr( strRom, i, 1 ) End /* Remove non-ASCII and other unwanted characters. */ /* This part may need some fine tuning; please */ /* notify me of any changes you need to make. */ strRom = "" Do i = 2 To chrRom.0 If DataType( chrRom.j, "S" ) = 1 Then boolAppend = 1 j = i - 1 If chrRom.i = "." Then Do boolAppend = 0 If DataType( chrRom.j, "A" ) = 1 Then boolAppend = 1 If chrRom.j = " " Then boolAppend = 1 If chrRom.j = "-" Then boolAppend = 1 If chrRom.j = "_" Then boolAppend = 1 End If boolAppend = 1 Then strRom = strRom || chrRom.j End /* Display result */ Say strRom /* Done */ EXIT 0 /* Cut everything from string before the first "word". */ /* This part may need some fine tuning; please */ /* notify me of any changes you need to make. */ StripString: Parse Arg start, strIn posSpace = Pos( " ", strIn, start ) If posSpace > 0 Then Do lposDot = LastPos( ".", SubStr( strIn, 1, posSpace ) ) If lposDot > 0 Then Do strIn = SubStr( strIn, lposDot + 1 ) /* Repeat if length of first word is less then 3 */ posDot = Pos( ".", strIn ) If posDot > 0 & posDot < 4 Then Do Call StripString 4, strIn End End End Return strIn Syntax: Say "VideoROM.rex, Version 1.00" Say "Display video adapter manufacturer information read from video ROM" Say Say "Usage: VIDEOROM.REX" Say Say 'Where: "" is your Rexx interpreter:' Say " - Windows: REGINA.EXE or REXX.EXE, whichever you installed" Say " (tested with Regina Rexx only!)" Say " - OS/2: no need to specify, just rename script to *.cmd" Say Say "This Rexx script uses DEBUG.EXE to read the video ROM" Say Say "Written by Rob van der Woude" Say "http://www.robvanderwoude.com" Say "Original idea by ComputerHope" Say "http://www.computerhope.com/rdebug.htm" EXIT 1 Return