[Simh] two h316 patches (for simhv36-1)

theo engel theo.engel at hetnet.nl
Tue Dec 5 14:04:22 EST 2006


While testing h316 magtape support with Honeywell's (ddp416/516) magtape 
drivers i encountered two problems:
1- while writing files (ASCII) on a magtape;
2- a small lineprinter problem.

A short description of problem 1:
When writing files with multiple records on a tape, the first record of the 
first file is ok, but of each of the following records the first 2 bytes 
(buffer word) are missing.
So of a 40 word recordbuffer, 39 words are written.

The driver (o$ma) does not execute an explicit OCP-stop-writing (which 
generates an reset ready), so the proposed solution is to add a reset ready 
when writing of the buffer is completed (pls see attached code change). With 
this change the problem is solved.

A short description of problem 2:
When writing is multiple files to the lineprinter is stopped (to a simulated 
single lineprinter file) the very last printed record is not written to the 
file of the simulated lineprinter.
Although a small problem, it is caused by the fact that the current 
lineprinter module "prints" a line to the simulated printer when the next 
line to print is received. For the last line the next line to print is never 
received, so that last line is never printed. With the attached code change, 
a line is "printed" when the line is received for printing, which solves the 
problem.

With kind regards,
Theo Engel


-------------- next part --------------
*** h316_mt.c   Mon Oct 23 18:37:01 2006
--- /usr/local/src/simhv36-1-org/H316/h316_mt.c Fri Feb 17 14:57:00 2006
***************
*** 432,438 ****
          if (mt_eor || mt_rdy) {                         /* done or no data? */
              if (!mt_rdy) mt_wrwd (uptr, mt_buf);        /* write last word */
              if (mt_ptr) {                               /* any data? */
-               mt_rdy = 0;                             /* ****ADDED1**** OK */
                  if (st = sim_tape_wrrecf (uptr, mtxb, mt_ptr))  /* write, err? */
                      r = mt_map_err (uptr, st);          /* map error */
                  }
--- 432,437 ----









*** h316_lp.c   Tue Oct 24 21:02:15 2006
--- /usr/local/src/simhv36-1-org/H316/h316_lp.c Mon Apr  3 10:23:00 2006
***************
*** 295,330 ****
  if (lpt_dma && lpt_eor) SET_INT (INT_LPT);              /* end of range? */
  if (lpt_svcst & LPT_SVCSH) {                            /* shuttling */
      SET_INT (INT_LPT);                                  /* interrupt */
!       if (lpt_crpos == 0)
!       {                                               /* ********** ADDED ********* */
!               /* output buf */
!               for (i = LPT_WIDTH - 1; i >= 0; i--)  {             /* backscan for blanks */
!                    if (lpt_buf[i] != ' ') break;
!               }
!               lpt_buf[i + 1] = 0;
!               fputs (lpt_buf, uptr->fileref);                     /* output buf */
!               uptr->pos = ftell (uptr->fileref);                  /* update pos */
!               for (i = 0; i < LPT_WIDTH; i++) lpt_buf[i] = ' ';   /* clear buf */
!
!           lpt_prdn = 1;   /* THIS LINE was there, so not added ******************** */
!       }                                               /* ********** ADDED ********* */
      }
  if (lpt_svcst & LPT_SVCPA) {                            /* paper advance */
      SET_INT (INT_LPT);                                  /* interrupt */
!     /* ******************** deleted
!     for (i = LPT_WIDTH - 1; i >= 0; i--)  {
!           if (lpt_buf[i] != ' ') break;
          }
      lpt_buf[i + 1] = 0;
!     fputs (lpt_buf, uptr->fileref);
!     *************** */
!
!     fputs (lpt_cc[lpt_svcch & 03], uptr->fileref);
      uptr->pos = ftell (uptr->fileref);                  /* update pos */
!
!      /* ******************** deleted
!     for (i = 0; i < LPT_WIDTH; i++) lpt_buf[i] = ' ';
!     *************** */
      }
  lpt_svcst = 0;
  return SCPE_OK;

--- 295,312 ----
  if (lpt_dma && lpt_eor) SET_INT (INT_LPT);              /* end of range? */
  if (lpt_svcst & LPT_SVCSH) {                            /* shuttling */
      SET_INT (INT_LPT);                                  /* interrupt */
!     if (lpt_crpos == 0) lpt_prdn = 1;
      }
  if (lpt_svcst & LPT_SVCPA) {                            /* paper advance */
      SET_INT (INT_LPT);                                  /* interrupt */
!     for (i = LPT_WIDTH - 1; i >= 0; i--)  {             /* backscan for blanks */
!         if (lpt_buf[i] != ' ') break;
          }
      lpt_buf[i + 1] = 0;
!     fputs (lpt_buf, uptr->fileref);                     /* output buf */
!     fputs (lpt_cc[lpt_svcch & 03], uptr->fileref);      /* output eol */
      uptr->pos = ftell (uptr->fileref);                  /* update pos */
!     for (i = 0; i < LPT_WIDTH; i++) lpt_buf[i] = ' ';   /* clear buf */
      }
  lpt_svcst = 0;
  return SCPE_OK;



More information about the Simh mailing list