mirror of
https://github.com/rcornwell/sims.git
synced 2026-05-03 06:29:48 +00:00
SCP: Updated to current.
This commit is contained in:
12
sim_disk.c
12
sim_disk.c
@@ -3380,12 +3380,14 @@ if ((uptr->flags & UNIT_BUF) && (uptr->filebuf)) {
|
||||
sim_messagef (SCPE_OK, "%s: writing buffer to file: %s\n", sim_uname (uptr), uptr->filename);
|
||||
sim_disk_wrsect (uptr, 0, (uint8 *)uptr->filebuf, NULL, (cap + ctx->sector_size - 1) / ctx->sector_size);
|
||||
}
|
||||
if (uptr->flags & UNIT_MUSTBUF) { /* dyn alloc? */
|
||||
free (uptr->filebuf); /* free buffers */
|
||||
uptr->filebuf = NULL;
|
||||
free (uptr->filebuf2);
|
||||
uptr->filebuf2 = NULL;
|
||||
}
|
||||
uptr->flags = uptr->flags & ~UNIT_BUF;
|
||||
}
|
||||
free (uptr->filebuf); /* free buffers */
|
||||
uptr->filebuf = NULL;
|
||||
free (uptr->filebuf2);
|
||||
uptr->filebuf2 = NULL;
|
||||
|
||||
update_disk_footer (uptr); /* Update meta data if highwater has changed */
|
||||
|
||||
@@ -5756,7 +5758,7 @@ if (1) { /* CHS Calculation */
|
||||
cylinderTimesHeads = totalSectors / sectorsPerTrack;
|
||||
}
|
||||
}
|
||||
cylinders = cylinderTimesHeads / heads;
|
||||
cylinders = (totalSectors + sectorsPerTrack * heads - 1) / (sectorsPerTrack * heads);
|
||||
Footer.DiskGeometry = NtoHl ((cylinders<<16)|(heads<<8)|sectorsPerTrack);
|
||||
}
|
||||
Footer.Checksum = NtoHl (CalculateVhdFooterChecksum(&Footer, sizeof(Footer)));
|
||||
|
||||
Reference in New Issue
Block a user