home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1981 < prev    next >
Encoding:
Internet Message Format  |  1990-12-28  |  5.2 KB

  1. From: ken@csis.dit.csiro.au (Ken Yap)
  2. Newsgroups: alt.sources,sci.electronics
  3. Subject: cheap pcb autorouter and printer
  4. Message-ID: <1990Oct23.074827.12643@csis.dit.csiro.au>
  5. Date: 23 Oct 90 07:48:27 GMT
  6.  
  7. If you're looking for a free pcb cad package, these diffs may be for
  8. you.  They are to be applied to Randy Nevin's pcb.arc version 1.00 to
  9. compile with gcc under SunOS 4.1.  The original sources are at
  10. wuarchive.wustl.edu in mirrors/msdos/cad/pcb.arc (or something like
  11. that).
  12.  
  13. Besides making pcbroute run, pcbprint was modified to generate pbm
  14. files which can be converted to a variety of formats with pbmplus
  15. (expo.lcs.mit.edu:contrib/pbmplus.tar.Z). No attempt has been made to
  16. Unixify the programs, pcbprint wants flags MSDOS style, e.g.  "pcbprint
  17. /Z3 foo".
  18.  
  19. DISCLAIMER: I have not tested the package beyond trying the example,
  20. printing the generated layers and observing that they look like good
  21. traces. I have not tried making PCBs; I don't have the materials at
  22. hand.  I'm sure there are limitations, but hey what do you want for
  23. free?  I'll be no good at answering questions about the package. I hear
  24. that Randy has a more comprehensive release he's selling. That's all I
  25. know, contact Randy yourself.  I'm posting these diffs simply because
  26. the diffs are so small and somebody might benefit.
  27.  
  28. *** /dev/null    Tue Oct 23 17:14:21 1990
  29. --- makefile    Tue Oct 23 17:33:39 1990
  30. ***************
  31. *** 0 ****
  32. --- 1,35 ----
  33. + # printed circuit board autorouter, viewer, and printer
  34. + CC=gcc        # or another ANSI standard compiler
  35. + .c.o:
  36. +     $(CC) -Dfar= -DAlloc=malloc -D_fmalloc=malloc -D_ffree=free -c $*.c
  37. + all:    pcbroute pcbprint
  38. + pcbroute: pcbroute.o io.o solve.o board.o queue.o work.o \
  39. +         dist.o alloc.o
  40. +     $(CC) -o $@ pcbroute.o io.o solve.o board.o queue.o work.o \
  41. +         dist.o alloc.o
  42. + pcbroute.o: pcbroute.c cell.h
  43. + io.o: io.c cell.h
  44. + solve.o: solve.c cell.h
  45. + board.o: board.c cell.h
  46. + queue.o: queue.c cell.h
  47. + work.o: work.c cell.h
  48. + dist.o: dist.c cell.h
  49. + alloc.o: alloc.c
  50. + bitmap.o: bitmap.c cell.h bitmap1.h bitmap2.h bitmap3.h
  51. + pcbprint: pcbprint.o bitmap.o board.o alloc.o
  52. +     $(CC) -o $@ pcbprint.o bitmap.o board.o alloc.o
  53. + pcbprint.o: pcbprint.c cell.h
  54. *** alloc.c.old    Mon Oct 22 15:26:50 1990
  55. --- alloc.c    Thu Aug 23 17:10:19 1990
  56. ***************
  57. *** 1,25 ****
  58.   #include <stdio.h>
  59.   #include <stdlib.h>
  60. - #include <dos.h>
  61.   
  62.   char far *Alloc( long );
  63.   void Nomem( void );
  64.   
  65. - char far *Alloc ( x ) /* allocate x bytes of far memory */
  66. -     long x;
  67. -     {
  68. -     union REGS regs;
  69. -     regs.h.ah = 0x48; /* allocate memory dos call */
  70. -     x = (x+15)>>4; /* get number of paragraphs to allocate */
  71. -     regs.x.bx = (int)x;
  72. -     intdos( ®s, ®s ); /* call dos; request memory */
  73. -     if (regs.x.cflag) /* memory allocation error */
  74. -         Nomem();
  75. -     return( (char far *)((long)regs.x.ax<<16) ); /* make a far pointer */
  76. -     }
  77.   void Nomem () { /* a memory allocation request has failed */
  78.       printf( "out of memory\n" );
  79.       exit( -1 );
  80.       }
  81. --- 1,15 ----
  82.   #include <stdio.h>
  83.   #include <stdlib.h>
  84.   
  85.   char far *Alloc( long );
  86.   void Nomem( void );
  87.   
  88.   void Nomem () { /* a memory allocation request has failed */
  89.       printf( "out of memory\n" );
  90.       exit( -1 );
  91.       }
  92. + strupr(s)
  93. +     char    *s;
  94. + {
  95. + }
  96. *** solve.c.old    Mon Oct 22 15:26:57 1990
  97. --- solve.c    Thu Aug 23 17:05:52 1990
  98. ***************
  99. *** 1,7 ****
  100.   #include <stdio.h>
  101.   #include <stdlib.h>
  102.   #include <fcntl.h>
  103. - #include <io.h>
  104.   #include "cell.h"
  105.   
  106.   /*
  107. --- 1,6 ----
  108. *** pcbprint.c.old    Mon Oct 22 15:26:55 1990
  109. --- pcbprint.c    Mon Oct 22 14:43:29 1990
  110. ***************
  111. *** 241,268 ****
  112.   static void prolog ( fp ) /* output initial laser printer commands */
  113.       register FILE *fp;
  114.       {
  115. !     putc( 0x1B, fp );        /* <esc> */
  116. !     putc( 'E', fp );        /* reset */
  117. !     putc( 0x1B, fp );        /* <esc> */
  118. !     fprintf( fp, "&l%dO", orient );    /* set image orientation */
  119. !     putc( 0x1B, fp );        /* <esc> */
  120. !     fprintf( fp, "&a10R" );        /* cursor to row 10 */
  121. !     putc( 0x1B, fp );        /* <esc> */
  122. !     fprintf( fp, "&a10C" );        /* cursor to column 10 */
  123. !     putc( 0x1B, fp );        /* <esc> */
  124. !     fprintf( fp, "*t%dR", resol );    /* set resolution in dots per inch */
  125. !     putc( 0x1B, fp );        /* <esc> */
  126. !     fprintf( fp, "*r1A" );        /* start graphics at cursor */
  127.       }
  128.   
  129.   static void epilog ( fp ) /* output final laser printer commands */
  130.       register FILE *fp;
  131.       {
  132. -     putc( 0x1B, fp );    /* <esc> */
  133. -     fprintf( fp, "*rB" );    /* end graphics */
  134. -     putc( 0x12, fp );    /* formfeed to eject paper */
  135. -     putc( 0x1B, fp );    /* <esc> */
  136. -     putc( 'E', fp );    /* reset */
  137.       }
  138.   
  139.   static void doimage ( fp ) /* create the board image, row by column */
  140. --- 241,252 ----
  141.   static void prolog ( fp ) /* output initial laser printer commands */
  142.       register FILE *fp;
  143.       {
  144. !     fprintf(fp, "P4\n%d %d\n", Ncols*size[zoom], Nrows*size[zoom]);
  145.       }
  146.   
  147.   static void epilog ( fp ) /* output final laser printer commands */
  148.       register FILE *fp;
  149.       {
  150.       }
  151.   
  152.   static void doimage ( fp ) /* create the board image, row by column */
  153. ***************
  154. *** 274,281 ****
  155.   
  156.       for (r = Nrows-1; r >= 0; r--) { /* each row */
  157.           for (ir = size[zoom]-1; ir >= 0; ir--) { /* each scan line */
  158. -             putc( 0x1B, fp );    /* <esc> */
  159. -             fprintf( fp, "*b%dW", nbytes );
  160.               initbit();
  161.               for (c = 0; c < Ncols; c++) {
  162.                   x = GetCell( r, c, TOP );
  163. --- 258,263 ----
  164.