[Coco] MAME FDC Issue that can cause corruption
David Ladd
davidwladd at gmail.com
Wed Aug 2 12:44:30 EDT 2017
On Wed, Aug 2, 2017 at 11:29 AM, William Astle <lost at l-w.ca> wrote:
> On 2017-08-02 02:31 AM, Ciaran Anscomb wrote:
>
>> Run out of time looking into this this morning, but the difference
>> between this and XRoar seems to be:
>>
>> When MAME switches drives (motor still on), the new disk is not "ready".
>> RSDOS doesn't check for this before submitting the read sector command,
>> so when it does so an NMI is triggered (in XRoar, the new drive is
>> immediately reflected as "ready" if it is indeed ready).
>>
>> The NMI is, I guess, taken as successful completion of command, so
>> as no new bytes were read, the old contents of the buffer remain: ie,
>> the granule map (which I believe is read to a specific address), and
>> the first sector of the directory (which is probably going to be read
>> to the same buffer).
>>
>> So what's the behaviour of real drives? Is there really a delay before
>> the ready signal is updated on switching drives?
>>
>
> Clearly the real hardware works fine with whatever DECB does or the COPY
> command would fail hard on multiple drive copies. In fact, DSKCON in DECB
> is fairly conservative in what it does.
>
William, indeed. Also I found this problem originally in OS-9 L1 &
NitrOS-9 L1 to start with. So a person asked if I could duplicated the
issue in Disk Basic which of course when I found out I could.
Disk Basic was just the easiest and quickest way to demonstrate the problem.
Which is why my original video was done in OS-9 L2 to demonstrate the
problem to begin with.
https://youtu.be/5XhtqXrQ99Q
Just the demo video I made was the easiest and fastest way to show the
problem in OS-9. I had spent the time to test on real hardware. Though I
knew it would work on real hardware since I was doing this stuff ALL the
time back in the late 80's and early 90's when I was running (2) 3.5"
floppy drives & 5.25" Floppy Drive.
>
> Looking at DSKCON, it *does* wait for a "ready" signal before even
> deciding which operation has been requested, even if the drive is already
> spun up. In fact, it does that before even checking if the drive is on the
> right track. The only thing it doesn't do when the motor should still be
> running is run two "count X from 0 to 0" delays.
>
> It further waits for the FDC chip to acknowledge ready for READ/WRITE
> before going in to the read/write loop. So, if things are exiting "clean",
> it means the FDC has said "I'm ready for you to send/read a byte".
>
> So that must mean that MAME is doing something hinky.
>
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco
>
+-----------------------------------------------------------------------+
| David Ladd a.k.a. PacoOtaktay a.k.a. Drencor |
| YouTube: http://www.youtube.com/user/PacoOtaktay |
| YouTube Gaming Live: https://gaming.youtube.com/user/PacoOtaktay/live |
| Websites: http://dwladd.com & http://www.theterrorzone.com |
| G+: https://plus.google.com/113262444659438038657 |
| G+: https://plus.google.com/+DavidLaddPacoOtaktay |
| |
| Do you have your CoCo 3 yet? |
+-----------------------------------------------------------------------+
More information about the Coco
mailing list