From 8c5305c857275c71be4ac5bdc774cb12d6b79356 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Thu, 13 Apr 2017 20:42:47 -0700 Subject: [PATCH] PDP11: Fix rounding up sector count computation Fix #412, #424 --- PDP11/pdp11_hk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PDP11/pdp11_hk.c b/PDP11/pdp11_hk.c index 27aed20f..0c6c6db0 100644 --- a/PDP11/pdp11_hk.c +++ b/PDP11/pdp11_hk.c @@ -1176,7 +1176,7 @@ switch (fnc) { /* case on function */ } } /* end if wr */ else if (uptr->FNC == FNC_READ) { /* read? */ - err = sim_disk_rdsect (uptr, da/HK_NUMWD, (uint8 *)hkxb, §sread, (wc + (HK_NUMWD - 1)) & ~(HK_NUMWD - 1)/HK_NUMWD); + err = sim_disk_rdsect (uptr, da/HK_NUMWD, (uint8 *)hkxb, §sread, ((wc + (HK_NUMWD - 1)) & ~(HK_NUMWD - 1))/HK_NUMWD); if ((err == SCPE_OK) && (sectsread != ((wc + (HK_NUMWD - 1)) & ~(HK_NUMWD - 1)/HK_NUMWD))) err = -1; @@ -1196,7 +1196,7 @@ switch (fnc) { /* case on function */ } } /* end if read */ else { /* wchk */ - err = sim_disk_rdsect (uptr, da/HK_NUMWD, (uint8 *)hkxb, §sread, (wc + (HK_NUMWD - 1)) & ~(HK_NUMWD - 1)/HK_NUMWD); + err = sim_disk_rdsect (uptr, da/HK_NUMWD, (uint8 *)hkxb, §sread, ((wc + (HK_NUMWD - 1)) & ~(HK_NUMWD - 1))/HK_NUMWD); sim_disk_data_trace (uptr, (uint8 *)hkxb, da/HK_NUMWD, sectsread*HK_NUMWD*sizeof(*hkxb), "sim_disk_rdsect", HKDEB_DAT & dptr->dctrl, HKDEB_OPS); awc = wc; for (wc = 0; wc < awc; wc++) { /* loop thru buf */