Page 1 of 2

IDCMP_DISKINSERTED

Posted: Tue Oct 27, 2015 8:44 pm
by mritter0
My program watches for IDCMP_DISKINSERTED and IDCMP_DISKREMOVED. When a floppy is inserted I first get a REMOVED then INSERTED message. When I remove the floppy I only get REMOVED.

It does not do this for CDs.

I am using OS4.1FE Classic in WinUAE. I posted it originally on EAB. http://eab.abime.net/showthread.php?t=80113 Not sure if it is OS issue or WinUAE issue.

Re: IDCMP_DISKINSERTED

Posted: Tue Oct 27, 2015 11:14 pm
by tonyw
When you insert a disk, the first signal (REMOVED) is redundant. That shouldn't be a problem to your software, though? It's just a notification to clear any old attachments you may have had.

Re: IDCMP_DISKINSERTED

Posted: Wed Oct 28, 2015 11:37 am
by thomasrapp
It causes flicker if your program shows a list of drives which is refreshed whenever such a signal is received.

Re: IDCMP_DISKINSERTED

Posted: Wed Oct 28, 2015 2:59 pm
by broadblues
thomasrapp wrote:It causes flicker if your program shows a list of drives which is refreshed whenever such a signal is received.
That depends on prgram design abit though does it not?

Receive Notification
Clear data
Update Display
Reload data
Update Display

Will certainly flicker

Recieve notification
Verify data
Update if changed

Won't so much.

I've not used it much directly, but I've always though of it's primary purpose as being to enabled auto clearing of insert volume requesters.

Re: IDCMP_DISKINSERTED

Posted: Wed Oct 28, 2015 5:31 pm
by thomasrapp
A program which plays sounds on system events would suffer, too.

Re: IDCMP_DISKINSERTED

Posted: Wed Oct 28, 2015 6:23 pm
by mritter0
I updated my code to not flash the list being updated twice. It is a little strange behavior, but I can live with it.

Thomas is right about sounds. Floppies aren't in much use anymore, but still have to have a little bit of support for them, mainly ADFs.

Re: IDCMP_DISKINSERTED

Posted: Thu Oct 29, 2015 3:46 pm
by xenic
mritter0 wrote:I updated my code to not flash the list being updated twice. It is a little strange behavior, but I can live with it.

Thomas is right about sounds. Floppies aren't in much use anymore, but still have to have a little bit of support for them, mainly ADFs.
If the Intuition only sends a IDCMP_DISKINSERTED message when a CD is inserted, how can you distinguish between a quick removal and reinsertion of a CD and the insertion of a floppy disk? Both actions will produce IDCMP_DISKREMOVED followed by IDCMP_DISKINSERTED.

It's nice that people have offered workarounds but the problem should be fixed or at least examined. The system should act constistantly for disk removal/insertion and I think someone needs to file a bug report so the issue can be examined and potentially fixed

Re: IDCMP_DISKINSERTED

Posted: Thu Oct 29, 2015 4:03 pm
by thomasrapp
CDs work fine. They send DISKINSERTED when you insert a disk and DISKREMOVED when you remove one.

Floppies issue redundant messages. When you remove a disk, they send DISKREMOVED, that's ok. But when you insert a disk, they send both DISKREMOVED and DISKINSERTED. They shouldn't send a REMOVED message on disk insertion.

Re: IDCMP_DISKINSERTED

Posted: Thu Oct 29, 2015 10:46 pm
by tonyw
What "floppies" are we talking about, here? Which device driver?

Re: IDCMP_DISKINSERTED

Posted: Fri Oct 30, 2015 8:07 am
by ZeroG
This could be a "feature" of WinUAE - if there is a disk (adf) in dfx: and you change the adf without manually removing the adf WinUAE has to emulate a "disk removed" and a "disk inserted" hardware event in a very short time - this could explain mritters observation.

WinUAE could even do this for every new inserted adf, even if there was no disk in drive before.

Anyone testet this on real hardware?