Skip to content
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

Floppsy: Changes for apple2 interface & output enable #37

Merged
merged 4 commits into from
Nov 21, 2024

Conversation

jepler
Copy link
Member

@jepler jepler commented Nov 20, 2024

GW and fluxengine host software will need changes to get Apple Disk ][ fluxing working again, but with a 1-liner change, GW v1.21 can talk to floppsy and see flux on a Disk ][....

diff --git a/src/greaseweazle/tools/util.py b/src/greaseweazle/tools/util.py
index 25cb4e7..33c2316 100644
--- a/src/greaseweazle/tools/util.py
+++ b/src/greaseweazle/tools/util.py
@@ -125,6 +125,7 @@ class Drive:
             '0': (USB.BusType.Shugart, 0),
             '1': (USB.BusType.Shugart, 1),
             '2': (USB.BusType.Shugart, 2),
+            'APPLE2': (USB.BusType.Apple2, 0),
         }
         if not letter.upper() in types:
             raise argparse.ArgumentTypeError("invalid drive letter: '%s'"

You have to use --tracks step=4 because our GW-compatible firmware steps 1/4 track each time a step is commanded.

I had a random floppy left over in the drive and it reads consistently but with errors:

$ gw read --drive APPLE2 --format apple2.nofs.140 /tmp/apple2.img  --device /dev/serial/by-id/usb-Adafruit_Floppsy_E4634012C72D5B24-if00  --tracks step=4
…
Cyl-> 0         1         2         3    
H. S: 01234567890123456789012345678901234
0. 0: .X....X..X.XX.XX.XX.XX.XX.X..X.XX.X
0. 1: .X..X..X.X..X.XX.XX.XX.XX.XX.XX.X..
0. 2: .XX.XX.X..X....X..X.XX.XX.XX.XX.XX.
0. 3: .XX.XX.XX.XX.X....XX.X..X.XX.XX.XX.
0. 4: ..X.XX.XX.XX.XX.XX.X....X..X.XX.XX.
0. 5: .....X.XX.XX.XX.XX.X..XX.X..X.XX.XX
0. 6: X..X....X..X.XX.XX.XX.XX.XX.X..X..X
0. 7: .X.X..X..X....X..X.XX.XX.XX.XX.XX.X
0. 8: XX.XX.X..X..X..X.X..X.XX.XX.XX.XX.X
0. 9: XX.XX.XX.XX.XX.X..X..X.XX.X.XX.XX.X
0.10: .X..X.XX.XX.XX.XX.XX.X..X..X.XX.X.X
0.11: ..X....X..X.XX.XX.XX.XX.XX.X..X.XX.
0.12: X.X..X..X.X..X..X.XX.XX.XX.XX.XX.X.
0.13: X.XX.XX.X..X..X.X..X.XX.XX.XX.XX.XX
0.14: X.XX.XX..X.XX.X..X....X..X.XX.XX.XX
0.15: X..X.XX.XX.XX.XX.XX.X..X.XX.X.XX.XX
Found 264 sectors of 560 (47%)

This pin can be defined if the interface has level
translators with enable inputs. If so, it's set to LOW
to enable the level translator outputs.
this also adds handling of tracks above 255, which are sent
as a SEEK packet but with 4 bytes (2 bytes of payload).

Using 16-bit ints might have worked, but we're not short of
RAM here.
@jepler
Copy link
Member Author

jepler commented Nov 21, 2024

Now I can write & read a whole floppy in the Disk ][.

@jepler jepler requested a review from ladyada November 21, 2024 00:12
@jepler jepler merged commit e66f50d into main Nov 21, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant