DISK: Properly support attach time disk copy to a larger container

This commit is contained in:
Mark Pizzolato 2022-03-17 07:28:11 -07:00
parent 36cd4668e7
commit aa637f58c0

View file

@ -2526,6 +2526,7 @@ if (sim_switches & SWMASK ('C')) { /* create new disk conta
source_capac = uptr->capac; source_capac = uptr->capac;
sim_messagef (SCPE_OK, "%s: Creating new %s '%s' disk container copied from '%s'\n", sim_uname (uptr), dest_fmt, gbuf, cptr); sim_messagef (SCPE_OK, "%s: Creating new %s '%s' disk container copied from '%s'\n", sim_uname (uptr), dest_fmt, gbuf, cptr);
capac_factor = ((dptr->dwidth / dptr->aincr) >= 32) ? 8 : ((dptr->dwidth / dptr->aincr) == 16) ? 2 : 1; /* capacity units (quadword: 8, word: 2, byte: 1) */ capac_factor = ((dptr->dwidth / dptr->aincr) >= 32) ? 8 : ((dptr->dwidth / dptr->aincr) == 16) ? 2 : 1; /* capacity units (quadword: 8, word: 2, byte: 1) */
uptr->capac = target_capac;
if (strcmp ("VHD", dest_fmt) == 0) if (strcmp ("VHD", dest_fmt) == 0)
dest = sim_vhd_disk_create (gbuf, ((t_offset)uptr->capac)*capac_factor*((dptr->flags & DEV_SECTORS) ? 512 : 1)); dest = sim_vhd_disk_create (gbuf, ((t_offset)uptr->capac)*capac_factor*((dptr->flags & DEV_SECTORS) ? 512 : 1));
else else