osGbpakInit (function)

Initializes the hardware and the structures pfs for controlling the N64 Transfer Pak


#include <ultra64.h>     /* ultra64.h */
s32 osGbpakInit(OSMesgQueue *siMessegeQ, OSPfs *pfs, int


osGbpakInit is the function for initializing the N64 Transfer Pak. It initializes the pfs structure and the hardware. To use the N64 Transfer Pak, you need to call this function first. If the N64 Transfer Pak is reinserted, please call the function again.

The OSPfs structure pfs is used for N64 Transfer Pak control. osGbpakInit initializes pfs. There is thus no need to initialize the pfs structure on the application side. siMessageQ is the initialized message queue connected to OS_EVENT_SI. Please refer to osSetEventMesg, for information on how to make this connection. Channel specifies the channel number of the Controller. Before osGbpakInit is called, osContInit must be called. This is necessary for internal OS initialization.

The osGbpakInit function performs an internal 0.2 second wait process because it takes a maximum of 0.2 second for the N64 Transfer Pak to stabilize after the power supply is turned ON. This wait process involves a 0.2s count using the CPU timer (osSetTimer function). Thus, before calling this function, you need to call the osCreateViManager function.

Return value is an error code. If the function terminates normally, a value of 0 is returned. If an error occurs, one of the following error codes is returned:


Nothing is inserted in the specified Controller.


Some device other than the N64 Transfer Pak is inserted in the Controller.


Data transfers with the Controller have failed. The Controller may not be connected correctly, or there may be some problem with the N64 Transfer Pak or the Controller connector.

See Also

osContInit, osGbpakGetStatus, osGbpakPower, osGbpakReadWrite, osGbpakReadId, and osGbpakCheckConnector

Revision History

1999/04/30 Changed format