DECLARE SUB introscreen () DECLARE SUB align () DECLARE SUB helppage () DECLARE SUB waithere () '+----------------------------------------------------------+ '| DQMSREAD : "DMQS - Mode-Analyzer" | '| | '| version 990721 - rev. 990726 | '| | '| public revisionlevel - see prglevel$ | '| | '| Peter H. Wendt / peterwendt@aol.com | '| | '| | '| Reads MONxxxx.DGS Files and analyzes the included data | '| | '+----------------------------------------------------------+ ' at first name some common variables DIM SHARED keycode$ DIM SHARED msgtext$ DIM SHARED helplvl DIM SHARED text$ DIM SHARED linelength DIM SHARED prglevel$ ' set the help level to 1 helplvl = 1 prglevel$ = "0.9.2 (BETA-990726)" ' start the intro introscreen ' switch to the first screen in Mode 0 (80x25 text) SCREEN 0, , 0, 0 SOUND 300, 3: SOUND 400, 4 ' this is the point a rerun of the program returns to ' all previous settings stay active restart: msgtext$ = " [ESC] Quit - [ENTER] Continue - [F1] Help " CLS ' this is the first input routine for the filename ' offers DIR and HELP and to stop the program LOCATE 1, 1 PRINT "NAME OF THE *.DGS file : " linelength = 79: text$ = " Type the FILE.NAME or [D] for a DIR or [?] for HELP " align LOCATE 25, 1: COLOR 15, 1: PRINT text$; COLOR 7, 0 LOCATE 1, 25: LINE INPUT openfile$ LOCATE 25, 1: PRINT STRING$(78, 32); LOCATE 2, 1 PRINT IF openfile$ = "" THEN GOTO trynext IF openfile$ = "?" THEN GOTO needhelp IF UCASE$(openfile$) = "D" THEN GOTO showme ELSE GOTO nowhere showme: doscommand$ = "DIR *.dgs /W/P" SHELL doscommand$ getkey0: a$ = INKEY$: IF a$ = "" THEN GOTO getkey0 GOTO restart nowhere: ' check if openfile$ has an extension at all ' if it has one - kill it off FOR x = 1 TO LEN(openfile$) IF MID$(openfile$, x, 1) = "." THEN openfile$ = MID$(openfile$, 1, (x - 1)) GOTO addextend END IF NEXT x ' add the proper .DGS extension ' and set openfile$ to uppercase addextend: IF LEN(openfile$) < 7 THEN GOTO restart IF MID$(UCASE$(openfile$), (LEN(openfile$) - 4), 4) <> ".DGS" THEN openfile$ = openfile$ + ".DGS" openfile$ = UCASE$(openfile$) LOCATE 1, 25: PRINT openfile$ END IF ' now open the file ... OPEN "r", #1, openfile$, 1 FIELD #1, 1 AS t$ ' look at the length ... if 0 kill off the file IF LOF(1) <> 0 THEN GOTO existing IF LOF(1) = 0 THEN CLOSE #1 KILL openfile$ GOTO sorry existing: ' the first 21h bytes are header and of no value ' ' Byte 22h of file = base(1) = 23h position !! ' Counting from 1 to x ' read total lenght of file - bytes 22h & 23h a = &H23: GET #1, a: tl = ASC(t$) a = &H24: GET #1, a: th = ASC(t$) LOCATE 3, 1 PRINT "File Length"; TAB(19); (tl + 256 * th); " bytes" ' read included monitor ID - bytes 24h & 25h ' (in case it has been copied ...) a = &H25: GET #1, a: tl$ = HEX$(ASC(t$)) IF LEN(tl$) < 2 THEN tl$ = "0" + tl$ a = &H26: GET #1, a: th$ = HEX$(ASC(t$)) IF LEN(th$) < 2 THEN th$ = "0" + th$ PRINT "Monitor ID"; TAB(20); : COLOR 11, 0: PRINT th$ + tl$: COLOR 7, 0 ' read file-revision - byte 26h a = &H27: GET #1, a: tl$ = HEX$(ASC(t$)) IF LEN(tl$) < 2 THEN tl$ = "0" + tl$ PRINT "File Revision"; TAB(20); tl$ ' read number of modes supported - byte 27h a = &H28: GET #1, a: tl$ = HEX$(ASC(t$)) dspmode = ASC(t$) IF LEN(tl$) < 2 THEN tl$ = "0" + tl$ PRINT "Supported Modes"; TAB(20); tl$; TAB(26); dspmode; "Modes" ' read display type codes - bytes 28h & 29h a = &H29: GET #1, a: tl$ = HEX$(ASC(t$)) IF LEN(tl$) < 2 THEN tl$ = "0" + tl$ a = &H2A: GET #1, a: th$ = HEX$(ASC(t$)) IF LEN(th$) < 2 THEN th$ = "0" + th$ tg$ = th$ + tl$ PRINT "Display-Type"; TAB(20); : COLOR 9, 0: PRINT tg$; TAB(27); IF tg$ = "0000" THEN dt$ = "Mono CRT": GOTO dtprint IF tg$ = "0001" THEN dt$ = "Color CRT": GOTO dtprint IF tg$ = "0002" THEN dt$ = "Mono LCD": GOTO dtprint IF tg$ = "0003" THEN dt$ = "Color LCD": GOTO dtprint IF tg$ = "0004" THEN dt$ = "Mono Borderless capable": GOTO dtprint IF tg$ = "0005" THEN dt$ = "Color Borderless capable": GOTO dtprint IF tg$ = "0009" THEN dt$ = "Color Multisync": GOTO dtprint dt$ = "Unknown Type" dtprint: COLOR 15, 0: PRINT dt$: COLOR 7, 0 ' read display width in mm - bytes 2Ah & 2Bh a = &H2B: GET #1, a: tl = ASC(t$) a = &H2C: GET #1, a: th = ASC(t$) sw = (tl + 256 * th) PRINT "Screen Width"; TAB(19); : COLOR 10, 0: PRINT sw; : COLOR 7, 0: PRINT " Millimeters" ' read display height in mm - bytes 2Ch & 2Dh a = &H2D: GET #1, a: tl = ASC(t$) a = &H2E: GET #1, a: th = ASC(t$) sh = (tl + 256 * th) PRINT "Screen Height"; TAB(19); : COLOR 10, 0: PRINT sh; : COLOR 7, 0: PRINT " Millimeters"; COLOR 12, 0 IF sh > sw THEN PRINT " (Portrait Screen)" IF sh <= sw THEN PRINT COLOR 7, 0 ' read display ID-string in ASCII, delimited by 00-value ' bytes 2Eh ... 7Dh (max. 80 characters) montype$ = "" FOR q = &H2F TO &H7E GET #1, q IF ASC(t$) = 0 THEN GOTO jumpout montype$ = montype$ + t$ NEXT q ' if the string value is 0 ... print the name jumpout: LOCATE 12, 1: COLOR 14, 0 LOCATE 12, 1: PRINT montype$ PRINT : COLOR 7, 0 ' read offset of modes - bytes 7Eh & 7Fh a = &H7F: GET #1, a: tl = ASC(t$) a = &H80: GET #1, a: th = ASC(t$) mloc$ = HEX$(tl + 256 * th) mloc = (tl + 256 * th) + 1 PRINT "Mode 1 starts at "; mloc$; "h" PRINT : PRINT getkey1: waithere IF LEN(keycode$) <> 1 THEN query$ = "getkey1" GOTO fkeyused END IF IF ASC(keycode$) = 27 THEN CLOSE #1 GOTO trynext END IF IF ASC(keycode$) = 13 THEN GOTO readmodes GOTO getkey1 readmodes: m = 1 donextmode: CLS PRINT "Mode "; : COLOR 15, 1: PRINT m; : COLOR 7, 0: PRINT " @ ["; HEX$(mloc - 1); "h]" PRINT a = mloc: GET #1, a: tl = ASC(t$) a = mloc + 1: GET #1, a: th = ASC(t$) offset = (tl + 256 * th) ' PRINT "Total Bytes in Mode "; m; " = "; HEX$(offset) nextloc = mloc + offset a = mloc + 2: GET #1, a: tl = ASC(t$) a = mloc + 3: GET #1, a: th = ASC(t$) pixelw = (tl + 256 * th): PRINT "Horizontal Pixels "; TAB(20); : COLOR 15, 0: PRINT pixelw: COLOR 7, 0 a = mloc + 4: GET #1, a: tl = ASC(t$) a = mloc + 5: GET #1, a: th = ASC(t$) pixelh = (tl + 256 * th): PRINT "Vertical Pixels "; TAB(20); : COLOR 15, 0: PRINT pixelh: COLOR 7, 0 a = mloc + 16: GET #1, a: tl = ASC(t$) a = mloc + 17: GET #1, a: th = ASC(t$) bandwidth = (tl + 256 * th) / 4: PRINT "Pixelrate "; : COLOR 11, 0: PRINT TAB(20); bandwidth; : COLOR 7, 0: PRINT " MHz" a = mloc + 18: GET #1, a: tl = ASC(t$) a = mloc + 19: GET #1, a: th = ASC(t$) linerate = (tl + 256 * th) / 10: PRINT "Mode Linerate "; : COLOR 11, 0: PRINT TAB(20); linerate; : COLOR 7, 0: PRINT " kHz" a = mloc + 20: GET #1, a: tl = ASC(t$) a = mloc + 21: GET #1, a: th = ASC(t$) framerate = (tl + 256 * th) / 10: PRINT "Frame Rate "; : COLOR 11, 0: PRINT TAB(20); framerate; : COLOR 7, 0: PRINT " Hz" ' read the display mode flags a = mloc + 12: GET #1, a: tl = ASC(t$) a = mloc + 13: GET #1, a: th = ASC(t$) f1value = ((tl + 256 * th) AND (NOT (65534))) f2value = ((tl + 256 * th) AND (NOT (65533))) IF f1value = 0 THEN scrbmode$ = "No" IF f1value = 1 THEN scrbmode$ = "Yes" IF f2value = 0 THEN scrimode$ = "Yes" IF f2value = 2 THEN scrimode$ = "No" PRINT PRINT "Borderless "; : COLOR 14, 0: PRINT TAB(21); scrbmode$: COLOR 7, 0 PRINT "Interlaced "; : COLOR 14, 0: PRINT TAB(21); scrimode$: COLOR 7, 0 ' read the mode offset a = mloc + 14: GET #1, a: tl = ASC(t$) a = mloc + 15: GET #1, a: th = ASC(t$) regoffset = (tl + 256 * th) 'PRINT "First Register Progr. at "; HEX$(mloc - 1 + regoffset) regloc = mloc - 1 + regoffset regend = nextloc - 3 FOR z = regloc TO regend STEP 3 ' PRINT "Location "; HEX$(z) GET #1, z + 1: p1 = ASC(t$): cont1$ = UCASE$(HEX$(p1)): IF LEN(cont1$) < 2 THEN cont1$ = "0" + cont1$ GET #1, z + 2: p2 = ASC(t$): cont2$ = UCASE$(HEX$(p2)): IF LEN(cont2$) < 2 THEN cont2$ = "0" + cont2$ GET #1, z + 3: p3 = ASC(t$): cont3$ = UCASE$(HEX$(p3)): IF LEN(cont3$) < 2 THEN cont3$ = "0" + cont3$ IF cont2$ = "10" THEN htrl = p3 IF cont2$ = "11" THEN htrh = p3 IF cont2$ = "12" THEN hdel = p3 IF cont2$ = "13" THEN hdeh = p3 IF cont2$ = "14" THEN hbsl = p3 IF cont2$ = "15" THEN hbsh = p3 IF cont2$ = "16" THEN hbel = p3 IF cont2$ = "17" THEN hbeh = p3 IF cont2$ = "18" THEN hspl = p3 IF cont2$ = "19" THEN hsph = p3 IF cont2$ = "1A" THEN hspel = p3 IF cont2$ = "1B" THEN hspeh = p3 ' the HSPP registers are read but not displayed ! IF cont2$ = "1C" THEN hsppl = p3 IF cont2$ = "1E" THEN hspph = p3 IF cont2$ = "20" THEN vtrl = p3 IF cont2$ = "21" THEN vtrh = p3 IF cont2$ = "22" THEN vdel = p3 IF cont2$ = "23" THEN vdeh = p3 IF cont2$ = "24" THEN vbsl = p3 IF cont2$ = "25" THEN vbsh = p3 IF cont2$ = "26" THEN vbel = p3 IF cont2$ = "27" THEN vbeh = p3 IF cont2$ = "28" THEN vspsl = p3 IF cont2$ = "29" THEN vspsh = p3 ' see help text remarks on the VSPE register ! IF cont2$ = "2A" THEN vspel = p3 IF cont2$ = "2C" THEN vlcl = p3 IF cont2$ = "2D" THEN vlch = p3 IF cont2$ = "58" THEN ppcr = p3 IF cont2$ = "50" THEN dcr1 = p3 ' register 50h is overwritten 3 times - twice at the start ' and again at the end. The last content is preserved and ' contains the HSYNC / VSYNC informations NEXT z LOCATE 12, 1: COLOR 14, 0: PRINT montype$: COLOR 7, 0 LOCATE 15, 1: PRINT "HT : ?" LOCATE 15, 21: PRINT "HDE : ?" LOCATE 15, 41: PRINT "HBS : ?" LOCATE 15, 61: PRINT "HBE : ?" LOCATE 16, 1: PRINT "HSPS: ?" LOCATE 16, 21: PRINT "HSPE: ?" 'LOCATE 16, 41: PRINT "HSPP: ?" LOCATE 17, 1: PRINT "VT : ?" LOCATE 17, 21: PRINT "VDE : ?" LOCATE 17, 41: PRINT "VBS : ?" LOCATE 17, 61: PRINT "VBE : ?" LOCATE 18, 1: PRINT "VSPS: ?" LOCATE 18, 21: PRINT "VSPE: ?" LOCATE 20, 1: PRINT "PPCR: ?" LOCATE 20, 41: PRINT "HSYNC: ?" LOCATE 20, 61: PRINT "VSYNC: ?" COLOR 12, 0 htr = ((htrl + 256 * htrh) + 1) * 8: LOCATE 15, 7: PRINT htr hde = ((hdel + 256 * hdeh) + 1) * 8: LOCATE 15, 27: PRINT hde hbs = ((hbsl + 256 * hbsh) + 1) * 8: LOCATE 15, 47: PRINT hbs hbe = ((hbel + 256 * hbeh) + 1) * 8: LOCATE 15, 67: PRINT hbe hsps = ((hspl + 256 * hsph) + 1) * 8: LOCATE 16, 7: PRINT hsps hspe = ((hspel + 256 * hspeh) + 1) * 8: LOCATE 16, 27: PRINT hspe vtr = ((vtrl + 256 * vtrh) + 1): LOCATE 17, 7: PRINT vtr vde = ((vdel + 256 * vdeh) + 1): LOCATE 17, 27: PRINT vde vbs = ((vbsl + 256 * vbsh) + 1): LOCATE 17, 47: PRINT vbs vbe = ((vbel + 256 * vbeh) + 1): LOCATE 17, 67: PRINT vbe vsps = ((vspsl + 256 * vspsh) + 1): LOCATE 18, 7: PRINT vsps vspe = ((vspel + 256 * vspsh) + 1): LOCATE 18, 27: PRINT vspe ' ' I am not sure about the use of the VSPE register, which is 8-bit ' but needs to be filled with the LSB from a 16-bit value ... ' and needs to be within 31 scan lines after VSPS - according to ' the XGA TRM. Some values given in DMQS are outside this range. ' I used MSB of VSPS ... ' 'LOCATE 18, 27: PRINT vspel ' The display control register 1 is set several times ' the final setting includes the VSYN/VSYNC polarity IF dcr1 < 128 THEN hsync$ = "-" ELSE hsync$ = "+" IF dcr1 < 64 THEN vsync$ = "-" ELSE vsync$ = "+" ' The Programmable Pixel clock register is bitmapped *and* ' contains 6 bits of values (0 - 5), while 6 & 7 contain ' settings for the base clock range. ' ' Dependencies: ' bit 7=0, 6=0, 16.25MHz base clock, divider=4, 0.25MHz steps ' bit 7=0, 6=1, 32.50MHz base clock, divider=2, 0.50MHz steps ' bit 7=1, 6=0, 65.00MHz base clock, divider=1, 1.00MHz steps ' bit 7=1, 6=1 Reserved and not used ppcb7 = ppcr AND (NOT (127)) ppcb6 = ppcr AND (NOT (191)) ppcidx = ppcr AND (NOT (192)) IF ppcb7 = 0 AND ppcb6 = 0 THEN ppcdiv = 4 basefrq = 16.25 incr = .25 END IF IF ppcb7 = 0 AND ppcb6 <> 0 THEN ppcdiv = 2 basefrq = 32.5 incr = .5 END IF IF ppcb7 <> 0 AND ppcb6 = 0 THEN ppcdiv = 1 basefrq = 65 incr = 1 END IF IF ppcb7 <> 0 AND ppcb6 <> 0 THEN ppcdiv = 0 basefrq = 0 incr = 0 END IF ' ' The Pixel Clock is the base-frequency + (X * steps) ' E.g. PPCIDX=36, then bit 7 & 6 are both 0 ' 16.25MHz + (36 * 0.25MHz) = 25.25MHz pixel clock ' ppcbw = basefrq + (ppcidx * incr) LOCATE 20, 7: PRINT ppcr; " = "; ppcbw; COLOR 7, 0 PRINT " MHz Pixelclock" COLOR 15, 0 LOCATE 20, 49: PRINT hsync$ LOCATE 20, 69: PRINT vsync$ COLOR 7, 0 getkey2: waithere IF LEN(keycode$) <> 1 THEN query$ = "getkey2" GOTO fkeyused END IF IF ASC(keycode$) = 27 THEN CLOSE #1 GOTO trynext END IF IF ASC(keycode$) = 13 AND m <= dspmode THEN m = m + 1 IF m > dspmode GOTO doneall mloc = nextloc GOTO donextmode END IF GOTO getkey2 doneall: CLOSE #1 GOTO trynext sorry: PRINT "The file "; openfile$; " does not exist !" msgtext$ = " [ESC] = Quit - [ENTER] = Retry " GOTO getkey3 trynext: LOCATE 22, 30: COLOR 15, 3: PRINT " Try another one ? ": COLOR 7, 0 getkey3: waithere IF LEN(keycode$) <> 1 THEN query$ = "getkey3" GOTO fkeyused END IF IF ASC(keycode$) = 27 THEN GOTO shutdown IF ASC(keycode$) = 13 THEN GOTO restart GOTO getkey3 shutdown: CLS linelength = 79 text$ = "This Program is brought to you by": align: LOCATE 10, 1: COLOR 15, 0: PRINT text$ text$ = "Peter H. Wendt (peterwendt@aol.com)": align: LOCATE 12, 1: COLOR 14, 0: PRINT text$ text$ = " Have A Nice Day ! ": align: LOCATE 16, 1: COLOR 12, 0: PRINT text$ COLOR 7, 0 a = TIMER: b = a WHILE a < b + .5 a = TIMER WEND SOUND 500, 2: SOUND 350, 3 LOCATE 22, 1 a = TIMER: b = a WHILE a < b + .5 a = TIMER WEND END needhelp: fkeyused: SCREEN 0, , 1, 1 helppage SCREEN 0, , 0, 0 IF query$ = "getkey1" THEN GOTO getkey1 IF query$ = "getkey2" THEN GOTO getkey2 IF query$ = "getkey3" THEN GOTO getkey3 GOTO restart SUB align esp = linelength - LEN(text$) espl = INT(esp / 2): espr = esp - espl text$ = STRING$(espl, 32) + text$ + STRING$(espr, 32) END SUB SUB helppage oldmsgtext$ = msgtext$ IF helplvl = 1 THEN GOTO level1 IF helplvl = 2 THEN GOTO level2 IF helplvl = 3 THEN GOTO level3 IF helplvl = 4 THEN GOTO level4 IF helplvl = 5 THEN GOTO level5 IF helplvl = 6 THEN GOTO level6 IF helplvl = 7 THEN GOTO level7 IF helplvl = 8 THEN GOTO level8 IF helplvl = 9 THEN GOTO level9 level1: ' Hilfe-Seite 1 CLS msgtext$ = "[ESC] Go Back - [+] Next Page - [-] Previous Page" COLOR 15, 1 LOCATE 1, 1: PRINT CHR$(201) + STRING$(77, 205) + CHR$(187); linelength = 77: text$ = "HELP - PAGE Level 1": align LOCATE 2, 1: PRINT CHR$(186) + text$ + CHR$(186); LOCATE 3, 1: PRINT CHR$(200); STRING$(77, 205); CHR$(188); COLOR 15, 0 LOCATE 7, 1 n = 5 PRINT TAB(n); "The purpose of this program is to decypher the cryptic settings included" PRINT TAB(n); "in the DMQS-Files which accompany the IBM XGA-2 Graphiccard and which are" PRINT TAB(n); "used to set the modes and the operational parameters for the monitors." PRINT : PRINT PRINT TAB(n); "The included modes and their settings may help to get the monitors" PRINT TAB(n); "adjusted for other operating systems like LINUX - or generally get to" PRINT TAB(n); "know *what* kind of settings the monitor allowes when being used with" PRINT TAB(n); "the XGA-2 ... and maybe when being used on other video-cards." PRINT : PRINT : PRINT linelength = 79: text$ = "This Program is Release " + prglevel$: align: PRINT text$ linelength = 79: text$ = "(C) 1999 by Peter H. Wendt / peterwendt@aol.com": align: PRINT text$ gethelp1: waithere IF ASC(keycode$) = 27 THEN GOTO endhelp IF ASC(keycode$) = 43 THEN helplvl = 2: GOTO level2 GOTO gethelp1 level2: CLS msgtext$ = "[ESC] Go Back - [+] Next Page - [-] Previous Page" COLOR 15, 1 LOCATE 1, 1: PRINT CHR$(201) + STRING$(77, 205) + CHR$(187); linelength = 77: text$ = "HELP - PAGE Level 2": align LOCATE 2, 1: PRINT CHR$(186) + text$ + CHR$(186); LOCATE 3, 1: PRINT CHR$(200); STRING$(77, 205); CHR$(188); COLOR 15, 0 LOCATE 7, 1 linelength = 79: text$ = "WHAT TO DO ON THE FIRST PAGE ?": align: PRINT text$ n = 15 PRINT : PRINT PRINT TAB(n); " Here you can do the following:": PRINT PRINT TAB(n); "- Enter a FILENAME (if you know the name)" PRINT TAB(n); " The filename is not case-sensitive" PRINT TAB(n); " The .DGS extension is added automatically" PRINT PRINT TAB(n); "- Press [D] to list all *.DGS files" PRINT TAB(n); " (If you don't know the name)" PRINT TAB(n); "- Press [?] to enter these help pages" PRINT TAB(n); "- Press [ENTER] to jump out of the program" gethelp2: waithere IF ASC(keycode$) = 27 THEN GOTO endhelp IF ASC(keycode$) = 43 THEN helplvl = 3: GOTO level3 IF ASC(keycode$) = 45 THEN helplvl = 1: GOTO level1 GOTO gethelp2 level3: CLS msgtext$ = "[ESC] Go Back - [+] Next Page - [-] Previous Page" COLOR 15, 1 LOCATE 1, 1: PRINT CHR$(201) + STRING$(77, 205) + CHR$(187); linelength = 77: text$ = "HELP - PAGE Level 3": align LOCATE 2, 1: PRINT CHR$(186) + text$ + CHR$(186); LOCATE 3, 1: PRINT CHR$(200); STRING$(77, 205); CHR$(188); COLOR 15, 0 LOCATE 5, 1 linelength = 79: text$ = "WHAT DOES THE FIRST OUTPUT PAGE SHOW ?": align: PRINT text$ n = 5 PRINT COLOR 7, 0: PRINT TAB(n); "File Length [bytes]"; : COLOR 15, 0: PRINT " the length of the files obviously" COLOR 7, 0: PRINT TAB(n); "Monitor ID "; : COLOR 11, 0: PRINT "[hex]"; : COLOR 15, 0: PRINT " the enclosed ID - in case it had been copied" COLOR 7, 0: PRINT TAB(n); "File Revision [hex] "; : COLOR 15, 0: PRINT "the internal revision of the file" COLOR 7, 0: PRINT TAB(n); "Supported Modes [hex] "; : COLOR 15, 0: PRINT "the number of included modes" COLOR 7, 0: PRINT TAB(n); "Display Type "; : COLOR 9, 0: PRINT "[hex] "; : COLOR 15, 0: PRINT "the technical type of display" PRINT TAB(n + 25); "0000 = Mono CRT, 0001 = Color CRT" PRINT TAB(n + 25); "0002 = Mono LCD, 0003 = Color LCD" PRINT TAB(n + 25); "0004 = Mono Borderless capable" PRINT TAB(n + 25); "0005 = Color Borderless capable" PRINT TAB(n + 25); "0009 = Color Multisync" COLOR 7, 0: PRINT TAB(n); "Screen Width "; : COLOR 10, 0: PRINT "[dec] "; : COLOR 15, 0: PRINT "Measured in Millimeters" COLOR 7, 0: PRINT TAB(n); "Screen Heigth "; : COLOR 10, 0: PRINT "[dec] "; : COLOR 15, 0: PRINT "Measured in Millimeters" PRINT COLOR 14, 0: PRINT TAB(n); "Some Text, Numbers, Sizes"; : COLOR 15, 0: PRINT " about the Type / Model of Display" PRINT COLOR 7, 0: PRINT TAB(n); "Mode x starts at [hex]"; : COLOR 15, 0: PRINT " Some information about the Mode-Table" gethelp3: waithere IF ASC(keycode$) = 27 THEN GOTO endhelp IF ASC(keycode$) = 43 THEN helplvl = 4: GOTO level4 IF ASC(keycode$) = 45 THEN helplvl = 2: GOTO level2 GOTO gethelp3 level4: CLS msgtext$ = "[ESC] Go Back - [+] Next Page - [-] Previous Page" COLOR 15, 1 LOCATE 1, 1: PRINT CHR$(201) + STRING$(77, 205) + CHR$(187); linelength = 77: text$ = "HELP - PAGE Level 4": align LOCATE 2, 1: PRINT CHR$(186) + text$ + CHR$(186); LOCATE 3, 1: PRINT CHR$(200); STRING$(77, 205); CHR$(188); COLOR 15, 0 LOCATE 5, 1 linelength = 79: text$ = "WHAT DOES THE MODE x PAGES SHOW (1) ?": align: PRINT text$ n = 5: COLOR 7, 0 PRINT PRINT TAB(n); "Horizontal Pixels "; : COLOR 15, 0: PRINT "[num] the number of screen dots left to right": COLOR 7, 0 PRINT TAB(n); "Vertical Pixels "; : COLOR 15, 0: PRINT "[num] the number of screen dots top to bottom": COLOR 7, 0 PRINT TAB(n); "Pixelrate "; : COLOR 11, 0: PRINT "[num]"; : COLOR 15, 0: PRINT " the total video-bandwidth for that mode": COLOR 7, 0 PRINT TAB(n); "Mode Linerate "; : COLOR 11, 0: PRINT "[num]"; : COLOR 15, 0: PRINT " the horizontal line rate in KiloHertz": COLOR 7, 0 PRINT TAB(n); "Frame Rate "; : COLOR 11, 0: PRINT "[num]"; : COLOR 15, 0: PRINT " the vertical refresh rate (Pictures Per Second)": COLOR 7, 0 PRINT PRINT TAB(n); "Borderless "; : COLOR 14, 0: PRINT "[Y/N]"; : COLOR 15, 0: PRINT " Indicates if the mode is Borderless": COLOR 7, 0 PRINT TAB(n); "Interlaced "; : COLOR 14, 0: PRINT "[Y/N]"; : COLOR 15, 0: PRINT " Indicates if the mode runs Interlaced": COLOR 7, 0 PRINT COLOR 14, 0: PRINT TAB(n); "Some Text, Numbers, Sizes"; : COLOR 15, 0: PRINT " about the Type / Model of Display" PRINT gethelp4: waithere IF ASC(keycode$) = 27 THEN GOTO endhelp IF ASC(keycode$) = 43 THEN helplvl = 5: GOTO level5 IF ASC(keycode$) = 45 THEN helplvl = 3: GOTO level3 GOTO gethelp4 level5: CLS msgtext$ = "[ESC] Go Back - [+] Next Page - [-] Previous Page" COLOR 15, 1 LOCATE 1, 1: PRINT CHR$(201) + STRING$(77, 205) + CHR$(187); linelength = 77: text$ = "HELP - PAGE Level 5": align LOCATE 2, 1: PRINT CHR$(186) + text$ + CHR$(186); LOCATE 3, 1: PRINT CHR$(200); STRING$(77, 205); CHR$(188); COLOR 15, 0 LOCATE 5, 1 linelength = 79: text$ = "WHAT DOES THE MODE x PAGES SHOW (2) ?": align: PRINT text$ n = 5 PRINT PRINT TAB(n); "HT = Hor. Total = total hor.pixels within a frame" PRINT TAB(n); "HDE = Hor. Display End = end pixel of visible area" PRINT TAB(n); "HBS = Hor. Blanking Start = end pixel of picture border" PRINT TAB(n); "HBE = Hor. Blanking End = start pixel of picture border" PRINT TAB(n); "HSPS= Hor. Sync Pulse Start = start of the HSYNC within frame" PRINT TAB(n); "HSPE= Hor. Sync Pulse End = end of the HYSNC within frame" PRINT PRINT TAB(n); "VT = Ver. Total = total vert.pixels within a frame" PRINT TAB(n); "VDE = Ver. Display End = end pixel of visible area" PRINT TAB(n); "VBS = Ver. Blanking Start = end pixel of picture border" PRINT TAB(n); "VBE = Ver. Blanking End = start pixel of picture border" PRINT TAB(n); "VSPS= Ver. Sync Pulse Start = start of the VSYNC within frame" PRINT TAB(n); "VSPE= Ver. Sync Pulse End = end of the VSYNC within frame" PRINT PRINT TAB(n); "PPCR= Prog.Pixel Clock Reg. = the re-calculated value for pixelclock" PRINT TAB(n); "HSYNC & VSYNC = polarity of the HSYNC and VSYNC" PRINT gethelp5: waithere IF ASC(keycode$) = 27 THEN GOTO endhelp IF ASC(keycode$) = 43 THEN helplvl = 6: GOTO level6 IF ASC(keycode$) = 45 THEN helplvl = 4: GOTO level4 GOTO gethelp5 level6: CLS msgtext$ = "[ESC] Go Back - [+] Next Page - [-] Previous Page" COLOR 15, 1 LOCATE 1, 1: PRINT CHR$(201) + STRING$(77, 205) + CHR$(187); linelength = 77: text$ = "HELP - PAGE Level 6": align LOCATE 2, 1: PRINT CHR$(186) + text$ + CHR$(186); LOCATE 3, 1: PRINT CHR$(200); STRING$(77, 205); CHR$(188); COLOR 15, 0 LOCATE 5, 1 linelength = 79: text$ = "HOW ARE THESE VALUES RELATED ?": align: PRINT text$ n = 8 PRINT PRINT TAB(n); " HSPSÚÄÄ?HSPE " PRINT TAB(n); " ÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄU AÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂ" PRINT TAB(n); " 0 HDE HBS HBE HT" PRINT TAB(n); "AÄÄÄÄ 0AÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄAÄÄÄÄÄÄÄÄÄÄÄÄAÄÄÄÄÄÄÄÄAÄÄÄÄÄÄÄÄÄÄÄÄÄ´" PRINT TAB(n); "3 322222222222222222223 3 3 3" PRINT TAB(n); "3 3222Active Picture223 Right 3 Blank 3 Left 3" PRINT TAB(n); "3 32222222Area222222223 Border 3 Phase 3 Border 3" PRINT TAB(n); "3 322222222222222222223 3 3 3" PRINT TAB(n); "3 VDE ÄAÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄU 3 3 3" PRINT TAB(n); "3 3Lower Border 3 3 3" PRINT TAB(n); "3 VBS ÄAÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄU 3 3" PRINT TAB(n); "AÄ?VSPS3 3 3" PRINT TAB(n); "ÚÄUVSPE3Blanking Phase 3 3" PRINT TAB(n); "3 VBE ÄAÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄU 3" PRINT TAB(n); "3 3Upper Border 3" PRINT TAB(n); "A VT ÄÄAÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄU" gethelp6: waithere IF ASC(keycode$) = 27 THEN GOTO endhelp IF ASC(keycode$) = 43 THEN helplvl = 7: GOTO level7 IF ASC(keycode$) = 45 THEN helplvl = 5: GOTO level5 GOTO gethelp6 level7: CLS msgtext$ = "[ESC] Go Back - [+] Next Page - [-] Previous Page" COLOR 15, 1 LOCATE 1, 1: PRINT CHR$(201) + STRING$(77, 205) + CHR$(187); linelength = 77: text$ = "HELP - PAGE Level 7": align LOCATE 2, 1: PRINT CHR$(186) + text$ + CHR$(186); LOCATE 3, 1: PRINT CHR$(200); STRING$(77, 205); CHR$(188); COLOR 15, 0 LOCATE 7, 1 linelength = 79: text$ = "COMMON STRUCTURE OF DMQS-FILES (1)": align: PRINT text$ n = 8 PRINT PRINT TAB(n); "00h - 21h [bytes] : DMQS Header (fixed set of hexcodes)" PRINT PRINT TAB(n); "22h [word] : Total lenght of file" PRINT TAB(n); "24h [word] : Composite Monitor ID" PRINT TAB(n); "26h [byte] : Revision Level" PRINT TAB(n); "27h [byte] : Number of supported Modes" PRINT TAB(n); "28h [word] : Display Type (e.g. 0003 Color CRT)" PRINT TAB(n); "2Ah [word] : Screen Width in Millimeter" PRINT TAB(n); "2Ch [word] : Screen Heigth in Millimeter" PRINT PRINT TAB(n); "2Eh [bytes] : 80 bytes of Text, Null-terminated" PRINT PRINT TAB(n); "7Eh [word] : Offset of Individual Mode Data from" PRINT TAB(n); " the beginning of the file" gethelp7: waithere IF ASC(keycode$) = 27 THEN GOTO endhelp IF ASC(keycode$) = 43 THEN helplvl = 8: GOTO level8 IF ASC(keycode$) = 45 THEN helplvl = 6: GOTO level6 GOTO gethelp7 level8: CLS msgtext$ = "[ESC] Go Back - [+] Next Page - [-] Previous Page" COLOR 15, 1 LOCATE 1, 1: PRINT CHR$(201) + STRING$(77, 205) + CHR$(187); linelength = 77: text$ = "HELP - PAGE Level 8": align LOCATE 2, 1: PRINT CHR$(186) + text$ + CHR$(186); LOCATE 3, 1: PRINT CHR$(200); STRING$(77, 205); CHR$(188); COLOR 15, 0 LOCATE 7, 1 linelength = 79: text$ = "COMMON STRUCTURE OF DMQS-FILES (2)": align: PRINT text$ n = 8 PRINT PRINT TAB(n); "80h [word] : Length of first optional extension" PRINT TAB(n); " Length = 0 : no optional extension" PRINT TAB(n); " Length <>0 : 16 bit identifier and optional data" PRINT TAB(n); "82h [word] : First 16-bit identifier" PRINT TAB(n); "84h [bytes] : First of multiple tables of variable" PRINT TAB(n); " Length with mode specific data" PRINT : PRINT PRINT TAB(n); " The mode-dependent settings start at the relative adress" PRINT TAB(n); " given in bytes 7Eh (LSB) and 7Fh (MSB)" gethelp8: waithere IF ASC(keycode$) = 27 THEN GOTO endhelp IF ASC(keycode$) = 43 THEN helplvl = 9: GOTO level9 IF ASC(keycode$) = 45 THEN helplvl = 7: GOTO level7 GOTO gethelp8 level9: CLS msgtext$ = "[ESC] Go Back - [+] Next Page - [-] Previous Page" COLOR 15, 1 LOCATE 1, 1: PRINT CHR$(201) + STRING$(77, 205) + CHR$(187); linelength = 77: text$ = "HELP - PAGE Level 9": align LOCATE 2, 1: PRINT CHR$(186) + text$ + CHR$(186); LOCATE 3, 1: PRINT CHR$(200); STRING$(77, 205); CHR$(188); COLOR 15, 0 LOCATE 5, 1 linelength = 79: text$ = "COMMON STRUCTURE OF DMQS-FILES (3)": align: PRINT text$ n = 8 PRINT PRINT TAB(n); "Each 'Mode' consists out of a set of 3-byte informations," PRINT TAB(n); "which are in fact XGA-programming commands into particular" PRINT TAB(n); "registers of the XGA-2 card." PRINT PRINT TAB(n); "Any 3 bytes are used as follows:" PRINT PRINT TAB(n); "n+0 : Register Type " PRINT TAB(n); " 00 = Write to XGA Direct Access I/O Register" PRINT TAB(n); " 01 = Write to XGA Indexed Access I/O Register" PRINT TAB(n); " 02 = OR with XGA Indexed Access I/O Register" PRINT TAB(n); " 03 = OR with XGA Direct Access I/O Register" PRINT TAB(n); " 04 = AND with XGA Indexed Access I/O Register" PRINT TAB(n); " 05 = AND with XGA Direct Access I/O Register" PRINT TAB(n); "n+1 : Register Offset from Base I/O" PRINT TAB(n); " Direct = 00 - 0Fh, Indirect = 00 - FFh" PRINT TAB(n); "n+2 : Register Value " gethelp9: waithere IF ASC(keycode$) = 27 THEN GOTO endhelp IF ASC(keycode$) = 43 THEN helplvl = 10: GOTO level10 IF ASC(keycode$) = 45 THEN helplvl = 8: GOTO level8 GOTO gethelp9 level10: CLS msgtext$ = "[ESC] Go Back - [+] Next Page - [-] Previous Page" COLOR 15, 1 LOCATE 1, 1: PRINT CHR$(201) + STRING$(77, 205) + CHR$(187); linelength = 77: text$ = "HELP - PAGE Level 10": align LOCATE 2, 1: PRINT CHR$(186) + text$ + CHR$(186); LOCATE 3, 1: PRINT CHR$(200); STRING$(77, 205); CHR$(188); COLOR 15, 0 LOCATE 7, 1 linelength = 79: text$ = "COMMON STRUCTURE OF DMQS-FILES (4)": align: PRINT text$ n = 8 PRINT PRINT TAB(n); "Usually the registers programming starts with 01-50-01, 01-50-00" PRINT TAB(n); "which is the equivalent of XGA CRT-controller Blanking and Reset." PRINT TAB(n); "Register 50h is the bitmapped Display Control Register 1 (DCR1)." PRINT PRINT TAB(n); "The sequence ends with 01-50-0x, which returns the CRT-controller" PRINT TAB(n); "back to normal operation. 'x' in this case is a bit pattern, which" PRINT TAB(n); "sets the bits 0 and 1 of Reg. 50h back to 'normal operation' status." PRINT PRINT TAB(n); "The other 'triplets' are commands to program various registers." PRINT gethelp10: waithere IF ASC(keycode$) = 27 THEN GOTO endhelp IF ASC(keycode$) = 43 THEN helplvl = 11: GOTO level11 IF ASC(keycode$) = 45 THEN helplvl = 9: GOTO level9 GOTO gethelp10 level11: CLS msgtext$ = "[ESC] Go Back - [+] Next Page - [-] Previous Page" COLOR 15, 1 LOCATE 1, 1: PRINT CHR$(201) + STRING$(77, 205) + CHR$(187); linelength = 77: text$ = "HELP - PAGE Level 11": align LOCATE 2, 1: PRINT CHR$(186) + text$ + CHR$(186); LOCATE 3, 1: PRINT CHR$(200); STRING$(77, 205); CHR$(188); COLOR 15, 0 LOCATE 5, 1 linelength = 79: text$ = "THE XGA-2 REGISTERS (1)": align: PRINT text$ n = 5 PRINT PRINT TAB(n); "LSB / MSB | Purpose" PRINT TAB(n); "----------+---------------------------------------------------------" PRINT TAB(n); "10h / 11h | Horizontal Total Register 00 = 8 pixel" PRINT TAB(n); "12h / 13h | Horizontal Display End Register 00 = 8 pixel" PRINT TAB(n); "14h / 15h | Horizontal Blanking Start Register 00 = 8 pixel" PRINT TAB(n); "16h / 17h | Horizontal Blanking End Register 00 = 8 pixel" PRINT TAB(n); "18h / 19h | Horizontal Sync Pulse Start Register 00 = 8 pixel" PRINT TAB(n); "1Ah / 1Bh | Horizontal Sync Pulse End Register 00 = 8 pixel" PRINT TAB(n); "1Ch / 1Eh | Horizontal Sync Pulse Position Register (bitmapped)" PRINT TAB(n); " | (This register is normally not used and set to 00 / 00)" PRINT TAB(n); "20h / 21h | Vertical Total Register 00 = 1 line" PRINT TAB(n); "22h / 23h | Vertical Display End Register 00 = 1 line" PRINT TAB(n); "24h / 25h | Vertical Blanking Start Register 00 = 1 line" PRINT TAB(n); "26h / 27h | Vertical Blanking End Register 00 = 1 line" PRINT TAB(n); "28h / 29h | Vertical Sync Pulse Start Register 00 = 1 line" PRINT TAB(n); " 2Ah | Vertical Sync Pulse End Register 00 = 1 line" PRINT TAB(n); " (The value must be within 31 lines of VSPS)" gethelp11: waithere IF ASC(keycode$) = 27 THEN GOTO endhelp IF ASC(keycode$) = 43 THEN helplvl = 12: GOTO level12 IF ASC(keycode$) = 45 THEN helplvl = 10: GOTO level10 GOTO gethelp11 level12: CLS msgtext$ = "[ESC] Go Back - [+] Next Page - [-] Previous Page" COLOR 15, 1 LOCATE 1, 1: PRINT CHR$(201) + STRING$(77, 205) + CHR$(187); linelength = 77: text$ = "HELP - PAGE Level 12": align LOCATE 2, 1: PRINT CHR$(186) + text$ + CHR$(186); LOCATE 3, 1: PRINT CHR$(200); STRING$(77, 205); CHR$(188); COLOR 15, 0 LOCATE 5, 1 linelength = 79: text$ = "THE XGA-2 REGISTERS (2)": align: PRINT text$ n = 5 PRINT PRINT TAB(n); "LSB / MSB | Purpose" PRINT TAB(n); "----------+---------------------------------------------------------" gethelp12: waithere IF ASC(keycode$) = 27 THEN GOTO endhelp IF ASC(keycode$) = 43 THEN helplvl = 13: GOTO level13 IF ASC(keycode$) = 45 THEN helplvl = 11: GOTO level11 GOTO gethelp12 level13: ' ' Add new levels above this line ' helplvl = 1: GOTO level1 endhelp: msgtext$ = oldmsgtext$ COLOR 7, 0 END SUB SUB introscreen SCREEN 0, 0, 0: CLS COLOR 15, 0 PRINT CHR$(218); STRING$(77, 196); CHR$(191); CHR$(32) FOR q = 1 TO 20 PRINT CHR$(179); STRING$(77, 32); CHR$(179); CHR$(177); NEXT q PRINT CHR$(192); STRING$(77, 196); CHR$(217); CHR$(177) PRINT CHR$(32); STRING$(79, 177); linelength = 70 text$ = "- D M Q S R E A D -": align: LOCATE 5, 5: COLOR 12, 0: PRINT text$; : COLOR 14, 0 text$ = "Yet another tool of questionable use from the restless brain of": align: LOCATE 9, 5: PRINT text$ text$ = "Peter H. Wendt a.k.a. 'Don Peter'": align: LOCATE 11, 5: PRINT text$ text$ = " (peterwendt@aol.com)": align: LOCATE 12, 5: PRINT text$ text$ = "(C) 1999 - Version " + prglevel$: align: LOCATE 18, 5: PRINT text$ COLOR 7, 0 introloop: a$ = INKEY$: IF a$ = "" GOTO introloop END SUB SUB waithere linelength = 79: text$ = msgtext$: align LOCATE 25, 1: COLOR 14, 4: PRINT text$; loop1: a$ = INKEY$ IF a$ = "" THEN GOTO loop1 ELSE GOTO leave leave: COLOR 7, 0 SOUND 1500, .1: SOUND 1000, .1: SOUND 2500, .1 LOCATE 25, 1: PRINT STRING$(78, 32); keycode$ = a$ END SUB