{----------------------------------------------------------------------------
  Frame handler
  Copyright (c) 1994,95 by J.E. Hoffmann
  All rights reserved
 ----------------------------------------------------------------------------}
{$A+,B-,D-,E-,F-,G+,I-,L-,N-,O-,P-,Q-,R-,S-,T-,V-,X+,Y-}
unit _Frame;



interface



var
  FC :LongInt;


const
  Active     :Boolean = false;



procedure InitFrameHandler;
procedure DoneFrameHandler;



implementation



uses Dos;



procedure OldHandler; assembler; asm db 0; db 0; db 0 end;
procedure FrameHandler; far; external;
{$L _FRAME.OBJ}



procedure InitFrameHandler;
begin
  GetIntVec($8,Pointer(@OldHandler^));
  SetIntVec($8,@FrameHandler);
  Port[$43]:=$36;
  Port[$40]:=$34;
  Port[$40]:=$12;
  FC := 0;
  Active := true;
end;



procedure DoneFrameHandler;
begin
  if Active then begin
    Port[$43]:=$36;
    Port[$40]:=0;
    Port[$40]:=0;
    SetIntVec($8,Pointer(@OldHandler^));
    Active := false;
  end;
end;



end.