Sunday, 2 February 2014

Re: [Rpcemu] Patch for floppy reading on ADFS 3.34 and later

On 20 Jan, webpages@sprow.co.uk wrote:
> The following patch implements that missing [verify] command.

It seems the addition of the formatting command has exposed a slight flaw in
my patch, which didn't honor the 'EC' flag in the command parameters.

So while mounting a disc (which uses verify) worked fine, a verify after
formatting got stuck. With the new formatting command implemented I've fixed
the verify command to look at the EC bit,
Sprow.



diff -r 3597d5973785 src/fdc.c
--- a/src/fdc.c Mon Jan 27 08:56:00 2014 +0000
+++ b/src/fdc.c Sun Feb 02 17:09:39 2014 +0000
@@ -674,13 +674,14 @@
fdc.curparam = 0;
break;
default:
- fatal("Bad ReadID command pos %i", fdc.commandpos);
+ fatal("Bad FormatTrack command pos %i", fdc.commandpos);
}
fdc.commandpos++;
break;

case FD_CMD_VERIFY_DATA_MFM:
- fdc.sector = fdc.parameters[5]; /* Verified OK (amazing!), jump straight
to the end */
+ /* Verified OK (amazing!), jump straight to the end */
+ fdc.sector = fdc.parameters[(fdc.parameters[0] & 128 /* EC */) ? 7 : 5];
switch (fdc.commandpos) {
case 0: fdcsend(fdc.st0); break;
case 1: fdcsend2(fdc.st1); break;
@@ -695,7 +696,7 @@
fdc.curparam = 0;
break;
default:
- fatal("Bad ReadID command pos %i", fdc.commandpos);
+ fatal("Bad VerifyData command pos %i", fdc.commandpos);
}
fdc.commandpos++;
break;


_______________________________________________
Rpcemu mailing list
Rpcemu@riscos.info
http://www.riscos.info/cgi-bin/mailman/listinfo/rpcemu

No comments:

Post a Comment