WDC1772 Data Access Framework Complete (2)
21 November 2004
In the previous WIP update we talked about the various data access execution paths. Well, now (3) works - so real data is accessible to the FDC.
It was quite a challenge to get every cycle right and still make it fast. Even simple things like (a * b) / c
optimized to (b prev + b) / c
to save on the multiply (if you iterate this expression, the next iteration is of course ((a + 1) * b) / c
which equals (a * b + b) / c)
, or guess based iteration, but sort of backtracked as it is much faster than the usual way.
This it is not very trivial and it was a challenge to make it this way, but it is worth the effort.
Implications for WinSTon
TOS can now seek and verify track positions properly based on the data read.
Type 2 Command
Type 2 read sector commands have now been implemented. After checking a few games, we see some that do not work yet.
- StarGlider 2 boots but halts on a Type 3 read track command, probably checking a protection track after loading.
- Flimbo’s Quest boots, a Type 3 read track needed for disk authorisation.
Shifter/AM Detector Logic
The Shifter/AM Detector logic is mostly guesswork because we could not gain the exact algorithm from the datasheets. This can be fine-tuned once something that really relies on the junk data that is output is found - but it may be ok as it is already.