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

Inconsistent writing #2

Closed
jtsiomb opened this issue Feb 28, 2018 · 11 comments
Closed

Inconsistent writing #2

jtsiomb opened this issue Feb 28, 2018 · 11 comments

Comments

@jtsiomb
Copy link

jtsiomb commented Feb 28, 2018

I've been experimenting with writing disks, with inconsistent results. I'm using a variation of your hardware design using a standalone AVR instead of an arduino, for which I've sent you an email yesterday (please check your spam if you didn't receive it).

The issue I'm encountering is that sometimes I'm writing an ADF, and read it back correctly (diff between the read-back version and the original returns no differences), but when I put the disk in my amiga 500 and run a checkdisk with X-copy it finds a bunch of errors. And indeed sometimes graphics in games I've written this way are corrupted, or they failed to run at all.
To make sure the disks are not the issue, I try to transfer the same ADF file to the same disk through a serial cable with transwarp, and there are no errors.

The floppy drive I'm using in conjunction with the AVR hardware is a regular PC floppy drive (mitsumi d359m3d) which is naturally an HD drive. Might this be a problem of insufficient magnetization by the PC drive? The floppies I'm using are DD, so the drive should be able to detect that and change the flux if such a thing is necessary I guess. I have not so far tried connecting the internal amiga drive to the AVR to see if it makes any difference.

Any ideas ?

@jtsiomb
Copy link
Author

jtsiomb commented Feb 28, 2018

The plot thickens.
I'm able to read the disk correctly back through the serial port with cloanto's amiga explorer, and comparing that adf with the original shows no differences. Yet checkdisk still marks at least 20 sectors as bad. I guess maybe amiga-explorer manages to read the problematic sectors correctly with multiple retries, but other code might not try as hard which results in the corruptions I mentioned in some games.

@RobSmithDev
Copy link
Owner

RobSmithDev commented Feb 28, 2018 via email

@jtsiomb
Copy link
Author

jtsiomb commented Mar 1, 2018

Not sure if it's re-reading a lot because it doesn't provide much feedback while it works. However your tool when writing with verify, takes different amounts of time to write and verify some tracks, which is clearly detectable by the uneven cadence of the stepper motor. Not sure if that means you're re-reading it more than once or not.

Ideally I think I should write some code in the amiga to read the tracks, and see what I get.

Another data point is that some game disks fail to boot at all with kickstart 1.3, but manage to proceed further with kickstart 3.1. I know for a fact that the trackdisk.device was re-written from scratch for kickstart 2.x, and I guess the new version might be more fault-tolerant and able to recover where the original code (and trackloaders in many games) fail to read properly.

@RobSmithDev
Copy link
Owner

Hoping the new V2.1 will resolve the writing issues, will have to wait and see I guess

@jtsiomb
Copy link
Author

jtsiomb commented Mar 14, 2018

I backported your changes to my AVR version of the firmware, and I'm afraid I'm still getting checksum errors on the amiga, while still reading back correctly the written disks on the pc.

I guess this was the change most relevant to this issue: https://github.com/jtsiomb/usbamigafloppy/blob/master/fw/src/avrfloppy.c#L517 I'm pretty sure I didn't introduce any bugs while manually back-porting your changes from the diff, but feel free to take a look.

Edit: maybe I should buy an arduino and try to run your original firmware, just to eliminate the possibility that I introduced the error in my version.

@RobSmithDev
Copy link
Owner

RobSmithDev commented Mar 14, 2018 via email

@dragonbane
Copy link

Hi Rob. Have this all built and have had a couple of successful writes of DOS disks. Most times, when the disk has successfully written, I can run it through a checkdisk and see alot of Checksum errors. I have recompiled the 2,1 from source with the same results. Is there any further information I can give you as I think this is an awesome project.

@RobSmithDev
Copy link
Owner

RobSmithDev commented Mar 25, 2018 via email

@RobSmithDev
Copy link
Owner

RobSmithDev commented Mar 27, 2018 via email

@jtsiomb
Copy link
Author

jtsiomb commented Mar 27, 2018

Excellent! the issue seems to be fixed. I can write disks without checksum errors now, and KS1.3 manages to load them just fine!

@jtsiomb jtsiomb closed this as completed Mar 27, 2018
@dragonbane
Copy link

Can't wait to try this. Thanks for everything! :)

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

No branches or pull requests

3 participants