[comp.lang.pascal] turbo pascal screen stuff

johnk@auscso.UUCP (John Knutson) (09/27/87)

The following shar file is of cursor.pas (a modified version of the
cursor modification stuff in computer language v4n9) and fbload.pas
(a VERY fast bload type program, just a demo, modify it to your taste
or use).  I wrote fbload.pas, but i didn't bother copywriting it cuz
just about any hacker could come up with something like that if he
was as bored as i was.  have fun with 'em.
------cut here------
#! /bin/sh
# This is a shell archive, meaning:
# 1.  Remove everything above the #! /bin/sh line.
# 2.  Save the resulting test in a file
# 3.  Execute the file with /bin/sh (not csh) to create the files:
#
#		cursor.pas
#		fbload.pas
#
# Created by johnk (John Knutson) on Sat Sep 26 17:26:08 CDT 1987
#
if test -f 'cursor.pas'
then
	echo shar: will not over-write existing file "'cursor.pas'"
else
echo extracting "'cursor.pas'"
sed 's/^X//' >cursor.pas <<'SHAR_EOF'
Xtype
X  regs = record case integer of
X    1:(ax,bx,cx,dx,bp,si,di,ds,es,flags:integer);
X    2:(ah,al,bh,bl,ch,cl,dh,dl:byte);
X  end;
X
Xvar
X  registers : regs;
X  x,y       : integer;
X
Xprocedure set_cursor(hi_line,low_line:byte);
Xbegin
X  with registers do
X    begin
X      ax := $0100;
X      ch := hi_line;
X      cl := low_line;
X      cx := 256*ch + cl;
X      intr($10,registers);
X    end; {with registers}
Xend; {procedure set_cursor}
X
Xbegin
X  set_cursor(0,7);
X  WriteLn('Watch the cursor.......');
X  delay(2000);
X  for x:=1 to 10 do
X  begin
X    for y:=0 to 6 do
X    begin
X      set_cursor(y,y+1);
X      delay(100);
X    end;  {for y}
X    for y:=6 downto 0 do
X    begin
X      set_cursor(y,y+1);
X      delay(100);
X    end;  {for y}
X  end;  {for x}
X  for x:=1 to 10 do
X  begin
X    for y:=0 to 3 do
X    begin
X      set_cursor(y,7-y);
X      delay(100);
X    end;  {for y}
X    for y:=3 downto 0 do
X    begin
X      set_cursor(y,7-y);
X      delay(100);
X    end;  {for y}
X  end;  {for x}
X  set_cursor(6,7);
Xend.
X
SHAR_EOF
if test 1052 -ne "`wc -c < 'cursor.pas'`"
then
	echo shar: error transmitting "'cursor.pas'" '(should have been 1052 characters)'
fi
fi
if test -f 'fbload.pas'
then
	echo shar: will not over-write existing file "'fbload.pas'"
else
echo extracting "'fbload.pas'"
sed 's/^X//' >fbload.pas <<'SHAR_EOF'
Xtype
X  binfrec = record
X    dat : array[0..$4000] of byte;
X  end;
X
Xvar
X  x,y       : integer;
X  scr_arr   : array[0..$4000] of byte absolute $b800:$0000;
X  binf      : file of binfrec;
X  workvar   : binfrec;
X
Xprocedure initfile;
Xbegin
X  Rewrite(binf);
X  clrscr;
X  Hires;
X  for x:= 1 to 500 do plot(random(639),random(199),1);
X  for x:=0 to $4000 do workvar.dat[x] := scr_arr[x];
X  Write(Binf,workvar);
X  close(binf);
X  WriteLn('Demo screen file initialized.  Run again to see FastBload work.');
X  halt;
Xend;
X
Xbegin
X  HiRes;
X  Assign(binf,'TEMP.BIN');
X  {$I-} Reset(binf); {$I+}
X  if (ioresult <> 0) then initfile;
X  Read(binf,workvar);
X  Move(workvar.dat,scr_arr,$4000);
X  Delay(2000);
X  TextMode(bw80);
Xend.
SHAR_EOF
if test 743 -ne "`wc -c < 'fbload.pas'`"
then
	echo shar: error transmitting "'fbload.pas'" '(should have been 743 characters)'
fi
fi
# end of shell archive
exit 0
-- 
John Knutson   {ihnp4,allegra,ut-sally}!ut-ngp!auscso!johnk
	Spies report that sea mines actually ARE an Iranian delicacy.
	The Pentagon however maintains that they are some sort of fast food.
Communicating, like in the good ol' days.