1
0
mirror of https://github.com/simh/simh.git synced 2026-01-25 11:46:37 +00:00

SCP: Added generic output routine sim_printf to output to stdout and sim_log (and sim_deb when enabled)

The goals here being to simplify calling code while getting consistent output delivered everywhere it may be useful.

Modified most places which explicitly used sim_log or merely called printf to now avoid doing that and merely call sim_printf().
This commit is contained in:
Mark Pizzolato
2014-03-28 08:20:05 -07:00
parent e81de979f6
commit 6ce8d99cd8
46 changed files with 332 additions and 498 deletions

View File

@@ -2259,11 +2259,8 @@ for (i = p = 0; (dptr = sim_devices[i]) != NULL; i++) { /* add devices *
for (j = 0; j < dibp->num; j++) { /* loop thru disp */
if (dibp->dsp[j]) { /* any dispatch? */
if (dev_tab[dibp->dev + j]) { /* already filled? */
printf ("%s device number conflict at %02o\n",
sim_dname (dptr), dibp->dev + j);
if (sim_log)
fprintf (sim_log, "%s device number conflict at %02o\n",
sim_dname (dptr), dibp->dev + j);
sim_printf ("%s device number conflict at %02o\n",
sim_dname (dptr), dibp->dev + j);
return TRUE;
}
dev_tab[dibp->dev + j] = dibp->dsp[j]; /* fill */

View File

@@ -1436,13 +1436,13 @@ if (uptr->filebuf == NULL) { /* can't alloc? */
return SCPE_MEM;
}
fbuf = (uint32 *) uptr->filebuf; /* file buffer */
printf ("%s%d: ", sim_dname (&dt_dev), u);
sim_printf ("%s%d: ", sim_dname (&dt_dev), u);
if (uptr->flags & UNIT_8FMT)
printf ("12b format");
sim_printf ("12b format");
else if (uptr->flags & UNIT_11FMT)
printf ("16b format");
else printf ("18b/36b format");
printf (", buffering file in memory\n");
sim_printf ("16b format");
else sim_printf ("18b/36b format");
sim_printf (", buffering file in memory\n");
uptr->io_flush = dt_flush;
if (uptr->flags & UNIT_8FMT) { /* 12b? */
for (ba = 0; ba < uptr->capac; ) { /* loop thru file */
@@ -1548,7 +1548,7 @@ if (sim_is_active (uptr)) {
uptr->STATE = uptr->pos = 0;
}
if (uptr->hwmark && ((uptr->flags & UNIT_RO) == 0)) { /* any data? */
printf ("%s%d: writing buffer to file\n", sim_dname (&dt_dev), u);
sim_printf ("%s%d: writing buffer to file\n", sim_dname (&dt_dev), u);
dt_flush (uptr);
} /* end if hwmark */
free (uptr->filebuf); /* release buf */

View File

@@ -573,7 +573,7 @@ if ((temp = getc (ptr_unit.fileref)) == EOF) { /* end of file? */
#endif
if (feof (ptr_unit.fileref)) {
if (ptr_stopioe)
printf ("PTR end of file\n");
sim_printf ("PTR end of file\n");
else return SCPE_OK;
}
else perror ("PTR I/O error");