SCP: Add ability to ECHOF output to TMXR lines
This commit is contained in:
parent
659aef2c52
commit
58ccb38d7b
4 changed files with 33 additions and 8 deletions
BIN
doc/simh_doc.doc
BIN
doc/simh_doc.doc
Binary file not shown.
25
scp.c
25
scp.c
|
@ -1761,7 +1761,10 @@ static const char simh_help[] =
|
|||
" followed by a newline:\n\n"
|
||||
/***************** 80 character line width template *************************/
|
||||
"++ECHOF {-n} \"<string>\"|<string> output string to console\n\n"
|
||||
" If there is no argument, ECHOF prints a blank line on the console.\n"
|
||||
" The ECHOF command can also print output on a specified multiplexer line\n"
|
||||
" (and log) followed by a newline:\n\n"
|
||||
"++ECHOF {-n} dev:line \"<string>\"|<string> output string to specified line\n\n"
|
||||
" If there is no argument, ECHOF prints a blank line.\n"
|
||||
" The string argument may be delimited by quote characters. Quotes may\n"
|
||||
" be either single or double but the opening and closing quote characters\n"
|
||||
" must match. If the string is enclosed in quotes, the string may\n"
|
||||
|
@ -3238,12 +3241,21 @@ return SCPE_OK;
|
|||
t_stat echof_cmd (int32 flag, CONST char *cptr)
|
||||
{
|
||||
char gbuf[CBUFSIZE];
|
||||
uint8 dbuf[CBUFSIZE];
|
||||
CONST char *tptr;
|
||||
TMLN *lp = NULL;
|
||||
uint8 dbuf[4*CBUFSIZE];
|
||||
uint32 dsize = 0;
|
||||
t_stat r;
|
||||
|
||||
GET_SWITCHES (cptr);
|
||||
if (!*cptr)
|
||||
return SCPE_2FARG;
|
||||
tptr = get_glyph (cptr, gbuf, ',');
|
||||
if (sim_isalpha(gbuf[0]) && (strchr (gbuf, ':'))) {
|
||||
r = tmxr_locate_line (gbuf, &lp);
|
||||
if (r != SCPE_OK)
|
||||
return r;
|
||||
cptr = tptr;
|
||||
}
|
||||
GET_SWITCHES (cptr);
|
||||
if ((*cptr == '"') || (*cptr == '\'')) {
|
||||
cptr = get_glyph_quoted (cptr, gbuf, 0);
|
||||
if (*cptr != '\0')
|
||||
|
@ -3253,6 +3265,11 @@ if ((*cptr == '"') || (*cptr == '\'')) {
|
|||
dbuf[dsize] = 0;
|
||||
cptr = (char *)dbuf;
|
||||
}
|
||||
if (lp) {
|
||||
tmxr_linemsgf (lp, "%s%s", cptr, (sim_switches & SWMASK('N')) ? "" : "\r\n");
|
||||
tmxr_send_buffered_data (lp);
|
||||
}
|
||||
else
|
||||
sim_printf ("%s%s", cptr, (sim_switches & SWMASK('N')) ? "" : "\n");
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
|
13
sim_tmxr.c
13
sim_tmxr.c
|
@ -3755,7 +3755,7 @@ pthread_mutex_unlock (&sim_tmxr_poll_lock);
|
|||
#endif
|
||||
}
|
||||
|
||||
static t_stat _tmxr_locate_line_send_expect (const char *cptr, SEND **snd, EXPECT **exp)
|
||||
static t_stat _tmxr_locate_line_send_expect (const char *cptr, TMLN **lp, SEND **snd, EXPECT **exp)
|
||||
{
|
||||
char gbuf[CBUFSIZE];
|
||||
DEVICE *dptr;
|
||||
|
@ -3776,6 +3776,8 @@ for (i=0; i<tmxr_open_device_count; ++i)
|
|||
int line = (int)get_uint (cptr, 10, tmxr_open_devices[i]->lines, &r);
|
||||
if (r != SCPE_OK)
|
||||
return r;
|
||||
if (lp)
|
||||
*lp = &tmxr_open_devices[i]->ldsc[line];
|
||||
if (snd)
|
||||
*snd = &tmxr_open_devices[i]->ldsc[line].send;
|
||||
if (exp)
|
||||
|
@ -3787,12 +3789,17 @@ return SCPE_ARG;
|
|||
|
||||
t_stat tmxr_locate_line_send (const char *cptr, SEND **snd)
|
||||
{
|
||||
return _tmxr_locate_line_send_expect (cptr, snd, NULL);
|
||||
return _tmxr_locate_line_send_expect (cptr, NULL, snd, NULL);
|
||||
}
|
||||
|
||||
t_stat tmxr_locate_line_expect (const char *cptr, EXPECT **exp)
|
||||
{
|
||||
return _tmxr_locate_line_send_expect (cptr, NULL, exp);
|
||||
return _tmxr_locate_line_send_expect (cptr, NULL, NULL, exp);
|
||||
}
|
||||
|
||||
t_stat tmxr_locate_line (const char *cptr, TMLN **lp)
|
||||
{
|
||||
return _tmxr_locate_line_send_expect (cptr, lp, NULL, NULL);
|
||||
}
|
||||
|
||||
static const char *_tmxr_send_expect_line_name (const SEND *snd, const EXPECT *exp)
|
||||
|
|
|
@ -295,6 +295,7 @@ t_stat tmxr_clock_coschedule_tmr_abs (UNIT *uptr, int32 tmr, int32 ticks);
|
|||
t_stat tmxr_change_async (void);
|
||||
t_stat tmxr_locate_line_send (const char *dev_line, SEND **snd);
|
||||
t_stat tmxr_locate_line_expect (const char *dev_line, EXPECT **exp);
|
||||
t_stat tmxr_locate_line (const char *dev_line, TMLN **lp);
|
||||
const char *tmxr_send_line_name (const SEND *snd);
|
||||
const char *tmxr_expect_line_name (const EXPECT *exp);
|
||||
t_stat tmxr_startup (void);
|
||||
|
|
Loading…
Add table
Reference in a new issue