home *** CD-ROM | disk | FTP | other *** search
/ PC Underground / UNDERGROUND.ISO / graphic / scrl_spt.pas < prev    next >
Pascal/Delphi Source File  |  1995-07-28  |  2KB  |  41 lines

  1. uses crt,Gif,ModeXLib;
  2. Var x,                          {current offset in x-direction}
  3.     x_dir,                      {specifies scroll direction for x}
  4.     y,                          {current offset for y-direction}
  5.     y_dir:word;                 {specifies scroll direction for y}
  6.     split_line:word;            {current position of Split-Line}
  7.     split_dir:word;             {specifies direction of movement for Split-Line}
  8. Begin
  9.   Init_ModeX;                   {enable Mode X}
  10.   double;                       {enable 160 byte mode}
  11.   Screen_Off;                   {screen off}
  12.   LoadGif_Pos('640400',160*50);{load big picture at position (0/50)}
  13.   p13_2_ModeX(vram_pos,rest div 4); {copy rest to VGA-RAM}
  14.   LoadGif('corner');            {load small picture at position (0/0)}
  15.   p13_2_ModeX(0,160*50);        {and copy to screen}
  16.   Screen_On;                    {screen on}
  17.  
  18.   split_line:=150;              {set Split at line 150 first}
  19.   split_dir:=1;                 {move Split-Line down first}
  20.   x:=1;                         {x-start with column 1}
  21.   x_dir:=1;                     {x-direction 1 byte per pass}
  22.   y:=160;                       {y-start with row 1}
  23.   y_dir:=160;                   {y-direction+160 bytes per pass}
  24.   Repeat
  25.     Inc(x,x_dir);               {x-movement}
  26.     Inc(y,y_dir);               {y-movement}
  27.     Inc(Split_line,Split_dir);  {move Split Line}
  28.     WaitRetrace;                {wait for Retrace}
  29.     SetStart(50*160+y+x);       {and write new start in register,}
  30.                                 {skipping the first 50 lines}
  31.     Split(Split_line);          {split screen at Split Line}
  32.     if (x >= 80)                {x-border reached -> turn x-direction around}
  33.     or (x <= 1) Then x_dir:=-x_dir;
  34.     if (y >= 200*160)           {y-border reached -> turn y-direction around}
  35.     or (y <= 160) Then y_dir:=-y_dir;
  36.     if (split_line >= 200)      {split reached border -> change direction}
  37.     or (split_line <= 150) then split_dir:=-split_dir
  38.   Until KeyPressed;             {run until key pressed}
  39.   TextMode(3);
  40. End.
  41.