1 |
|
/* |
2 |
|
* disk.cpp - Generic disk driver |
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 |
90 |
|
// Icon address (Mac address space, set by PatchROM()) |
91 |
|
uint32 DiskIconAddr; |
92 |
|
|
93 |
– |
// Number of ticks between checks for disk insertion |
94 |
– |
const int driver_delay = 120; |
95 |
– |
|
93 |
|
// Flag: Control(accRun) has been called, interrupt routine is now active |
94 |
|
static bool acc_run_called = false; |
95 |
|
|
265 |
|
info->num_blocks = SysGetFileSize(info->fh) / 512; |
266 |
|
info->to_be_mounted = true; |
267 |
|
} |
268 |
< |
D(bug(" %ld blocks\n", info->num_blocks)); |
268 |
> |
D(bug(" %d blocks\n", info->num_blocks)); |
269 |
|
WriteMacInt16(info->status + dsDriveSize, info->num_blocks & 0xffff); |
270 |
|
WriteMacInt16(info->status + dsDriveS1, info->num_blocks >> 16); |
271 |
|
|
481 |
|
// Drive-specific codes |
482 |
|
switch (code) { |
483 |
|
case 8: // Get drive status |
484 |
< |
memcpy(Mac2HostAddr(pb + csParam), Mac2HostAddr(info->status), 22); |
484 |
> |
Mac2Mac_memcpy(pb + csParam, info->status, 22); |
485 |
|
return noErr; |
486 |
|
|
487 |
|
default: |
492 |
|
|
493 |
|
|
494 |
|
/* |
495 |
< |
* Driver interrupt routine - check for volumes to be mounted |
495 |
> |
* Driver interrupt routine (1Hz) - check for volumes to be mounted |
496 |
|
*/ |
497 |
|
|
498 |
|
void DiskInterrupt(void) |
499 |
|
{ |
503 |
– |
static int tick_count = 0; |
500 |
|
if (!acc_run_called) |
501 |
|
return; |
502 |
|
|
503 |
< |
tick_count++; |
508 |
< |
if (tick_count > driver_delay) { |
509 |
< |
tick_count = 0; |
510 |
< |
mount_mountable_volumes(); |
511 |
< |
} |
503 |
> |
mount_mountable_volumes(); |
504 |
|
} |