pcecd: don't fill FIFO before seek.
This commit is contained in:
@@ -94,6 +94,7 @@ private:
|
||||
//uint8_t state;
|
||||
int CDDAStart;
|
||||
int CDDAEnd;
|
||||
int CDDAFirst;
|
||||
uint8_t CDDAMode;
|
||||
sense_t sense;
|
||||
|
||||
|
||||
@@ -390,18 +390,25 @@ void pcecdd_t::Update() {
|
||||
return;
|
||||
|
||||
DISKLED_ON;
|
||||
FileSeek(&this->toc.tracks[index].f, (this->lba * 2352) - this->toc.tracks[index].offset, SEEK_SET);
|
||||
|
||||
sec_buf[0] = 0x30;
|
||||
sec_buf[1] = 0x09;
|
||||
ReadCDDA(sec_buf + 2);
|
||||
for (int i = 0; i <= this->CDDAFirst; i++)
|
||||
{
|
||||
FileSeek(&this->toc.tracks[index].f, (this->lba * 2352) - this->toc.tracks[index].offset, SEEK_SET);
|
||||
|
||||
if (SendData)
|
||||
SendData(sec_buf, 2352 + 2, PCECD_DATA_IO_INDEX);
|
||||
sec_buf[0] = 0x30;
|
||||
sec_buf[1] = 0x09;
|
||||
ReadCDDA(sec_buf + 2);
|
||||
|
||||
//printf("\x1b[32mPCECD: Audio sector send = %i, track = %i, offset = %i\n\x1b[0m", this->lba, this->index, (this->lba * 2352) - this->toc.tracks[index].offset);
|
||||
if (SendData)
|
||||
SendData(sec_buf, 2352 + 2, PCECD_DATA_IO_INDEX);
|
||||
|
||||
//printf("\x1b[32mPCECD: Audio sector send = %i, track = %i, offset = %i\n\x1b[0m", this->lba, this->index, (this->lba * 2352) - this->toc.tracks[index].offset);
|
||||
|
||||
this->lba++;
|
||||
}
|
||||
|
||||
this->CDDAFirst = 0;
|
||||
|
||||
this->lba++;
|
||||
if (this->lba > this->CDDAEnd)
|
||||
{
|
||||
if (this->CDDAMode == PCECD_CDDAMODE_LOOP) {
|
||||
@@ -604,6 +611,7 @@ void pcecdd_t::CommandExec() {
|
||||
this->CDDAStart = new_lba;
|
||||
this->CDDAEnd = this->toc.tracks[index].end;
|
||||
this->CDDAMode = comm[1];
|
||||
this->CDDAFirst = 1;
|
||||
|
||||
if (this->CDDAMode == PCECD_CDDAMODE_SILENT) {
|
||||
this->state = PCECD_STATE_PAUSE;
|
||||
@@ -612,17 +620,6 @@ void pcecdd_t::CommandExec() {
|
||||
this->state = PCECD_STATE_PLAY;
|
||||
}
|
||||
|
||||
FileSeek(&this->toc.tracks[index].f, (this->lba * 2352) - this->toc.tracks[index].offset, SEEK_SET);
|
||||
|
||||
sec_buf[0] = 0x30;
|
||||
sec_buf[1] = 0x09;
|
||||
ReadCDDA(sec_buf + 2);
|
||||
|
||||
if (SendData)
|
||||
SendData(sec_buf, 2352 + 2, PCECD_DATA_IO_INDEX);
|
||||
|
||||
this->lba++;
|
||||
|
||||
PendStatus(PCECD_STATUS_GOOD, 0);
|
||||
}
|
||||
printf("\x1b[32mPCECD: Command SAPSP, start = %d, end = %d, [1] = %02X, [2] = %02X, [9] = %02X\n\x1b[0m", this->CDDAStart, this->CDDAEnd, comm[1], comm[2], comm[9]);
|
||||
|
||||
Reference in New Issue
Block a user