DEFINITION FOR C MODULE GamePort ;

FROM SYSTEM IMPORT SHORTSET   ;
FROM Exec   IMPORT CMD_NONSTD ;

(*------ GamePort commands -----*)

CONST
  GPD_READEVENT  = (CMD_NONSTD+0) ;
  GPD_ASKCTYPE	 = (CMD_NONSTD+1) ;
  GPD_SETCTYPE	 = (CMD_NONSTD+2) ;
  GPD_ASKTRIGGER = (CMD_NONSTD+3) ;
  GPD_SETTRIGGER = (CMD_NONSTD+4) ;

(*-----	 GamePort structures ------*)

(* gpt_Keys *)

CONST
  GPTB_DOWNKEYS	= 0 ; GPTF_DOWNKEYS = { GPTB_DOWNKEYS } ;
  GPTB_UPKEYS	= 1 ; GPTF_UPKEYS   = { GPTB_UPKEYS }   ;

TYPE
  GamePortTrigger = RECORD
    gpt_Keys    : BITSET   ; (* key transition triggers		    *)
    gpt_Timeout : CARDINAL ; (* time trigger (vertical blank units) *)
    gpt_XDelta  : CARDINAL ; (* X distance trigger		    *)
    gpt_YDelta  : CARDINAL ; (* Y distance trigger		    *)
  END ;

(*----- Controller Types -----*)

CONST
  GPCT_ALLOCATED    = -1 ; (* allocated by another user *)
  GPCT_NOCONTROLLER =  0 ;

  GPCT_MOUSE	    = 1 ;
  GPCT_RELJOYSTICK  = 2 ;
  GPCT_ABSJOYSTICK  = 3 ;

(*----- Errors -----*)

  GPDERR_SETCTYPE   = 1 ; (* this controller not valid at this time *)

END GamePort.
