home *** CD-ROM | disk | FTP | other *** search
- {Set palette program: Call with arguments NN:MM where NN=palette number
- and MM=value. setpal 0:1 whould set the normal
- backgrpund color to blue. Multiple arguments
- are accepted.
-
- author: Frank Guenther (compuserve 76545,666)
- date : Dec 2 1985
- contact at "The Programmers Toolbox"
- (301) 540-7230 (data)
-
- }
- program setpal;
-
- type
- regpak=
- record AX,BX,CX,DX,BP,SI,DI,DS,ES,FLAGS:INTeger END;
- str80=string[80];
-
- var stemp,stemp2:str80;
- x,y,len,pal,palval,code1,code2:integer;
-
- procedure setpalette(spalnum,spalcolor:byte);
- var sr:regpak;
- begin
- sr.AX:=$1000;
- sr.BX:=(spalcolor shl 8)+spalnum;
- intr(16,sr);
- end;
-
- begin
- for x:=1 to paramcount do begin
- y:=pos(':',paramstr(x));
- len:=length(paramstr(x));
- if (y>1) and (len>y) then begin
- stemp:=copy(paramstr(x),1,y-1);
- stemp2:=copy(paramstr(x),y+1,len);
- val(stemp,pal,code1);
- val(stemp2,palval,code2);
- if (code1=0) and (code2=0) then begin
- setpalette(pal,palval);
- writeln('Palette number ',pal,' set to ',palval,'.');
- end;
- end;
- end;
- end.