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

  1.  
  2. program textscroll; { SCR_TXT2.PAS }
  3. { Textscroll, use CHARSET.PAS to create CHARS.INC. By Bas van Gaalen }
  4. uses u_vga,u_txt,u_kb;
  5. const
  6. {$i chars.inc}
  7.   tseg:word=$b800; hi=1;
  8.   txt:string=
  9.     'howdy world...     this is a multicolored-bigchar-'+
  10.     'proportional-''smooth''-textscroll...          of '+
  11.     'course made by bas van gaalen!     it contains an '+
  12.     'extensive number of characters: 0 1 2 3 4 5 6 7 8 '+
  13.     '9 :-) ( / ? ! , . etc...       ';
  14.   cpos:array[0..46] of word=(
  15.     0,5,12,19,26,33,40,47,54,61,65,72,80,87,97,104,111,118,125,132,139,146,
  16.     153,160,170,177,184,191,195,200,205,211,215,222,227,232,240,247,252,259,
  17.     266,273,280,287,294,301,308);
  18.   clen:array[0..46] of byte=(
  19.     3,7,7,7,7,7,7,7,7,4,7,7,7,10,7,7,7,7,7,7,7,7,7,10,7,7,7,4,5,5,6,4,7,5,
  20.     5,4,7,5,7,7,7,7,7,7,7,7,6);
  21.  
  22. var
  23.   i,cur,idx,line:byte;
  24.  
  25. begin
  26.   setvideo(259);
  27.   cursoroff;
  28.   dspat('As you can see, not the complete screen is scrolling...',-1,6,lightgray);
  29.   idx:=1;
  30.   repeat
  31.     cur:=ord(txt[idx]);
  32.     idx:=1+idx mod length(txt);
  33.     { conv ascii to table }
  34.     case cur of
  35.       32:cur:=0;
  36.       33:cur:=31;
  37.       39:cur:=29;
  38.       40,41:dec(cur,7);
  39.       44:cur:=28;
  40.       45:cur:=30;
  41.       46:cur:=27;
  42.       47:cur:=46;
  43.       48..57:dec(cur,12);
  44.       58:cur:=35;
  45.       63:cur:=32;
  46.       65..90:dec(cur,64);
  47.       97..122:dec(cur,96);
  48.     end;
  49.     for i:=0 to pred(clen[cur]) do begin
  50.       vretrace;
  51.       for line:=0 to 4 do begin
  52.         move(mem[tseg:(hi+line)*160+2],mem[tseg:(hi+line)*160],158);
  53.         memw[tseg:158+(hi+line)*160]:=chars[line,cpos[cur]+i];
  54.       end;
  55.     end;
  56.   until keypressed;
  57.   cursoron;
  58. end.
  59.