-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add MFM floppy emulator #34
base: main
Are you sure you want to change the base?
Conversation
Later, the RP2040 PIO peripheral will want to use this compact flux representation.
though it's not mfm-flux
I used jumper wires between my metro & a genuine greaseweazle. gw host software does display a warning twice for each track: ``` Unknown mark 4e ``` This is very proof of concept quality at the moment but hey it's there!
As a milestone, greasweazle can now grok the flux produced by the USB floppy sketch.
dunno what's up with the unknown markers yet. |
Now, real data from the SD card is returned. The side number is not used/checked yet. |
ef3ce7b
to
bf50da2
Compare
this also enables working on the featherwing, with no defined PIN_CARD_CS; in this case, test data is output instead of a real disk image.
Otherwise, we end up doing extra work: A sequential read will go from e.g., track 0 side 1 to track 1 side 0. But there's a moment in there where the inputs to floppsy are "track 1 side 1", so we flux-convert T1.1 and then immediately have to convert T1.0. This would often make GW report that it failed reading a track the first time (T70.0 in this case): ``` T69.1: IBM MFM (18/18 sectors) from Raw Flux (156238 flux in 400.36ms) T70.0: IBM MFM (0/18 sectors) from Raw Flux (78084 flux in 236.36ms) T70.0: IBM MFM (18/18 sectors) from Raw Flux (311958 flux in 836.88ms) (Retry #1.1) ``` After this change, GW ripped a whole floppy without needing to retry and without getting any weird transient failures.
Tested: 360k, 720k & 1.44M
@ladyada this is ready for review, though it still needs to be tested with a real PC host as well. My setup:
#pragma once
// old featherwing pinout
#define DENSITY_PIN A0 // IDC 2
#define INDEX_PIN A1 // IDC 8
#define SELECT_PIN A2 // IDC 12
#define MOTOR_PIN A3 // IDC 16
#define DIR_PIN 24 // IDC 18
#define STEP_PIN 25 // IDC 20
#define WRDATA_PIN 13 // IDC 22
#define WRGATE_PIN 12 // IDC 24
#define TRK0_PIN 11 // IDC 26
#define PROT_PIN 10 // IDC 28
#define READ_PIN 9 // IDC 30
#define SIDE_PIN D6 // IDC 32
#define READY_PIN D5 // IDC 34
#define PIN_CARD_CS D4 // modified adalogger featherwing
#define DISKCHANGE_PIN 1 // RX the code should probably be polished up some (and then a lot more when we have floppsy with LCD & 4 buttons) but I think the functionality is there. I tested all 4 common sizes (360, 1200, 720, 1440) with GW decoding them all just fine. These were basic images I created on my computer with a FAT image creator (mkfs.fat), no content on them. |
Targeted feature list for this version
This PR will not encompass