Japanese
PROGRAMMER'S GUIDECD communication I/F (CD part)
BackForward
CD communication interface user's manual (CD part)

Function details-8


8.2.8 CD Block File System


 one
View
table
 Title

function specification

 Function

Move directory

 Function Name[SR]

CDC_ChgDir

 No

8.1

Format
Sint32 CDC_ChgDir(Sint32 filtno, Sint32 fid)
input
 filtno
 : Aperture number
 fid
 :File identifier of directory file (CDC_NUL_FID: root directory)
output
none
function value
Returns an error code.
end flag
EFLS flag
function
Moves the current directory to the directory indicated by the specified file identifier. Specifying CDC_NUL_FID as the file identifier moves you to the root directory. When moving, it reads directory records and retains up to 254 file information from the beginning. (Up to 256 including self and parent) Returns REJECT if the file identifier does not point to a directory.
remarks
The CD block file system uses selectors for its work. The working selector is specified by the aperture number.

 one
View
table
 Title

function specification

 Function

Retaining file information

 Function Name[SR]

CDC_ReadDir

 No

8.2

Format
Sint32 CDC_ReadDir(Sint32 filtno, Sint32 fid)
input
filtno: Aperture number
output
none
function value
Returns an error code.
end flag
EFLS flag
function
Reads the directory record of the current directory and retains information on up to 254 files starting from the specified file identifier. (Always retained by myself and parents)
remarks
The CD block file system uses selectors for its work. The working selector is specified by the aperture number.

 one
View
table
 Title

function specification

 Function

Obtaining the retained file information range

 Function Name[S-]

CDC_GetFileScope

 No

8.3

Format
Sint32 CDC_GetFileScope(Sint32 *fid, Sint32 *infnum, Bool *drend)
input
none
output
 fid
 : First file identifier held
 infnum
 : Number of retained file information
 drend
 :Last directory record retention flag
function value
Returns an error code.
function
Returns the range of file information currently held by the CD block.

(1) Last directory record retention flag
Notifies whether the current retained file information range includes the last directory record in the directory block. This allows you to determine if there are any subsequent directory records.
 constant name
 explanation
 TRUE
 Holds the final directory record.
 FALSE
 Not keeping the final directory record.

remarks
Since the self and parent directories are always retained, they are not included in the number of file information.

 one
View
table
 Title

function specification

 Function

Get retained file information

 Function Name[S-]

CDC_TgetFileInfo

 No

8.4

Format
Sint32 CDC_TgetFileInfo(Sint32 fid, CdcFile *file)
input
fid: File identifier (CDC_NUL_FID: Shows all file information)
output
file: File information
function value
Returns an error code.
function
Obtain file information (12 bytes) by specifying a file identifier from the retained file information range.
If you specify CDC_NUL_FID as the file identifier, all file information held by the CD block (up to 254 files excluding self and parent) will be retrieved.
Note
Immediately after issuing the file read (CDC_ReadFile) command, be sure to wait at least 16.7ms to prevent the command from being overwritten.
example
CdcFile file; /* Secure 1 file information storage area */
ret = CDC_TgetFileInfo(fid, &file);

CdcFile allfile[254]; /* Secure all file information storage area */
ret = CDC_TgetFileInfo(CDC_NUL_FID, allfile);

 one
View
table
 Title

function specification

 Function

Load file

 Function Name[SR]

CDC_ReadFile

 No

8.5

Format
Sint32 CDC_ReadFile(Sint32 filtno, Sint32 fid, Sint32 offset)
input
 filtno
 : Aperture number
 fid
 :File identifier
 offset
 : Logical offset from the beginning of the file (in sectors)
output
none
function value
Returns an error code.
end flag
EFLS flag
function
Reads the specified file into the CD buffer. The load destination selector is specified by the aperture number.

 one
View
table
 Title

function specification

 Function

Aborting file access

 Function Name[SR]

CDC_AbortFile

 No

8.6

Format
Sint32 CDC_AbortFile(void)
input
none
output
none
function value
Returns an error code.
end flag
EFLS flag (only cleared to 0)...Can be executed regardless of the EFLS value
function
Stops accessing files using the CD block file system (features described below).

When file access is aborted, the CD drive is paused and the EFLS flag in the interrupt factor register becomes 1.
If the file is not being accessed, just set the EFLS flag to 1.
remarks
Aborting file access does not clear the buffer partition or initialize the selector.
If you stop executing the CDC_ChgDir or CDC_ReadDir functions, all retained file information will be cleared.
File access is also aborted if the tray is opened.

BackForward
PROGRAMMER'S GUIDECD communication I/F (CD part)
Copyright SEGA ENTERPRISES, LTD., 1997