1
0
mirror of https://github.com/rcornwell/sims.git synced 2026-01-11 23:52:48 +00:00

I7000: Updated general card reader, printer and magtape

Card reader handle EOF correctly.
     Line printer proper handling of paging.
     Magtape clean up debug message.
This commit is contained in:
Richard Cornwell 2024-05-10 21:15:43 -04:00
parent 3a4cda8439
commit efc3cd4ead
3 changed files with 39 additions and 11 deletions

View File

@ -122,8 +122,13 @@ uint32 cdr_cmd(UNIT * uptr, uint16 cmd, uint16 dev)
uptr->u5 &= ~0xF0000;
uptr->u5 |= stk << 16;
#endif
if (uptr->u5 & (URCSTA_EOF|URCSTA_ERR)) {
uptr->u5 &= ~(URCSTA_EOF|URCSTA_ERR);
if (uptr->u5 & (URCSTA_EOF)) {
uptr->u5 &= ~(URCSTA_EOF);
return SCPE_EOF;
}
if (uptr->u5 & (URCSTA_ERR)) {
uptr->u5 &= ~(URCSTA_ERR);
return SCPE_IOERR;
}
@ -151,11 +156,12 @@ uint32 cdr_cmd(UNIT * uptr, uint16 cmd, uint16 dev)
/* If at eof, just return EOF */
if (sim_card_eof(uptr)) {
uint16 *image = (uint16 *)(uptr->up7);
sim_debug(DEBUG_DETAIL, &cdr_dev, "%d: EOF\n", u);
chan_set_eof(chan);
chan_set_attn(chan);
uptr->u5 &= ~(URCSTA_EOF|URCSTA_ERR);
(void)sim_read_card(uptr, image);
return SCPE_IOERR;
return SCPE_EOF;
}
uptr->u5 |= URCSTA_READ;

View File

@ -135,7 +135,7 @@ lpr_setlpp(UNIT *uptr, int32 val, CONST char *cptr, void *desc)
if (i < 20 || i > 100)
return SCPE_ARG;
uptr->u6 = i;
uptr->u4 = 0;
uptr->u4 = 1;
return SCPE_OK;
}
@ -231,7 +231,9 @@ print_line(UNIT * uptr, int chan, int unit)
sim_putchar(out[j++]);
}
uptr->u4++;
if (uptr->u4 > (int32)uptr->u6) {
if (uptr->u4 >= (int32)uptr->u6) {
sim_fwrite("\f", 1, 1, uptr->fileref);
uptr->pos += 1;
uptr->u4 = 1;
}
@ -241,6 +243,7 @@ print_line(UNIT * uptr, int chan, int unit)
if (uptr->flags & UNIT_ATT) {
sim_fwrite("\r\n", 1, 2, uptr->fileref);
uptr->pos += 2;
uptr->u4++;
}
if (uptr->flags & ECHO)
sim_putchar('\r');
@ -255,18 +258,22 @@ print_line(UNIT * uptr, int chan, int unit)
sim_putchar('\n');
}
uptr->u4++;
if (uptr->u4 > (int32)uptr->u6) {
uptr->u4 = 1;
if (uptr->u4 >= (int32)uptr->u6) {
i = 0;
}
}
}
if (uptr->u4 >= (int32)uptr->u6) {
sim_fwrite("\f", 1, 1, uptr->fileref);
uptr->u4 = 1;
}
uptr->u5 &= ~(URCSTA_SKIPAFT|(0x7f << 12));
}
if (uptr->u4 == 1)
lpr_chan9[chan] = 1;
#ifdef I7010
if (uptr->u4 == uptr->u6)
if (uptr->u4 >= uptr->u6)
lpr_chan12[chan] = 1;
#endif
@ -356,7 +363,10 @@ uint32 lpr_cmd(UNIT * uptr, uint16 cmd, uint16 dev)
case 1:
case 9: if (uptr->u4 == 1)
break;
i = uptr->u6 - uptr->u4 + 1; break;
i = uptr->u6 - uptr->u4 + 1;
sim_debug(DEBUG_DATA, &lpr_dev, "%d: Feed %d %d %d\n", u,
uptr->u6, uptr->u4, i);
break;
case 12: i = (uptr->u6/2) - uptr->u4; break;
}
if (i == 0)
@ -369,12 +379,20 @@ uint32 lpr_cmd(UNIT * uptr, uint16 cmd, uint16 dev)
if (uptr->flags & UNIT_ATT) {
sim_fwrite("\r\n", 1, 2, uptr->fileref);
uptr->pos += 2;
uptr->u4++;
if (uptr->u4 >= (int32)uptr->u6) {
i = 0;
}
}
if (uptr->flags & ECHO) {
sim_putchar('\r');
sim_putchar('\n');
}
}
if (uptr->u4 >= (int32)uptr->u6) {
sim_fwrite("\f", 1, 1, uptr->fileref);
uptr->u4 = 1;
}
break;
}
if (uptr->u4 == uptr->u6)
@ -468,6 +486,10 @@ lpr_srv(UNIT *uptr) {
void
lpr_ini(UNIT *uptr, t_bool f) {
if (uptr->u6 == 0) {
uptr->u6 = 55;
}
uptr->u4 = 1;
}
t_stat
@ -479,7 +501,7 @@ lpr_attach(UNIT * uptr, CONST char *file)
if ((r = attach_unit(uptr, file)) != SCPE_OK)
return r;
uptr->u5 = 0;
uptr->u4 = 0;
uptr->u4 = 1;
return SCPE_OK;
}

View File

@ -905,7 +905,7 @@ t_stat mt_srv(UNIT * uptr)
/* Do BCD translation */
if ((parity_table[ch & 077] ^ (ch & 0100) ^ mode) == 0) {
sim_debug(DEBUG_DETAIL, dptr, "%s parity error %d %03o\n",
(cmd == MT_RDS) ? "BCD" : "Binary", uptr->u3-1, ch);
(cmd == MT_RDS) ? "BCD" : "Binary", uptr->u6-1, ch);
#ifdef I7010
if (astmode)
ch = 054;