Re: [hatari-devel] Re: Hatari floppy drive detection with EmuTOS |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] Re: Hatari floppy drive detection with EmuTOS
- From: David Savinkoff <dsavnkff@xxxxxxxxx>
- Date: Thu, 16 Jan 2014 20:33:19 -0700 (MST)
- Thread-index: xRJECH+sRbiLDAH4NfTnN7W0j0vzXA==
- Thread-topic: Hatari floppy drive detection with EmuTOS
----- Roger Burrows wrote:
> On 16 Jan 2014 at 18:28, David Savinkoff wrote:
> > > OK, the following runs were made with floppy 1 tested first, then floppy
> > 0.
> > >
> > > 1. Drive 0 connected, drive 1 disconnected:
> > > Drive 1: timeout (3 seconds)
> > > Drive 0: 255 ticks
> > > 2. Both drives connected
> > > Drive 1: 361 ticks
> > > Drive 0: 26 ticks
> > >
> > Are these tests done without floppy disks in the drives?
> > What model are your floppy drives?
>
> Drive 0 had a floppy in, drive 1 not. Drive 0 is a standard internal STF
> drive, drive 1 is a somewhat-incompatible (media change not reported) 720K PC
> drive. Sorry, don't feel like tearing a box open to get the exact model
> number.
>
> Roger
>
Thanks for the info, I'll ponder it.
Could you check what happens on the real Atari when Neither drive has
a floppy disk inserted.
I just compiled EmuTOS two different ways:
--- emutos/bios/floppy.c 2014-01-13 20:04:47.000000000 -0800
+++ emutos/bios/floppy.c 2014-01-16 18:29:43.000000000 -0800
@@ -292,7 +292,7 @@
#if CONF_WITH_FDC
floplock(dev);
select(dev, 0);
- set_fdc_reg(FDC_CS, FDC_RESTORE | finfo[dev].actual_rate);
+ set_fdc_reg(FDC_CS, FDC_RESTORE | FDC_HBIT | finfo[dev].actual_rate);
if(timeout_gpip(TIMEOUT)) {
/* timeout */
KDEBUG(("flop_detect_drive(%d) timeout\n",dev));
The first way is:
- set_fdc_reg(FDC_CS, FDC_RESTORE | finfo[dev].actual_rate);
This way has the problems as currently noted.
The second way disables spin-up:
+ set_fdc_reg(FDC_CS, FDC_RESTORE | FDC_HBIT | finfo[dev].actual_rate);
This way works in Hatari.
With Both drives Enabled and No disks inserted:
When spin-up is disabled Drive B light comes on dim for a moment,
then goes dark as Drive A light comes on bright for a moment before
going dim on Hatari. Hatari then takes a Long time to get to the desktop
with Both Drive A and Drive B displayed.
With Both drives Disabled and No disks inserted:
When spin-up is disabled Drive A light comes on bright for a moment,
then goes dark as Drive B light comes on bright for a moment before
going dim on Hatari. Hatari then takes a Short time to get to the desktop
with No drives displayed.
With Drive A Enabled and Drive B Disabled and No disks inserted:
When spin-up is disabled Drive B light comes on bright for a moment,
then goes dim, then goes dark as Drive A light comes on bright for a
longer moment before going dim on Hatari. Hatari then takes a Long
time to get to the desktop with Drive A displayed.
With Drive B Enabled and Drive A Disabled and No disks inserted:
When spin-up is disabled Drive A light comes on bright for a moment,
then goes dark as Drive B light comes on dim on Hatari. Hatari then
takes a Short time to get to the desktop with Drive B displayed.
David
diff -ur emutos/bios/floppy.c emutos/bios/floppy.c
--- emutos/bios/floppy.c 2014-01-13 20:04:47.000000000 -0800
+++ emutos/bios/floppy.c 2014-01-16 18:29:43.000000000 -0800
@@ -292,7 +292,7 @@
#if CONF_WITH_FDC
floplock(dev);
select(dev, 0);
- set_fdc_reg(FDC_CS, FDC_RESTORE | finfo[dev].actual_rate);
+ set_fdc_reg(FDC_CS, FDC_RESTORE | FDC_HBIT | finfo[dev].actual_rate);
if(timeout_gpip(TIMEOUT)) {
/* timeout */
KDEBUG(("flop_detect_drive(%d) timeout\n",dev));