Пример #1
0
PICO_INTERNAL int Open_Tray_CDD_cD(void)
{
	CHECK_TRAY_OPEN

	Pico_mcd->scd.Status_CDC &= ~1;			// Stop CDC read

	elprintf(EL_STATUS, "tray open\n");

	Unload_ISO();
	CD_Present = 0;

	if (PicoMCDopenTray != NULL)
		PicoMCDopenTray();

	Pico_mcd->scd.Status_CDD = TRAY_OPEN;
	Pico_mcd->cdd.Status = 0x0E00;

	Pico_mcd->cdd.Minute = 0;
	Pico_mcd->cdd.Seconde = 0;
	Pico_mcd->cdd.Frame = 0;
	Pico_mcd->cdd.Ext = 0;

	Pico_mcd->scd.CDD_Complete = 1;

	return 0;
}
Пример #2
0
PICO_INTERNAL int Load_ISO(const char *iso_name, int is_bin)
{
	int i, j, num_track, Cur_LBA, index, ret, iso_name_len;
	_scd_track *Tracks = Pico_mcd->TOC.Tracks;
	char tmp_name[1024], tmp_ext[10];
	pm_file *pmf;
	static char *exts[] = {
		"%02d.mp3", " %02d.mp3", "-%02d.mp3", "_%02d.mp3", " - %02d.mp3",
		"%d.mp3", " %d.mp3", "-%d.mp3", "_%d.mp3", " - %d.mp3",
#if CASE_SENSITIVE_FS
		"%02d.MP3", " %02d.MP3", "-%02d.MP3", "_%02d.MP3", " - %02d.MP3",
#endif
	};

	if (PicoCDLoadProgressCB != NULL) PicoCDLoadProgressCB(1);

	Unload_ISO();

	Tracks[0].ftype = is_bin ? TYPE_BIN : TYPE_ISO;

	Tracks[0].F = pmf = pm_open(iso_name);
	if (Tracks[0].F == NULL)
	{
		Tracks[0].ftype = 0;
		Tracks[0].Length = 0;
		return -1;
	}

	if (Tracks[0].ftype == TYPE_ISO)
		Tracks[0].Length = pmf->size >>= 11;	// size in sectors
	else	Tracks[0].Length = pmf->size /= 2352;
Пример #3
0
int Stop_CD(void)
{
	int ret = CD_Present;

	Unload_ISO();
	CD_Present = 0;

	return ret;
}
Пример #4
0
void Stop_CD(void)
{
	if (CD_Load_System == CDROM_)
	{
		ASPI_Lock(0);
		ASPI_Stop_Play_Scan(0, NULL);
	}
	else
	{
		Unload_ISO();
	}
}
Пример #5
0
PICO_INTERNAL int Load_CD_Image(const char *cd_img_name, cd_img_type type)
{
	int i, j, num_track, Cur_LBA, index, ret;
	int iso_name_len, missed, cd_img_sectors;
	_scd_track *Tracks = Pico_mcd->TOC.Tracks;
	char tmp_name[256], tmp_ext[10], tmp_ext_u[10];
	cue_data_t *cue_data = NULL;
	pm_file *pmf;
	static const char *exts[] = {
		"%02d.mp3", " %02d.mp3", "-%02d.mp3", "_%02d.mp3", " - %02d.mp3",
		"%d.mp3", " %d.mp3", "-%d.mp3", "_%d.mp3", " - %d.mp3",
	};

	if (PicoCDLoadProgressCB != NULL)
		PicoCDLoadProgressCB(cd_img_name, 1);

	Unload_ISO();

	/* is this a .cue? */
	cue_data = cue_parse(cd_img_name);
	if (cue_data != NULL) {
		cd_img_name = cue_data->tracks[1].fname;
		Tracks[0].ftype = cue_data->tracks[1].type;
	}
	else
		Tracks[0].ftype = type == CIT_BIN ? CT_BIN : CT_ISO;

	Tracks[0].F = pmf = pm_open(cd_img_name);
	if (Tracks[0].F == NULL)
	{
		Tracks[0].ftype = 0;
		Tracks[0].Length = 0;
		if (cue_data != NULL)
			cue_destroy(cue_data);
		return -1;
	}

	if (Tracks[0].ftype == CT_ISO)
	     cd_img_sectors = pmf->size >>= 11;	// size in sectors
	else cd_img_sectors = pmf->size /= 2352;
Пример #6
0
PICO_INTERNAL void End_CD_Driver(void)
{
	Unload_ISO();
}