1
0
mirror of https://github.com/simh/simh.git synced 2026-05-04 15:05:39 +00:00

DISK: Add support to properly autosize fixed sized disk from a set of choices

As discussed in #704
This commit is contained in:
Mark Pizzolato
2019-05-21 15:38:39 -07:00
parent 4f2dc069ae
commit 6b3bff56b3
8 changed files with 53 additions and 20 deletions

View File

@@ -1497,11 +1497,13 @@ uint32 drv;
t_offset p;
t_stat r;
int32 old_hkds;
static const char *drives[] = {"RK06", "RK07", NULL};
uptr->capac = HK_SIZE (uptr);
r = sim_disk_attach (uptr, cptr, HK_NUMWD * sizeof (uint16),
sizeof (uint16), TRUE, 0,
(uptr->capac == RK06_SIZE) ? "RK06" : "RK07", HK_NUMSC, 0);
r = sim_disk_attach_ex (uptr, cptr, HK_NUMWD * sizeof (uint16),
sizeof (uint16), TRUE, 0,
(uptr->capac == RK06_SIZE) ? "RK06" : "RK07", HK_NUMSC, 0,
(uptr->flags & UNIT_AUTO) ? drives : NULL);
if (r != SCPE_OK) /* error? */
return r;
drv = (uint32) (uptr - hk_dev.units); /* get drv number */

View File

@@ -1017,11 +1017,13 @@ t_stat rl_attach (UNIT *uptr, CONST char *cptr)
{
t_offset p;
t_stat r;
static const char *drives[] = {"RL01", "RL02", NULL};
uptr->capac = (uptr->flags & UNIT_RL02)? RL02_SIZE: RL01_SIZE;
r = sim_disk_attach (uptr, cptr, RL_NUMWD * sizeof (uint16),
sizeof (uint16), TRUE, 0,
(uptr->capac == RL02_SIZE) ? "RL02" : "RL01", RL_NUMSC, 0);
r = sim_disk_attach_ex (uptr, cptr, RL_NUMWD * sizeof (uint16),
sizeof (uint16), TRUE, 0,
(uptr->capac == RL02_SIZE) ? "RL02" : "RL01", RL_NUMSC, 0,
(uptr->flags & UNIT_AUTO) ? drives : NULL);
if (r != SCPE_OK) /* error? */
return r;
/*

View File

@@ -1378,11 +1378,12 @@ t_stat rp_attach (UNIT *uptr, CONST char *cptr)
int32 drv, i, p;
t_stat r;
DEVICE *dptr = find_dev_from_unit (uptr);
static const char *drives[] = {"RM03", "RP04", "RM80", "RP06", "RM05", "RP07", NULL};
uptr->capac = drv_tab[GET_DTYPE (uptr->flags)].size;
r = sim_disk_attach (uptr, cptr, RP_NUMWD * sizeof (uint16),
sizeof (uint16), TRUE, 0,
drv_tab[GET_DTYPE (uptr->flags)].name, drv_tab[GET_DTYPE (uptr->flags)].sect, 0);
r = sim_disk_attach_ex (uptr, cptr, RP_NUMWD * sizeof (uint16),
sizeof (uint16), TRUE, 0,
drv_tab[GET_DTYPE (uptr->flags)].name, drv_tab[GET_DTYPE (uptr->flags)].sect, 0, (uptr->flags & UNIT_AUTO) ? drives : NULL);
if (r != SCPE_OK) /* error? */
return r;
drv = (int32) (uptr - dptr->units); /* get drv number */