1.5 The Rumble Pak

The Rumble Pak, like the Controller Pak, is a peripheral device that connects to the joyport of the Standard Controller. It vibrates the game player's Controller, producing tactile sensations of impacts as feedback during game play.

The N64 OS has only three Rumble Pak functions: to initialize, start vibration, and end vibration. Thus, in order to express the strength of the vibrations you need to repeatedly turn the Rumble Pak on and off over a short period of time.

This requires quite a bit of work on the part of the programmer, so in order to decrease this the NuSystem provides extra functions to specify the strength and duration of continued vibration for controlling the Rumble Pak:

nuContRmbMgrInit
Initializes the Rumble Pak Manager

nuContRmbCheck
Checks the Rumble Pak

nuContRmbStart
Starts vibrating the Rumble Pak

nuContRmbModeSet
Sets the operation mode of the Rumble Pak

nuContRmbForceStop
Forces the Rumble Pak to stop

nuContRmbForceStopEnd
Releases the forced stop of the Rumble Pak

nuContRmbSearchTimeSet
Sets Rumble Pak check time

1.5.1 Initializing the Rumble Pak

Make sure to check the Rumble Pak with the nuContRmbCheck function before operating the device. The return value for this function is the return value of the N64 OS osMotorInit function. If some device other than the Rumble Pak is inserted, PFS_ERR_DEVICE is returned.


Function name: nuContRmbCheck
Syntax: s32 nuContRmbCheck(u32 contNo)
Arguments: contNo Controller number
Return Value: The value returned by osMotorInit

In the NuSystem there is the operation mode for the Rumble Pak. To set this, use the nuContRmbModeSet function.


Function name: nuContRmbModeSet
Syntax: void nuContRmbModeSet(u32 contNo, u8 mode)
Arguments: contNo Controller number
  mode Rumble Pak operation mode
 NU_CONT_RMB_MODE_DISABLE  Disabled
 NU_CONT_RMB_MODE_ENABLE  Enabled
 NU_CONT_RMB_MODE_AUTORUN  Auto detect
Return Value: None

When NU_CONT_RMB_MODE_DISABLE is specified, use of the Rumble Pak is prohibited. By default, the Rumble Pak is disabled for every Controller.

When NU_CONT_RMB_MODE_AUTORUN is specified, periodic checks are made to see whether or not a Rumble Pak is inserted. If it is, it is enabled. By using this mode, you can deal with situations where the user inserts a Rumble Pak during game play, or the device stops working temporarily because of a poor connection.

The period between checks of the Rumble Pak is set with the nuContRmbSearchTimeSet function.


Function name: nuContRmbSearchTimeSet
Syntax: void nuContRmbSearchTimeSet(u32 frame)
Arguments: frame  The time between checks (in frames)
Return Value: None

The default value for this time period is set at 300 frames (5 seconds). The Rumble Pak Manager does not check all four Controllers during the same frame, so the burden of performing this check does not happen all at once.

1.5.2 Controlling the Rumble Pak

To vibrate the Rumble Pak, you use the nuContRmbStart function.


Function name: nuContRmbStart
Syntax: void nuContRmbStart(u32 contNo, u16 freq, u16 frame)
Arguments: contNo Controller number
  freq Frequency (1-256)
    1 = 1 pulse per 256 frames. 256 = Continuous operation.
  frame Duration of vibration (the number of frames)
Return Value: None

The freq argument specifies the frequency of time the vibration motor is ON. For example, if freq is set to 1 the motor is ON once every 256 frames. If it is set to 128 the motor is ON once every 2 frames. If it is set to 256 the motor is in continuous motion. The larger the value set in freq the stronger the vibration felt by the player. The frame argument specifies the amount of the time that the Rumble Pak vibrates, in units of frames. When the mode is not set to auto detect in nuContRmbModeSet you must execute the nuContRmbCheck function before calling this function.

1.5.3 Forcing the Rumble Pak to Stop

Since the nuContRmbStart function, which starts the Rumble Pak, also specifies how long to vibrate the device, it is normally unnecessary to stop the vibration while a game is progressing forward. However, when a pause process, reset process or a screen switch is performed you must stop the vibrations immediately as per the rules in the "Programming Cautions."

To force the Rumble Pak to stop, use the nuContRmbForceStop function.


Function name: nuContRmbForceStop
Syntax: void nuContRmbForceStop(void)
Arguments: None
Return Value: None

Once this function is executed, the Rumble Pak start function nuContRmbStart remains invalid until the nuContRmbForceStopEnd function is called to release the forced stop.


Function name: nuContRmbForceStopEnd
Syntax: void nuContRmbForceStopEnd(void)
Arguments: None
Return Value: None