upd765: Deassert DRQ on terminal count and prevent FIFO handling from reasserting DRQ after the DMA transfer has completed - #15861
Open
startaq wants to merge 1 commit into
Open
Conversation
reasserting DRQ after the DMA transfer has completed. Fixes floppy format in ct486 which enables the FDC37C78 FIFO.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #15853.
The
ct486BIOS enables the FIFO:while
at486doesn't, which means formatting failed inct486but worked inat486.The root cause are issues with FIFO handling. Logs from
ct486(which additional DRQ logging added) follow.The
FORMAT_TRACKcommand is issued:That's 18 sectors, each sector needing 4 bytes for the sector description, a total of 72 bytes.
WRITE_TRACK_PRE_SECTORSis called requesting 4 bytes:fifo_expect(4, true).DRQ is issued and the data begins to flow:
The first 4 bytes are now buffered in the FIFO.
For each additional sector
WRITE_TRACK_SECTORis called, which then callsfifo_expect(4, true)After writing sector 16, the FIFO contains all data that is needed and TC is set:
However, after writing sector 17 DRQ is issued again requesting more data:
This DRQ request continues into the next command:
Data is read:
But TC is now reached now too early:
AI disclosure: gpt-5.6-sol was used as a research and debugging tool, all code was written by me.