Japanese
INDEXSTN-2 | STN-3 | STN-4 | STN-5 | STN-6 | STN-9 | STN-18

STN-5

Read retry on Sega Saturn CD-ROM


 issue number:
STN-5
 date of issue:
94/10/07
 media:
○Common ●CD-ROM ○Cartridge ○Others
 connection:
●Program ○Hard ○Manual ○Tools ○Game ○ Bug ○Others
 Information distinction:
●New ○Change ○Addition
 importance:
●Strict observance ○Recommended ○Reference ○Others
 attached file:
○No ●Yes
 Subject supplement:

Contents

When creating a CD-ROM for Sega Saturn, be sure to perform a read retry in consideration of data errors.

■Description

Although CD-ROMs have a high level of error correction ability, uncorrectable errors may occur due to drive deterioration, disc scratches, eccentricity, dust attached to the disc, etc.
Therefore, in consideration of data errors, be sure to perform read retries in addition to "How to increase the number of ECCs" (see attached document) .
However, please note that when debugging, etc., by performing a read retry, the cause of an error may not be known.


attached file

How to set ECC/retry count

■Purpose

If an error occurs when reading CD-ROM data, the default setting is to abort the read without retrying.
→[Return error status]

■Setting method

Set the retry count using the CDC_CdInit function. The settings will take effect if they are made before the desired CD is played. In fact, once set, the setting remains valid until it is set again or soft reset, so it is usually appropriate to execute it at the beginning of the program (initialization, etc.).

◆Caution
When you run the CDC_CdInit function, the CD drive will:< PAUSE> state. Therefore, if you change the retry count while playing a CD, the setting will be changed.<PAUSE> condition.

◆Program example
	#include "sega_cdc.h"
	#define ECC 5 /* ECC repetition count: 5 times */
	#define RETRY 0x0f /* Number of retries: 15 times */

	/* Setting ECC/retry count (initialization flag, standby time are default values) */
	CDC_CdInit(0,0,ECC,RETRY);

◆Reference CDC_CdInit() function
  • "PROGRAMMER'S GUIDE VOL.1" CD Communication Interface User's Manual
  • STN-19 : How to initialize CD block when using GFS

    ◆ Others
    CD drive status< ERROR> If this occurs, please seek to the FAD where the data was read correctly and play again.
    To know the current FAD, issue the pause command once and then obtain the CD status information. in the same place over and over again<ERROR> If this happens, there may be some damage that cannot be repaired, so you may have no choice but to skip it.

    ■Sample program

    #include "sega_cdc.h"
    
    #define STS_MSK 0x0f /* CD status mask pattern */
    
    Sint32 recovPlay(Sint32 fad);
    Sint32 waitStat(Sint32 sts);
    
    /* CD playback recovery process (resume playback from specified fad) */
    Sint32 recovPlay(Sint32 fad)
    {
    	Sint32 Ret;
    	CdcPos pos;
    	CdcPly ply;
    	
    	/* Seek to destination */
    	CDC_POS_PTYPE(&pos) = CDC_PTYPE_FAD;
    	CDC_POS_FAD(&pos) = fad;
    	ret = CDC_CdSeek(&pos);
    	if (ret != CDC_ERR_OK) {
    		return NG;
    	}
    	
    	/*<PAUSE> Wait until the state */
    	ret = waitStat(CDC_ST_PAUSE);
    	if (ret != OK) {
    		return ret;
    	}
    	
    	/* Resume CD playback */
    	CDC_PLY_STYPE(&ply) = CDC_PTYPE_NOCHG;
    	CDC_PLY_ETYPE(&ply) = CDC_PTYPE_NOCHG;
    	CDC_PLY_PMODE(&ply) = CDC_PM_NOCHG;
    	ret = CDC_CdPlay(&ply);
    	if (ret != CDC_ERR_OK) {
    		return NG;
    	}
    	return OK;
    }
    
    /* Wait until the specified drive status */
    Sint32 waitStat(Sint32 sts)
    {
    	Sint32 ret;
    	Sint32 stwk;
    	CdcStat stat;
    	
    	while (TRUE) { /* We actually need an upper limit on the number of loops */
    		/* Get periodic response */
    		ret = CDC_GetPeriStat(&stat);
    		if (ret == CDC_ERR_PERI) {
    			continue;
    		}
    		if (ret != CDC_ERR_OK) {
    			return NG;
    		}
    		stwk = (CDC_STAT_STATUS(&stat) & STS_MSK);
    		if (stwk == sts) {
    			brake;
    		}
    	}
    	return OK;
    }
     
    

  • that's all
    INDEXSTN-2 | STN-3 | STN-4 | STN-5 | STN-6 | STN-9 | STN-18
    Copyright SEGA ENTERPRISES, LTD., 1997