ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/sony.cpp
(Generate patch)

Comparing BasiliskII/src/sony.cpp (file contents):
Revision 1.5 by cebix, 1999-11-03T10:56:16Z vs.
Revision 1.8 by cebix, 2000-07-22T16:07:18Z

# Line 1 | Line 1
1   /*
2   *  sony.cpp - Replacement .Sony driver (floppy drives)
3   *
4 < *  Basilisk II (C) 1997-1999 Christian Bauer
4 > *  Basilisk II (C) 1997-2000 Christian Bauer
5   *
6   *  This program is free software; you can redistribute it and/or modify
7   *  it under the terms of the GNU General Public License as published by
# Line 42 | Line 42
42   #define DEBUG 0
43   #include "debug.h"
44  
45 +
46 + // Check for inserted disks by polling?
47   #ifdef AMIGA
48 < #define DISK_INSERT_CHECK 1             // Check for inserted disks (problem: on most hardware, disks are not ejected and automatically remounted)
48 > #define DISK_INSERT_CHECK 1
49   #else
50   #define DISK_INSERT_CHECK 0
51   #endif
# Line 123 | Line 125 | static DriveInfo *first_drive_info;
125   uint32 SonyDiskIconAddr;
126   uint32 SonyDriveIconAddr;
127  
126 // Number of ticks between checks for disk insertion
127 const int driver_delay = 120;
128
128   // Flag: Control(accRun) has been called, interrupt routine is now active
129   static bool acc_run_called = false;
130  
# Line 450 | Line 449 | int16 SonyControl(uint32 pb, uint32 dce)
449                                  WriteMacInt32(pb + csParam, 0x0104);    // External drive
450                          return noErr;
451  
452 <                case 'SC': {    // Format and write to disk
452 >                case 0x5343: {  // Format and write to disk ('SC'), used by DiskCopy
453                          if (!ReadMacInt8(info->status + dsDiskInPlace))
454                                  return offLinErr;
455                          if (info->read_only)
# Line 504 | Line 503 | int16 SonyStatus(uint32 pb, uint32 dce)
503                          WriteMacInt32(pb + csParam, ReadMacInt32(info->status + dsMFMDrive) & 0xffffff00 | 0xfe);
504                          return noErr;
505  
506 <                case 'DV':      // Duplicator version supported
506 >                case 0x4456: // Duplicator version supported ('DV')
507                          WriteMacInt16(pb + csParam, 0x0410);
508                          return noErr;
509  
510 <                case 'SC':      // Get address header format byte
510 >                case 0x5343: // Get address header format byte ('SC')
511                          WriteMacInt8(pb + csParam, 0x22);       // 512 bytes/sector
512                          return noErr;
513  
# Line 520 | Line 519 | int16 SonyStatus(uint32 pb, uint32 dce)
519  
520  
521   /*
522 < *  Driver interrupt routine - check for volumes to be mounted
522 > *  Driver interrupt routine (1Hz) - check for volumes to be mounted
523   */
524  
525   void SonyInterrupt(void)
526   {
528        static int tick_count = 0;
527          if (!acc_run_called)
528                  return;
529  
530 <        tick_count++;
533 <        if (tick_count > driver_delay) {
534 <                tick_count = 0;
535 <                mount_mountable_volumes();
536 <        }
530 >        mount_mountable_volumes();
531   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines