procedure auxcolor;
begin
  textbackground(aux_b);
  textcolor(aux_f);
end;

procedure Brite_auxcolor;
begin
  textbackground(brite_b);
  textcolor(brite_f);
end;

procedure normcolor;
begin
  textbackground(norm_b);
  textcolor(norm_f);
end;

procedure save_screen;
begin
  old_x := WhereX;
  old_y := WhereY;
  FillPage(@image);
end;

procedure restore_screen;
begin
  window(1,1,80,25);
  DisplayPage(@image);
  gotoxy(old_x,old_y);
end;

procedure save_entry_screen;
begin
  curs_x := whereX;
  curs_y := whereY;
  FillPage(@screen1);
end;

procedure restore_entry_screen;
begin
  DisplayPage(@screen1);
  window(1,1,80,25);
  gotoxy(curs_x,curs_y);
end;

procedure save_attr(var f,b : integer; x1,y1: integer);
var attr : integer;
begin
  if VideoMode = 7
    then  attr := mono_video[(x1 + WhereX - 2)*2 + (y1 + WhereY - 2)*160 + 1]
    else  attr := colr_video[(x1 + WhereX - 2)*2 + (y1 + WhereY - 2)*160 + 1];
  f := attr AND $0F;
  b := (attr SHR 4) AND $0F;
end;

procedure restore_attr(f,b : integer);
begin
  textcolor(f);
  textbackground(b);
end;

