VOGONS


First post, by superfury

User metadata
Rank l33t++
Rank
l33t++

At the moment, my emulator keeps checking the DREQ line (raised/lowered by the FDC). My FDC also raises the EOP line when it enters the result or error phase.

How should the Terminal Count and different modes of operation be handled? Does the Terminal Count have any effect on transfers?

What's the difference between the on demand, single and block transfer modes? How should they be handled (combined with the DREQ/EOP?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 1 of 2, by crazyc

User metadata
Rank Member
Rank
Member

TC is only an input and when it rises the FDC reads or writes but does not transfer until the end of the current sector and then terminates the operation successfully. That works even in PIO mode although that isn't relevant to the PC.

Reply 2 of 2, by Harekiet

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Wouldn't really bother with drq/eop whatever lines, that's all bus level and you shouldn't really care for emulating that.
My dma channel read/write routines can just return a value if terminal count has been reached during this read/write action and the floppy goes into the result phase then when that's encountered with enough all bytes done.
If the floppy encounters any kind of error with a dma not being setup correctly or not enough bytes being programmed you just go into error mode and the controller would need to be reset anyway.