pcecd: minor timing adjustments
Minor timing adjustments
This commit is contained in:
@@ -24,8 +24,14 @@ void pcecd_poll()
|
||||
|
||||
if (CheckTimer(poll_timer))
|
||||
{
|
||||
poll_timer += 13 + (!adj ? 1 : 0);
|
||||
if (++adj >= 3) adj = 0;
|
||||
if ((!pcecdd.latency) && (pcecdd.state == PCECD_STATE_READ)) {
|
||||
poll_timer += 16 + ((adj == 10) ? 1 : 0); // 16.1ms between frames if reading data */
|
||||
if (--adj <= 0) adj = 10;
|
||||
} else {
|
||||
poll_timer += 13 + ((adj == 3) ? 1 : 0); // 13.33ms otherwise (including latency counts) */
|
||||
if (adj > 3) adj = 3;
|
||||
if (--adj <= 0) adj = 3;
|
||||
}
|
||||
|
||||
if (pcecdd.has_status && !pcecdd.latency) {
|
||||
uint16_t s;
|
||||
|
||||
@@ -538,7 +538,13 @@ void pcecdd_t::CommandExec() {
|
||||
new_lba = this->toc.tracks[index].start;
|
||||
}*/
|
||||
|
||||
this->latency = (int)(get_cd_seek_ms(this->lba, new_lba)/13.33);
|
||||
/* HuVideo streams by fetching 120 sectors at a time, taking advantage of the geometry
|
||||
* of the disc to reduce/eliminate seek time */
|
||||
if ((this->lba == new_lba) && (cnt_ == 120)) {
|
||||
this->latency = 0;
|
||||
} else {
|
||||
this->latency = (int)(get_cd_seek_ms(this->lba, new_lba)/13.33);
|
||||
}
|
||||
printf("seek time ticks: %d\n", this->latency);
|
||||
|
||||
this->lba = new_lba;
|
||||
|
||||
@@ -93,27 +93,27 @@ float get_cd_seek_ms(int start_sector, int target_sector)
|
||||
// Now, we use the algorithm to determine how long to wait
|
||||
if (abs(target_sector - start_sector) < 2)
|
||||
{
|
||||
milliseconds = (3 * 1000 / 60);
|
||||
milliseconds = (2 * 1000 / 60);
|
||||
}
|
||||
else if (abs(target_sector - start_sector) < 5)
|
||||
{
|
||||
milliseconds = (9 * 1000 / 60) + (float)(sector_list[target_index].rotation_ms * 0.7);
|
||||
milliseconds = (9 * 1000 / 60) + (float)(sector_list[target_index].rotation_ms * 0.75);
|
||||
}
|
||||
else if (track_difference <= 80)
|
||||
{
|
||||
milliseconds = (16 * 1000 / 60) + (float)(sector_list[target_index].rotation_ms * 0.7);
|
||||
milliseconds = (17 * 1000 / 60) + (float)(sector_list[target_index].rotation_ms * 0.75);
|
||||
}
|
||||
else if (track_difference <= 160)
|
||||
{
|
||||
milliseconds = (22 * 1000 / 60) + (float)(sector_list[target_index].rotation_ms * 0.7);
|
||||
milliseconds = (22 * 1000 / 60) + (float)(sector_list[target_index].rotation_ms * 0.75);
|
||||
}
|
||||
else if (track_difference <= 644)
|
||||
{
|
||||
milliseconds = (22 * 1000 / 60) + (float)(sector_list[target_index].rotation_ms * 0.7) + (float)((track_difference - 161) * 16.66 / 80);
|
||||
milliseconds = (22 * 1000 / 60) + (float)(sector_list[target_index].rotation_ms * 0.75) + (float)((track_difference - 161) * 16.66 / 80);
|
||||
}
|
||||
else
|
||||
{
|
||||
milliseconds = (36 * 1000 / 60) + (float)((track_difference - 644) * 16.66 / 195);
|
||||
milliseconds = (36 * 1000 / 60) + (float)(sector_list[target_index].rotation_ms * 0.5) + (float)((track_difference - 644) * 16.66 / 195);
|
||||
}
|
||||
|
||||
printf("From sector %d to sector %d:\n", start_sector, target_sector);
|
||||
|
||||
Reference in New Issue
Block a user