#include "sega_cdc.h"
Sint32 recocGfsInit (void);
Sint32 waitStat (Sint32sts);
/ * GFS_Init, GFS_LoadDir return processing * /
Sint32 revovGfsInit (void)
{
Sint32 ret;
CdcPos pos;
/ * Issue a pause command * /
CDC_POS_PTYPE (& pos) = CDC_PTYPE_NOCHG;
ret = CDC_CdSeek (& pos);
if (ret! = CDC_ERR_OK) {
return NG;
}
/ * Wait until "PAUSE" state * /
ret = waitStat (CDC_ST_PAUSE);
return ret;
}
/ * Wait until the specified drive status is reached * /
Sint32 waitStat (Sint32 sts)
{
Sint32 ret;
Sint32 stwk;
CdcStat stat;
while (TRUE) {/ * Actually, the upper limit of the number of loops is required * /
/ * Get regular response * /
ret = CDC_GetPeriStat (& stat);
if (ret == CDC_ERR_PERI) {
continue; continue;
}
if (ret! = CDC_ERR_OK) {
return NG;
}
stwk = CDC_GET_STC (& stat);
if (stwk == sts) {
brake;
}
}
return OK;
}