int Play_CDD_c3(void) { _msf MSF; int delay, new_lba; CHECK_TRAY_OPEN CHECK_CD_PRESENT if (CD_Load_System == CDROM_) { SCD.Status_CDC &= ~1; // Stop read data with CDC Wait_Read_Complete(); } // MSF of the track to play in TC buffer MSF.M = (CDD.Trans_Comm[2] & 0xF) + (CDD.Trans_Comm[3] & 0xF) * 10; MSF.S = (CDD.Trans_Comm[4] & 0xF) + (CDD.Trans_Comm[5] & 0xF) * 10; MSF.F = (CDD.Trans_Comm[6] & 0xF) + (CDD.Trans_Comm[7] & 0xF) * 10; SCD.Cur_Track = MSF_to_Track(&MSF); new_lba = MSF_to_LBA(&MSF); delay = new_lba - SCD.Cur_LBA; if (delay < 0) delay = -delay; delay >>= 12; SCD.Cur_LBA = new_lba; CDC_Update_Header(); #ifdef DEBUG_CD fprintf(debug_SCD_file, "Read : Cur LBA = %d, M=%d, S=%d, F=%d\n", SCD.Cur_LBA, MSF.M, MSF.S, MSF.F); #endif if (CD_Load_System == CDROM_) { delay += 20; delay >>= 2; ASPI_Seek(SCD.Cur_LBA, 1, ASPI_Fast_Seek_COMP); ASPI_Flush_Cache_CDC(); }
int Play_CDD_c3 (void) { _msf MSF; int delay, new_lba; CHECK_TRAY_OPEN CHECK_CD_PRESENT if (CD_Load_System == CDROM_) //aggiunta { SCD.Status_CDC &= ~1; // Stop read data with CDC Wait_Read_Complete (); } // MSF of the track to play in TC buffer MSF.M = (CDD.Trans_Comm[2] & 0xF) + (CDD.Trans_Comm[3] & 0xF) * 10; MSF.S = (CDD.Trans_Comm[4] & 0xF) + (CDD.Trans_Comm[5] & 0xF) * 10; MSF.F = (CDD.Trans_Comm[6] & 0xF) + (CDD.Trans_Comm[7] & 0xF) * 10; SCD.Cur_Track = MSF_to_Track (&MSF); new_lba = MSF_to_LBA (&MSF); delay = new_lba - SCD.Cur_LBA; if (delay < 0) delay = -delay; delay >>= 12; SCD.Cur_LBA = new_lba; CDC_Update_Header (); #ifdef DEBUG_CD fprintf (debug_SCD_file, "Read : Cur LBA = %d, M=%d, S=%d, F=%d\n", SCD.Cur_LBA, MSF.M, MSF.S, MSF.F); #endif if (CD_Load_System == CDROM_) { delay += 20; //delay >>= 2; //ASPI_Seek (SCD.Cur_LBA, 1, ASPI_Fast_Seek_COMP); //aggiunta } else if (SCD.Status_CDD != PLAYING) delay += 20; SCD.Status_CDD = PLAYING; CDD.Status = 0x0102; // CDD.Status = COMM_OK; if (File_Add_Delay == 0) File_Add_Delay = delay; if (SCD.TOC.Tracks[SCD.Cur_Track - SCD.TOC.First_Track].Type) { CDD.Control |= 0x0100; // DATA } else { CDD.Control &= ~0x0100; // AUDIO CD_Audio_Starting = 1; if (CD_Load_System == FILE_ISO) FILE_Play_CD_LBA (); } if (SCD.Cur_Track == 100) CDD.Minute = 0x0A02; else CDD.Minute = INT_TO_BCDW (SCD.Cur_Track); CDD.Seconde = 0; CDD.Frame = 0; CDD.Ext = 0; SCD.Status_CDC |= 1; // Read data with CDC CDD_Complete = 1; return 0; }