From bd45a9c45f52bceadd5555b00b552a752fabd056 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Mon, 13 May 2019 00:18:11 -0700 Subject: [PATCH] PDP11, Most VAX: Improve rewind time for TQ device Make the rewind time vary based on tape position. --- PDP11/pdp11_tq.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PDP11/pdp11_tq.c b/PDP11/pdp11_tq.c index d33a2dbc..e4a8dbd2 100644 --- a/PDP11/pdp11_tq.c +++ b/PDP11/pdp11_tq.c @@ -1210,7 +1210,11 @@ if ((uptr = tq_getucb (lu))) { /* unit exist? */ uptr->cpkt = pkt; /* op in progress */ if ((tq_pkt[pkt].d[CMD_MOD] & MD_RWD) && /* rewind? */ (!(tq_pkt[pkt].d[CMD_MOD] & MD_IMM))) { /* !immediate? */ - sim_activate_after (uptr, tq_rwtime); /* use 2 sec rewind execute time */ + double walltime = (tq_rwtime - 100); + + if (uptr->hwmark) + walltime *= ((double)uptr->pos)/uptr->hwmark; + sim_activate_after_d (uptr, 100 + walltime);/* use scaled 2 sec rewind execute time */ } else { /* otherwise */ uptr->iostarttime = sim_grtime();