--- BasiliskII/src/sony.cpp 1999/10/25 19:01:31 1.4 +++ BasiliskII/src/sony.cpp 2000/07/22 16:07:18 1.8 @@ -1,7 +1,7 @@ /* * sony.cpp - Replacement .Sony driver (floppy drives) * - * Basilisk II (C) 1997-1999 Christian Bauer + * Basilisk II (C) 1997-2000 Christian Bauer * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -42,8 +42,10 @@ #define DEBUG 0 #include "debug.h" + +// Check for inserted disks by polling? #ifdef AMIGA -#define DISK_INSERT_CHECK 1 // Check for inserted disks (problem: on most hardware, disks are not ejected and automatically remounted) +#define DISK_INSERT_CHECK 1 #else #define DISK_INSERT_CHECK 0 #endif @@ -123,9 +125,6 @@ static DriveInfo *first_drive_info; uint32 SonyDiskIconAddr; uint32 SonyDriveIconAddr; -// Number of ticks between checks for disk insertion -const int driver_delay = 120; - // Flag: Control(accRun) has been called, interrupt routine is now active static bool acc_run_called = false; @@ -450,7 +449,7 @@ int16 SonyControl(uint32 pb, uint32 dce) WriteMacInt32(pb + csParam, 0x0104); // External drive return noErr; - case 'SC': { // Format and write to disk + case 0x5343: { // Format and write to disk ('SC'), used by DiskCopy if (!ReadMacInt8(info->status + dsDiskInPlace)) return offLinErr; if (info->read_only) @@ -497,18 +496,18 @@ int16 SonyStatus(uint32 pb, uint32 dce) return paramErr; case 8: // Get drive status - memcpy(Mac2HostAddr(pb + csParam), Mac2HostAddr(info->status), 22); + Mac2Mac_memcpy(pb + csParam, info->status, 22); return noErr; case 10: // Get disk type WriteMacInt32(pb + csParam, ReadMacInt32(info->status + dsMFMDrive) & 0xffffff00 | 0xfe); return noErr; - case 'DV': // Duplicator version supported + case 0x4456: // Duplicator version supported ('DV') WriteMacInt16(pb + csParam, 0x0410); return noErr; - case 'SC': // Get address header format byte + case 0x5343: // Get address header format byte ('SC') WriteMacInt8(pb + csParam, 0x22); // 512 bytes/sector return noErr; @@ -520,18 +519,13 @@ int16 SonyStatus(uint32 pb, uint32 dce) /* - * Driver interrupt routine - check for volumes to be mounted + * Driver interrupt routine (1Hz) - check for volumes to be mounted */ void SonyInterrupt(void) { - static int tick_count = 0; if (!acc_run_called) return; - tick_count++; - if (tick_count > driver_delay) { - tick_count = 0; - mount_mountable_volumes(); - } + mount_mountable_volumes(); }