1
0
mirror of https://github.com/simh/simh.git synced 2026-02-27 09:09:46 +00:00

PDP11: Fix RK11/RL11 byte/word count mismatch (and cyl upd in RK11)

This commit is contained in:
Tony Lawrence
2022-12-01 21:33:26 -05:00
committed by Mark Pizzolato
parent f56ab51da6
commit ff2d849460
2 changed files with 5 additions and 4 deletions

View File

@@ -718,7 +718,7 @@ if (wc && (err == 0)) { /* seek ok? */
else { /* normal store */
if ((t = MAP_WRW (ma, wc << 1, rkxb))) { /* store buf */
rker = rker | RKER_NXM; /* NXM? set flag */
wc = wc - t; /* adj wd cnt */
wc = wc - (t >> 1); /* adj wd cnt */
}
}
break; /* end read */
@@ -735,7 +735,7 @@ if (wc && (err == 0)) { /* seek ok? */
else { /* normal fetch */
if ((t = MAP_RDW (ma, wc << 1, rkxb))) { /* get buf */
rker = rker | RKER_NXM; /* NXM? set flg */
wc = wc - t; /* adj wd cnt */
wc = wc - (t >> 1); /* adj wd cnt */
}
}
if (wc) { /* any xfer? */
@@ -785,6 +785,7 @@ if ((uptr->FUNC == RKCS_READ) && (rkcs & RKCS_FMT)) /* read format? */
else da = da + wc + (RK_NUMWD - 1); /* count by words */
track = (da / RK_NUMWD) / RK_NUMSC;
sect = (da / RK_NUMWD) % RK_NUMSC;
uptr->CYL = track / RK_NUMSF;
rkda = (rkda & RKDA_DRIVE) | (track << RKDA_V_TRACK) | (sect << RKDA_V_SECT);
rk_set_done (0);

View File

@@ -889,7 +889,7 @@ if (uptr->FNC >= RLCS_READ) { /* read (no hdr)? */
sim_disk_data_trace (uptr, (uint8 *)rlxb, da/RL_NUMWD, sectsread*RL_NUMWD*sizeof(*rlxb), "sim_disk_rdsect", RLDEB_DAT & dptr->dctrl, RLDEB_OPS);
if ((t = Map_WriteW (ma, wc << 1, rlxb))) { /* store buffer */
rlcs = rlcs | RLCS_ERR | RLCS_NXM; /* nxm */
wc = wc - t; /* adjust wc */
wc = wc - (t >> 1); /* adjust wc */
}
} /* end read */
@@ -897,7 +897,7 @@ else
if (uptr->FNC == RLCS_WRITE) { /* write? */
if ((t = Map_ReadW (ma, wc << 1, rlxb))) { /* fetch buffer */
rlcs = rlcs | RLCS_ERR | RLCS_NXM; /* nxm */
wc = wc - t; /* adj xfer lnt */
wc = wc - (t >> 1); /* adj xfer lnt */
}
if (wc) { /* any xfer? */
awc = (wc + (RL_NUMWD - 1)) & ~(RL_NUMWD - 1); /* clr to */