Today, lots of information about how a file or JSON becomes a disk
image is embedded in the metadata for the image and/or disk. This
makes it hard to write back to the source when the in-memory disk
image changes.
This refactoring is an attempt to break out all of the bits of logic
into composable pieces. While this is mestly concerned with reading
right now, the idea is that it will eventually allow configuring
writing as well. The main goal is to allow round-tripping to the same
file on disk, but, in theory, it could also save to a different file
or the local database, too.
Note that this is a work in progress.
* Refactor disk handling to allow disk processing to happen in a worker
* Type cleanup
* Convert format handlers to TypeScript
* Convert CFFA to TypeScript
Like the DOS 3.3 and ProDOS sector order issues, this change fixes the
physical order of the sectors on 13-sector disks when nibblized.
This change also adds tests for the 13-sector format to verify the
sector order.
One of the crazy things is that _Beneath Apple DOS_ failed me in this
instance because it doesn't discuss what happens to the last byte in
"5 and 3" encoding anywhere (AFAICT). I went back to the DOS 3.1
source released by the Computer History Museum here:
https://computerhistory.org/blog/apple-ii-dos-source-code/
The code is in `appdos31.lst` in the `POSTNIB` routine on line 4777.