diff --git a/doc/simh_doc.doc b/doc/simh_doc.doc index 80d7290e..bdc1dd1a 100644 Binary files a/doc/simh_doc.doc and b/doc/simh_doc.doc differ diff --git a/scp.c b/scp.c index 12f209d4..274749bd 100644 --- a/scp.c +++ b/scp.c @@ -1761,7 +1761,10 @@ static const char simh_help[] = " followed by a newline:\n\n" /***************** 80 character line width template *************************/ "++ECHOF {-n} \"\"| 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 \"\"| 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,7 +3265,12 @@ if ((*cptr == '"') || (*cptr == '\'')) { dbuf[dsize] = 0; cptr = (char *)dbuf; } -sim_printf ("%s%s", cptr, (sim_switches & SWMASK('N')) ? "" : "\n"); +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; } diff --git a/sim_tmxr.c b/sim_tmxr.c index 8c2e6dd6..538f2c48 100644 --- a/sim_tmxr.c +++ b/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; ilines, &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) diff --git a/sim_tmxr.h b/sim_tmxr.h index 16953ee2..f80dd6e0 100644 --- a/sim_tmxr.h +++ b/sim_tmxr.h @@ -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);