int Seek_CDD_c4 (void) { _msf MSF; CHECK_TRAY_OPEN CHECK_CD_PRESENT // MSF to seek 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); SCD.Cur_LBA = MSF_to_LBA (&MSF); CDC_Update_Header (); SCD.Status_CDC &= ~1; // Stop CDC read if (CD_Load_System == CDROM_) { ASPI_Seek (SCD.Cur_LBA, 1, ASPI_Seek_CDD_c4_COMP); SCD.Status_CDD = READY; CDD.Status = 0x0200; // DATA ? if (SCD.TOC.Tracks[SCD.Cur_Track - SCD.TOC.First_Track].Type) CDD.Control |= 0x0100; else CDD.Control &= 0xFEFF; // AUDIO CDD.Minute = 0; CDD.Seconde = 0; CDD.Frame = 0; CDD.Ext = 0; } else { SCD.Status_CDD = READY; CDD.Status = 0x0200; // DATA ? if (SCD.TOC.Tracks[SCD.Cur_Track - SCD.TOC.First_Track].Type) CDD.Control |= 0x0100; else CDD.Control &= 0xFEFF; // AUDIO CDD.Minute = 0; CDD.Seconde = 0; CDD.Frame = 0; CDD.Ext = 0; } CDD_Complete = 1; return 0; }
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(); }