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

   

osPfsFileState

Format
#include <ultra64.h>
s32 osPfsFileState(OSPfs *pfs, s32 file_no, OSPfsState *state);


What This Function Does
It obtains the specified game note information. To specify a game note, use the note number file_no (file descriptor) argument. To retrieve specific game note information, it is necessary to obtain the note number by calling osPfsFindFile, before calling this function. Also, to retrieve all game note information in a Controller Pak, assign 0 to 15 to the file number (file_no) and call osPfsFileState 16 times.

The OSPfs handle must be the handle returned from osPfsInitPak. See the osPfsInitPak page for information on how to create this handle.

The game note information is stored in the OSPfsState structure specified by the pointer state argument. The following is the definition of that structure:
   typedef struct {
   u32 file_size;       /*Note Size*/
   u32 game_code;       /*Game Code*/
   u16 company_code;    /*Company Code*/
   char ext_name[4];    /*Note Extension*/
   char game_name[16];  /*Note Name*/
    }
If this function is called successfully, a 0 is returned. If an error occurs, one of the following error codes is returned:
  • PFS_ERR_NOPACK - Some type of PIF error has occurred. Either the Controller Pak is not inserted into the specified Controller or the Controller is not properly connected. To determine which is the case, use osContStartQuery or osContGetQuery.
  • PFS_ERR_NEW_PACK - A different Controller Pak has been inserted. To use the inserted Controller Pak, initialize it by calling osPfsInitPak.
  • PFS_ERR_CONTRFAIL - Data transfer to or from the Controller has failed. If a transfer error occurs, up to three tries will be done internally. Therefore, it is rather rare to see this error. If this error has returned, it is possible that either the Controller is not connected properly, or the Controller Pak or Controller Socket is damaged.
  • PFS_ERR_INCONSISTENT - There is a problem in the file system's management area. Usually this error does not occur because osPfsChecker is called internally when you initialize the file system by calling osPfsInitPak. If this error is returned, either the Controller Pak is not connected properly, or the Controller Pak itself is damaged.
  • PFS_ERR_INVALID - If this error is returned, an incorrect argument was specified when this function was called, the specified game note does not exist, or the Pfs function has been called without first being initialized by calling osPfsInitPak. Therefore, usually this error is not returned.
See Also
osContInit
osContStartQuery
osContGetQuery
osPfsAllocateFile
osPfsChecker
osPfsDeleteFile
osPfsFindFile
osPfsFreeBlocks
osPfsInitPak
osPfsIsPlug
osPfsReadWriteFile



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