'=========================================================================== ' Subject: WRITE TO FILE, THE DAC/AC DATA Date: 03-17-99 (13:15) ' Author: Jacob Wieles Code: QB, QBasic, PDS, PB ' Origin: jacwls@worldonline.nl Packet: EGAVGA.ABC '=========================================================================== 'program : DACAC12B.BAS (17-03-99) ' Get data from the Digital-to-Analog Converter (DAC) and ' the Attribute Controler (AC). ' Write the data to the file DACxx-12.TXT so you can print ' out the default data. The xx stay for PB or QB 'which basic : PowerBASIC and Q(uick)BASIC 'Auteur : Jacob Wieles defint a-z dim dac(191),pal(15) i$=" intensity values " i$=i$+i$ l$=" -------------------- " l$=l$+l$ l2$="======================================" l2$=l2$+l2$ d$=" DAC-index Red Green Blue " d$=d$+d$ scrnmode=12 cls color 14 print print" After a key hit the program looks for the possibility of SCREEN 12." print print" If there is an error the program stop." print print" Else the default DAC and AC data are set in the file DACPB-12.TXT" print print" or in the file DACQB-12.TXT while inkey$<>"":wend hitakey$=input$(1) on error goto NoVGA screen 12 out 967,0 for i=0 to 191 dac(i)=inp(969) next i 'Get AC data for making the output file dummy=inp(&H3DA) for i=0 to 15 out &H3C0,i out &H3C0,inp(&H3C1) pal(i)=inp(&H3C1) next i out &H3C0,32 if pal(15)=15 then wbas$=" with Q(uick)BASIC." wname$="QB" else wbas$=" with PowerBASIC." wname$="PB" end if screen 0 '=================>>>> to file filename$="DAC"+wname$+"-12.TXT" open filename$ for output as #1 print #1, print #1," Default settings for screen "; print #1,right$("0"+ltrim$(str$(scrnmode)),2);" "; print #1,wbas$ print #1, print #1," Attribute Controler" print #1,l2$ print #1," attribute : "; for i=0 to 15 print #1,right$("0"+ltrim$(str$(i)),2);" "; next i print #1, print #1," color : "; for i=0 to 15 print #1,right$("0"+ltrim$(str$(pal(i))),2);" "; next i print #1, print #1, print #1," Digital Analog Converter" print #1,l2$ for j=0 to 1 print #1,i$ print #1,l$ print #1,d$ for i=0 to 15 print #1,space$(9); print #1,right$("0"+ltrim$(str$(i+j*32)),2); print #1,space$(6); print #1,right$("0"+ltrim$(str$(dac(i*3+0+j*96))),2); print #1,space$(6); print #1,right$("0"+ltrim$(str$(dac(i*3+1+j*96))),2); print #1,space$(6); print #1,right$("0"+ltrim$(str$(dac(i*3+2+j*96))),2); print #1,space$(13); print #1,right$("0"+ltrim$(str$(i+16+j*32)),2); print #1,space$(6); print #1,right$("0"+ltrim$(str$(dac(i*3+48+j*96))),2); print #1,space$(6); print #1,right$("0"+ltrim$(str$(dac(i*3+49+j*96))),2); print #1,space$(6); print #1,right$("0"+ltrim$(str$(dac(i*3+50+j*96))),2); print #1, next i print #1, print #1, next j close #1 print print" The data is on the disk as :" print print" ";filename$ print while inkey$>"":wend print" Hit a key for end." hitakey$=input$(1) EndProg: cls print" Thanks for running this program. Hit a key for the source." end NoVGA: print print" There is a problem with screen 12 so the program stop." print while inkey$<>"":wend print" Hit a key for end." hitkey$=input$(1) resume EndProg