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

Data details


7.2.1 Basic data

 List
 Title

Data specifications

 Data

Basic data

 Data Name

 No

1.0

(1) Basic data type
 Model name
 explanation
 Uint8
 Unsigned 1-byte integer
 Sint8
 Signed 1-byte integer
 Uint16
 Unsigned 2-byte integer
 Sint16
 Signed 2-byte integer
 Uint32
 Unsigned 4-byte integer
 Sint32
 Signed 4-byte integer
 Boo1
 Logical type 4-byte integer (takes a logical constant as a value)

(2) Logical constant
Used as a Boolean value.

 Constant name
 value
 explanation
 FALSE
TRUE
 0
1
 Represents a false logical value.
Represents the true value of a logical value.
 OFF OFF
ON
 0
1
 Indicates switch off (false).
Indicates switch-on (true).

(3) Other
 Constant name
 value
 explanation
 NULL
 ((Void *) 0)
 NULL pointer 

7.2.2 Constant

 List
 Title

Data specifications

 Data

Constant (1/2)

 Data Name

Constant

 No

2.0

(1) Bit names related to interrupt factor registers (HIRQREQ, HIRQMSK)
bit 7 6 5 4 3 2 1 0
    [] [] [] [] [] [] [] []
     | | | | | | | |
     | | | | | | | + ---- CDC_HIRQ_CMOK 1: Command can be issued | | | | | | + ------- CDC_HIRQ_DRDY 1: Data transfer ready | | | | | + ----- ----- CDC_HIRQ_CSCT 1: 1 sector read completed | | | | + ------------- CDC_HIRQ_BFUL 1: CD buffer full | | | + ---------- ------ CDC_HIRQ_PEND 1: End of CD playback | | + ------------------ CDC_HIRQ_DCHG 1: Disk replacement occurs | + ------- --------------- CDC_HIRQ_ESEL 1: End of selector setting process + ------------------------- CDC_HIRQ_EHST 1: End of host input / output processing bit 15 14 13 12 11 10 9 8
    [-] [-] [] [] [] [] [] []
           | | | | | |
           | | | | | + ---- CDC_HIRQ_ECPY 1: End of copy / move processing | | | | + ------- CDC_HIRQ_EFLS 1: End of file system processing | | | + ------- --- CDC_HIRQ_SCDQ 1: Subcode Q update completed | | + ------------- CDC_HIRQ_MPED 1: MPEG related processing completed | + ------------ ---- CDC_HIRQ_MPCM 1: End of MPEG malfunction section + ------------------- CDC_HIRQ_MPST 1: Notification of MPEG interrupt status

(2) Error code
 Constant name
 explanation
 CDC_ERR_OK
 The function completed normally.
 CDC_ERR_CMDBUSY
 When issuing a command, the command end flag is not 1.
Target: All functions that check the command end flag
 CDC_ERR_CMDNG
 The CMOK flag is not set to 1 when the command is issued.
Target: All functions that issue commands
 CDC_ERR_TMOUT
 Timed out. (Waiting for response, waiting for data transfer preparation)
Target: All functions that issue commands CDC_GetPeriStat function, CDC_DataReady function
 CDC_ERR_PUT
 A free sector could not be secured while waiting for data transfer preparation by writing sector data.
Target: CDC_DataReady function after executing the CDC_PutSctData function
 CDC_ERR_REJECT
 The response to the command is now REJECT.
Target: All functions that issue commands
 CDC_ERR_WAIT
 The response to the command is now WAIT.
Target: All functions that issue commands
 CDC_ERR_TRNS
 The data transfer size is abnormal.
Target: Functions that transfer data internally (functions that start with CDC_Tget)
 CDC_ERR_PERI
 The periodic response could not be obtained.
Target: CDC_GetPeriStat function

(3) Special specification of sector range (sector position and number of sectors) of buffer partition
 Constant name
 explanation
 CDC_SPOS_END
 Indicates the sector position at the end of the partition.
Same as the specification of (Number of sectors in partition-1).
 CDC_SNUM_END
 Indicates the number of sectors from the specified sector position SP to the end of the partition.
Same as the specification of (Number of sectors in partition-SP).
This is valid for the following buffer partition functions.

CDC_CalActSiz
CDC_GetSctInfo
CDC_ExeFadSearch
CDC_GetSctData
CDC_DelSctData
CDC_GetdelSctData
CDC_CopySctData
CDC_MoveSctData

caution
When the number of sectors in a partition is 0, WAIT is always returned regardless of the specification. Before executing these functions, be sure to execute Get the number of sectors in the buffer partition (CDC_GetSctNum) to make sure that the number of sectors is not 0.

(4) Other special designations
 Constant name
 explanation
 CDC_PARA_DFL
 Specify default value of setting parameter (0)
It can be used when the default value is specified as 0.
 CDC_PARA_NOCHG
 Unchanged specification of setting parameters (-1)
It can be used when unchanged is specified by FFH, FFFFH, most significant bit = 1, etc.
 CDC_NUL_SEL
 Special value of selector number (aperture number, buffer partition number)
 CDC_NUL_FID
 File identifier special value 

7.2.3 TOC information / session information

 List
 Title

Data specifications

 Data

TOC information / session information

 Data Name

TOC / SES

 No

3.0

(1) TOC information …… CDC_TgetToc function

(2) Session information …… CDC_GetSes function

7.2.4 Subcode information

 List
 Title

Data specifications

 Data

Subcode information

 Data Name

Subcode

 No

4.0

(1) Subcode Q information …… CDC_TgetScdQch function
(a) When Adr = 1

byte
 1
 2
 3
 4
 5
 6
 7
 8
 9
 Ten
Ctrl
Adr
TNO X P_FAD 00 Q_FAD CRC

Ctrl Adr : CONTROL / ADR bytes
TNO : Track number (binary value, not BCD)
X : Index number (binary value, not BCD)
P_FAD : In-track time (frame address format with 0 at the beginning of the track)
Q_FAD : Absolute time (frame address format with 00:00:00 as 0)

The content of each status is the same as for the CD report.
The values for each TNO are shown in the following table.
(Lead-in and lead-out can be obtained in multiple sessions)

 TNO
 X
 P_FAD
 01H ~ 63H (1 ~ 99)
 01H ~ 63H
 Progress FAD in the track
 AAH (lead out)
 01H ~ 63H
 Progress FAD in the track
 00H (lead-in)
 01H ~ 63H, A0H, A1H, A2H
 000000H

The lead-in of the first session is Q_FAD = 000000H.
(Usually not available)

(b) Others (ADR ≠ 1):
The raw value of subcode Q (10 bytes other than CRC)

(2) Subcode R to W information …… CDC_TgetScdRwch function

Subcodes R to W are decoded in units of 1 pack (24 bytes = 12 words).
The CD block has a pack buffer for 24 packs (6 packets) inside.

7.2.5 Status and reports

 List
 Title

Data specifications

 Data

Status and reports

 Data Name

Status & CD Report

 No

5.0

(1) Response format
The response consists of a Status and a Report. Whether to return a CD Report as a report depends on the command. Regular responses always return a CD report.
The combination of status and CD report is called CD status information.

(2) Status
When the status is FFH, it indicates REJECT (command invalid). The status code is always valid except during REJECT. Also, bit5 to bit7 are exclusive and cannot be 1 at the same time.

bit 7 6 5 4 3 2 1 0
    [] [] [] [-] []
     | | | Status code (CD drive status)
     | | |
     | | + ----- CDC_ST_PERI 1: Periodic response 0: Response to command | + --------- CDC_ST_TRNS 1: Data transfer request 0: No request + --------- --CDC_ST_WAIT 1: WAIT (execution pending) 0: ACK (command normal reception)

(a) Status code (CD drive status)
 Constant name
 value
 Status
 explanation
 CDC_ST_BUSY
 00H
 <BUSY>
 During state transition
 CDC_ST_PAUSE
 01H
 <PAUSE>
 Pausing (pause)
 CDC_ST_STANDBY
 02H
 <STANDBY>
 Standby (drive stopped state)
 CDC_ST_PLAY
 03H
 <PLAY>
 Playing a CD
 CDC_ST_SEEK
 04H
 <SEEK>
 Seeking
 CDC_ST_SCAN
 05H
 <SCAN>
 Scan playback
 CDC_ST_OPEN
 06H
 <OPEN>
 The tray is open
 CDC_ST_NODISC
 07H
 <NODISC>
 No disk
 CDC_ST_RETRY
 08H
 <RETRY>
 Read retry processing in progress
 CDC_ST_ERROR
 09H
 <ERROR>
 Read data error occurred
 CDC_ST_FATAL
 0AH
 <FATAL>
 A fatal error has occurred

(3) CD report
byte
 1
 2
 3
 4
 5
 6
 7
CD Report Flg Rep
Cnt
Ctrl
Adr
TNO X FAD

Flg : CD flag (upper 4 bits) …… Valid in <PLAY> state
RepCnt : Number of repeats (lower 4 bits) …… Notification range is 0H to EH
bit 7 6 5 4 3 2 1 0
    [] [-] [-] [-] []
     | Repeat count |
     + ----------- CDC_CDFLG_ROM 1: CD-ROM decoding 0: CD-DA, seek, scan, etc.

Ctrl Adr : CONTROL / ADR bytes
TNO : Track number (binary value, not BCD) Based on subcode Q
X : Index number (binary value, not BCD)
FAD : Frame address (based on header information for CD-ROM, otherwise based on subcode Q)

(4) CD report contents in each status
The CD drive status and CD report contents are shown below. The sequence of FFH means an invalid value. (CD report at REJECT is invalid, valid at WAIT.)

 Status
 CD flag / repeat
 CONTROL / ADR
 Track number
 Index number
 Frame address
 <BUSY>
 ○ / FFH
 ○ / FFH
 ○ / FFH
 ○ / FFH
 ○ / FFFFFFH
 <PAUSE>
 <STANDBY>
 Value at the time of pause
 Value at the time of pause
 Value at the time of pause
 Value at the time of pause
 Value at the time of pause
 At seek home
 FFH
 FFH
 FFH
 FFH
 FFFFFFH
 <PLAY>
 <SEEK>
 Target position
 Target position
 Target position
 Target position
 <SCAN>
 <OPEN>
 FFH
 FFH
 FFH
 FFH
 FFFFFFH
 <NODISC>
 FFH
 FFH
 FFH
 FFH
 FFFFFFH
 <RETRY>
 <ERROR>
 FFH
 FFH
 FFH
 FFH
 FFFFFFH
 <FATAL>
 Indefinite
 Indefinite
 Indefinite
 Indefinite
 Indefinite
○: Current value Seek Home: Seek (stop) to the home position
When the standby time elapses and the status changes from <PAUSE> to <STANDBY>, the value at the time of pause is retained.

(5) When the content of the CD report is invalid

  1. The previous value is retained for the number of repeats. When it transitions to another state, it returns to the retained value.

  2. When transitioning from seek home to the <PAUSE> state, it moves to the beginning of the disk (FAD = 150).

  3. When <ERROR>, the previous value is retained. When it transitions to the state, it returns to the retained value.

  4. In the case of state transition, on the way The state may return an invalid value.
    Be sure to confirm the status other than <BUSY> before referring to the contents of the CD report.


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