home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / GFXFX2.ZIP / DOTS3.PAS < prev    next >
Pascal/Delphi Source File  |  1995-02-14  |  6KB  |  120 lines

  1.  
  2. program dots3; { DOTS3.PAS }
  3. { Parallax screensaver, run a few times to see all. By Bas van Gaalen }
  4. uses u_vga,u_kb;
  5. const
  6.   xspd=1; yspd=1;
  7.   noftab=6; txtcol=31; collen=17;
  8.   coltab:array[0..noftab,0..collen] of byte=(
  9.     (3,3,11,3,11,11,15,11,15,15,7,15,7,7,8,7,8,8),
  10.     (8,8,7,8,7,7,15,7,15,15,7,15,7,7,8,7,8,8),
  11.     (1,1,9,1,9,9,11,9,11,11,9,11,9,9,1,9,1,1),
  12.     (4,4,12,4,12,12,15,12,15,15,12,15,12,12,4,12,4,4),
  13.     (3,3,11,3,11,11,15,11,15,15,11,15,11,11,3,11,3,3),
  14.     (3,3,11,3,11,11,15,11,15,15,10,15,10,10,2,10,2,2),
  15.     (4,4,12,4,12,12,15,12,15,15,11,15,11,11,3,11,3,3));
  16.   sintab:array[0..1000] of byte=(
  17.     100,100,100,100,100,100, 99, 99, 99, 99, 98, 98, 98, 97, 97,
  18.      96, 96, 95, 95, 94, 94, 93, 92, 92, 91, 90, 89, 88, 88, 87,
  19.      86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72,
  20.      71, 69, 68, 67, 66, 65, 64, 63, 61, 60, 59, 58, 57, 55, 54,
  21.      53, 52, 51, 50, 48, 47, 46, 45, 44, 43, 42, 41, 39, 38, 37,
  22.      36, 35, 34, 33, 32, 32, 31, 30, 29, 28, 27, 26, 26, 25, 24,
  23.      23, 23, 22, 22, 21, 20, 20, 19, 19, 19, 18, 18, 17, 17, 17,
  24.      17, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17,
  25.      17, 17, 18, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 24,
  26.      24, 25, 26, 27, 27, 28, 29, 30, 31, 32, 33, 33, 34, 35, 36,
  27.      37, 38, 39, 40, 41, 42, 43, 45, 46, 47, 48, 49, 50, 51, 52,
  28.      53, 54, 55, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
  29.      69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 81, 82,
  30.      83, 84, 85, 85, 86, 87, 88, 88, 89, 90, 90, 91, 91, 92, 92,
  31.      93, 93, 94, 94, 95, 95, 95, 96, 96, 97, 97, 97, 97, 98, 98,
  32.      98, 98, 99, 99, 99, 99, 99, 99, 99,100,100,100,100,100,100,
  33.     100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,
  34.     100,100,100,100,100,100,100,100,100,100,100,100,101,101,101,
  35.     101,101,101,101,102,102,102,102,103,103,103,103,104,104,105,
  36.     105,105,106,106,107,107,108,108,109,109,110,110,111,112,112,
  37.     113,114,115,115,116,117,118,119,119,120,121,122,123,124,125,
  38.     126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,
  39.     141,142,143,145,146,147,148,149,150,151,152,153,154,155,157,
  40.     158,159,160,161,162,163,164,165,166,167,167,168,169,170,171,
  41.     172,173,173,174,175,176,176,177,178,178,179,179,180,180,181,
  42.     181,182,182,182,183,183,183,183,184,184,184,184,184,184,184,
  43.     184,184,184,184,184,183,183,183,183,182,182,181,181,181,180,
  44.     180,179,178,178,177,177,176,175,174,174,173,172,171,170,169,
  45.     168,168,167,166,165,164,163,162,161,159,158,157,156,155,154,
  46.     153,152,150,149,148,147,146,145,143,142,141,140,139,137,136,
  47.     135,134,133,132,131,129,128,127,126,125,124,123,122,121,120,
  48.     119,118,117,116,115,114,113,112,112,111,110,109,108,108,107,
  49.     106,106,105,105,104,104,103,103,102,102,102,101,101,101,101,
  50.     100,100,100,100,100,100,100,100,100,100,100,101,101,101,101,
  51.     102,102,102,103,103,104,104,105,105,106,106,107,108,108,109,
  52.     110,111,112,112,113,114,115,116,117,118,119,120,121,122,123,
  53.     124,125,126,127,128,129,131,132,133,134,135,136,137,139,140,
  54.     141,142,143,145,146,147,148,149,150,152,153,154,155,156,157,
  55.     158,159,161,162,163,164,165,166,167,168,168,169,170,171,172,
  56.     173,174,174,175,176,177,177,178,178,179,180,180,181,181,181,
  57.     182,182,183,183,183,183,184,184,184,184,184,184,184,184,184,
  58.     184,184,184,183,183,183,183,182,182,182,181,181,180,180,179,
  59.     179,178,178,177,176,176,175,174,173,173,172,171,170,169,168,
  60.     167,167,166,165,164,163,162,161,160,159,158,157,155,154,153,
  61.     152,151,150,149,148,147,146,145,143,142,141,140,139,138,137,
  62.     136,135,134,133,132,131,130,129,128,127,126,125,124,123,122,
  63.     121,120,119,119,118,117,116,115,115,114,113,112,112,111,110,
  64.     110,109,109,108,108,107,107,106,106,105,105,105,104,104,103,
  65.     103,103,103,102,102,102,102,101,101,101,101,101,101,101,100,
  66.     100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,
  67.     100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,
  68.     100,100, 99, 99, 99, 99, 99, 99, 99, 98, 98, 98, 98, 97, 97,
  69.      97, 97, 96, 96, 95, 95, 95, 94, 94, 93, 93, 92, 92, 91, 91,
  70.      90, 90, 89, 88, 88, 87, 86, 85, 85, 84, 83, 82, 81, 81, 80,
  71.      79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 65,
  72.      64, 63, 62, 61, 60, 59, 58, 57, 55, 54, 53, 52, 51, 50, 49,
  73.      48, 47, 46, 45, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33,
  74.      33, 32, 31, 30, 29, 28, 27, 27, 26, 25, 24, 24, 23, 22, 22,
  75.      21, 21, 20, 20, 19, 19, 18, 18, 18, 17, 17, 17, 17, 16, 16,
  76.      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18,
  77.      18, 19, 19, 19, 20, 20, 21, 22, 22, 23, 23, 24, 25, 26, 26,
  78.      27, 28, 29, 30, 31, 32, 32, 33, 34, 35, 36, 37, 38, 39, 41,
  79.      42, 43, 44, 45, 46, 47, 48, 50, 51, 52, 53, 54, 55, 57, 58,
  80.      59, 60, 61, 63, 64, 65, 66, 67, 68, 69, 71, 72, 73, 74, 75,
  81.      76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 88, 89,
  82.      90, 91, 92, 92, 93, 94, 94, 95, 95, 96, 96, 97, 97, 98, 98,
  83.      98, 99, 99, 99, 99,100,100,100,100,100,100);
  84.  
  85. procedure plotter;
  86. const startcount=150;
  87. var xst,yst,i,dots,countdown,on,off,txtx,txty:word; colstart,xstep,ystep:byte;
  88. begin
  89.   randomize;
  90.   dots:=(20+random(20))*succ(collen);
  91.   colstart:=random(succ(noftab));
  92.   xstep:=succ(random(8));
  93.   ystep:=succ(random(8)); if ystep=xstep then inc(ystep);
  94.   xst:=0; yst:=0; countdown:=1; txtx:=0; txty:=0;
  95.   repeat
  96.     vretrace;
  97.     for i:=0 to dots do begin
  98.       off:=(sintab[(xst+i*xstep) mod 1000])+50+sintab[(yst+i*ystep) mod 1000]*320;
  99.       on:=(sintab[(xst+xspd+i*xstep) mod 1000])+50+sintab[(yst+yspd+i*ystep) mod 1000]*320;
  100.       if mem[u_vidseg:off]<>txtcol then mem[u_vidseg:off]:=0;
  101.       if mem[u_vidseg:on]<>txtcol then mem[u_vidseg:on]:=coltab[colstart,i mod succ(collen)];
  102.     end;
  103.     xst:=(xst+xspd) mod 1000; yst:=(yst+yspd) mod 1000;
  104.     dec(countdown);
  105.     if countdown=0 then begin
  106.       writetxt(' press a key ',txtx,txty,0);
  107.       txtx:=50+random(132); txty:=50+random(100);
  108.       writetxt(' press a key ',txtx,txty,txtcol);
  109.       countdown:=startcount;
  110.     end;
  111.   until keypressed;
  112. end;
  113.  
  114. begin
  115.   usefont:=font8x8;
  116.   setvideo($13);
  117.   plotter;
  118.   setvideo(u_lm);
  119. end.
  120.