SCP: Add ability to display device description if -D specified on SHOW DEVICE

The SHOW FEATURES will enumerate all devices in a simulator and for each of
them display the device specific description if one is available.

This change allows the description to be optionally visible for a single device
displayed with SHOW DEVICE.
This commit is contained in:
Mark Pizzolato 2016-05-07 15:21:40 -07:00
parent 1af590d806
commit 576f5b39e5

6
scp.c
View file

@ -4197,6 +4197,10 @@ fprintf (st, "%s", sim_dname (dptr)); /* print dev name */
if ((flag == 2) && dptr->description) { if ((flag == 2) && dptr->description) {
fprintf (st, "\t%s\n", dptr->description(dptr)); fprintf (st, "\t%s\n", dptr->description(dptr));
} }
else {
if ((sim_switches & SWMASK ('D')) && dptr->description)
fprintf (st, "\t%s\n", dptr->description(dptr));
}
if (qdisable (dptr)) { /* disabled? */ if (qdisable (dptr)) { /* disabled? */
fprintf (st, "\tdisabled\n"); fprintf (st, "\tdisabled\n");
return SCPE_OK; return SCPE_OK;
@ -7659,6 +7663,8 @@ DEVICE *find_dev (const char *cptr)
int32 i; int32 i;
DEVICE *dptr; DEVICE *dptr;
if (cptr == NULL)
return NULL;
for (i = 0; (dptr = sim_devices[i]) != NULL; i++) { for (i = 0; (dptr = sim_devices[i]) != NULL; i++) {
if ((strcmp (cptr, dptr->name) == 0) || if ((strcmp (cptr, dptr->name) == 0) ||
(dptr->lname && (dptr->lname &&