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

CD block file system


6.1 File management on CD-ROM (ISO9660)

The CD block file system supports logical formats compliant with ISO9660.

Figure 6.1 File management data structure in CD-ROM (ISO9660)

6.2 CD Block File System Features

The CD block file system (hereinafter abbreviated as file system) has the following functions. (Available only for GAME-CD)

(1) Directory movement (CDC_ChgDir) and file information retention (CDC_ReadDir)
Move to the specified directory and keep the file information in that directory in the file information table inside the CD block.

(2) Acquisition of retained file information (CDC_GetFileScope, CDC_TgetFileInfo)
Gets the range of file information held and extracts the contents of the file information table.

(3) Reading the file (CDC_ReadFile)
Reads the file's sector data into the CD buffer based on the stored file information. The host can retrieve the read sector data by data transfer.

(4) Abort file access (CDC_AbortFile)
Stops moving directories, preserving file information, and loading files. When you perform abort file access, CD Block pauses the CD drive.

Figure 6.2 Structure of CD block file system

6.2.1 File information retention method

The CD block prepares a file information table for 256 pieces and holds the file information to be accessed.
The first two entries in this table always contain information about the current directory (self) and parent directory. Up to 254 general file information can be held. (The number cannot be specified.)

(1)Move directory
When moving a directory, the directory record is read, file information (12 bytes) is extracted and stored in a table. The range to keep is from the beginning of the directory block.

(2) Retention of file information (specifying the range to be retained)
You can specify a file identifier to retain file information from any location within the current directory. In this case as well, the first two pieces of the table will hold information for yourself and the parent.

6.2.2 File access procedures

(1) Move to root directory
To use the file system, you must first create a file information table by navigating to the root directory. The same applies when file information is cleared, such as when starting up or replacing a disk.
If the disk is not in ISO9660 format (standard identifier is “CD001”), the table will not be created and the file system will not be usable. To check the table creation results, try retrieving the retained file information range. If it cannot be created, it will be REJECT.

(2) Retention of file information
A file system can only access files and directories in the file information table. Before you can load files, move directories, or retrieve retained file information, you must retain file information. If the target file information is not retained, the result will be REJECT.

(3) Loading files
Reads a file by specifying the file identifier and offset (in sectors). The load destination selector is specified by the aperture number.

(4) Extracting sector data
Files read into the buffer section are transferred and retrieved by retrieving sector data (e.g. CDC_GetSctData). You can retrieve data even while it is being loaded, and there is no need to wait for it to finish loading.
If the CD buffer becomes full in the middle of a file, it will pause, and when it becomes free, it will unpause and read the rest of the file.

(5) End of file reading
When the file has been read, the EFLS flag in the interrupt factor register becomes 1. To stop reading a file, execute Stop File Access. (The same applies when accessing files by moving directories or retaining file information.)

6.2.3 File system notes

(1) Specifying the work selector
When reading file information, CD block requires a selector to work with. Specify one selector when moving directories or preserving file information. At this time, at least one free sector is required. After the process is finished, the unused sectors will be erased.

(2) Selector settings
When accessing a file, the file system makes the following settings for the selector:

  1. Connection status of specified aperture
    • Aperture input connector: Connects to a CD device.
    • True output connector: Connects to a buffer section with the same number.
    • False output connector: Separate from other selectors.

  2. Aperture conditions
    Table 6.1 Aperture conditions to be set
     motion
     Aperture conditions
     Move directory
     -Set the aperture frame address range.
    ・ Enable frame address range for aperture mode.
     Retaining file information
     Load file
     -Set the aperture frame address range (FAD range).
    ・ Set the file number (FN) for the aperture subheader condition.
    ・ Enable FAD range and FN selection in aperture mode.

  3. Buffer compartment connected to aperture
    Clear sectors of the buffer partition before file access.

(3)CD playback range and drive commands
When accessing a file, the playback range will be the default value (from the beginning to the end of the disc).
Drive commands (CD playback, pause, etc.) are executed as is even if the file system is running. Please be careful as it is possible to interfere with the operation of the file system.
The settings made by CD block initialization (CDC_CdInit) (ECC count, retry count, etc.) are valid even when accessing files.
Automatic pause/unpause when the buffer is full also works as usual.

(4) Termination and cancellation of file access
When you finish or abort file access, the EFLS flag becomes 1. File access is also canceled when the tray is opened.
If a directory is being moved or file information is being retained, if file access is stopped, the file information table will be destroyed (initialized) and no information will be entered.

(5) For multi-session
The file system refers to the last session's volume descriptor.


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