Skip to content

Commit

Permalink
Fix read-only error writing with Pro-Dos v2 (#64)
Browse files Browse the repository at this point in the history
The issue was caused by a timeout condition falsely triggering, which
happens when DRQ is set but data isn't being read. SAM DICE uses this to
synchronise with the track index.

In this case DRQ was set for data to be written, and the lack of data
_reads_ caused SimCoupe to generate a LOST DATA error. The timeout counter
also needed to be reset when data is _written_ to avoid the condition.

Pro-Dos does a better job of checking the flags after commands than SAMDOS,
which is perhaps why this hadn't been seen until now.
  • Loading branch information
simonowen committed Sep 9, 2021
1 parent 80af4f7 commit 68cd825
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Base/Drive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ void Drive::Out(uint16_t port, uint8_t val)
if ((m_regs.status & DRQ) && m_buffer_pos < m_buffer.size())
{
m_buffer[m_buffer_pos++] = val;
m_status_reads_with_data = 0;

if (m_buffer_pos == m_buffer.size())
{
Expand Down

0 comments on commit 68cd825

Please sign in to comment.