cheap pcb autorouter and printer
Ken Yap
ken at csis.dit.csiro.au
Tue Oct 23 17:48:27 AEST 1990
If you're looking for a free pcb cad package, these diffs may be for
you. They are to be applied to Randy Nevin's pcb.arc version 1.00 to
compile with gcc under SunOS 4.1. The original sources are at
wuarchive.wustl.edu in mirrors/msdos/cad/pcb.arc (or something like
that).
Besides making pcbroute run, pcbprint was modified to generate pbm
files which can be converted to a variety of formats with pbmplus
(expo.lcs.mit.edu:contrib/pbmplus.tar.Z). No attempt has been made to
Unixify the programs, pcbprint wants flags MSDOS style, e.g. "pcbprint
/Z3 foo".
DISCLAIMER: I have not tested the package beyond trying the example,
printing the generated layers and observing that they look like good
traces. I have not tried making PCBs; I don't have the materials at
hand. I'm sure there are limitations, but hey what do you want for
free? I'll be no good at answering questions about the package. I hear
that Randy has a more comprehensive release he's selling. That's all I
know, contact Randy yourself. I'm posting these diffs simply because
the diffs are so small and somebody might benefit.
*** /dev/null Tue Oct 23 17:14:21 1990
--- makefile Tue Oct 23 17:33:39 1990
***************
*** 0 ****
--- 1,35 ----
+ # printed circuit board autorouter, viewer, and printer
+ CC=gcc # or another ANSI standard compiler
+
+ .c.o:
+ $(CC) -Dfar= -DAlloc=malloc -D_fmalloc=malloc -D_ffree=free -c $*.c
+
+ all: pcbroute pcbprint
+
+ pcbroute: pcbroute.o io.o solve.o board.o queue.o work.o \
+ dist.o alloc.o
+ $(CC) -o $@ pcbroute.o io.o solve.o board.o queue.o work.o \
+ dist.o alloc.o
+
+ pcbroute.o: pcbroute.c cell.h
+
+ io.o: io.c cell.h
+
+ solve.o: solve.c cell.h
+
+ board.o: board.c cell.h
+
+ queue.o: queue.c cell.h
+
+ work.o: work.c cell.h
+
+ dist.o: dist.c cell.h
+
+ alloc.o: alloc.c
+
+ bitmap.o: bitmap.c cell.h bitmap1.h bitmap2.h bitmap3.h
+
+ pcbprint: pcbprint.o bitmap.o board.o alloc.o
+ $(CC) -o $@ pcbprint.o bitmap.o board.o alloc.o
+
+ pcbprint.o: pcbprint.c cell.h
*** alloc.c.old Mon Oct 22 15:26:50 1990
--- alloc.c Thu Aug 23 17:10:19 1990
***************
*** 1,25 ****
#include <stdio.h>
#include <stdlib.h>
- #include <dos.h>
char far *Alloc( long );
void Nomem( void );
- char far *Alloc ( x ) /* allocate x bytes of far memory */
- long x;
- {
- union REGS regs;
-
- regs.h.ah = 0x48; /* allocate memory dos call */
- x = (x+15)>>4; /* get number of paragraphs to allocate */
- regs.x.bx = (int)x;
- intdos( ®s, ®s ); /* call dos; request memory */
- if (regs.x.cflag) /* memory allocation error */
- Nomem();
- return( (char far *)((long)regs.x.ax<<16) ); /* make a far pointer */
- }
-
void Nomem () { /* a memory allocation request has failed */
printf( "out of memory\n" );
exit( -1 );
}
--- 1,15 ----
#include <stdio.h>
#include <stdlib.h>
char far *Alloc( long );
void Nomem( void );
void Nomem () { /* a memory allocation request has failed */
printf( "out of memory\n" );
exit( -1 );
}
+
+ strupr(s)
+ char *s;
+ {
+ }
*** solve.c.old Mon Oct 22 15:26:57 1990
--- solve.c Thu Aug 23 17:05:52 1990
***************
*** 1,7 ****
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
- #include <io.h>
#include "cell.h"
/*
--- 1,6 ----
*** pcbprint.c.old Mon Oct 22 15:26:55 1990
--- pcbprint.c Mon Oct 22 14:43:29 1990
***************
*** 241,268 ****
static void prolog ( fp ) /* output initial laser printer commands */
register FILE *fp;
{
! putc( 0x1B, fp ); /* <esc> */
! putc( 'E', fp ); /* reset */
! putc( 0x1B, fp ); /* <esc> */
! fprintf( fp, "&l%dO", orient ); /* set image orientation */
! putc( 0x1B, fp ); /* <esc> */
! fprintf( fp, "&a10R" ); /* cursor to row 10 */
! putc( 0x1B, fp ); /* <esc> */
! fprintf( fp, "&a10C" ); /* cursor to column 10 */
! putc( 0x1B, fp ); /* <esc> */
! fprintf( fp, "*t%dR", resol ); /* set resolution in dots per inch */
! putc( 0x1B, fp ); /* <esc> */
! fprintf( fp, "*r1A" ); /* start graphics at cursor */
}
static void epilog ( fp ) /* output final laser printer commands */
register FILE *fp;
{
- putc( 0x1B, fp ); /* <esc> */
- fprintf( fp, "*rB" ); /* end graphics */
- putc( 0x12, fp ); /* formfeed to eject paper */
- putc( 0x1B, fp ); /* <esc> */
- putc( 'E', fp ); /* reset */
}
static void doimage ( fp ) /* create the board image, row by column */
--- 241,252 ----
static void prolog ( fp ) /* output initial laser printer commands */
register FILE *fp;
{
! fprintf(fp, "P4\n%d %d\n", Ncols*size[zoom], Nrows*size[zoom]);
}
static void epilog ( fp ) /* output final laser printer commands */
register FILE *fp;
{
}
static void doimage ( fp ) /* create the board image, row by column */
***************
*** 274,281 ****
for (r = Nrows-1; r >= 0; r--) { /* each row */
for (ir = size[zoom]-1; ir >= 0; ir--) { /* each scan line */
- putc( 0x1B, fp ); /* <esc> */
- fprintf( fp, "*b%dW", nbytes );
initbit();
for (c = 0; c < Ncols; c++) {
x = GetCell( r, c, TOP );
--- 258,263 ----
More information about the Alt.sources
mailing list