1
0
mirror of https://github.com/rcornwell/sims.git synced 2026-01-16 16:27:19 +00:00

KA10: Fixed TU to read correctly.

This commit is contained in:
Richard Cornwell 2019-11-04 23:42:35 -05:00
parent 8254121c6d
commit ce56a29ced
3 changed files with 19 additions and 17 deletions

View File

@ -526,9 +526,9 @@ struct rh_dev {
typedef struct pdp_dib DIB;
void df10_setirq(struct df10 *df) ;
void df10_writecw(struct df10 *df) ;
void df10_finish_op(struct df10 *df, int flags) ;
void df10_setirq(struct df10 *df);
void df10_writecw(struct df10 *df);
void df10_finish_op(struct df10 *df, int flags);
void df10_setup(struct df10 *df, uint32 addr);
int df10_fetch(struct df10 *df);
int df10_read(struct df10 *df);
@ -545,8 +545,9 @@ t_stat rh_show_type (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
t_stat rh_devio(uint32 dev, t_uint64 *data);
t_addr rh_devirq(uint32 dev, t_addr addr);
void rh_setattn(struct rh_if *rh, int unit);
void rh_error(struct rh_if *rh);
int rh_blkend(struct rh_if *rh);
void rh_setirq(struct rh_if *rh) ;
void rh_setirq(struct rh_if *rh);
void rh_finish_op(struct rh_if *rh, int flags);
int rh_read(struct rh_if *rh);
int rh_write(struct rh_if *rh);

View File

@ -500,6 +500,12 @@ void rh_setattn(struct rh_if *rhc, int unit)
set_interrupt(rhc->devnum, rhc->status);
}
void rh_error(struct rh_if *rhc)
{
if (rhc->imode == 2)
rhc->status |= RH20_DR_EXC;
}
/* Decrement block count for RH20, nop for RH10 */
int rh_blkend(struct rh_if *rhc)
{
@ -529,12 +535,15 @@ void rh_writecw(struct rh_if *rhc, int nxm) {
uint32 chan = (rhc->devnum - 0540);
int wc = ((rhc->wcr ^ RH20_WMASK) + 1) & RH20_WMASK;
rhc->status |= RH20_CHAN_RDY;
rhc->status &= ~(RH20_PCR_FULL);
if (wc != 0 || (rhc->status & RH20_XEND) == 0 ||
(rhc->ptcr & BIT10) != 0) {
(rhc->ptcr & BIT10) != 0 || nxm) {
uint64 wrd1 = SMASK|(uint64)(rhc->ccw);
if ((rhc->ptcr & BIT10) == 0 && (rhc->status & RH20_DR_EXC) != 0)
return;
if (nxm) {
wrd1 |= RH20_NXM_ERR;
rhc->status |= RH20_CHAN_ERR;
wrd1 |= RH20_NXM_ERR;
rhc->status |= RH20_CHAN_ERR;
}
if (wc != 0) {
wrd1 |= RH20_NOT_WC0;
@ -553,7 +562,6 @@ void rh_writecw(struct rh_if *rhc, int nxm) {
((uint64)(rhc->cda) & AMASK);
//fprintf(stderr, "RH20 final %012llo %012llo %06o\n\r", M[eb_ptr|chan|1], M[eb_ptr|chan|2], wc);
}
rhc->status &= ~(RH20_PCR_FULL);
return;
}
#endif

View File

@ -338,10 +338,6 @@ tu_write(DEVICE *dptr, struct rh_if *rhc, int reg, uint32 data) {
case 007: /* look ahead */
case 011: /* tape control register */
tu_tcr[ctlr] = data & 0177777 ;
if ((tu_tcr[ctlr] & TC_DENS) == TC_1600)
uptr->STATUS |= DS_PES;
else
uptr->STATUS &= ~DS_PES;
break;
default:
uptr->STATUS |= ER1_ILR;
@ -475,6 +471,8 @@ void tu_error(UNIT * uptr, t_stat r)
}
if (uptr->CMD & CS_ATA)
rh_setattn(rhc, 0);
if (uptr->CMD & (CS_ATA | CS_TM))
rh_error(rhc);
uptr->CMD &= ~(CS_MOTION|CS_PIP|CS1_GO);
sim_debug(DEBUG_EXP, dptr, "Setting status %d\n", r);
}
@ -749,11 +747,6 @@ t_stat tu_srv(UNIT * uptr)
/* Fall Through */
case MTSE_TMK: /* tape mark */
/* Position just after mark */
if (GET_FNC(uptr->CMD) == FNC_SPACEB && r == MTSE_TMK)
sim_tape_sprecf(uptr, &reclen);
/* Fall Through */
case MTSE_EOM: /* end of medium */
if (tu_frame[ctlr] != 0)
uptr->STATUS |= ER1_FCE;