1
0
mirror of https://github.com/simh/simh.git synced 2026-01-25 19:56:25 +00:00

Notes For V3.5-0

The source set has been extensively overhauled.  For correct
viewing, set Visual C++ or Emacs to have tab stops every 4
characters.

1. New Features in 3.4-1

1.1 All Ethernet devices

- Added Windows user-defined adapter names (from Timothe Litt)

1.2 Interdata, SDS, HP, PDP-8, PDP-18b terminal multiplexors

- Added support for SET <unit>n DISCONNECT

1.3 VAX

- Added latent QDSS support
- Revised autoconfigure to handle QDSS

1.4 PDP-11

- Revised autoconfigure to handle more casees

2. Bugs Fixed in 3.4-1

2.1 SCP and libraries

- Trim trailing spaces on all input (for example, attach file names)
- Fixed sim_sock spurious SIGPIPE error in Unix/Linux
- Fixed sim_tape misallocation of TPC map array for 64b simulators

2.2 1401

- Fixed bug, CPU reset was clearing SSB through SSG

2.3 PDP-11

- Fixed bug in VH vector display routine
- Fixed XU runt packet processing (found by Tim Chapman)

2.4 Interdata

- Fixed bug in SHOW PAS CONN/STATS
- Fixed potential integer overflow exception in divide

2.5 SDS

- Fixed bug in SHOW MUX CONN/STATS

2.6 HP

- Fixed bug in SHOW MUX CONN/STATS

2.7 PDP-8

- Fixed bug in SHOW TTIX CONN/STATS
- Fixed bug in SET/SHOW TTOXn LOG

2.8 PDP-18b

- Fixed bug in SHOW TTIX CONN/STATS
- Fixed bug in SET/SHOW TTOXn LOG

2.9 Nova, Eclipse

- Fixed potential integer overflow exception in divide
This commit is contained in:
Bob Supnik
2005-09-09 18:09:00 -07:00
committed by Mark Pizzolato
parent ec60bbf329
commit b7c1eae41f
257 changed files with 107140 additions and 97195 deletions

View File

@@ -1,6 +1,6 @@
/* id_lp.c: Interdata line printer
Copyright (c) 2001-2004, Robert M. Supnik
Copyright (c) 2001-2005, 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"),
@@ -19,13 +19,13 @@
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of Robert M Supnik shall not
be used in advertising or otherwise to promote the sale, use or other dealings
Except as contained in this notice, the name of Robert M Supnik shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from Robert M Supnik.
lpt M46-206 line printer
lpt M46-206 line printer
25-Apr-03 RMS Revised for extended file support
25-Apr-03 RMS Revised for extended file support
*/
#include "id_defs.h"
@@ -33,35 +33,35 @@
/* Device definitions */
#define UNIT_V_UC (UNIT_V_UF + 0) /* UC only */
#define UNIT_UC (1 << UNIT_V_UC)
#define SPC_BASE 0x40 /* spacing base */
#define VFU_BASE 0x78 /* VFU base */
#define VFU_WIDTH 0x8 /* VFU width */
#define LF 0xA
#define VT 0xB
#define VT_VFU 4 /* VFU chan for VT */
#define FF 0xC
#define FF_VFU 8 /* VFU chan for FF */
#define CR 0xD
#define VFUP(ch,val) ((val) & (1 << (ch))) /* VFU chan test */
#define UNIT_V_UC (UNIT_V_UF + 0) /* UC only */
#define UNIT_UC (1 << UNIT_V_UC)
#define SPC_BASE 0x40 /* spacing base */
#define VFU_BASE 0x78 /* VFU base */
#define VFU_WIDTH 0x8 /* VFU width */
#define LF 0xA
#define VT 0xB
#define VT_VFU 4 /* VFU chan for VT */
#define FF 0xC
#define FF_VFU 8 /* VFU chan for FF */
#define CR 0xD
#define VFUP(ch,val) ((val) & (1 << (ch))) /* VFU chan test */
/* Status byte, * = dynamic */
#define STA_PAPE 0x40 /* *paper empty */
#define STA_MASK (STA_BSY) /* static status */
#define STA_PAPE 0x40 /* *paper empty */
#define STA_MASK (STA_BSY) /* static status */
uint32 lpt_sta = STA_BSY; /* status */
char lpxb[LPT_WIDTH + 1]; /* line buffer */
uint32 lpt_bptr = 0; /* buf ptr */
uint32 lpt_spnd = 0; /* space pending */
uint32 lpt_vfup = 0; /* VFU ptr */
uint32 lpt_vful = 1; /* VFU lnt */
uint8 lpt_vfut[VFU_LNT] = { 0xFF }; /* VFU tape */
uint32 lpt_arm = 0; /* int armed */
int32 lpt_ctime = 10; /* char time */
int32 lpt_stime = 1000; /* space time */
int32 lpt_stopioe = 0; /* stop on err */
uint32 lpt_sta = STA_BSY; /* status */
char lpxb[LPT_WIDTH + 1]; /* line buffer */
uint32 lpt_bptr = 0; /* buf ptr */
uint32 lpt_spnd = 0; /* space pending */
uint32 lpt_vfup = 0; /* VFU ptr */
uint32 lpt_vful = 1; /* VFU lnt */
uint8 lpt_vfut[VFU_LNT] = { 0xFF }; /* VFU tape */
uint32 lpt_arm = 0; /* int armed */
int32 lpt_ctime = 10; /* char time */
int32 lpt_stime = 1000; /* space time */
int32 lpt_stopioe = 0; /* stop on err */
extern uint32 int_req[INTSZ], int_enb[INTSZ];
@@ -73,12 +73,12 @@ t_stat lpt_attach (UNIT *uptr, char *cptr);
t_stat lpt_bufout (UNIT *uptr);
t_stat lpt_vfu (UNIT *uptr, int32 ch);
t_stat lpt_spc (UNIT *uptr, int32 cnt);
/* LPT data structures
lpt_dev LPT device descriptor
lpt_unit LPT unit descriptors
lpt_reg LPT register list
lpt_dev LPT device descriptor
lpt_unit LPT unit descriptors
lpt_reg LPT register list
*/
DIB lpt_dib = { d_LPT, -1, v_LPT, NULL, &lpt, NULL };
@@ -86,61 +86,70 @@ DIB lpt_dib = { d_LPT, -1, v_LPT, NULL, &lpt, NULL };
UNIT lpt_unit = { UDATA (&lpt_svc, UNIT_SEQ+UNIT_ATTABLE+UNIT_UC, 0) };
REG lpt_reg[] = {
{ HRDATA (STA, lpt_sta, 8) },
{ HRDATA (BUF, lpt_unit.buf, 7) },
{ BRDATA (DBUF, lpxb, 16, 7, LPT_WIDTH) },
{ HRDATA (DBPTR, lpt_bptr, 8) },
{ HRDATA (VFUP, lpt_vfup, 8) },
{ HRDATA (VFUL, lpt_vful, 8) },
{ BRDATA (VFUT, lpt_vfut, 16, 8, VFU_LNT) },
{ FLDATA (IREQ, int_req[l_LPT], i_LPT) },
{ FLDATA (IENB, int_enb[l_LPT], i_LPT) },
{ FLDATA (IARM, lpt_arm, 0) },
{ DRDATA (POS, lpt_unit.pos, T_ADDR_W), PV_LEFT },
{ DRDATA (CTIME, lpt_ctime, 24), PV_LEFT },
{ DRDATA (STIME, lpt_stime, 24), PV_LEFT },
{ FLDATA (STOP_IOE, lpt_stopioe, 0) },
{ HRDATA (DEVNO, lpt_dib.dno, 8), REG_HRO },
{ NULL } };
{ HRDATA (STA, lpt_sta, 8) },
{ HRDATA (BUF, lpt_unit.buf, 7) },
{ BRDATA (DBUF, lpxb, 16, 7, LPT_WIDTH) },
{ HRDATA (DBPTR, lpt_bptr, 8) },
{ HRDATA (VFUP, lpt_vfup, 8) },
{ HRDATA (VFUL, lpt_vful, 8) },
{ BRDATA (VFUT, lpt_vfut, 16, 8, VFU_LNT) },
{ FLDATA (IREQ, int_req[l_LPT], i_LPT) },
{ FLDATA (IENB, int_enb[l_LPT], i_LPT) },
{ FLDATA (IARM, lpt_arm, 0) },
{ DRDATA (POS, lpt_unit.pos, T_ADDR_W), PV_LEFT },
{ DRDATA (CTIME, lpt_ctime, 24), PV_LEFT },
{ DRDATA (STIME, lpt_stime, 24), PV_LEFT },
{ FLDATA (STOP_IOE, lpt_stopioe, 0) },
{ HRDATA (DEVNO, lpt_dib.dno, 8), REG_HRO },
{ NULL }
};
MTAB lpt_mod[] = {
{ UNIT_UC, 0, "lower case", "LC", NULL },
{ UNIT_UC, UNIT_UC, "upper case", "UC", NULL },
{ MTAB_XTD|MTAB_VDV, 0, "DEVNO", "DEVNO",
&set_dev, &show_dev, NULL },
{ 0 } };
{ UNIT_UC, 0, "lower case", "LC", NULL },
{ UNIT_UC, UNIT_UC, "upper case", "UC", NULL },
{ MTAB_XTD|MTAB_VDV, 0, "DEVNO", "DEVNO",
&set_dev, &show_dev, NULL },
{ 0 }
};
DEVICE lpt_dev = {
"LPT", &lpt_unit, lpt_reg, lpt_mod,
1, 10, 31, 1, 16, 7,
NULL, NULL, &lpt_reset,
NULL, &lpt_attach, NULL,
&lpt_dib, DEV_DISABLE };
"LPT", &lpt_unit, lpt_reg, lpt_mod,
1, 10, 31, 1, 16, 7,
NULL, NULL, &lpt_reset,
NULL, &lpt_attach, NULL,
&lpt_dib, DEV_DISABLE
};
/* Line printer: IO routine */
uint32 lpt (uint32 dev, uint32 op, uint32 dat)
{
int32 t;
switch (op) { /* case IO op */
case IO_ADR: /* select */
return BY; /* byte only */
case IO_OC: /* command */
lpt_arm = int_chg (v_LPT, dat, lpt_arm); /* upd int ctrl */
break;
case IO_WD: /* write */
t = lpt_unit.buf = dat & 0x7F; /* mask char */
lpt_sta = STA_BSY; /* set busy */
if (lpt_spnd || ((t >= LF) && (t <= CR))) /* space op? */
sim_activate (&lpt_unit, lpt_stime);
else sim_activate (&lpt_unit, lpt_ctime); /* normal char */
break;
case IO_SS: /* status */
t = lpt_sta & STA_MASK; /* status byte */
if ((lpt_unit.flags & UNIT_ATT) == 0) /* test paper out */
t = t | STA_EX | STA_PAPE | STA_BSY;
return t; }
switch (op) { /* case IO op */
case IO_ADR: /* select */
return BY; /* byte only */
case IO_OC: /* command */
lpt_arm = int_chg (v_LPT, dat, lpt_arm); /* upd int ctrl */
break;
case IO_WD: /* write */
t = lpt_unit.buf = dat & 0x7F; /* mask char */
lpt_sta = STA_BSY; /* set busy */
if (lpt_spnd || ((t >= LF) && (t <= CR))) /* space op? */
sim_activate (&lpt_unit, lpt_stime);
else sim_activate (&lpt_unit, lpt_ctime); /* normal char */
break;
case IO_SS: /* status */
t = lpt_sta & STA_MASK; /* status byte */
if ((lpt_unit.flags & UNIT_ATT) == 0) /* test paper out */
t = t | STA_EX | STA_PAPE | STA_BSY;
return t;
}
return 0;
}
@@ -151,37 +160,41 @@ t_stat lpt_svc (UNIT *uptr)
int32 t;
t_stat r = SCPE_OK;
lpt_sta = 0; /* clear busy */
if (lpt_arm) SET_INT (v_LPT); /* armed? intr */
if ((uptr->flags & UNIT_ATT) == 0) /* attached? */
return IORETURN (lpt_stopioe, SCPE_UNATT);
t = uptr->buf; /* get character */
if (lpt_spnd || ((t >= LF) && (t < CR))) { /* spc pend or spc op? */
lpt_spnd = 0;
if (lpt_bufout (uptr) != SCPE_OK) return SCPE_IOERR; /* print */
if ((t == 1) || (t == LF)) lpt_spc (uptr, 1); /* single space */
else if (t == VT) r = lpt_vfu (uptr, VT_VFU - 1); /* VT->VFU */
else if (t == 0xC) r = lpt_vfu (uptr, FF_VFU - 1); /* FF->VFU */
else if ((t >= SPC_BASE) && (t < VFU_BASE))
lpt_spc (uptr, t - SPC_BASE); /* space */
else if ((t >= VFU_BASE) && (t < VFU_BASE + VFU_WIDTH))
r = lpt_vfu (uptr, t - VFU_BASE); /* VFU */
else fputs ("\r", uptr->fileref); /* overprint */
uptr->pos = ftell (uptr->fileref); /* update position */
if (ferror (lpt_unit.fileref)) {
perror ("LPT I/O error");
clearerr (uptr->fileref);
return SCPE_IOERR; } }
else if (t == CR) { /* CR? */
lpt_spnd = 1; /* set spc pend */
return lpt_bufout (uptr); } /* print line */
else if (t >= 0x40) { /* printable? */
if ((uptr->flags & UNIT_UC) && islower (t)) /* UC only? */
t = toupper (t);
if (lpt_bptr < LPT_WIDTH) lpxb[lpt_bptr++] = t; }
lpt_sta = 0; /* clear busy */
if (lpt_arm) SET_INT (v_LPT); /* armed? intr */
if ((uptr->flags & UNIT_ATT) == 0) /* attached? */
return IORETURN (lpt_stopioe, SCPE_UNATT);
t = uptr->buf; /* get character */
if (lpt_spnd || ((t >= LF) && (t < CR))) { /* spc pend or spc op? */
lpt_spnd = 0;
if (lpt_bufout (uptr) != SCPE_OK) return SCPE_IOERR; /* print */
if ((t == 1) || (t == LF)) lpt_spc (uptr, 1); /* single space */
else if (t == VT) r = lpt_vfu (uptr, VT_VFU - 1); /* VT->VFU */
else if (t == 0xC) r = lpt_vfu (uptr, FF_VFU - 1); /* FF->VFU */
else if ((t >= SPC_BASE) && (t < VFU_BASE))
lpt_spc (uptr, t - SPC_BASE); /* space */
else if ((t >= VFU_BASE) && (t < VFU_BASE + VFU_WIDTH))
r = lpt_vfu (uptr, t - VFU_BASE); /* VFU */
else fputs ("\r", uptr->fileref); /* overprint */
uptr->pos = ftell (uptr->fileref); /* update position */
if (ferror (lpt_unit.fileref)) {
perror ("LPT I/O error");
clearerr (uptr->fileref);
return SCPE_IOERR;
}
}
else if (t == CR) { /* CR? */
lpt_spnd = 1; /* set spc pend */
return lpt_bufout (uptr); /* print line */
}
else if (t >= 0x40) { /* printable? */
if ((uptr->flags & UNIT_UC) && islower (t)) /* UC only? */
t = toupper (t);
if (lpt_bptr < LPT_WIDTH) lpxb[lpt_bptr++] = t;
}
return r;
}
/* Printing and spacing routines */
t_stat lpt_bufout (UNIT *uptr)
@@ -189,17 +202,19 @@ t_stat lpt_bufout (UNIT *uptr)
int32 i;
t_stat r = SCPE_OK;
if (lpt_bptr == 0) return SCPE_OK; /* any char in buf? */
if (lpt_bptr == 0) return SCPE_OK; /* any char in buf? */
for (i = LPT_WIDTH - 1; (i >= 0) && (lpxb[i] == ' '); i--)
lpxb[i] = 0; /* backscan line */
if (lpxb[0]) { /* any char left? */
fputs (lpxb, uptr->fileref); /* write line */
lpt_unit.pos = ftell (uptr->fileref); /* update position */
if (ferror (uptr->fileref)) {
perror ("LPT I/O error");
clearerr (uptr->fileref);
r = SCPE_IOERR; } }
lpt_bptr = 0; /* reset buffer */
lpxb[i] = 0; /* backscan line */
if (lpxb[0]) { /* any char left? */
fputs (lpxb, uptr->fileref); /* write line */
lpt_unit.pos = ftell (uptr->fileref); /* update position */
if (ferror (uptr->fileref)) {
perror ("LPT I/O error");
clearerr (uptr->fileref);
r = SCPE_IOERR;
}
}
lpt_bptr = 0; /* reset buffer */
for (i = 0; i < LPT_WIDTH; i++) lpxb[i] = ' ';
lpxb[LPT_WIDTH] = 0;
return r;
@@ -209,16 +224,19 @@ t_stat lpt_vfu (UNIT *uptr, int32 ch)
{
uint32 i, j;
if ((ch == (FF_VFU - 1)) && VFUP (ch, lpt_vfut[0])) { /* top of form? */
fputs ("\n\f", uptr->fileref); /* nl + ff */
lpt_vfup = 0; /* top of page */
return SCPE_OK; }
for (i = 1; i < lpt_vful + 1; i++) { /* sweep thru cct */
lpt_vfup = (lpt_vfup + 1) % lpt_vful; /* adv pointer */
if (VFUP (ch, lpt_vfut[lpt_vfup])) { /* chan punched? */
for (j = 0; j < i; j++) fputc ('\n', uptr->fileref);
return SCPE_OK; } }
return STOP_VFU; /* runaway channel */
if ((ch == (FF_VFU - 1)) && VFUP (ch, lpt_vfut[0])) { /* top of form? */
fputs ("\n\f", uptr->fileref); /* nl + ff */
lpt_vfup = 0; /* top of page */
return SCPE_OK;
}
for (i = 1; i < lpt_vful + 1; i++) { /* sweep thru cct */
lpt_vfup = (lpt_vfup + 1) % lpt_vful; /* adv pointer */
if (VFUP (ch, lpt_vfut[lpt_vfup])) { /* chan punched? */
for (j = 0; j < i; j++) fputc ('\n', uptr->fileref);
return SCPE_OK;
}
}
return STOP_VFU; /* runaway channel */
}
t_stat lpt_spc (UNIT *uptr, int32 cnt)
@@ -226,25 +244,27 @@ t_stat lpt_spc (UNIT *uptr, int32 cnt)
int32 i;
if (cnt == 0) fputc ('\r', uptr->fileref);
else { for (i = 0; i < cnt; i++) fputc ('\n', uptr->fileref);
lpt_vfup = (lpt_vfup + cnt) % lpt_vful; }
else {
for (i = 0; i < cnt; i++) fputc ('\n', uptr->fileref);
lpt_vfup = (lpt_vfup + cnt) % lpt_vful;
}
return SCPE_OK;
}
/* Reset routine */
t_stat lpt_reset (DEVICE *dptr)
{
int32 i;
sim_cancel (&lpt_unit); /* deactivate */
lpt_sta = 0; /* clr busy */
lpt_bptr = 0; /* clr buf ptr */
for (i = 0; i < LPT_WIDTH; i++) lpxb[i] = ' '; /* clr buf */
sim_cancel (&lpt_unit); /* deactivate */
lpt_sta = 0; /* clr busy */
lpt_bptr = 0; /* clr buf ptr */
for (i = 0; i < LPT_WIDTH; i++) lpxb[i] = ' '; /* clr buf */
lpxb[LPT_WIDTH] = 0;
CLR_INT (v_LPT); /* clearr int */
CLR_ENB (v_LPT); /* disable int */
lpt_arm = 0; /* disarm int */
CLR_INT (v_LPT); /* clearr int */
CLR_ENB (v_LPT); /* disable int */
lpt_arm = 0; /* disarm int */
return SCPE_OK;
}
@@ -252,7 +272,7 @@ return SCPE_OK;
t_stat lpt_attach (UNIT *uptr, char *cptr)
{
lpt_vfup = 0; /* top of form */
lpt_vfup = 0; /* top of form */
return attach_unit (uptr, cptr);
}
@@ -267,21 +287,25 @@ char cbuf[CBUFSIZE], gbuf[CBUFSIZE];
if (*cptr != 0) return SCPE_ARG;
ptr = 0;
for ( ; (cptr = fgets (cbuf, CBUFSIZE, fileref)) != NULL; ) { /* until eof */
mask = 0;
if (*cptr == '(') { /* repeat count? */
cptr = get_glyph (cptr + 1, gbuf, ')'); /* get 1st field */
rpt = get_uint (gbuf, 10, VFU_LNT, &r); /* repeat count */
if (r != SCPE_OK) return SCPE_FMT; }
else rpt = 1;
while (*cptr != 0) { /* get col no's */
cptr = get_glyph (cptr, gbuf, ','); /* get next field */
col = get_uint (gbuf, 10, 7, &r); /* column number */
if (r != SCPE_OK) return SCPE_FMT;
mask = mask | (1 << col); } /* set bit */
for ( ; rpt > 0; rpt--) { /* store vals */
if (ptr >= VFU_LNT) return SCPE_FMT;
vfubuf[ptr++] = mask; } }
for ( ; (cptr = fgets (cbuf, CBUFSIZE, fileref)) != NULL; ) { /* until eof */
mask = 0;
if (*cptr == '(') { /* repeat count? */
cptr = get_glyph (cptr + 1, gbuf, ')'); /* get 1st field */
rpt = get_uint (gbuf, 10, VFU_LNT, &r); /* repeat count */
if (r != SCPE_OK) return SCPE_FMT;
}
else rpt = 1;
while (*cptr != 0) { /* get col no's */
cptr = get_glyph (cptr, gbuf, ','); /* get next field */
col = get_uint (gbuf, 10, 7, &r); /* column number */
if (r != SCPE_OK) return SCPE_FMT;
mask = mask | (1 << col); /* set bit */
}
for ( ; rpt > 0; rpt--) { /* store vals */
if (ptr >= VFU_LNT) return SCPE_FMT;
vfubuf[ptr++] = mask;
}
}
if (ptr == 0) return SCPE_FMT;
lpt_vful = ptr;
lpt_vfup = 0;