--- BasiliskII/src/sony.cpp 2001/07/01 14:38:02 1.11 +++ BasiliskII/src/sony.cpp 2005/01/30 21:42:13 1.16 @@ -1,7 +1,7 @@ /* * sony.cpp - Replacement .Sony driver (floppy drives) * - * Basilisk II (C) 1997-2001 Christian Bauer + * Basilisk II (C) 1997-2005 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 @@ -28,6 +28,8 @@ * Technote FL 24: "Don't Look at ioPosOffset for Devices" */ +#include "sysdeps.h" + #include #include @@ -35,7 +37,6 @@ using std::vector; #endif -#include "sysdeps.h" #include "cpu_emulation.h" #include "main.h" #include "macos_util.h" @@ -194,10 +195,12 @@ bool SonyMountVolume(void *fh) while (info != end && info->fh != fh) ++info; if (info != end) { + D(bug("Looking for disk in drive %d\n", info->num)); if (SysIsDiskInserted(info->fh)) { info->read_only = SysIsReadOnly(info->fh); WriteMacInt8(info->status + dsDiskInPlace, 1); // Inserted removable disk WriteMacInt8(info->status + dsWriteProt, info->read_only ? 0xff : 0); + D(bug(" disk inserted, mounting\n")); info->to_be_mounted = true; } return true; @@ -218,7 +221,7 @@ static void mount_mountable_volumes(void #if DISK_INSERT_CHECK // Disk in drive? - if (!ReadMacInt8(info->status + dsDiskInPlace)) { + if (ReadMacInt8(info->status + dsDiskInPlace) == 0) { // No, check if disk was inserted if (SysIsDiskInserted(info->fh)) @@ -245,6 +248,7 @@ static void mount_mountable_volumes(void static int16 set_dsk_err(int16 err) { + D(bug("set_dsk_err(%d)\n", err)); WriteMacInt16(0x142, err); return err; } @@ -306,6 +310,7 @@ int16 SonyOpen(uint32 pb, uint32 dce) if (SysIsDiskInserted(info->fh)) { WriteMacInt8(info->status + dsDiskInPlace, 1); // Inserted removable disk WriteMacInt8(info->status + dsWriteProt, info->read_only ? 0xff : 0); + D(bug(" disk inserted, flagging for mount\n")); info->to_be_mounted = true; }