1
0
mirror of https://github.com/simh/simh.git synced 2026-01-28 04:48:05 +00:00

PDP8: Fix device conflict warnings to report problems correctly

As reported in #1084
This commit is contained in:
Bob Supnik
2021-10-23 14:40:34 -07:00
committed by Mark Pizzolato
parent a39b50ff63
commit fa113143d0
3 changed files with 38 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
/* pdp8_cpu.c: PDP-8 CPU simulator
Copyright (c) 1993-2017, Robert M Supnik
Copyright (c) 1993-2021, Robert M Supnik
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
@@ -1515,7 +1515,7 @@ for (i = 0; (dptr = sim_devices[i]) != NULL; i++) { /* add devices */
if (dspp->dsp) { /* any dispatch? */
if (dev_tab[dspp->dev]) { /* already filled? */
sim_printf ("%s device number conflict at %02o\n",
sim_dname (dptr), dibp->dev + j);
sim_dname (dptr), dspp->dev);
return TRUE;
}
dev_tab[dspp->dev] = dspp->dsp; /* fill */

View File

@@ -1,6 +1,6 @@
/* pdp8_fpp.c: PDP-8 floating point processor (FPP8A)
Copyright (c) 2007-2011, Robert M Supnik
Copyright (c) 2007-2021, Robert M Supnik
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
@@ -25,6 +25,7 @@
fpp FPP8A floating point processor
21-Oct-21 RMS Added device number display
03-Jan-10 RMS Initialized variables statically, for VMS compiler
19-Apr-09 RHM FPICL does not clear all command and status reg bits
modify fpp_reset to conform with FPP
@@ -242,8 +243,13 @@ REG fpp_reg[] = {
{ NULL }
};
MTAB fpp_mod[] = {
{ MTAB_XTD|MTAB_VDV, 0, "DEVNO", NULL, NULL, &show_dev },
{ 0 }
};
DEVICE fpp_dev = {
"FPP", &fpp_unit, fpp_reg, NULL,
"FPP", &fpp_unit, fpp_reg, fpp_mod,
1, 10, 31, 1, 8, 8,
NULL, NULL, &fpp_reset,
NULL, NULL, NULL,

View File

@@ -1,6 +1,6 @@
/* pdp8_ttx.c: PDP-8 additional terminals simulator
Copyright (c) 1993-2016, Robert M Supnik
Copyright (c) 1993-2021, Robert M Supnik
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
@@ -25,6 +25,7 @@
ttix,ttox PT08/KL8JA terminal input/output
21-Oct-21 RMS Added device number display from V4
18-Sep-16 RMS Expanded support to 16 terminals
27-Mar-15 RMS Backported Dave Gesswein's fix to prevent data loss
11-Oct-13 RMS Poll TTIX immediately to pick up initial connect (Mark Pizzolato)
@@ -90,6 +91,7 @@ t_stat ttx_attach (UNIT *uptr, char *cptr);
t_stat ttx_detach (UNIT *uptr);
void ttx_reset_ln (int32 i);
t_stat ttx_vlines (UNIT *uptr, int32 val, char *cptr, void *desc);
t_stat ttx_show_devno (FILE *st, UNIT *uptr, int32 val, void *desc);
#define TTIX_SET_DONE(ln) ttx_new_flags (ttix_done | (1u << (ln)), ttox_done, ttx_enbl)
#define TTIX_CLR_DONE(ln) ttx_new_flags (ttix_done & ~(1u << (ln)), ttox_done, ttx_enbl)
@@ -146,6 +148,8 @@ REG ttix_reg[] = {
MTAB ttix_mod[] = {
{ MTAB_XTD | MTAB_VDV, 0, "LINES", "LINES",
&ttx_vlines, &tmxr_show_lines, (void *) &ttx_desc },
{ MTAB_XTD | MTAB_VDV, 0, "DEVNO", NULL,
NULL, &ttx_show_devno, (void *) &ttx_desc },
{ UNIT_ATT, UNIT_ATT, "summary", NULL,
NULL, &tmxr_show_summ, (void *) &ttx_desc },
{ MTAB_XTD | MTAB_VDV, 1, NULL, "DISCONNECT",
@@ -207,6 +211,8 @@ MTAB ttox_mod[] = {
{ TT_MODE, TT_MODE_7B, "7b", "7B", NULL },
{ TT_MODE, TT_MODE_8B, "8b", "8B", NULL },
{ TT_MODE, TT_MODE_7P, "7p", "7P", NULL },
{ MTAB_XTD | MTAB_VDV, 1, "DEVNO", NULL,
NULL, &ttx_show_devno, (void *) &ttx_desc },
{ MTAB_XTD|MTAB_VUN, 0, NULL, "DISCONNECT",
&tmxr_dscln, NULL, &ttx_desc },
{ MTAB_XTD|MTAB_VUN|MTAB_NC, 0, "LOG", "LOG",
@@ -503,3 +509,24 @@ ttx_dib.num = newln * 2;
return SCPE_OK;
}
/* Show device numbers */
t_stat ttx_show_devno (FILE *st, UNIT *uptr, int32 val, void *desc)
{
int32 i;
DEVICE *dptr;
if (uptr == NULL)
return SCPE_IERR;
dptr = find_dev_from_unit (uptr);
if (dptr == NULL)
return SCPE_IERR;
if ((((uint32) val) & ~1u) != 0)
return SCPE_IERR;
fprintf(st, "devno=");
for (i = 0; i < ttx_lines; i++) {
fprintf(st, "%02o%s", ttx_dsp[(i * 2) + val].dev, (i < ttx_lines-1)?
"," : "");
}
return SCPE_OK;
}