PROGRAMMER'S GUIDECD communication I / F (CD part)
BackForward
CD Communication Interface User's Manual (CD Part) / Reference

Data details


7.2.6 Data type

 List
 Title

Data specifications

 Data

CD status information

 Data Name

CdcStat

 No

6.1

The CD block status and the CD report are collectively called CD status information.

(1) CD status information …… CDC_GetCurStat, CDC_GetLastStat, CDC_GetPeriStat functions
CdcStat * stat
 Access macro
 Mold
 explanation
 CDC_STAT_STATUS (stat)
 Uint8
 Status (status code, etc.)
 CDC_STAT_FLGREP (stat)
 Uint8
 CD flag and repeat count for CD reports
 CDC_STAT_CTLADR (stat)
 Uint8
 CONTROL / ADR bytes for CD reports
 CDC_STAT_TNO (stat)
 Uint8
 CD report track number (binary value)
 CDC_STAT_IDX (stat)
 Uint8
 CD report index number (binary value)
 CDC_STAT_FAD (stat)
 Uint32
 CD report frame address

(2) Related macros
 Macro name
 explanation
 CDC_GET_STC (stat)
 Get status code from CD status information
 CDC_GET_REPEAT (stat)
 Get the number of repeats from the CD status information 

 List
 Title

Data specifications

 Data

Hardware information

 Data Name

CdcHw

 No

6.2.

(1) Hardware information …… CDC_GetHwlnfo function
CdcHw * hw
 Access macro
 Mold
 explanation
 CDC_HW_HFLAG (hw)
 Uint8
 Hardware flag
 CDC_HW_VER (hw)
 Uint8
 CD block version information
 CDC_HW_MPVER (hw)
 Uint8
 MPEG version information ・ For 0: MPEG cannot be used *
・ Other than 0: MPEG can be used
 CDC_HW_DRV (hw)
 Uint8
 CD drive information
 CDC_HW_REV (hw)
 Uint8
 CD block revision information
* It is necessary to execute the MPEG check of the service routine in the BOOT ROM.

(2) Hardware flag
bit 7 6 5 4 3 2 1 0
    [] [-] [-] [-] [-] [-] [] [-]
     | |   
     | |
     | + ------- CDC_HFLAG_MPEG 1: MPEG cartridge installed |
     + ------------------------- CDC_HFLAG_HERR 1: Hardware error occurred 

 List
 Title

Data specifications

 Data

CD position parameter (1/2)

 Data Name

CdcPos

 No

6.3

It is used to specify the playback range (start position, end position) of a CD, and to specify the seek position.

(1) Position type
Positional parameters can be default, frame address, track / index, or unchanged. Specify which one to select with the following constants (position type).

 Constant name
 explanation
 CDC_PTYPE_DFL
 Specifying a default value_When playing a CD: Representing the beginning / end of a disc When seeking: Representing the home position
 CDC_PTYPE_FAD
 Frame address specification
 CDC_PTYPE_TNO
 Track / index specification
 CDC_PTYPE_NOCHG
 Unchanged specification (do not change the set value)
Disc head: FAD = 150 (96H) position (absolute time 2 seconds 0 frame)
Disk end: FAD = readout start frame address (TOC information) -1 position

(2) Position parameter …… CDC_CdSeek function
CdcPos * pos
 Access macro
 Mold
 explanation
 CDC_POS_PTYPE (pos)
 Sint32
 Position type
 CDC_POS_FAD (pos)
 Sint32
 Frame address, number of FAD sectors
 CDC_POS_TNO (pos)
 Uint8
 Track number
 CDC_POS_IDX (pos)
 Uint8
 Index number

(3) Setting method

  1. Specifying the default value
    CdcPos poswk, * pos = & poswk;
    CDC_POS_PTYPE (pos) = CDC_PTYPE_DFL;
    

  2. Frame address specification
    CdcPos poswk, * pos = & poswk;
    CDC_POS_PTYPE (pos) = CDC_PTYPE_FAD;
    CDC_POS_FAD (pos) = fad; / * frame address * /
    
    For the end position, specify the number of sectors from the start FAD (number of FAD sectors).

  3. Track / index specification
    CdcPos poswk, * pos = & poswk;
    CDC_POS_PTYPE (pos) = CDC_PTYPE_TNO;
    CDC_POS_TNO (pos) = tno; / * Track number * /
    CDC_POS_IDX (pos) = x; / * Index number * /
    

  4. Unchanged designation
    CdcPos poswk, * pos = & poswk;
    CDC_POS_PTYPE (pos) = CDC_PTYPE_NOCHG;
    

(4) Frame address exceptions
Depending on the condition, the frame address is interpreted as follows.

 conditions
 Start position, seek position
 End position
 FAD <disc top
 FAD = beginning of disk (150)
 FAD = beginning of disk-1
(The number of FAD sectors is 0)
 FAD> Last disc
 FAD = last disk +1
(Equivalent to lead out)
 FAD = last disc

 Relationship between start position and end position
 : End FAD = Start FAD + Number of FAD sectors-1
 If start FAD <150
 : End FAD = 150 + number of FAD sectors-1

The contents of the playback range that are retained are the start FAD and end FAD.

(5) Track / index exceptions
Depending on the condition, the track / index is interpreted as follows.

 conditions
 Start position, seek position
 End position
 TNO = 0
(Track default)
 TNO = first track on disc
 TNO = last track of disc
 X = 0
(Index default value)
 X = 1
 X = 99 (63H)
 TNO <first track on disc
 TNO = first track on disc
X = 1 (same as X = 0)
 TNO = first track on disc
X = 99 (same as X = 0)
 TNO> Last track of disc
 TNO = last track of disc
X = 1 (same as X = 0)
 TNO = last track of disc
X = 99 (same as X = 0)
 X does not exist
 (From the next track)
 (Until the end of the track)
TNO: track number, X: index number

X = 0 means that only the track is specified. (Track start / end index)
TNO = X = 0 is the default value for the position parameter.
(Start position: disc start position, end position: disc end, seek position: home position)

(6) Exceptions to the playback range
If the end position <start position, the playback range is retained, but the CD is not played.
(In both cases of frame address specification and track / index specification)

(7) Meaning of special designation
 List
 Title

Data specifications

 Data

CD playback parameters

 Data Name

CdcPly

 No

6.4

Used to specify the playback range and playback mode when playing a CD.

(1) Playback mode
When playing a CD, specify the maximum number of repeats in the playback section and the pickup position (playback position).

bit 7 6 5 4 3 2 1 0
    [] [] Default value (initial value): 00H
     | Maximum number of repeats (The valid range of the specified number of times is the lower 4 bits)
     |
     | 00H → No repeat (play only once)
     | 01H ~ 0EH → Repeat specified number of times (1 to 14 times repeat)
     | 0FH → Infinite repeat | 7FH → Do not change the maximum number of repeats |
     + ------------------------- 0: Do not change the pickup position (play from the current position)
                                1: Move the pickup to the start position (play from the start position)

Constant name
 explanation
 CDC_PM_DFL
 Playback mode default (no repeat, move pickup to start position)
 CDC_PM_REP_NOCHG
 Do not change the maximum number of repeats
 CDC_PM_PIC_NOCHG
 Do not change the pickup position
 CDC_PM_NOCHG
 Playback mode (maximum number of repeats, pickup position)
Do not change

<< When the pickup position is not changed >>
You can start playback from any position by seeking and then executing. If you execute it during <PLAY>, you can change only the playback range and the maximum number of repeats without interrupting the CD playback.
As a result of execution, if the current position goes out of the playback range, repeat processing will be performed.

(2) Playback parameters …… CDC_CdPlay function
CdcPly * ply
 Access macro
 Mold
 explanation
 CDC_PLY_START (ply)
 CdcPos
 Playback start position parameter
 CDC_PLY_STYPE (ply)
 Sint32
 Start position type
 CDC_PLY_SFAD (ply)
 Sint32
 Start position frame address
 CDC_PLY_STNO (ply)
 Uint8
 Start position Track number
 CDC_PLY_SIDX (ply)
 Uint8
 Start position index number
 CDC_PLY_END (ply)
 CdcPos
 Playback end position parameter
 CDC_PLY_ETYPE (ply)
 Sint32
 End position type
 CDC_PLY_EFAS (ply)
 Sint32
 End position Frame address Number of sectors
 CDC_PLY_ETNO (ply)
 Uint8
 End position track number
 CDC_PLY_EIDX (ply)
 Uint8
 End position index number
 CDC_PLY_PMODE (ply)
 Uint8
 Playback mode (repeat designation, pickup movement)

(3) How to set playback parameters
The playback parameters specify the playback range and playback mode. The playback range is specified by the combination of the position parameters of the start position and the end position.

  1. You cannot combine track specification and frame address specification for the playback range.
    In that case, it returns REJECT. All other combinations of playback ranges are possible.

  2. All combinations of playback range and playback mode are possible.

  3. The playback range and maximum number of repeats are retained within the CD block and are valid until reset.

  4. Default value: From the beginning of the disc to the end of the disc, no repeat, move the pickup

A setting example is shown below.

 NO
 How to play
 Starting position
 End position
 remarks
 1
 Track designation
 tno1, x1
 tno2, x2
 2
 Frame address specification
 fad
 fasnum
 Note 1
 3
 Play from the beginning of the disc
 CDC_PTYPE_DFL
 tno2, x2
 fasnum
 Four
 Play to the end of the disc
 tno1, x1
 CDC_PTYPE_DFL
 fad
 Five
 Do not change the end position (change only the start position)
 tno1, x1
 CDC_PTYPE_NOCHG
 Note 2
 fad
 6
 Do not change the start position (change only the end position)
 CDC_PTYPE_NOCHG
 tno2, x2
 Note 2
 fasnum
 7
 Resume CD playback (cancel pause) without changing playback parameters
 CDC_PTYPE_NOCHG
 CDC_PTYPE_NOCHG
 In play mode
CDC_PM_NOCHG
To specify.
"labels"
fad : Frame address
fasnum : Number of frame address sectors
tno1 : Starting track number
tno2 : End track number
x1 : Starting index number
x2 : End index number

Note 1: fad + fasnum−1 is retained as the end position.
Note 2: Even if one of them has not been changed, the combination of track and frame address specification is not possible.

(4) Exceptions to the playback range
If the end position <start position, it will not be played. As with the outside of the playback range, it will be in the <PAUSE> state.
However, the playback range is retained and the playback mode is also valid.

 List
 Title

Data specifications

 Data

Subheader condition

 Data Name

CdcSubh

 No

6.5 6.5

Used when setting / acquiring subheader conditions for aperture.

(1) Subheader condition …… CDC_SetFiltSubh, CDC_GetFiltSubh function
* subh
 Access macro
 Mold
 explanation
 CDC_SUBH_FN (subh)
 Uint8
 File number
 CDC_SUBH_CN (subh)
 Uint8
 Channel number
 CDC_SUBH_SMMSK (subh)
 Uint8
 Submode mask pattern
 CDC_SUBH_SMVAL (subh)
 Uint8
 Submode comparison value
 CDC_SUBH_CIMSK (subh)
 Uint8
 Coding information mask pattern
 CDC_SUBH_CIVAL (subh)
 Uint8
 Comparison value of coding information
-Mask pattern: Bit pattern to be compared
-Comparison position: Comparison value of bits specified by the mask pattern

The submode and coding information are determined to be equal to the comparison value after being ANDed with the mask pattern.

Conditional expression (Submode & SMMSK) = SMVAL
(Coding information & CIMSK) = CIVAL

(2) Sub mode
bit 7 6 5 4 3 2 1 0
    [] [] [] [] [] [] [] []
     | | | | | | | |
     | | | | | | | + ---- CDC_SM_EOR 1: Last sector of the record | | | | | | + ------- CDC_SM_VIDEO 1: Video sector | | | | | + ------ ---- CDC_SM_AUDIO 1: Audio Sector | | | | + ------------- CDC_SM_DATA 1: Data Sector | | | + -------------- --CDC_SM_TRIG 1: Trigger ON
     | | + ------------------- CDC_SM_FORM 1: Form2 0: Form1
     | + ------------------------ CDC_SM_RT 1: Real-time sector + -------------------- ----- CDC_SM_EOF 1: Last sector of file 

 List
 Title

Data specifications

 Data

Sector information

 Data Name

CdcSct

 No

6.6

(1) Sector information …… CDC_GetSctInfo function
CdcSct * sct
 Access macro
 Mold
 explanation
 CDC_SCT_FAD (sct)
 Sint32
 Frame address
 CDC_SCT_FN (sct)
 Uint8
 File number
 CDC_SCT_CN (sct)
 Uint8
 Channel number
 CDC_SCT_SM (sct)
 Uint8
 Submode
 CDC_SCT_CI (sct)
 Uint8
 Coding information 

 List
 Title

Data specifications

 Data

File information

 Data Name

CdcFile

 No

6.7

(1) File information …… CDC_TgetFileInfo function
CdcFile * file
 Access macro
 Mold
 explanation
 CDC_FILE_FAD (file)
 Sint32
 File first frame address
 CDC_FILE_SIZE (file)
 Sint32
 File size (number of bytes) * 1
 CDC_FILE_UNIT (file)
 Uint8
 File unit size
 CDC_FILE_GAP (file)
 Uint8
 Gap size
 CDC_FILE_FN (file)
 Uint8
 File number * 2
 CDC_FILE_ATR (file)
 Uint8
 File attributes
* 1: Indicates the net file size, not including the gap sector at the time of interleaving.
* 2: If there is no system information in the directory record, the file number will be 0.

(2) File attributes
bit 7 6 5 4 3 2 1 0
    [] [] [] [] [] [-] [] [-]
     | | | | | |
     | | | | | |
     | | | | | + ------- CDC_ATR_DIRFG 1: Directory * 3
     | | | | |
     | | | | + ------------- CDC_ATR_FORM1 1: Includes Form1 sector * 4
     | | | + ---------------- CDC_ATR_FORM2 1: Includes Form2 sector * 4
     | | + ------------------- CDC_ATR_INTLV 1: Includes interleaved sectors * 4
     | + ---------------------- CDC_ATR_CDDA 1: CD-DA file * 4
     + ------------------------- CDC_ATR_DIRXA 1: Directory file * 4

* 3: bit1 is the directory bit of the file flag in the directory record.
This is valid when there is no system information in the directory record.
(If there is system information, bit7 is prioritized for directory determination)
* 4: Bit3 to 7 are attribute information conforming to the CD-ROM XA standard.
If there is no system information, bit3 to 7 are all set to 0.


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