Closed iflan closed 2 years ago
I've got https://github.com/whscullin/apple2js/commit/ef71dd77b7babb646418c6e110c14909925ff0cc as a follow-on to this. I'll make a PR when this one is merged (or rejected).
I've now got https://github.com/whscullin/apple2js/commit/1dab93612f84d9d2bee13429b9b74b47e94516a3, too. If you'd like me to just pile these all into one change, let me know. I'm keeping them separate so they are easier to review and test.
I've made a branch with all the changes so you can see what's coming: https://github.com/whscullin/apple2js/compare/main...iflan:apple2js:disk-refactoring
This LGTM, I'm currently bogged down in other projects and haven't had a chance to play with it but I think the direction is great.
Not a worry. I've just had some free time. There is no rush. :-)
Before, the
drives
field was anarray[0..1]
ofDrive
, but all of the methods took aDriveNumber
, which was[1..2]
. This meant that code everywhere was always subtracting 1 from the drive number.Now,
drives
is aRecord<DriveNumber, Drive>
, which means tha it has indexes1, 2
and there's no need to subtract 1 everywhere.This change updates the
DiskII
class and its tests.The motivation for this change is to slowly split the WOZ disk implementation from the nibble disk implementation. I've tried twice, but the change has always grown too big and hairy, so I'm starting very small this time and working my way up.