home *** CD-ROM | disk | FTP | other *** search
- #include <exec/types.h>
- #include <devices/trackdisk.h>
- #include <clib/alib_protos.h>
- #include <proto/exec.h>
-
- #include "ClickDrive.h"
-
-
- /*
- * Set drive click off if toggle is TRUE
- * Set drive click on otherwise
- *
- */
- __regargs void
- SetClickDrive (BOOL toggle)
- {
- struct IOExtTD *td;
- struct MsgPort *po;
- struct TDU_PublicUnit *tpu;
- long unit;
-
- if (po = CreatePort (NULL, 0))
- {
- for (unit = 0; unit < 4; unit++)
- {
- if (td = (struct IOExtTD *) CreateExtIO (po, sizeof (struct IOExtTD)))
- {
- if (!(OpenDevice ("trackdisk.device", unit, (struct IORequest *) td, 0L)))
- {
- tpu = (struct TDU_PublicUnit *) td->iotd_Req.io_Unit;
- if (toggle==TRUE)
- {
- /* Stop clicking ! */
- tpu->tdu_PubFlags |= TDPF_NOCLICK;
- }
- else
- {
- /* Keep on clicking ! */
- tpu->tdu_PubFlags &= ~TDPF_NOCLICK;
- }
- CloseDevice ((struct IORequest *) td);
- DeleteExtIO ((struct IORequest *) td);
- }
- }
- }
- DeletePort (po);
- }
- }
-
-
-
-
-
-