home *** CD-ROM | disk | FTP | other *** search
/ Global Amiga Experience / globalamigaexperience.iso / compressed / development / clusterdemo.dms / clusterdemo.adf / Modules.lha / modules / txt / Gameport.def < prev    next >
Text File  |  1994-05-25  |  1KB  |  59 lines

  1. |##########|
  2. |#MAGIC   #|CLABLMLL
  3. |#PROJECT #|""
  4. |#PATHS   #|"StdProject"
  5. |#FLAGS   #|xx-x-x-xxx----x-----------------
  6. |#USERSW  #|--------------------------------
  7. |#USERMASK#|--------------------------------
  8. |#SWITCHES#|x-xx------------
  9. |##########|
  10. DEFINITION MODULE GamePort;
  11.  
  12. $$LongAllign:= FALSE      | Absolutely essential
  13.  
  14. FROM T_Exec       IMPORT IOCommand, nonstdVAL, IOStdReq;
  15. FROM Resources    IMPORT ContextPtr;
  16.  
  17. CONST
  18.   readEvent    = IOCommand( nonstdVAL + 0 );
  19.   askCType     = IOCommand( nonstdVAL + 1 );
  20.   setCType     = IOCommand( nonstdVAL + 2 );
  21.   askTrigger   = IOCommand( nonstdVAL + 3 );
  22.   setTrigger   = IOCommand( nonstdVAL + 4 );
  23.  
  24. |Errors
  25.   errSetCType  = 1;
  26.  
  27.   portOne      = 0;
  28.   portTwo      = 1;
  29.  
  30. TYPE
  31.   Keys            = ( downKeys, upKeys, makemeword = 15 );
  32.   KeySet          = SET OF Keys;
  33.  
  34.   GamePortTrigger = RECORD
  35.               keys    : KeySet;
  36.               timeout : CARDINAL;
  37.               xDelta  : CARDINAL;
  38.               yDelta  : CARDINAL
  39.             END;
  40.  
  41.    Controller     = (allocated=-1,noController,mouse,relJoystick,
  42.              absJoystick);
  43.  
  44.    GameReqPtr     = POINTER TO GameReq;
  45.    GameReq        = RECORD OF IOStdReq END;
  46.  
  47. PROCEDURE OpenGamePort( port : INTEGER;
  48.             context : ContextPtr:=NIL ): GameReqPtr;
  49.  
  50. PROCEDURE CloseGamePort( VAR request : GameReqPtr );
  51.  
  52. GROUP
  53.   All   = T_Exec.ExecIOGrp,askCType,askTrigger,errSetCType,portOne,
  54.       portTwo,readEvent,setCType,setTrigger,Keys,GamePortTrigger,
  55.       GameReq,GameReqPtr,Controller,OpenGamePort,CloseGamePort;
  56.  
  57. END GamePort.
  58.  
  59.