pcecd: fast seek option.

This commit is contained in:
sorgelig
2020-05-16 01:02:46 +08:00
parent eb64a771cf
commit 0af2be775c
3 changed files with 23 additions and 9 deletions

View File

@@ -67,19 +67,18 @@ void pcecd_poll()
{
last_req = req;
uint16_t data_in[6];
uint16_t data_mode;
uint16_t data_in[7];
data_in[0] = spi_w(0);
data_in[1] = spi_w(0);
data_in[2] = spi_w(0);
data_in[3] = spi_w(0);
data_in[4] = spi_w(0);
data_in[5] = spi_w(0);
data_mode = spi_w(0);
data_in[6] = spi_w(0);
DisableIO();
switch (data_mode & 0xFF)
switch (data_in[6] & 0xFF)
{
case 0:
pcecdd.SetCommand((uint8_t*)data_in);

View File

@@ -99,7 +99,7 @@ private:
sense_t sense;
uint8_t stat[2];
uint8_t comm[12];
uint8_t comm[14];
uint8_t sec_buf[2352 + 2];

View File

@@ -540,9 +540,16 @@ void pcecdd_t::CommandExec() {
/* 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)) {
if ((this->lba == new_lba) && (cnt_ == 120))
{
this->latency = 0;
} else {
}
else if (comm[13] & 0x80) // fast seek (OSD setting)
{
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);
@@ -602,7 +609,15 @@ void pcecdd_t::CommandExec() {
break;
}
this->latency = (int)(get_cd_seek_ms(this->lba, new_lba) / 13.33);
if (comm[13] & 0x80) // fast seek (OSD setting)
{
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;
@@ -719,7 +734,7 @@ int pcecdd_t::GetStatus(uint8_t* buf) {
}
int pcecdd_t::SetCommand(uint8_t* buf) {
memcpy(comm, buf, 12);
memcpy(comm, buf, 14);
return 0;
}