H316, NOVA, PDP11, PDP8, PDP18B, KX10: Record Sequential updates consistently
Devices that do single character I/O could be attached to non seekable host OS devices (tty, pipes, etc.) and thus shouldn't count on fseek() and ftell(). These DEVICEs on these simulators do single character I/O and easily can update their POS REGisters to reflect how much data has been emitted. Changing such a REGister will have no useful effect when attached to a non seekable file.
This commit is contained in:
parent
3597772a08
commit
e519c93ebf
6 changed files with 9 additions and 9 deletions
|
@ -408,7 +408,7 @@ else {
|
|||
}
|
||||
else if ((uptr->flags & UNIT_ASC) && (c != 0)) /* ASCII? */
|
||||
c = c | 0200;
|
||||
uptr->pos = ftell (uptr->fileref); /* update pos */
|
||||
uptr->pos = uptr->pos + 1; /* update pos */
|
||||
}
|
||||
SET_INT (INT_PTR); /* set ready flag */
|
||||
uptr->buf = c & 0377; /* get byte */
|
||||
|
@ -568,7 +568,7 @@ if (putc (c, uptr->fileref) == EOF) { /* output byte */
|
|||
clearerr (uptr->fileref);
|
||||
return SCPE_IOERR;
|
||||
}
|
||||
uptr->pos = ftell (uptr->fileref); /* update pos */
|
||||
uptr->pos = uptr->pos + 1; /* update pos */
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
||||
|
@ -704,7 +704,7 @@ else if ((ruptr->flags & UNIT_ATT) && /* TTR attached */
|
|||
}
|
||||
else if ((ruptr->flags & UNIT_ASC) && (c != 0))
|
||||
c = c | 0200; /* ASCII nz? cvt */
|
||||
ruptr->pos = ftell (ruptr->fileref);
|
||||
ruptr->pos = ruptr->pos + 1;
|
||||
}
|
||||
if (ttr_xoff_read != 0) { /* reader stopping? */
|
||||
if (c == RUBOUT) /* rubout? stop */
|
||||
|
@ -808,7 +808,7 @@ if ((puptr->flags & UNIT_ATT) && /* TTP attached */
|
|||
clearerr (puptr->fileref);
|
||||
return SCPE_IOERR;
|
||||
}
|
||||
puptr->pos = ftell (puptr->fileref); /* update pos */
|
||||
puptr->pos = puptr->pos + 1; /* update pos */
|
||||
}
|
||||
}
|
||||
return SCPE_OK;
|
||||
|
|
|
@ -133,12 +133,12 @@ DEV_UPDATE_INTR ;
|
|||
if ((lpt_unit.flags & UNIT_ATT) == 0) /* attached? */
|
||||
return IORETURN (lpt_stopioe, SCPE_UNATT);
|
||||
fputc (uptr->buf, uptr->fileref);
|
||||
uptr->pos = ftell (uptr->fileref);
|
||||
if (ferror (uptr->fileref)) {
|
||||
sim_perror ("LPT I/O error");
|
||||
clearerr (uptr->fileref);
|
||||
return SCPE_IOERR;
|
||||
}
|
||||
uptr->pos = uptr->pos + 1;
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -181,12 +181,12 @@ t_stat ptp_svc (UNIT *uptr)
|
|||
return SCPE_OK;
|
||||
}
|
||||
fputc (uptr->CHR, uptr->fileref); /* print char */
|
||||
uptr->pos = ftell (uptr->fileref);
|
||||
if (ferror (uptr->fileref)) { /* error? */
|
||||
perror ("PTP I/O error");
|
||||
clearerr (uptr->fileref);
|
||||
return SCPE_IOERR;
|
||||
}
|
||||
uptr->pos = uptr->pos + 1;
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -163,12 +163,12 @@ if (lpt_csr & CSR_IE)
|
|||
if ((uptr->flags & UNIT_ATT) == 0)
|
||||
return IORETURN (lpt_stopioe, SCPE_UNATT);
|
||||
fputc (uptr->buf & 0177, uptr->fileref);
|
||||
uptr->pos = ftell (uptr->fileref);
|
||||
if (ferror (uptr->fileref)) {
|
||||
sim_perror ("LPT I/O error");
|
||||
clearerr (uptr->fileref);
|
||||
return SCPE_IOERR;
|
||||
}
|
||||
uptr->pos = uptr->pos + 1;
|
||||
lpt_csr = lpt_csr & ~CSR_ERR;
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
|
|
@ -623,12 +623,12 @@ c = uptr->buf & 0177; /* get char */
|
|||
if ((c == 0) || (c == 0177)) /* skip NULL, DEL */
|
||||
return SCPE_OK;
|
||||
fputc (c, uptr->fileref); /* print char */
|
||||
uptr->pos = ftell (uptr->fileref); /* update position */
|
||||
if (ferror (uptr->fileref)) { /* error? */
|
||||
sim_perror ("LPT I/O error");
|
||||
clearerr (uptr->fileref);
|
||||
return SCPE_IOERR;
|
||||
}
|
||||
uptr->pos = uptr->pos + 1; /* update position */
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -149,12 +149,12 @@ if ((uptr->flags & UNIT_ATT) == 0) {
|
|||
return IORETURN (lpt_stopioe, SCPE_UNATT);
|
||||
}
|
||||
fputc (uptr->buf, uptr->fileref); /* print char */
|
||||
uptr->pos = ftell (uptr->fileref);
|
||||
if (ferror (uptr->fileref)) { /* error? */
|
||||
sim_perror ("LPT I/O error");
|
||||
clearerr (uptr->fileref);
|
||||
return SCPE_IOERR;
|
||||
}
|
||||
uptr->pos = uptr->pos + 1;
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue