home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / MBUG / MBUG013.ARC / COLOR2.PAS < prev    next >
Pascal/Delphi Source File  |  1979-12-31  |  3KB  |  80 lines

  1. program COLOR2;
  2.  
  3. { Demonstration of the use of the procedure
  4.   FillChar to  place  the colour values for
  5.   MicroBee Colour Computers into the Colour
  6.   RAM and providing a visual  demonstration
  7.   of the effect of changing the intensities
  8.   of the Red, Green and Blue colour guns on
  9.   the background colours.
  10.  
  11.         Program designed by Bob Burt        }
  12.  
  13. const
  14.   black     = 7;   {black   background, white foreground}
  15.   red       = 39;  {red     background, white foreground}
  16.   green     = 64;  {green   background, black foreground}
  17.   yellow    = 100; {yellow  background, red   foreground}
  18.   blue      = 135; {blue    background, white foreground}
  19.   magenta   = 160; {magenta background, black foreground}
  20.   cyan      = 192; {cyan    background, black foreground}
  21.   white     = 224; {white   background, black foreground}
  22.  
  23. var
  24.   colour_ram : byte absolute $F800;
  25.   intensity  : byte;
  26.  
  27. begin {main}
  28.   intensity := 78; {R G B Guns Full, Colour RAM ON}
  29.   repeat
  30.     port[8] := intensity;
  31.     clrscr;
  32.     gotoxy(12,2);
  33.     lowvideo;
  34.     writeln('*** Effect of Changing Intensity on Background Colours ***');
  35.     gotoxy(19,14);
  36.     write(' Background Intensity : ');
  37.     case intensity of
  38.       78 : write('R G B Full, none Half ');
  39.       76 : write('G B Full, R Half ');
  40.       74 : write('R B Full, G Half ');
  41.       72 : write('B Full, R G Half ');
  42.       70 : write('R G Full, B Half ');
  43.       68 : write('G Full, R B Half ');
  44.       66 : write('R Full, G B Half ');
  45.       64 : write('None Full, R G B Half ');
  46.     end; {case intensity}
  47.     normvideo;
  48.     gotoxy(19,14); {Hide cursor}
  49.     fillchar(colour_ram,1920,red);
  50.     delay(1000);
  51.     fillchar(colour_ram,1680,green);
  52.     delay(1000);
  53.     fillchar(colour_ram,1440,yellow);
  54.     delay(1000);
  55.     fillchar(colour_ram,1200,blue);
  56.     delay(1000);
  57.     fillchar(colour_ram,960,magenta);
  58.     delay(1000);
  59.     fillchar(colour_ram,720,cyan);
  60.     delay(1000);
  61.     fillchar(colour_ram,480,white);
  62.     delay(1000);
  63.     fillchar(colour_ram,240,black);
  64.     delay(1000);
  65.     if intensity > 64 then
  66.       begin
  67.         gotoxy(23,8);
  68.         lowvideo;
  69.         write(' Press any key for next display');
  70.         normvideo;
  71.         repeat until keypressed
  72.       end; {if intensity}
  73.     intensity := intensity - 2
  74.   until intensity = 62;
  75.   gotoxy(25,20);
  76.   lowvideo;
  77.   write(^G,' Press any key to return to CP/M');
  78.   normvideo;
  79.   repeat until keypressed
  80. end. {main}