Japanese
PROGRAMMER'S GUIDEFile system library
■ | Go forward
file system library

1. overview


This section describes libraries for accessing files on CDs.

1.1 Features

This library has the following features.

(1) Target CD-ROM
  1. ISO9660 level file access is possible.
  2. This library does not cover access using CD-ROM XA subheader information.

(2) Data buffering
  1. Access is performed assuming the CD block buffer management mechanism.
  2. In addition to simple file reading, it is possible to read ahead using a buffer.

(3) File identifier
  1. Access is based on file identifier (order number within the directory).
  2. Eliminate the slowdown caused by directory searches. >
  3. Access by file name is possible by using the file name to file identifier conversion function.

(4) Development support function
  1. Memory files and DOS files can be accessed as a development support function.
  2. If it is a small amount of data, a memory file can replace the file on the CD.
  3. DOS files on IBM-PC can be accessed like memory files via SCSI.
    Even if the data is too large to fit in the SIMM, it can be used as a substitute for files on the CD.
  4. We provide two types of libraries: one for product embedding and one that includes development support functions.

1.2 Functional overview

This section provides an overview of the functionality of the file system library. The functions of this library are classified into the following six types.

(1)Directory operations
It provides the following functions such as library initialization, reading directory information, and setting the current directory.

 function
 function
 GFS_Init
 Library initialization and CD mounting process
 GFS_LoadDir
 Load directory information
 GFS_SetDir
 Setting the current directory
 GFS_NameToId
 File name → file identifier conversion
 GFS_IdToName
 File identifier → file name conversion
 GFS_GetDirInfo
 Get directory information
 GFS_Reset
 Resetting the file system

(2) File operations
Perform common file operations such as opening, closing, and seeking files.

 function
 function
 GFS_Open
 Open file
 GFS_Close
 Close file
 GFS_Seek
 Moving the access point
 GFS_Tell
 Get access pointer
 GFS_IsEof
 Check if the access pointer is at the end of the file
 GFS_ByteToSct
 Conversion from byte to sector
 GFS_GetFileSize
 Get file size
 GFS_GetFileInfo
 Get file information
 GFS_GetNumCdbuf
 Obtaining the number of sectors in the CD buffer partition

(3) Completion return type reading
Read data from file. In this case, control will not return from the function until data loading is complete.

 function
 function
 GFS_Fread
 Reads data from the opened file.
 GFS_Load
 Reads data by specifying a file identifier.

(4) Immediate return type reading
The request and server functions read data from the file. The server function processes requests issued by the request function in processing units.
Server functions must be called repeatedly. By inserting application processing into the server function call loop, you can execute application processing until data loading is complete.

 function
 function
 GFS_NwFread
 Issuing a data load request
 GFS_NwCdRead
 Issuing a read request to the CD buffer
 GFS_NwIsComplete
 Check for completion of loading process
 GFS_NwStop
 Aborting the loading process
 GFS_NwGetStat
 Get access status
 GFS_NwExecOne
 Server function for one file
 GFS_NwExecServer
 Server functions for multiple files

(5) Reading parameter settings
Set various parameters for the completion return and immediate return read functions. You can change how to use the CD buffer, transfer method (DMA, CPU, etc.), and transfer unit.

 function
 function
 GFS_SetGmode
 Setting the ejecting method from the CD buffer
 GFS_SetTmode
 Transfer method settings
 GFS_SetReadPara
 Setting the reading unit to the CD buffer
 GFS_SetTransPara
 Transfer unit setting from CD buffer
 GFS_SetTrFunc
 Registering a transfer function
 GFS_StartTrans
 Transfer start in transfer function

(6) Others
Provides CD pickup control, error processing function registration, and error status acquisition functions. Error handling functions are called when an error occurs.

It also provides a CD-DA track number conversion function when using the DSS system.

 function
 function
 GFS_CdMovePickup
 Moving the CD pickup
 GFS_SetErrFunc
 Registering an error handling function
 GFS_GetErrStat
 Get error status
 GFS_ConvTno
 Track number conversion 

1.3 Module configuration

Figure 1.1 shows the positioning of this library in relation to hardware and other software. The dotted lines are modules included in the debugging library.

Figure 1.1 Module configuration diagram

To use this library, you need to link the following libraries at the same time.


■ | Go forward
PROGRAMMER'S GUIDEFile system library
Copyright SEGA ENTERPRISES, LTD., 1997