N64® Functions Menu

al - Audio Library Functions
gDP - DP GBI Macros
gdSP - General GBI Macros
gSP - SP GBI Macros
gt - Turbo Microcode RDP
gu - Graphics Utilities
Math - Math Functions
nuSys - NuSystem
os - N64 Operating System
sp - Sprite Library Functions
uh - Host to Target IO
64DD - N64 Disk Drive

Nintendo® Confidential

   

nuContPakFileOpen

Format
void nuContPakFileOpen(NUContPakFile *file,
   u8* noteName, u8* extName,
   u32 mode, s32 size)
Arguments
  • file is pointer to the Controller Pak file structure
  • noteName is the pointer to the game note name (16 bytes in N64 font code)
  • extName is the pointer to the note extension (1 byte in N64 font code)
  • mode specifies whether or not to make a game note if none exists:

    • NU_CONT_PAK_CREATE means make a game note if it isn't there
    • NU_CONT_PAK_NOCREATE means do not make a game note

  • size is the size of game note when mode is NU_CONT_PAK_CREATE. It is an invalid value when mode is NU_CONT_PAK_NOCREATE.
Returned Value
none

What This Function Does
It opens the Controller Pak game note and prepares it so that it can be used. The file argument points to the Controller Pak structure of the device opened with the nuContPakOpen function. If the device is not open, then PFS_ERR_NOPACK is set in file.error. Before this function is called, the company code and game code must be registered by using the nuContPakCodeSet function.

If the game note name (noteName) does not fill 16 bytes, 0x00 is assigned to the unused space. The extName argument specifies the extension for use with multiple notes. The size is 4 bytes, but 1 byte is usable, and it is usually 0x00. Additional notes are assigned 0x1A-0x33 ('A'-'Z' in N64 font code).

If NU_CONT_PAK_CREATE is specified in mode and there is no game note, a game note of the specified size is created. Because game notes are managed in 256-byte units, the actual size secured is rounded up to a multiple of 256.

If NU_CONT_PAK_NOCREATE is specified, PFS_ERR_INVALID is returned to file.error where there is no game note. The error returned to error.file is slightly different depending on the mode. In NU_CONT_PAK_CREATE mode, the error.file takes the error value of osPfsFindFile or osPfsAllocateFile. In NU_CONT_PAK_NOCREATE mode, it takes the error value of osPfsFindFile.

The nuContPakOpen function and the nuContPakFileOpen function play different error checking roles. nuContPakOpen concerns itself with physical errors, like whether the Controller Pak is there or not, and whether it can be accessed. nuContPakFileOpen checks for errors in the data in the Controller Pak, like a missing game note or open space. Thus, you can divide the error processing routines into separate error groups.

See Also
nuContPakOpen
nuContPakOpenJis
nuContPakCodeSet



Nintendo® Confidential

Warning: all information in this document is confidential and covered by a non-disclosure agreement. You are responsible for keeping this information confidential and protected. Nintendo will vigorously enforce this responsibility.


Copyright © 1998
Nintendo of America Inc. All rights reserved
Nintendo and N64 are registered trademarks of Nintendo
Last updated January 1998