1
0
mirror of https://github.com/simh/simh.git synced 2026-05-01 13:56:02 +00:00

PDP18B: Latest updates from Bob Supnik

- Added unix v0 terminal support
- Added 3-cycle databreak set/show entries
- Revised for dynamically allocated memory
- Added support for -u modifier (UC15 and Unix v0)

These changes are to support the Unix v0 bringup and to implement a
"Unix input" mode on the console terminal.  In Unix mode, CR and LF are
swapped (so that a modern terminal can use 'enter' instead of CTRK-J to
create the newline Unix expects), escape is mapped to altmode (175),
upper and lower case are enabled and the parity bit is forced to 1.  This
most closely matches the characteristics of the KSR-37, but there is no
definitive evidence of the terminal that was actually used.
This commit is contained in:
Mark Pizzolato
2016-03-15 09:53:19 -07:00
parent 1f3c9550d5
commit 7251196f31
13 changed files with 126 additions and 73 deletions

View File

@@ -1,6 +1,6 @@
/* pdp18b_stddev.c: 18b PDP's standard devices
Copyright (c) 1993-2015, Robert M Supnik
Copyright (c) 1993-2016, 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"),
@@ -29,6 +29,8 @@
tto teleprinter
clk clock
15-Mar-16 RMS Added unix v0 terminal support
07-Mar-16 RMS Revised for dynamically allocated memory
13-Sep-15 RMS Added APIVEC register to PTR, CLK only
28-Mar-15 RMS Revised to use sim_printf
18-Apr-12 RMS Added clk_cosched routine
@@ -85,7 +87,7 @@
#define UNIT_V_PASCII (UNIT_V_UF + 0) /* punch ASCII */
#define UNIT_PASCII (1 << UNIT_V_PASCII)
extern int32 M[];
extern int32 *M;
extern int32 int_hwre[API_HLVL+1], PC, ASW;
extern int32 api_vec[API_HLVL][32];
extern UNIT cpu_unit;
@@ -311,7 +313,9 @@ DEVICE ptp_dev = {
#define TTI_MASK ((1 << TTI_WIDTH) - 1)
#define TTUF_V_HDX (TTUF_V_UF + 0) /* half duplex */
#define TTUF_V_UNIX (TTUF_V_UF + 1)
#define TTUF_HDX (1 << TTUF_V_HDX)
#define TTUF_UNIX (1 << TTUF_V_UNIX)
DIB tti_dib = { DEV_TTI, 1, &tti_iors, { &tti } };
@@ -334,10 +338,13 @@ REG tti_reg[] = {
MTAB tti_mod[] = {
#if !defined (KSR28)
{ TT_MODE, TT_MODE_KSR, "KSR", "KSR", &tty_set_mode },
{ TT_MODE, TT_MODE_7B, "7b", "7B", &tty_set_mode },
{ TT_MODE, TT_MODE_8B, "8b", "8B", &tty_set_mode },
{ TT_MODE, TT_MODE_7P, "7b", NULL, NULL },
{ TTUF_UNIX|TT_PAR|TT_MODE, TT_MODE_KSR, "KSR", "KSR", &tty_set_mode },
{ TTUF_UNIX|TT_PAR|TT_MODE, TT_MODE_7B, "7b", "7B", &tty_set_mode },
{ TTUF_UNIX|TT_PAR|TT_MODE, TT_MODE_8B, "8b", "8B", &tty_set_mode },
{ TTUF_UNIX|TT_PAR|TT_MODE, TT_MODE_7P, "7b", NULL, NULL },
#if !defined (PDP15)
{ TTUF_UNIX|TT_PAR|TT_MODE, TTUF_UNIX|TT_PAR_MARK|TT_MODE_7B, "Unix v0", "UNIX", &tty_set_mode },
#endif
#endif
{ TTUF_HDX, 0 , "full duplex", "FDX", NULL },
{ TTUF_HDX, TTUF_HDX, "half duplex", "HDX", NULL },
@@ -389,10 +396,13 @@ REG tto_reg[] = {
MTAB tto_mod[] = {
#if !defined (KSR28)
{ TT_MODE, TT_MODE_KSR, "KSR", "KSR", &tty_set_mode },
{ TT_MODE, TT_MODE_7B, "7b", "7B", &tty_set_mode },
{ TT_MODE, TT_MODE_8B, "8b", "8B", &tty_set_mode },
{ TT_MODE, TT_MODE_7P, "7p", "7P", &tty_set_mode },
{ TTUF_UNIX|TT_PAR|TT_MODE, TT_MODE_KSR, "KSR", "KSR", &tty_set_mode },
{ TTUF_UNIX|TT_PAR|TT_MODE, TT_MODE_7B, "7b", "7B", &tty_set_mode },
{ TTUF_UNIX|TT_PAR|TT_MODE, TT_MODE_8B, "8b", "8B", &tty_set_mode },
{ TTUF_UNIX|TT_PAR|TT_MODE, TT_MODE_7P, "7p", "7P", &tty_set_mode },
#if !defined (PDP15)
{ TTUF_UNIX|TT_PAR|TT_MODE, TTUF_UNIX|TT_PAR_MARK|TT_MODE_7B, "Unix v0", "UNIX", &tty_set_mode },
#endif
#endif
{ MTAB_XTD|MTAB_VDV, 0, "DEVNO", NULL, NULL, &show_devno },
{ 0 }
@@ -1061,6 +1071,14 @@ out = c & 0177; /* mask echo to 7b */
if (c & SCPE_BREAK) /* break? */
c = 0;
else c = sim_tt_inpcvt (c, TT_GET_MODE (uptr->flags) | TTUF_KSR);
if (uptr->flags & TTUF_UNIX) { /* unix v0? */
if (c == 0215) /* cr -> lf */
c = 0212;
else if (c == 0212) /* lf -> cr */
c = 0215;
else if (c == 0233) /* esc -> altmode */
c = 0375;
}
if ((uptr->flags & TTUF_HDX) && !tti_fdpx && out && /* half duplex and */
((out = sim_tt_outcvt (out, TT_GET_MODE (uptr->flags) | TTUF_KSR)) >= 0)) {
sim_putchar (out); /* echo */
@@ -1166,7 +1184,7 @@ return SCPE_OK;
t_stat tty_set_mode (UNIT *uptr, int32 val, char *cptr, void *desc)
{
tti_unit.flags = (tti_unit.flags & ~TT_MODE) | val;
tto_unit.flags = (tto_unit.flags & ~TT_MODE) | val;
tti_unit.flags = (tti_unit.flags & ~(TTUF_UNIX|TT_PAR|TT_MODE)) | val;
tto_unit.flags = (tto_unit.flags & ~(TTUF_UNIX|TT_PAR|TT_MODE)) | val;
return SCPE_OK;
}