From 74d819b35ac3151aff0dc86874aafac21e07a9aa Mon Sep 17 00:00:00 2001 From: Sergiy Dvodnenko Date: Sun, 31 Mar 2024 06:59:50 +0300 Subject: [PATCH] Saturn: finish reading one sector when a PLAY command is immediately interrupted by a SEEK command (Astal sound stutters) (#893) --- support/saturn/saturn.h | 1 + support/saturn/saturncdd.cpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/support/saturn/saturn.h b/support/saturn/saturn.h index 33f17e6..b3b2574 100644 --- a/support/saturn/saturn.h +++ b/support/saturn/saturn.h @@ -72,6 +72,7 @@ private: bool stop_pend; bool seek_pend; bool read_pend; + bool final_read; bool seek_ring; bool seek_ring2; bool pause_pend; diff --git a/support/saturn/saturncdd.cpp b/support/saturn/saturncdd.cpp index 63e7f0d..7fa1258 100644 --- a/support/saturn/saturncdd.cpp +++ b/support/saturn/saturncdd.cpp @@ -609,6 +609,7 @@ void satcdd_t::CommandExec() { this->index = this->toc.GetIndexByLBA(this->track, this->seek_lba); this->seek_pend = true; + this->final_read = this->read_pend; this->read_pend = false; this->pause_pend = false; this->speed = comm[10] == 1 ? 1 : 2; @@ -731,7 +732,7 @@ void satcdd_t::Process(uint8_t* time_mode) { #endif // SATURN_DEBUG } else if (this->seek_pend) { - this->state = Seek; + this->state = this->final_read ? Read : Seek; LBAToMSF(this->lba + 150, &amsf); if (this->lba < 0) @@ -757,6 +758,8 @@ void satcdd_t::Process(uint8_t* time_mode) { seek_time = 1; //} + this->final_read = false; + *time_mode = 1;// this->speed; #ifdef SATURN_DEBUG