osGbpakPower (function)

Turns power ON/OFF to the Game Boy Game Pak inserted in the N64 Transfer Pak

Syntax

#include <ultra64.h>     /* ultra64.h */
s32 osGbpakPower(OSPfs *pfs, s32 flag);

Description

The osGbpakPower function controls the supply of power to the Game Boy Game Pak.

If there is no activity, no power is supplied to the Game Boy Game Pak connected to the N64 Transfer Pak. Before accessing the Game Boy Game Pak, power must be turned on using osGbpakPower.

Also, please use the osGbpakInit function to initialize the pfs structure in advance. Power is turned ON or OFF according to the value specified by the flag. If OS_GBPAK_POWER_ON is specified for flag, the power is turned on; if OS_GBPAK_POWER_OFF is specified, the power is turned off.

Ensure that the power is on before calling osGbpakReadWrite.

When the Game Boy Game Pak is not being accessed, use the osGbpakPower function to turn the Game Pak power OFF. Then turn the power back ON the next time it is accessed. Before a user may insert/pull out the Game Boy Game Pak, turn off the power.

If power is turned from OFF to ON, the function performs an internal process for more than 0.12 second to wait for the power supply to stabilize. osGbpakPower internally uses the CPU timer (osSetTimer function)to wait for this interval. Thus, osCreateViManager must be called before calling osGbpakPower.

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:

PFS_ERR_NOPACK

Nothing is inserted in the specified Controller.

PFS_ERR_CONTRFAIL

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

osGbpakInit, osGbpakPower, osGbpakReadWrite, osGbpakGetStatus, osGbpakReadId, and osGbpakCheckConnector

Revision History

1999/04/30 Changed format