program demo;
var x,y : integer;

procedure xy_plot(x,y : integer);external $F230;

procedure clrscr; (* XBIOS Aufruf loescht Statuszeile *)
begin
inline ($CD/$5A/$FC/$C2/$00);
end;

procedure memtest;  (* Test auf Byte 0 und 1 *)
begin
if not ((mem[$F230]=$E1) and (mem[$F231]=$C1)) then
  begin
  writeln('Fehler bei Test auf Byte 0 und 1');
  writeln('der Grafik-Routine ...');
  writeln('Grafik-RSX aktiv ?');
  repeat until keypressed;
  halt;
  end;
end;

begin
memtest;
clrscr;
y:=0;
for x:=0 to 719 do xy_plot(x,y);
for y:=0 to 255 do xy_plot(x,y);
for x:=719 downto 0 do xy_plot(x,y);
for y:=255 downto 0 do xy_plot(x,y);
y:=128;             (* Nullinie *)
for x:= 0 to 719 do xy_plot(x,y);
for x:=0 to 719 do  (* Phantasie *)
  xy_plot(x,128+round(sin(x/10)*400/(sqrt(x+1))));
for x:=0 to 900 do  (* Zufall-Pixel *)
    xy_plot(250+round(400*random),180+round(60*random));
gotoxy(30,6);write('------------------------');
gotoxy(30,7);write('<<   GRAFIK - DEMO    >>');
gotoxy(30,8);write('------------------------');
repeat until keypressed;
end.

