With this change, the actual logic of reading an image is moved into a "driver". The DiskII class still controls the state of the card, I/O, and basic drive state (like head positioning). There are three new driver classes:
EmptyDriver: a do-nothing driver for empty drives. (In theory this could return random data, but currently it does nothing.)
NibbleDiskDriver: a driver for dealing with simple nibble disk emulation.
WozDiskDriver: a driver for WOZ disk images.
The idea is that splitting these classes apart provides better separation of concerns and, perhaps, easier testing. It will allow changing the drivers without having to worry (much) about breaking the other drivers.
Follow-on changes will put these drivers in their own files, fix up some bad naming, and improve the documentation. Feedback is welcome!
This draft PR includes the 13 sector disk support, but that has its own PR and should probably be submitted first.
With this change, the actual logic of reading an image is moved into a "driver". The
DiskII
class still controls the state of the card, I/O, and basic drive state (like head positioning). There are three new driver classes:EmptyDriver
: a do-nothing driver for empty drives. (In theory this could return random data, but currently it does nothing.)NibbleDiskDriver
: a driver for dealing with simple nibble disk emulation.WozDiskDriver
: a driver for WOZ disk images.The idea is that splitting these classes apart provides better separation of concerns and, perhaps, easier testing. It will allow changing the drivers without having to worry (much) about breaking the other drivers.
Follow-on changes will put these drivers in their own files, fix up some bad naming, and improve the documentation. Feedback is welcome!
This draft PR includes the 13 sector disk support, but that has its own PR and should probably be submitted first.