mirror of
https://github.com/simh/simh.git
synced 2026-01-25 19:56:25 +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. Conflicts: I1620/i1620_cpu.c sim_console.c sim_console.h
This commit is contained in:
@@ -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)
|
||||
07-Dec-11 MP Added sim_ttisatty to support reasonable behaviour (i.e.
|
||||
avoid in infinite loop) in the main command input
|
||||
@@ -75,7 +76,7 @@
|
||||
01-Feb-02 RMS Added VAX fix (Robert Alan Byer)
|
||||
19-Sep-01 RMS More MacOS changes
|
||||
31-Aug-01 RMS Changed int64 to t_int64 for Windoze
|
||||
20-Jul-01 RMS Added Macintosh support (Louis Chretien, Peter Schorn, Ben Supnik)
|
||||
20-Jul-01 RMS Added MacOS support (Louis Chretien, Peter Schorn, Ben Supnik)
|
||||
15-May-01 RMS Added logging support
|
||||
05-Mar-01 RMS Added clock calibration support
|
||||
08-Dec-00 BKR Added OS/2 support (Bruce Ray)
|
||||
@@ -1599,6 +1600,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;
|
||||
}
|
||||
|
||||
|
||||
#if defined(SIM_ASYNCH_IO) && defined(SIM_ASYNCH_MUX)
|
||||
extern pthread_mutex_t sim_tmxr_poll_lock;
|
||||
|
||||
Reference in New Issue
Block a user