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


 List
 Title

Function specifications

 Function

Move directory

 Function Name [SR]

CDC_ChgDir

 No

8.1

Form
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 for the file identifier will take you to the root directory. When moved, it reads the directory record and holds up to 254 file information from the beginning. (Maximum 256 including yourself and parent) Returns REJECT if the file identifier does not point to a directory.
remarks
The CD block file system uses selectors for work. The work selector is specified by the aperture number.

 List
 Title

Function specifications

 Function

Retention of file information

 Function Name [SR]

CDC_ReadDir

 No

8.2. 8.2

Form
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 holds up to 254 file information after the specified file identifier. (Always keep yourself and your parents)
remarks
The CD block file system uses selectors for work. The work selector is specified by the aperture number.

 List
 Title

Function specifications

 Function

Acquisition of retained file information range

 Function Name [S-]

CDC_GetFileScope

 No

8.3

Form
Sint32 CDC_GetFileScope (Sint32 * fid, Sint32 * infnum, Bool * drend)
input
none
output
 fid
 : Retained first file identifier
 infnum
 : Number of file information held
 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
Tells you if the current retained file information range contains 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 last directory record.
 FALSE
 Does not hold the last directory record.

remarks
It is not included in the number of file information because it always keeps its own and its parent directories.

 List
 Title

Function specifications

 Function

Acquisition of retained file information

 Function Name [S-]

CDC_TgetFileInfo

 No

8.4

Form
Sint32 CDC_TgetFileInfo (Sint32 fid, CdcFile * file)
input
fid: File identifier (CDC_NUL_FID: Indicates all file information)
output
file: File information
Function value
Returns an error code.
function
The file information (12 bytes) is acquired by specifying the file identifier from the retained file information range.
If CDC_NUL_FID is specified as the file identifier, all file information held by the CD block (up to 254 excluding yourself and the parent) will be acquired.
caution
Immediately after issuing the file read (CDC_ReadFile) command, be sure to leave at least 16.7 ms to prevent the command from being overwritten.
example
CdcFile file; / * 1 Secure file information storage area * /
ret = CDC_TgetFileInfo (fid, & file);

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

 List
 Title

Function specifications

 Function

Read file

 Function Name [SR]

CDC_ReadFile

 No

8.5

Form
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 sector units)
output
none
Function value
Returns an error code.
End flag
EFLS flag
function
Reads the specified file into the CD buffer. The selector to read to is specified by the aperture number.

 List
 Title

Function specifications

 Function

Stop file access

 Function Name [SR]

CDC_AbortFile

 No

8.6

Form
Sint32 CDC_AbortFile (void)
input
none
output
none
Function value
Returns an error code.
End flag
EFLS flag (only 0 is cleared) …… Can be executed regardless of the EFLS value
function
Stops file access by the CD block file system (features below).

When file access is aborted, the CD drive is paused and the EFLS flag in the interrupt cause register is set to 1.
If you are not accessing a file, just set the EFLS flag to 1.
remarks
Even if file access is stopped, the buffer partition is not cleared and the selector is not initialized.
When the execution of the CDC_ChgDir and CDC_ReadDir functions is stopped, all the stored file information is cleared.
File access is also stopped when the tray is opened.

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