CDSilImpl.mesa
Copyright © 1983, 1985 by Xerox Corporation. All rights reserved.
by Ch. Jacobi August 11, 1983 3:56 pm
Last Edited by: Ch. Jacobi, April 11, 1985 4:06:36 pm PST
gbb September 13, 1985 2:08:54 pm PDT
DIRECTORY
CD USING [Design, lambda, Layer, NewLayer, RegisterTechnology, Technology],
CDColors USING [Brick, DefineColor],
CDOps USING [CreateDesign],
CDPanel USING [DefineIntEntry, DefineLayerEntry, DefineNewLine],
CDSil USING [],
CDTipEtc USING [SetTipTable],
CDValue USING [StoreInt],
CDViewer USING [CreateViewer],
Commander USING [CommandProc, Register],
IO USING [PutRope],
Rope USING [ROPE],
TerminalIO USING [WriteRope];
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 with the addition of blue.
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
xblue: PUBLIC CD.Layer;  -- not a Sil color
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
s1: CARDINAL = 1;
s2: CARDINAL = 16;
s3: CARDINAL = 16*16;
s4: CARDINAL = 16*16*16;
ss: CARDINAL = s1+s2+s3+s4;
--4bit colors--
blue: CARDINAL = 1;
green: CARDINAL = 2;
red: CARDINAL = 4;
yellow: CARDINAL = 14;
black: CARDINAL = 0FFFFH;
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
xblue ← CD.NewLayer[cdsil, $xblue];  -- not a Sil color
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←[8*s1, 0, 0, 0]], bit4];
CDColors.DefineColor[xneutral,
NEW[CDColors.Brick←[05H*1111H, 0AH*1111H, 05H*1111H, 0AH*1111H]], bw]; -- 00
CDColors.DefineColor[xneutral,
NEW[CDColors.Brick←[black, black, black, black]], bw]; -- 00
CDColors.DefineColor[xred,
NEW[CDColors.Brick←[7*ss, 11*ss, 7*ss, 11*ss]], bit4];
CDColors.DefineColor[xred,
NEW[CDColors.Brick←[8*ss, 4*ss, 2*ss, 1*ss]], bw]; -- 01
CDColors.DefineColor[xyellow,
NEW[CDColors.Brick←[yellow*ss, yellow*ss, yellow*ss, yellow*ss]], bit4];
CDColors.DefineColor[xyellow,
NEW[CDColors.Brick←[2*ss, 0, 2*ss, 0]], bw]; -- 02
CDColors.DefineColor[xgreen,
NEW[CDColors.Brick←[green*ss, green*ss, green*ss, green*ss]], bit4];
CDColors.DefineColor[xgreen,
NEW[CDColors.Brick←[4*ss, ss, 4*ss, ss]], bw]; -- 03
CDColors.DefineColor[xcyan,
NEW[CDColors.Brick←[2*(s1+s2+s3), 2*ss, 2*(s1+s2+s3)+15*s4, 2*ss]], bit4];
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←[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←[8*ss, 8*ss, 2*ss, 2*ss]], bw]; -- 06
CDColors.DefineColor[xwhite,
NEW[CDColors.Brick←[11*ss, 11*ss, 11*ss, 11*ss]], bit4];
CDColors.DefineColor[xwhite,
NEW[CDColors.Brick←[4*ss, 0, 0, 0]], bw]; -- 07
CDColors.DefineColor[xbrown,
NEW[CDColors.Brick←[10*1111H, 10*1111H, 10*1111H, 10*1111H]], bit4];
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←[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←[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←[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←[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←[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←[8*ss, 2*ss, 0, 0]], bw]; -- 14
CDColors.DefineColor[xsmoke,
NEW[CDColors.Brick←[red*ss, red*ss, red*ss, red*ss]], bit4];
CDColors.DefineColor[xsmoke,
NEW[CDColors.Brick←[4*ss, 14*ss, 4*ss, 0*ss]], bw]; -- 15
CDColors.DefineColor[xblue,
NEW[CDColors.Brick←[blue*ss, blue*ss, blue*ss, blue*ss]], bit4];
CDColors.DefineColor[xblue,
NEW[CDColors.Brick←[7*ss, 11*ss, 7*ss, 11*ss]], bw]; -- not Sil
CDPanel.DefineLayerEntry[cdsil, xneutral, "black", 0, CD.lambda];
CDPanel.DefineLayerEntry[cdsil, xwhite, "white", 0, CD.lambda];
CDPanel.DefineLayerEntry[cdsil, xsmoke, "grey", 0, CD.lambda];
CDPanel.DefineLayerEntry[cdsil, xred, "red", 0, CD.lambda];
CDPanel.DefineLayerEntry[cdsil, xgreen, "green", 0, CD.lambda];
CDPanel.DefineLayerEntry[cdsil, xblue, "blue", 0, CD.lambda];
CDPanel.DefineLayerEntry[cdsil, xcyan, "cyan", 0, CD.lambda];
CDPanel.DefineLayerEntry[cdsil, xmagenta, "magenta", 0, CD.lambda];
CDPanel.DefineLayerEntry[cdsil, xyellow, "yellow", 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["ChipNSil loaded [September 13, 1985\n"];
END;
Init[]
END.