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 |
39 |
|
#include "prefs.h" |
40 |
|
#include "sony.h" |
41 |
|
|
42 |
< |
#define DEBUG 1 |
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 |
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 |
|
|
496 |
|
return paramErr; |
497 |
|
|
498 |
|
case 8: // Get drive status |
499 |
< |
memcpy(Mac2HostAddr(pb + csParam), Mac2HostAddr(info->status), 22); |
499 |
> |
Mac2Mac_memcpy(pb + csParam, info->status, 22); |
500 |
|
return noErr; |
501 |
|
|
502 |
|
case 10: // Get disk type |
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 |
|
} |