1
0
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:
Richard Cornwell
2023-09-26 13:49:30 -04:00
parent 0e2a7ac940
commit 1d87e14651
4 changed files with 33 additions and 17 deletions

View File

@@ -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)));