Three primary steps are required to open the gameport device: * Create a message port using createport(). reply messages from the device must be directed to a message port. * Create an I/O request structure of type iostdreq. the iostdreq structure is created by the createextio() function. createextio() will initialize the I/O request with your reply port. * Open the gameport device. Call opendevice(), passing the i/o request and and indicating the unit you wish to use. struct MsgPort *GameMP; /* Message port pointer */ struct IOStdReq *GameIO; /* I/O request pointer */ /* Create port for gameport device communications */ if (!(GameMP = CreatePort("RKM_game_port",0))) cleanexit(" Error: Can't create port\n",RETURN_FAIL); /* Create message block for device I/O */ if (!(GameIO = CreateExtIO(GameMP,sizeof(struct IOStdReq)))) cleanexit(" Error: Can't create I/O request\n",RETURN_FAIL); /* Open the right/back (unit 1, number 2) gameport.device unit */ if (error=OpenDevice("gameport.device",1,GameIO,0)) cleanexit(" Error: Can't open gameport.device\n",RETURN_FAIL); The gameport commands are unit specific. The unit number specified in the call to opendevice() determines which unit is acted upon.