osMotorInit osMotorInit (function)

Initializes the Rumble Pak

Syntax

#include <ultra64.h>        /* os.h */
s32 osMotorInit(OSMesgQueue *mq,  OSPfs *pfs,  int controller_no);

Description

osMotorInit is a Rumble Pak initialization function. osMotorInit should be used to perform the special Rumble Pak initialization procedure after all SI devices have been configured using osContInit. When SI devices are used, configuration is required for SI use. Thus, osContInit should be called once at the start, before osMotorInit is called.

controller_no specifies the controller port number (0 - 3). The Rumble Pak inserted in the controller connected to the controller port specified by controller_no is initialized.

The OSPfs structure pfs is used to control the Rumble Pak. pfs is initialized by osMotorInit. mq is a message queue initialized by being associated with OS_EVENT_SI. For information how the association is formed, see the osSetEventMesg function reference. Because mq is used by the function as an internal message queue, it is not necessary for the application to use mq for purposes such as queuing function-termination messages.

The return values are error codes. With normal termination, 0 is returned. The other error codes returned are as follows:

PFS_ERR_NOPACK
Nothing inserted in the specified controller.

PFS_ERR_DEVICE
A device other than a Rumble Pak is inserted in the controller.

PFS_ERR_CONTRFAIL
Data transmission failed between the N64 unit and Rumble Pak. The controller may not be properly connected, or there may be an abnormality in the Rumble Pak or controller connector.

See Also

osContInit, osMotorStart, osMotorStop, and osSetEventMesg

Revision History

1999/02/01 Completely revised
1999/04/30 Changed format