home *** CD-ROM | disk | FTP | other *** search
- {$title:'EGADISPL.PAS Version 2.00' $pagesize:55 $linesize:96}
- {$symtab- $debug-}
- program egadisp1(input,output);
- const g320x200=16#0d;
- g640x200=16#0e;
- g640x350=16#10;
- type pic_arr=array [0..269,0..199] of byte;
- pic_rec=record
- max_count:word;
- xcenter,ycenter,xdistance,ydistance:real8;
- pic:pic_arr;
- end;
- chunk=record
- val1,val2,val3,val4:lstring(23);
- littlechunk : array[0..319,0..199] of byte;
- end;
- function allmqq(wants:word):adsmem;extern;
- function egamove(mode:integer;bf1,bf2:adsmem):integer;extern;
-
- var bfa1,bfa2:ads of byte;
- i,result:integer;
- w,r1,r2:word;
- color:array [0..15] of byte;
- begin
- bfa1:=allmqq(32000);r1:=bfa1.r;
- if r1<=1 then
- writeln('Memory cannot be allocated.')
- else
- begin
- writeln('Making a 16 color buffer for 320x200 display.');
- for i:=0 to 15 do color[i]:=wrd(i);
- w:=0;
- while w<32000 do
- begin
- i:=ord((w div 1600) mod 16);
- if i=0 then i:=ord(w mod 16);
- bfa1^:=color[i]+16*color[i];
- w:=w+1;bfa1.r:=bfa1.r+1;
- end;
- bfa1.r:=r1;
- writeln('Invoking function egamove. ESC cancels display.');
- w:=0;while w<maxword do w:=w+1;
- result:=egamove(g320x200,bfa1,bfa1);
- case result of
- 0:writeln('Display generated successfully.');
- 1:writeln('EGA not attached.');
- 2:writeln('Illegal mode invoked.');
- otherwise writeln('Unknown error',result,' occured.')
- end;
- end;
- bfa1:=allmqq(64000);r1:=bfa1.r;
- if r1<=1 then
- writeln('Memory cannot be allocated.')
- else
- begin
- writeln('Making a 16 color buffer for 640x200 display.');
- for i:=0 to 15 do color[i]:=wrd(i);
- w:=0;
- while w<64000 do
- begin
- i:=ord((w div 3200) mod 16);
- if i=0 then i:=ord(w mod 16);
- bfa1^:=color[i]+16*color[i];
- w:=w+1;bfa1.r:=bfa1.r+1;
- end;
- bfa1.r:=r1;
- writeln('Invoking function egamove. ESC cancels display.');
- w:=0;while w<maxword do w:=w+1;
- result:=egamove(g640x200,bfa1,bfa1);
- case result of
- 0:writeln('Display generated successfully.');
- 1:writeln('EGA not attached.');
- 2:writeln('Illegal mode invoked.');
- otherwise writeln('Unknown error',result,' occured.')
- end;
- end;
- bfa1:=allmqq(56000);r1:=bfa1.r;
- bfa2:=allmqq(56000);r2:=bfa2.r;
- if (r1<=1) or (r2<=1) then
- writeln('Memory cannot be allocated.')
- else
- begin
- writeln('Making two 8 color buffers for 640x350 display.');
- for i:=0 to 15 do color[i]:=wrd(i);
- w:=0;
- while w<56000 do
- begin
- i:=ord((w div 6400) mod 8);
- if i=0 then i:=ord(w mod 16);
- bfa1^:=color[i]+16*color[i];
- w:=w+1;bfa1.r:=bfa1.r+1;
- end;
- bfa1.r:=r1;
- w:=0;
- while w<56000 do
- begin
- i:=ord((w div 6400+8) mod 16);
- if i=0 then i:=ord(w mod 16);
- bfa2^:=color[i]+16*color[i];
- w:=w+1;bfa2.r:=bfa2.r+1;
- end;
- bfa2.r:=r2;
- writeln('Invoking function egamove. ESC cancels display.');
- w:=0;while w<maxword do w:=w+1;
- result:=egamove(g640x350,bfa1,bfa2);
- case result of
- 0:writeln('Display generated successfully.');
- 1:writeln('EGA not attached.');
- 2:writeln('Illegal mode invoked.');
- otherwise writeln('Unknown error',result,' occured.')
- end;
- end;
- bfa1.s:=#1000;bfa1.r:=0;bfa2.s:=#f000;bfa2.r:=0;
- writeln('Using segments 1 and f for display.');
- writeln('Invoking function egamove. ESC cancels display.');
- w:=0;while w<maxword do w:=w+1;
- result:=egamove(g640x350,bfa1,bfa2);
- case result of
- 0:writeln('Display generated successfully.');
- 1:writeln('EGA not attached.');
- 2:writeln('Illegal mode invoked.');
- otherwise writeln('Unknown error',result,' occured.')
- end
- end.{egadisp1}
-