Function


nuContPakOpen

Syntax:
void nuContPakOpen(NUContPakFile *file, u32 cont_no)
Arguments:
file	Controller Pak file structure
cont_no	Controller number to open
Return Value:
None
Explanation:

Opens a Controller Pak device

Checks to see whether a Controller Pak or a Rumble Pak is inserted. If a Controller Pak is inserted, a file is initialized so it can be accessed by the Controller Pak.

When a Controller Pak is inserted, NU_CONT_PAK_TYPE_PAK is set in file.type. If nothing is inserted, NU_CONT_PAK_TYPE_NONE is set. This function can be used to determine which Controller(s) contain Controller Pak(s).

The value returned from the osPfsInitPak function or from the osMotorInit function is set in file.error. For details about the returned values, please see the explanation for each function.

For example:
	NUContPakFile pakFile;

	// Register company code and game code
	nuContPakCodeSet("64", "TEST");

	// Open Controller Pak device
	nuContPakOpen(&pakFile, 0);

	if(!pakFile.error){
		// Error processes for PFS_ERR_NOPACK, PFS_ERR_NEW_PACK,
		// PFS_ERR_CONTRFAIL, PFS_ERR_ID_FATAL, PFS_ERR_DEVICE
		......
		return ERROR;
	}

	if(pakFile.type !=NU_CONT_PAK_TYPE_PAK){
		// Process if not a Controller Pak
		......
		return ERROR;
	}

	// Open game note
	nuContPakFileOpenJis(&pakFile, "NuSystemSaveData", "a", NU_CONT_PAK_CREATE, 256);

	if(!pakFile.error){
		// Error processes for PFS_ERR_INCONSISTENT, PFS_ERR_INVALID
		// PFS_ERR_DATA_FULL, PFS_DIR_FULL
		......
		return ERROR;
	}

Reference: nuContPakFileOpen, nuContPakFileOpenJis 

- Revision History

1999/2/1 Deleted text regarding Rumble Pak