simonowen / simcoupe

SAM Coupé emulator
GNU General Public License v2.0
54 stars 12 forks source link

FDD timings accuracy #89

Open dandoore opened 1 year ago

dandoore commented 1 year ago

Can the timing of (non fast floppy disk access) simulated disk loading be tweaked to match real hardware so that this lovely peice of music playing loader code functions correctly?

Attached are the MGT images for real hardware and one patched for emulation.

HighColor_CustomLoader.zip

simonowen commented 1 year ago

Interesting demo! I remember discussions about the feasibility of a tune playing during loading but hadn't realised anyone had written one.

SimCoupe currently makes no attempt to respect timings with any disk loading, just sector ordering and general behaviour. It acts as though the drive head is always in the right place to read what it's looking for next. The extra speed will be mostly a combination of the lack of waiting time in the gaps between sectors and missing loops waiting bytes to be assembled when reading the sector data.

A full cycle-accurate floppy disk controller emulation would be fairly challenging, but overkill for this anyway. It should be enough to simulate a track-level view of the disk surface with the disk rotating under the head at the correct rate. I already build a track-level view for the READ_TRACK command, so it would need something to use that layout and track the elapsed time for events.

Hopefully not a massive job and well worth doing since it removes some other fiddle-factor code.