1
0
mirror of https://github.com/simh/simh.git synced 2026-01-26 04:01:38 +00:00

I1620 : Changes from Bob Supnik re: Bob Armstrong has been running diagnostics and software, and these changes reflect fixes to bugs that were found.

We're not absolutely sure that all of the changes are correct - in particular the treatment of record marks in add/compare - but they do make the diagnostics pass, which they didn't before.

Bob asked for variable tab stops on the typewriter, and those are implemented as well. The routines were general enough that I put the SET/SHOW processors in sim_console.c, so I'm enclosing that and its header file.
This commit is contained in:
Mark Pizzolato
2014-01-05 14:28:29 -08:00
parent d31e9148e6
commit 9171387bcb
9 changed files with 242 additions and 58 deletions

View File

@@ -1,6 +1,6 @@
/* sim_console.c: simulator console I/O library
Copyright (c) 1993-2012, Robert M Supnik
Copyright (c) 1993-2014, 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"),
@@ -23,6 +23,7 @@
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from Robert M Supnik.
02-Jan-14 RMS Added tab stop routines
18-Mar-12 RMS Removed unused reference to sim_switches (Dave Bryan)
20-Jan-11 MP Added support for BREAK key on Windows
30-Sep-06 RMS Fixed non-printable characters in KSR mode
@@ -537,6 +538,59 @@ else c = c & 0377;
return c;
}
/* Tab stop array handling
*desc points to a uint8 array of length val
Columns with tabs set are non-zero; columns without tabs are 0 */
t_stat sim_tt_settabs (UNIT *uptr, int32 val, char *cptr, void *desc)
{
uint8 *temptabs, *tabs = (uint8 *) desc;
int32 i, d;
t_stat r;
char gbuf[CBUFSIZE];
if ((cptr == NULL) || (tabs == NULL) || (val <= 1))
return SCPE_IERR;
if (*cptr == 0)
return SCPE_2FARG;
if ((temptabs = (uint8 *)malloc (val)) == NULL)
return SCPE_MEM;
for (i = 0; i < val; i++)
temptabs[i] = 0;
do {
cptr = get_glyph (cptr, gbuf, ';');
d = get_uint (gbuf, 10, val, &r);
if ((r != SCPE_OK) || (d == 0)) {
free (temptabs);
return SCPE_ARG;
}
temptabs[d - 1] = 1;
} while (*cptr != 0);
for (i = 0; i < val; i++)
tabs[i] = temptabs[i];
free (temptabs);
return SCPE_OK;
}
t_stat sim_tt_showtabs (FILE *st, UNIT *uptr, int32 val, void *desc)
{
uint8 *tabs = (uint8 *) desc;
int32 i, any;
if ((st == NULL) || (val == 0) || (desc == NULL))
return SCPE_IERR;
for (i = any = 0; i < val; i++) {
if (tabs[i] != 0) {
fprintf (st, (any? ";%d": "%d"), i + 1);
any = 1;
}
}
fprintf (st, (any? "\n": "no tabs set\n"));
return SCPE_OK;
}
/* VMS routines, from Ben Thomas, with fixes from Robert Alan Byer */
#if defined (VMS)