Virtual file sources
[Virtual Files]


Enumerations

enum  GBFS_INIT_MODES { GBFS_COMPATIBLE_MODE, GBFS_DEFAULT_MODE }

Functions

int ulInitLibFat ()
int ulInitGBFS (int compatMode)

Variables

int VF_MEMORY
int VF_FILE
int VF_GBFS

Detailed Description

There are three virtual file sources available by default: memory, gbfs and libfat.

Enumeration Type Documentation

enum GBFS_INIT_MODES

GBFS compatibility modes. Used with ulInitGBFS.

Enumerator:
GBFS_COMPATIBLE_MODE  Enables compatibility with EZ3 (and maybe other linkers). It needs more time (2 ~ 3 seconds) if no GBFS file system is present into the ROM.
GBFS_DEFAULT_MODE  Default (fast) mode. Not compatible with EZ3.


Function Documentation

int ulInitLibFat (  ) 

Initializes LibFAT - crashes if no device supporting libfat is present...

You have to call this routine before you can work with files. libFat support will be added to your code, eating something like 75 kB.

int ulInitGBFS ( int  compatMode  ) 

Initializes GBFS - returns 0 in case of success or -1 if it failed.

You have to call this routine before you can open any GBFS file. GBFS support will be added to your application, it's quite small (less than 2 kB IIRC).


Variable Documentation

int VF_MEMORY

Read and write from memory. Automatically registered when initializing µLibrary.

int VF_FILE

Use libFat as a virtual file source. Needs to call ulInitLibFat to use it. However, it will crash if no device supporting libFat is present, so be careful.

If you want to create several versions, I suggest you to keep a global variable that identifies the virtual file source you're using. In one version, it could have the value of VF_GBFS, in another VF_FILE. At startup you would just have to do:

int myID;
[...]
#if defined(USE_GBFS)
myID = ulInitGBFS(GBFS_COMPATIBLE_MODE);
#elif defined(USE_LIBFAT)
myID = ulInitLibFat();
#endif
[...]
VIRTUAL_FILE *f = VirtualFileOpen("/test.txt", 0, myID, VF_O_READ);
[...]

It could even be a choice proposed to the user at startup.

int VF_GBFS

Use GBFS (Game Boy File System). Needs to call ulInitGBFS to use that source.


Generated on Sat Jul 14 23:39:33 2007 by  doxygen 1.5.2