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

Data details


7.2.6 Data types

 one
View
table
 Title

data specifications

 Data

CD status information

 Data Name

CdcStat

 No

6.1

Together, the CD block status and CD report are referred to as 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 (e.g. status code)
 CDC_STAT_FLGREP(stat)
 Uint8
 CD flag and repeat count in CD report
 CDC_STAT_CTLADR(stat)
 Uint8
 CONTROL/ADR byte of CD report
 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 repeat count from CD status information 

 one
View
table
 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
・ If 0: MPEG cannot be used*
・ If 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 perform an 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

 one
View
table
 Title

data specifications

 Data

CD position parameter (1/2)

 Data Name

CdcPos

 No

6.3

Used to specify the CD playback range (start position, end position) and seek position.

(1)Position type
Positional parameters can be specified as default values, frame addresses, tracks/indexes, or unchanged. Specify which one to select using the constant (position type) below.

 constant name
 explanation
 CDC_PTYPE_DFL
 Default value specification_When playing a CD: Indicates the beginning/end of the disc
When seeking: represents the home position
 CDC_PTYPE_FAD
 Frame addressing
 CDC_PTYPE_TNO
 Track/index specification
 CDC_PTYPE_NOCHG
 Specify unchanged (do not change the setting value)
Disc start: FAD = 150 (96H) position (2 seconds 0 frames in absolute time)
End of disc: FAD = lead-out start frame address (TOC information) - 1 position

(2) Positional parameter……CDC_CdSeek function
CdcPos *pos
 access macro
 mold
 explanation
 CDC_POS_PTYPE(pos)
 Sint32
 location type
 CDC_POS_FAD(pos)
 Sint32
 Frame address, FAD sector number
 CDC_POS_TNO(pos)
 Uint8
 track number
 CDC_POS_IDX(pos)
 Uint8
 index number

(3) Setting method

  1. Specifying default values
    CdcPosposwk, *pos = &poswk;
    CDC_POS_PTYPE(pos) = CDC_PTYPE_DFL;
    

  2. Frame addressing
    CdcPosposwk, *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 (FAD sector number).

  3. Track/index specification
    CdcPosposwk, *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
    CdcPosposwk, *pos = &poswk;
    CDC_POS_PTYPE(pos) = CDC_PTYPE_NOCHG;
    

(4) Exceptions to frame addresses
Depending on the conditions, frame addresses are interpreted as follows:

 conditions
 Start position, seek position
 End position
 F.A.D.< beginning of disc
 FAD = beginning of disk (150)
 FAD=disc start-1
(The number of FAD sectors is 0)
 F.A.D.> disc last
 FAD=end of disk +1
(equal to leadout)
 FAD=end of disk

 Relationship between start and end positions
 : End FAD = Start FAD + Number of FAD sectors - 1
 Starting FAD< For 150
 : End FAD = 150 + Number of FAD sectors - 1

The content of the playback range that is retained is the start FAD and end FAD.

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

 conditions
 Start position, seek position
 End position
 TNO=0
(default value for tracks)
 TNO = Disc first track
 TNO=last track of disc
 X=0
(default value of index)
 X=1
 X=99 (63H)
 TNO< Disc first track
 TNO = Disc first track
X=1 (same as X=0)
 TNO = Disc first track
X=99 (same as X=0)
 TNO> disc final track
 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 next track)
 (until the end of the track)
TNO: Track number, X: Index number

X=0 means specifying only the track. (Track start/last index)
TNO=X=0 is the default value for positional parameters.
(Start position: beginning of disk, end position: end of disk, seek position: home position)

(6) Exceptions to playback range
End position< If it is the start position, the playback range will be maintained, but the CD will not be played.
(For both frame address specification and track/index specification)

(7) Meaning of special designations

  • Specifying a default value for the seek position: Used as a stop command. (seek to home position)

  • Specify the seek position unchanged: Use as a pause command.

  • Specifying the playback range as unchanged: Used to release the pause (resume CD playback).

 one
View
table
 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 for 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 (valid range of the specified number of times is the lower 4 bits)
     |
     |     00H   → No repeat (plays only once)
     |   01H~0EH→ Specified number of repeats (1 to 14 repeats)
     |     0FH   → Infinite repeat
     |     7FH   → Maximum repeat count does not change
     |
     +------------------------- 0: Do not change pickup position (play from current position)
                                1: Move the pickup to the start position (play from the start position)

constant name
 explanation
 CDC_PM_DFL
 Default playback mode
(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 pickup position
 CDC_PM_NOCHG
 Playback mode (maximum repeat count, pickup position)
do not change

《If you do not change the pickup position》
You can start playback from any position by seeking and then executing.〈 PLAY〉 If you run it during playback, you can change only the playback range and maximum repeat count without interrupting CD playback.
If the current position is outside the playback range as a result of execution, 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
 Starting 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
 Starting 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 specification, pickup movement)

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

  1. Track specification and frame address specification cannot be combined in the playback range.
    In that case, return REJECT. All other playback range combinations are possible.

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

  3. The playback range and maximum repeat count are retained within the CD block and remain in effect until reset.

  4. Default value: Disc start to disc end, no repeat, move 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 addressing
 fad
 fasnum
 Note 1
 3
 Play from the beginning of the disc
 CDC_PTYPE_DFL
 tno2,x2
 fasnum
 4
 Play until the end of the disc
 tno1,x1
 CDC_PTYPE_DFL
 fad
 5
 Do not change end position
(change only the starting position)
 tno1,x1
 CDC_PTYPE_NOCHG
 Note 2
 fad
 6
 Do not change starting position
(change only the end position)
 CDC_PTYPE_NOCHG
 tno2,x2
 Note 2
 fasnum
 7
 Change playback parameters
CD playback resumes without
(Cancel pause)
 CDC_PTYPE_NOCHG
 CDC_PTYPE_NOCHG
 into play mode
CDC_PM_NOCHG
Specify.
"Notation"
fad :Frame address
fasnum : Number of frame address sectors
tno1 :Start track number
tno2 :Ending track number
x1 :Start index number
x2 :Ending index number

Note 1: fad+fasnum-1 is retained as the end position.
Note 2: Even if one of them is unchanged, combinations of track and frame address specifications are not possible.

(4) Exceptions to playback range
End position< If it is at the start position, it will not be played. As well as outside the playback range,〈 PAUSE〉 state.
However, the playback range is retained and the playback mode is also valid.

 one
View
table
 Title

data specifications

 Data

subheader condition

 Data Name

CdcSubh

 No

6.5

Used when setting/obtaining subheader conditions for aperture.

(1) Subheader conditions……CDC_SetFiltSubh, CDC_GetFiltSubh functions
*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
 Coding information comparison value
・Mask pattern: Comparison target bit pattern
・Comparison position: Comparison value of bits specified by mask pattern

After each submode and coding information are ANDed with the mask pattern, it is determined whether they are equal to the comparison value.

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

(2) Submode
bit  7  6  5  4  3  2  1  0
    [ ][ ][ ][ ][ ][ ][ ][ ]
     |  |  |  |  |  |  |  |
     |  |  |  |  |  |  |  +---- CDC_SM_EOR     1:Last sector of 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

 one
View
table
 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 

 one
View
table
 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: Represents the net file size, not including gap sectors during interleaving.
*2: If there is no system information for 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 directory record system information.
(If there is system information, bit 7 will be prioritized to determine the directory)
*4: Bits 3 to 7 are attribute information compliant with the CD-ROM XA standard.
If there is no system information, bits 3 to 7 are all set to 0.


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