CDSilImpl.mesa
Copyright © 1983, 1985 by Xerox Corporation. All rights reserved.
by Ch. Jacobi August 11, 1983 3:56 pm
Last Edited by: Beretta, December 28, 1984 11:10:04 am PST
Last Edited by: Ch. Jacobi, April 11, 1985 4:06:36 pm PST
DIRECTORY
CD,
CDColors,
CDOps,
CDPanel,
CDSil,
CDTipEtc,
CDValue,
CDViewer,
Commander USING [CommandProc, Register],
IO,
Rope,
TerminalIO;
CDSilImpl: CEDAR PROGRAM
IMPORTS CD, CDTipEtc, CDColors, CDOps, CDPanel, CDValue, CDViewer, Commander, IO, TerminalIO
EXPORTS CDSil =
BEGIN
cdsil: PUBLIC CD.Technology ~ CD.RegisterTechnology[$chipnsil, "chipnsil"];
The colours are the same as on Alto Sil.
xneutral: PUBLIC CD.Layer;  -- 00
xred: PUBLIC CD.Layer;  -- 01
xyellow: PUBLIC CD.Layer;  -- 02
xgreen: PUBLIC CD.Layer;  -- 03
xcyan: PUBLIC CD.Layer;  -- 04
xviolet: PUBLIC CD.Layer;   -- 05
xmagenta: PUBLIC CD.Layer;  -- 06
xwhite: PUBLIC CD.Layer;  -- 07
xbrown: PUBLIC CD.Layer;  -- 08
xorange: PUBLIC CD.Layer;  -- 09
xlime: PUBLIC CD.Layer;  -- 10
xturquise: PUBLIC CD.Layer;  -- 11
xaqua: PUBLIC CD.Layer;  -- 12
xultraviolet: PUBLIC CD.Layer;  -- 13
xpink: PUBLIC CD.Layer;  -- 14
xsmoke: PUBLIC CD.Layer;  -- 15
tipTable: Rope.ROPENIL;
Load: Commander.CommandProc =
BEGIN
cmd.out.PutRope["chipnsil loaded\n"];
END;
NewSWorld: Commander.CommandProc =
BEGIN
design: CD.Design ~ CDOps.CreateDesign[cdsil];
[] ← CDViewer.CreateViewer[design];
END;
Init: PROC [] =
BEGIN
xneutral ← CD.NewLayer[cdsil, $xneutral];  -- 00
xred ← CD.NewLayer[cdsil, $xred];  -- 01
xyellow ← CD.NewLayer[cdsil, $xyellow];  -- 02
xgreen ← CD.NewLayer[cdsil, $xgreen];  -- 03
xcyan ← CD.NewLayer[cdsil, $xcyan];  -- 04
xviolet ← CD.NewLayer[cdsil, $xviolet];  -- 05
xmagenta ← CD.NewLayer[cdsil, $xmagenta];  -- 06
xwhite ← CD.NewLayer[cdsil, $xwhite];  -- 07
xbrown ← CD.NewLayer[cdsil, $xbrown];  -- 08
xorange ← CD.NewLayer[cdsil, $xorange];  -- 09
xlime ← CD.NewLayer[cdsil, $xlime];  -- 10
xturquise ← CD.NewLayer[cdsil, $xturquise];  -- 11
xaqua ← CD.NewLayer[cdsil, $xaqua];  -- 12
xultraviolet ← CD.NewLayer[cdsil, $xultraviolet];  -- 13
xpink ← CD.NewLayer[cdsil, $xpink];  -- 14
xsmoke ← CD.NewLayer[cdsil, $xsmoke];  -- 15
CDTipEtc.SetTipTable[cdsil, "Standard"];
the 1 bit pattern are fair but not great
the 4 bit pattern are nice with cmos-chipmonk
the 8 bit pattern don't fit anywhere
CDColors.DefineColor[xneutral,
NEW[CDColors.Brick←[10*1010H, 10*0101H, 10*1010H, 10*0101H]], bit4];
CDColors.DefineColor[xneutral,
NEW[CDColors.Brick←[10*1010H, 10*0101H, 10*1010H, 10*0101H]], bit8];
CDColors.DefineColor[xneutral,
NEW[CDColors.Brick←[05H*1111H, 0AH*1111H, 05H*1111H, 0AH*1111H]], bw]; -- 00
CDColors.DefineColor[xred,
NEW[CDColors.Brick←[10*1111H, 10*1111H, 10*1111H, 10*1111H]], bit4];
CDColors.DefineColor[xred,
NEW[CDColors.Brick←[10*1111H, 10*1111H, 10*1111H, 10*1111H]], bit8];
CDColors.DefineColor[xred,
NEW[CDColors.Brick←[0EH*1111H, 0DH*1111H, 0BH*1111H, 07H*1111H]], bw]; -- 01
CDColors.DefineColor[xyellow,
NEW[CDColors.Brick←[10*1111H, 10*1111H, 10*1111H, 10*1111H]], bit4];
CDColors.DefineColor[xyellow,
NEW[CDColors.Brick←[10*1111H, 10*1111H, 10*1111H, 10*1111H]], bit8];
CDColors.DefineColor[xyellow,
NEW[CDColors.Brick←[0EH*1111H, 0DH*1111H, 0BH*1111H, 07H*1111H]], bw]; -- 02
CDColors.DefineColor[xgreen,
NEW[CDColors.Brick←[10*1111H, 10*1111H, 10*1111H, 10*1111H]], bit4];
CDColors.DefineColor[xgreen,
NEW[CDColors.Brick←[10*1111H, 10*1111H, 10*1111H, 10*1111H]], bit8];
CDColors.DefineColor[xgreen,
NEW[CDColors.Brick←[0EH*1111H, 0DH*1111H, 0BH*1111H, 07H*1111H]], bw]; -- 03
CDColors.DefineColor[xcyan,
NEW[CDColors.Brick←[10*1111H, 10*1111H, 10*1111H, 10*1111H]], bit4];
CDColors.DefineColor[xcyan,
NEW[CDColors.Brick←[10*1111H, 10*1111H, 10*1111H, 10*1111H]], bit8];
CDColors.DefineColor[xcyan,
NEW[CDColors.Brick←[0EH*1111H, 0DH*1111H, 0BH*1111H, 07H*1111H]], bw]; -- 04
CDColors.DefineColor[xviolet,
NEW[CDColors.Brick←[10*1111H, 10*1111H, 10*1111H, 10*1111H]], bit4];
CDColors.DefineColor[xviolet,
NEW[CDColors.Brick←[10*1111H, 10*1111H, 10*1111H, 10*1111H]], bit8];
CDColors.DefineColor[xviolet,
NEW[CDColors.Brick←[0EH*1111H, 0DH*1111H, 0BH*1111H, 07H*1111H]], bw]; -- 05
CDColors.DefineColor[xmagenta,
NEW[CDColors.Brick←[10*1111H, 10*1111H, 10*1111H, 10*1111H]], bit4];
CDColors.DefineColor[xmagenta,
NEW[CDColors.Brick←[10*1111H, 10*1111H, 10*1111H, 10*1111H]], bit8];
CDColors.DefineColor[xmagenta,
NEW[CDColors.Brick←[0EH*1111H, 0DH*1111H, 0BH*1111H, 07H*1111H]], bw]; -- 06
CDColors.DefineColor[xwhite,
NEW[CDColors.Brick←[10*1111H, 10*1111H, 10*1111H, 10*1111H]], bit4];
CDColors.DefineColor[xwhite,
NEW[CDColors.Brick←[10*1111H, 10*1111H, 10*1111H, 10*1111H]], bit8];
CDColors.DefineColor[xwhite,
NEW[CDColors.Brick←[0EH*1111H, 0DH*1111H, 0BH*1111H, 07H*1111H]], bw]; -- 07
CDColors.DefineColor[xbrown,
NEW[CDColors.Brick←[10*1111H, 10*1111H, 10*1111H, 10*1111H]], bit4];
CDColors.DefineColor[xbrown,
NEW[CDColors.Brick←[10*1111H, 10*1111H, 10*1111H, 10*1111H]], bit8];
CDColors.DefineColor[xbrown,
NEW[CDColors.Brick←[0EH*1111H, 0DH*1111H, 0BH*1111H, 07H*1111H]], bw]; -- 08
CDColors.DefineColor[xorange,
NEW[CDColors.Brick←[10*1111H, 10*1111H, 10*1111H, 10*1111H]], bit4];
CDColors.DefineColor[xorange,
NEW[CDColors.Brick←[10*1111H, 10*1111H, 10*1111H, 10*1111H]], bit8];
CDColors.DefineColor[xorange,
NEW[CDColors.Brick←[0EH*1111H, 0DH*1111H, 0BH*1111H, 07H*1111H]], bw]; -- 09
CDColors.DefineColor[xlime,
NEW[CDColors.Brick←[10*1111H, 10*1111H, 10*1111H, 10*1111H]], bit4];
CDColors.DefineColor[xlime,
NEW[CDColors.Brick←[10*1111H, 10*1111H, 10*1111H, 10*1111H]], bit8];
CDColors.DefineColor[xlime,
NEW[CDColors.Brick←[0EH*1111H, 0DH*1111H, 0BH*1111H, 07H*1111H]], bw]; -- 10
CDColors.DefineColor[xturquise,
NEW[CDColors.Brick←[10*1111H, 10*1111H, 10*1111H, 10*1111H]], bit4];
CDColors.DefineColor[xturquise,
NEW[CDColors.Brick←[10*1111H, 10*1111H, 10*1111H, 10*1111H]], bit8];
CDColors.DefineColor[xturquise,
NEW[CDColors.Brick←[0EH*1111H, 0DH*1111H, 0BH*1111H, 07H*1111H]], bw]; -- 11
CDColors.DefineColor[xaqua,
NEW[CDColors.Brick←[10*1111H, 10*1111H, 10*1111H, 10*1111H]], bit4];
CDColors.DefineColor[xaqua,
NEW[CDColors.Brick←[10*1111H, 10*1111H, 10*1111H, 10*1111H]], bit8];
CDColors.DefineColor[xaqua,
NEW[CDColors.Brick←[0EH*1111H, 0DH*1111H, 0BH*1111H, 07H*1111H]], bw]; -- 12
CDColors.DefineColor[xultraviolet,
NEW[CDColors.Brick←[10*1111H, 10*1111H, 10*1111H, 10*1111H]], bit4];
CDColors.DefineColor[xultraviolet,
NEW[CDColors.Brick←[10*1111H, 10*1111H, 10*1111H, 10*1111H]], bit8];
CDColors.DefineColor[xultraviolet,
NEW[CDColors.Brick←[0EH*1111H, 0DH*1111H, 0BH*1111H, 07H*1111H]], bw]; -- 13
CDColors.DefineColor[xpink,
NEW[CDColors.Brick←[10*1111H, 10*1111H, 10*1111H, 10*1111H]], bit4];
CDColors.DefineColor[xpink,
NEW[CDColors.Brick←[10*1111H, 10*1111H, 10*1111H, 10*1111H]], bit8];
CDColors.DefineColor[xpink,
NEW[CDColors.Brick←[0EH*1111H, 0DH*1111H, 0BH*1111H, 07H*1111H]], bw]; -- 14
CDColors.DefineColor[xsmoke,
NEW[CDColors.Brick←[10*1111H, 10*1111H, 10*1111H, 10*1111H]], bit4];
CDColors.DefineColor[xsmoke,
NEW[CDColors.Brick←[10*1111H, 10*1111H, 10*1111H, 10*1111H]], bit8];
CDColors.DefineColor[xsmoke,
NEW[CDColors.Brick←[0EH*1111H, 0DH*1111H, 0BH*1111H, 07H*1111H]], bw]; -- 15
CDPanel.DefineLayerEntry[cdsil, xneutral, "black", 0, CD.lambda];
CDPanel.DefineLayerEntry[cdsil, xcyan, "other", 0, CD.lambda];
CDPanel.DefineIntEntry[cdValueKey: $CDxSelectNewMode, tech: cdsil,
text: "select new:", min: 0, max: 1, default: 1];
CDPanel.DefineNewLine[cdsil];
CDPanel.DefineIntEntry[cdValueKey: $CDxStepValue, tech: cdsil, text: "step moves size:", min: 1, default: 4];
CDPanel.DefineIntEntry[cdValueKey: $CDxStretchyMove, tech: cdsil,
text: "stretchy:", min: 0, max: 1, default: 0];
CDPanel.DefineNewLine[cdsil];
CDValue.StoreInt[boundTo: cdsil, key: $CDxInitScale, value: 9];
CDValue.StoreInt[boundTo: cdsil, key: $CDxInitGrid, value: 8];
Commander.Register[
key: "CDSil",
proc: Load,
doc: "loads ChipNSil"
];
Commander.Register[
key: "cdnewsil",
proc: NewSWorld,
doc: "Creates new chipndale 'sil' design"
];
TerminalIO.WriteRope["ChiPencil impl\n"];
END;
Init[]
END.