
FUNCTION t_getdate : Integer ;
  GEMDOS( $2a ) ;

FUNCTION t_setdate( date : Integer ) : Integer ;
  GEMDOS( $2b ) ;

FUNCTION t_gettime : Integer ;
  GEMDOS( $2c ) ;

FUNCTION t_settime( time : integer ) : integer ;
  GEMDOS( $2d ) ;


FUNCTION Super( x: long_integer ) : long_integer;
   Gemdos( $20 );

FUNCTION Ticks : Long_integer; { System timer 200/second resolution }
TYPE
   Long_pointer = ^long_integer;
VAR
   SSP : Long_Integer;        { save old supervisor stack pointer }
   hz_200 : RECORD
      CASE Boolean OF
         true : ( l: long_integer );
         false : ( p: long_pointer );
      END;
BEGIN
   SSP := Super( 0 );        { save supervisor stack.. enter super mode }
   hz_200.l := $4ba;         { point at 200 hertz timer }
   {$p-}                     { turn pointer checking off }
   Ticks := hz_200.p^;        { get the longword at that location }
   {$p=}                     { restore old value of pointer checking }
   SSP := Super( SSP );      { restore supervisor stack... enter user mode }
END;  { of Ticks }

PROCEDURE Event_Loop ;
VAR
   which,
   dummy,
   key_state, W_key,
   x, y : integer ;
   msg : Message_Buffer ;
BEGIN
   REPEAT
     { Get a mouse button event. }
     which := Get_Event( E_Timer | E_Button, $0001, 0, 0,
              0, { time count of zero - quik return }
              false, 0, 0, 0, 0, false, 0, 0, 0, 0, { no rect's }
              msg, W_Key,   { what key }
              dummy, dummy, x, y, key_state ) ;
   UNTIL which>33;
   REPEAT
     { Get a mouse button event. }
     which := Get_Event( E_Timer | E_Button, $0001, 0, 0,
              0, { time count of zero - quik return }
              false, 0, 0, 0, 0, false, 0, 0, 0, 0, { no rect's }
              msg, W_Key,   { what key }
              dummy, dummy, x, y, key_state ) ;
   UNTIL which<34;
END ;  { of Event_Loop }
