'=========================================================================== ' Subject: PLAYING WITH GET/PUT AND DAC Date: 03-17-99 (13:15) ' Author: Jacob Wieles Code: QB, QBasic, PDS, PB ' Origin: jacwls@worldonline.nl Packet: EGAVGA.ABC '=========================================================================== 'program : DACAC12D (16-03-99) ' Playing with get, put and change data DAC. ' See how many colors you have for making ' a 16 color palette. (Even with PowerBASIC) 'auteur : Jacob Wieles 'basic ? : PowerBASIC and Q(uick)BASIC defint a-z Esc=27:Ent=13 sub NewPalette(attr,col) dummy=inp(&H3DA) out &H3C0,attr and 15 out &H3C0,col and 63 out &H3C0,32 end sub sub SetNewColor(index,R,G,B) out &H3C8,index out &H3C9,R and 63 out &H3C9,G and 63 out &H3C9,B and 63 end sub cls screen 12 w!=timer while timer"":wend locate 1,2 print"Hit a key for (put,xor) the picture. " hitakey$=input$(1) locate 1,1:print space$(78) for i=1 to 20 put(bx+i*10,by+i*10),fig,xor next i while inkey$<>"":wend locate 1,25 print" Hit a key for start " begin$=input$(1) R=21:B=62:G=42:R1=21:G1=42:B1=21 'start colors RF=+1:BF=+1:GF=+1:R1F=+1:B1F=+1:GF1=+1 'values change colors do locate 1,25 print" Hit a key for stop. " do while inkey$="" R=R+RF:if R=63 or R=0 then RF=-RF G=G-GF:if G=63 or G=0 then GF=-GF B=B+BF:if B=63 or B=0 then BF=-BF R1=R1-R1F:if R1=10 or R1=50 then R1F=-R1F B1=B1+B1F:if B1=10 or B1=50 then B1F=-B1F G1=G1-G1F:if G1=10 or G1=50 then G1F=-G1F call SetNewColor(1,R,G,B) call SetnewColor(2,G,B,R) call SetnewColor(3,B,R,G) call SetnewColor(4,B,G,R) call SetNewColor(5,R,B,G) call SetNewColor(6,G,R,B) call SetNewColor(7,R1,R,B1) call SetNewColor(8,R,G1,B1) call SetNewColor(9,B1,G,R1) call SetNewColor(0,R1,G1,B1) w!=timer while timer