Thomas Harte
aefbafa18d
Centralised the 8272's actions of setting the non-DMA execution flag, picking the drive and head and loading the head for accessing commands, and switched error flag if read ID doesn't find anything.
2017-08-15 21:49:10 -04:00
Thomas Harte
73080d6c36
Added an easy way for disk controllers to clamp termination of written data exactly to the index hole.
...
This commit also temporarily provides a whole load of extra logging and minor logic improvements from the 8272. I'm mid-flow on finding a particularly vicious error in its handling of writing; wait for the pull request. But, at least: now waits for the first part of a post-ID gap before writing data, and attempts partially to handle appearance of the index hole during writing a track. More work to do on that though.
2017-08-15 16:05:10 -04:00
Thomas Harte
cddcd0fb79
Put my money where my mouth is and switched the superclass of WD1770
to MFMController
, eliminating duplicated (/factored out) code.
2017-08-14 16:32:53 -04:00
Thomas Harte
8a7b23dc9e
Ensured data-accessing commands cancel seeks on their drives. Also introduced a count of drives currently seeking in order to make for a slightly better broad-phase test in run_for.
2017-08-14 09:45:39 -04:00
Thomas Harte
b7065575f3
Added (empty) call-ins for DMA usage; switched to having the 'is seeking' bit in the status register stay high until sense interrupt status, but now it goes high even for seeks that don't actually go anywhere, and corrected interpretation of the specify command, with a positive result: the received step rate time, now that it's being interpreted correctly, is much shorter.
2017-08-14 09:04:22 -04:00
Thomas Harte
7ea703f150
Started making provisions for a DMA-compatible implementation. Re: the CPC, it sounds like DMA acknowledge might be permanently wired, causing DMA mode seemingly to work from the 8272's point of view.
2017-08-14 08:38:00 -04:00
Thomas Harte
b0a7208cc7
Strung together a very basic version of 8272 write [/deleted] data. Lots of cases as-yet unhandled.
2017-08-13 12:50:07 -04:00
Thomas Harte
0f15a2f97f
Relented: it actually looks like status bytes aren't per-drive. But each drive may fail at seeking individually. So that piece of state accumulates at the 8272 drive.
2017-08-12 12:52:36 -04:00
Thomas Harte
e7db2a2f6d
Sought to introduce head loading and unloading delays.
2017-08-12 09:36:21 -04:00
Thomas Harte
7f824d6494
Ensured seeks and recalibrates end immediately if no seeking is required.
2017-08-07 10:31:32 -04:00
Thomas Harte
3853966a1e
Removed formal storage of ST3, as it just seems to be composed live. This may turn out also to be the best way to deal with ST0–2, time will tell. Also took a stab at the error in responding properly to the ROM's intended use of seek might be accepting new commands as replacements for old ones rather than rejecting them. That didn't seem to do the trick.
2017-08-06 22:10:12 -04:00
Thomas Harte
d63893a437
Collapsed implementations of recalibrate and seek, and decided to intend to go for an upward count on steps taken rather than a downward one. But seek continues presently to fail.
2017-08-06 21:52:52 -04:00
Thomas Harte
600445d90a
Made a first attempt to return sector contents.
2017-08-06 20:40:29 -04:00
Thomas Harte
3b7ecbdf0d
Renamed result_
to result_stack_
to emphasis the fact that it goes backwards. Switched meaning of CB so that it is set for the entire command, execution and result phases.
2017-08-06 20:17:12 -04:00
Thomas Harte
01efb645cb
Took a reasonable gamble that the CHRN reported is from internal registers, not from the last-found header.
2017-08-06 19:57:34 -04:00
Thomas Harte
e9972aa0dd
Added respect for the index-hole limit on reading, and an error phase.
2017-08-06 19:25:44 -04:00
Thomas Harte
1c9a744b01
Made an effort to start inspecting ID fields, at least. Discovered that my emulation has somehow stopped proceeding beyond sense interrupt status though. Fix one in that area: adjust ST0 just in time for the sense interrupt status response, as that'll need to specify the drive number properly.
2017-08-06 18:06:20 -04:00
Thomas Harte
6c5b562d97
Made an attempt at some of the correct seek/recalibrate behaviour: it's now asynchronous from command processing and able to work on up to four drives at once. I just probably am not yet hitting all the status flags I need to hit.
2017-08-06 15:22:07 -04:00
Thomas Harte
a7103f9333
Disks are now communicated to the 8272. Which is able to handle four of them.
2017-08-06 13:24:14 -04:00
Thomas Harte
c12425e141
Added storage for the extended four status registers, and made an attempt at implementing the two most trivial result-phase commands. Am slightly paused momentarily trying to figure out whether seek activity is orthogonal to read/write activity.
2017-08-06 12:55:57 -04:00
Thomas Harte
89f6de1383
Started on a real ugly-implementation coroutine approach, and implemented specify as a fairly trivial first command: it has no result phase, and is the only thing called by AMSDOS as part of the initialisation sequence.
2017-08-06 12:36:18 -04:00
Thomas Harte
29288b690e
Switched disk controllers to be instantiated explicitly in terms of cycles, created an Amstrad-specific subclass of the 8272 to record the direct programmatic availability of all disk motors bundled together, and otherwise adjusted to ensure the thing is clocked and that the motor is enabled and disabled appropriately. The 8272 is also now formally a subclass of the incoming MDM controller.
2017-08-06 09:45:16 -04:00
Thomas Harte
25fd3f7e50
Mildly increased work in here, still primarily oriented towards logging what I actually need to get done.
2017-08-05 22:26:59 -04:00
Thomas Harte
3e984e75b6
Strung up an empty shell that eventually should contain the 8272, and added appropriate IO decoding to the Amstrad.
2017-08-05 19:45:52 -04:00