home *** CD-ROM | disk | FTP | other *** search
- { }
- { EGA Graphic Demonstration, Turbo Pascal 3.01A, Version 10JAN86. }
- { (C) 1986 by Kent Cedola, 2015 Meadow Lake Ct., Norfolk, VA, 23518 }
- { }
- { This program will display over a hundred different colors by using }
- { a bit color map. Only the standard palette setting are used, if }
- { changed, more colors could be produced (but not at the same time). }
- { }
-
- program Colors;
-
- {$K- }
-
- var
- x,y: integer;
- buffer: array [0..639] of Byte;
-
- {$I GPParms.p }
- {$I GPInit.p }
- {$I GPTerm.p }
- {$I GPMOVE.P }
- {$I GPWtRow.p }
-
- begin { Main program }
-
- GPParms;
-
- if GDTYPE <> 5 then
- begin
- ClrScr;
- Writeln('Enhanced Graphic Adapter and Display not found!');
- Halt(1);
- end;
-
- if GDMEMORY = 64 then
- begin
- ClrScr;
- Writeln('This program works much better with 128k or more EGA memory!');
- Writeln;
- Writeln(' Hit any key to continue...');
- Readln;
- end;
-
- GPInit;
-
- y := 0;
- while (y < GDMAXROW)
- begin
- x := 0;
- while (x < GDMAXCOL)
- begin
- buffer[x] := y * GDMAXPAL div GDMAXROW;
- buffer[x+1] := x div 40;
- x := x + 2;
- end;
-
- GPMOVE(0,y);
- GPWtRow(buffer,GDMAXCOL);
- y := y + 1;
-
- x := 0;
- while (x < GDMAXCOL)
- begin
- buffer[x] := x div 40;
- buffer[x+1] := y * GDMAXPAL div GDMAXROW;
- x := x + 2;
- end;
- GPMOVE(0,y);
- GPWtRow(buffer,GDMAXCOL);
- y := y + 1;
- end;
-
- Readln;
-
- GPTerm;
-
- end.