OpenCores
URL https://opencores.org/ocsvn/eco32/eco32/trunk

Subversion Repositories eco32

[/] [eco32/] [trunk/] [sim/] [disk.c] - Diff between revs 8 and 25

Show entire file | Details | Blame | View Log

Rev 8 Rev 25
Line 156... Line 156...
      if (diskCap != 0) {
      if (diskCap != 0) {
        delta = labs((long) diskSct - lastSct);
        delta = labs((long) diskSct - lastSct);
        if (delta > diskCap) {
        if (delta > diskCap) {
          delta = diskCap;
          delta = diskCap;
        }
        }
        timerStart(DISK_DELAY + (delta * DISK_SEEK) / diskCap,
        timerStart(DISK_DELAY_USEC + (delta * DISK_SEEK_USEC) / diskCap,
                   diskCallback, 1);
                   diskCallback, 1);
      }
      }
    } else {
    } else {
      diskCtrl &= ~DISK_STRT;
      diskCtrl &= ~DISK_STRT;
      if (data & DISK_ERR) {
      if (data & DISK_ERR) {
Line 211... Line 211...
  diskCap = 0;
  diskCap = 0;
  lastSct = 0;
  lastSct = 0;
  if (totalSectors != 0) {
  if (totalSectors != 0) {
    cPrintf("Disk of size %ld sectors (%ld bytes) installed.\n",
    cPrintf("Disk of size %ld sectors (%ld bytes) installed.\n",
            totalSectors, totalSectors * SECTOR_SIZE);
            totalSectors, totalSectors * SECTOR_SIZE);
    timerStart(DISK_STARTUP, diskCallback, 0);
    timerStart(DISK_START_USEC, diskCallback, 0);
  }
  }
}
}
 
 
 
 
void diskInit(char *diskImageName) {
void diskInit(char *diskImageName) {

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.