-- THIRD feed-back area module of silicon (pretty picture) program
-- last modified by E. McCreight, December 16, 1982  10:21 AM

DIRECTORY
	ppdddefs,ppddefs,
	ppdefs,ppfeeddefs;
ppfeed3: PROGRAM IMPORTS ppdefs,ppddefs,ppdddefs,ppfeeddefs
EXPORTS ppdddefs,ppfeeddefs =
BEGIN OPEN ppdefs,ppdddefs,ppddefs,ppfeeddefs;

rectLev:PUBLIC level←NOcOL;

fbAr2:PUBLIC ARRAY [0..fbC) OF fbParmR ←[
[sx:320,sy:bwFeedTop+10,s1:"MODE: RECTANGLE",prm:NIL,s2:"",dspPrm:nullDP,
	tx1:320,tx2:320,ty1:bwFeedTop,ty2:bwFeedTop,
	rbP:nullMP,ybP:nullMP,bbP:nullMP,m:0,n:0,code:0,
	chgC:FALSE,chgB:FALSE,setStr:"",setP:nullST],
[sx:415,sy:bwFeedTop+10,s1:"",prm:NIL,
	s2:"",dspPrm:nullDP,
	tx1:415,tx2:415,ty1:bwFeedTop,ty2:bwFeedTop,
	rbP:nullMP,ybP:nullMP,bbP:nullMP,m:7,n:0,code:1,
	chgC:FALSE,chgB:FALSE,setStr:"",setP:nullST],
[sx:320,sy:bwFeedTop+25,s1:"Pushes: ",prm:@pushLevel,s2:"",dspPrm:dspInt,
	tx1:320,tx2:320,ty1:bwFeedTop+25,ty2:bwFeedTop+25,
	rbP:nullMP,ybP:nullMP,bbP:nullMP,m:0,n:0,code:0,
	chgC:FALSE,chgB:FALSE,setStr:"",setP:nullST],
[sx:390,sy:bwFeedTop+25,s1:"Currently In Cell: ",prm:@insideCell,
	s2:"",dspPrm:dspName,
	tx1:370,tx2:370,ty1:bwFeedTop+25,ty2:bwFeedTop+25,
	rbP:nullMP,ybP:nullMP,bbP:nullMP,m:7,n:0,code:1,
	chgC:FALSE,chgB:FALSE,setStr:"",setP:nullST],
[sx:110,sy:bwFeedTop+10,s1:"SCALE:",prm:NIL,s2:"",dspPrm:nullDP,
	tx1:0,tx2:0,ty1:bwFeedTop,ty2:bwFeedTop,
	rbP:nullMP,ybP:nullMP,bbP:nullMP,m:0,n:0,code:0,
	chgC:FALSE,chgB:FALSE,setStr:"",setP:nullST],
[sx:100,sy:bwFeedTop+20,s1:"Col ",prm:@cScale,
	s2:"",dspPrm:dspScl,
	tx1:100,tx2:135,ty1:bwFeedTop+10,ty2:bwFeedTop+115,
	rbP:incScl,ybP:tyScl,bbP:decScl,m:20,n:1,code:1,
	chgC:TRUE,chgB:FALSE,setStr:"clscl",setP:setScl],
[sx:150,sy:bwFeedTop+20,s1:"BW ",prm:@bwScale,
	s2:"",dspPrm:dspScl,
	tx1:150,tx2:185,ty1:bwFeedTop+10,ty2:bwFeedTop+115,
	rbP:incScl,ybP:tyScl,bbP:decScl,m:20,n:1,code:2,
	chgC:FALSE,chgB:TRUE,setStr:"bscl",setP:setScl],
[sx:100,sy:bwFeedTop+130,s1:"n-MOS",prm:NIL,s2:"",dspPrm:dspCM,
	tx1:100,tx2:140,ty1:bwFeedTop+120,ty2:bwFeedTop+130,
	rbP:setCM,ybP:setCM,bbP:setCM,m:0,n:0,code:0,
	chgC:FALSE,chgB:FALSE,setStr:"",setP:nullST],
[sx:150,sy:bwFeedTop+130,s1:"CMOS",prm:NIL,s2:"",dspPrm:dspCM,
	tx1:150,tx2:185,ty1:bwFeedTop+120,ty2:bwFeedTop+130,
	rbP:setCM,ybP:setCM,bbP:setCM,m:0,n:1,code:1,
	chgC:FALSE,chgB:FALSE,setStr:"",setP:nullST],

[sx:465,sy:bwFeedTop+10,s1:"Leave Rectangle Mode",prm:@rectangleMode,
	s2:"",dspPrm:nullDP,
	tx1:465,tx2:605,ty1:bwFeedTop,ty2:bwFeedTop+12,
	rbP:rmButt,ybP:rmButt,bbP:rmButt,m:2048,n:1,code:1,
	chgC:FALSE,chgB:FALSE,setStr:"",setP:nullST],
[sx:200,sy:bwFeedTop+15,s1:"Leave Rect Mode",prm:@rectangleMode,
	s2:"",dspPrm:nullDP,
	tx1:200,tx2:320,ty1:bwFeedTop,ty2:bwFeedTop+17,
	rbP:rmButt,ybP:rmButt,bbP:rmButt,m:2048,n:1,code:1,
	chgC:FALSE,chgB:FALSE,setStr:"",setP:nullST],
[sx:350,sy:bwFeedTop+43,s1:"Leave Rectangle Mode",prm:@rectangleMode,
	s2:"",dspPrm:nullDP,
	tx1:350,tx2:490,ty1:bwFeedTop+30,ty2:bwFeedTop+45,
	rbP:rmButt,ybP:rmButt,bbP:rmButt,m:2048,n:1,code:1,
	chgC:FALSE,chgB:FALSE,setStr:"",setP:nullST],
[sx:415,sy:bwFeedTop+10,s1:"",prm:NIL,
	s2:"",dspPrm:nullDP,
	tx1:415,tx2:415,ty1:bwFeedTop,ty2:bwFeedTop,
	rbP:nullMP,ybP:nullMP,bbP:nullMP,m:7,n:0,code:1,
	chgC:FALSE,chgB:FALSE,setStr:"",setP:nullST],

[sx:220,sy:bwFeedTop+32,s1:"Rectangle Layer:",prm:@rectLev,
	s2:"",dspPrm:nullDP,
	tx1:200,tx2:200,ty1:bwFeedTop,ty2:bwFeedTop,
	rbP:nullMP,ybP:nullMP,bbP:nullMP,m:3,n:0,code:1,
	chgC:FALSE,chgB:FALSE,setStr:"",setP:nullST],
[sx:200,sy:bwFeedTop+48,s1:"Cut",prm:NIL,
	s2:"",dspPrm:dspRL,
	tx1:200,tx2:230,ty1:bwFeedTop+35,ty2:bwFeedTop+48,
	rbP:setRL,ybP:flipLevVisible,bbP:setRL,m:20,n:1,code: LOOPHOLE[level[cut]],
	chgC:FALSE,chgB:FALSE,setStr:"",setP:nullST],
[sx:235,sy:bwFeedTop+48,s1:"Dif",prm:NIL,
	s2:"",dspPrm:dspRL,
	tx1:235,tx2:265,ty1:bwFeedTop+35,ty2:bwFeedTop+48,
	rbP:setRL,ybP:flipLevVisible,bbP:setRL,m:20,n:1,code: LOOPHOLE[level[dif]],
	chgC:FALSE,chgB:FALSE,setStr:"",setP:nullST],
[sx:270,sy:bwFeedTop+48,s1:"Pol",prm:NIL,
	s2:"",dspPrm:dspRL,
	tx1:270,tx2:300,ty1:bwFeedTop+35,ty2:bwFeedTop+48,
	rbP:setRL,ybP:flipLevVisible,bbP:setRL,m:20,n:1,code: LOOPHOLE[level[pol]],
	chgC:FALSE,chgB:FALSE,setStr:"",setP:nullST],
[sx:305,sy:bwFeedTop+48,s1:"Met",prm:NIL,
	s2:"",dspPrm:dspRL,
	tx1:305,tx2:335,ty1:bwFeedTop+35,ty2:bwFeedTop+48,
	rbP:setRL,ybP:flipLevVisible,bbP:setRL,m:20,n:1,code: LOOPHOLE[level[met]],
	chgC:FALSE,chgB:FALSE,setStr:"",setP:nullST],
[sx:200,sy:bwFeedTop+63,s1:"Imp",prm:NIL,
	s2:"",dspPrm:dspRL,
	tx1:200,tx2:230,ty1:bwFeedTop+51,ty2:bwFeedTop+63,
	rbP:setRL,ybP:flipLevVisible,bbP:setRL,m:20,n:1,code: LOOPHOLE[level[imp]],
	chgC:FALSE,chgB:FALSE,setStr:"",setP:nullST],
[sx:235,sy:bwFeedTop+63,s1:"Ovg",prm:NIL,
	s2:"",dspPrm:dspRL,
	tx1:235,tx2:265,ty1:bwFeedTop+51,ty2:bwFeedTop+63,
	rbP:setRL,ybP:flipLevVisible,bbP:setRL,m:20,n:1,code: LOOPHOLE[level[ovg]],
	chgC:FALSE,chgB:FALSE,setStr:"",setP:nullST],
[sx:270,sy:bwFeedTop+63,s1:"Bur",prm:NIL,
	s2:"",dspPrm:dspRL,
	tx1:270,tx2:300,ty1:bwFeedTop+51,ty2:bwFeedTop+63,
	rbP:setRL,ybP:flipLevVisible,bbP:setRL,m:20,n:1,code: LOOPHOLE[level[bur]],
	chgC:FALSE,chgB:FALSE,setStr:"",setP:nullST],
[sx:305,sy:bwFeedTop+63,s1:"Cut2",prm:NIL,
	s2:"",dspPrm:dspRL,
	tx1:305,tx2:335,ty1:bwFeedTop+51,ty2:bwFeedTop+63,
	rbP:setRL,ybP:flipLevVisible,bbP:setRL,m:20,n:1,code: LOOPHOLE[level[cut2]],
	chgC:FALSE,chgB:FALSE,setStr:"",setP:nullST],
[sx:340,sy:bwFeedTop+63,s1:"pDif",prm:NIL,
	s2:"",dspPrm:dspRL,
	tx1:340,tx2:370,ty1:bwFeedTop+51,ty2:bwFeedTop+63,
	rbP:setRL,ybP:flipLevVisible,bbP:setRL,m:20,n:1,code: LOOPHOLE[level[pdif]],
	chgC:FALSE,chgB:FALSE,setStr:"",setP:nullST],
[sx:375,sy:bwFeedTop+63,s1:"Met2",prm:NIL,
	s2:"",dspPrm:dspRL,
	tx1:375,tx2:405,ty1:bwFeedTop+51,ty2:bwFeedTop+63,
	rbP:setRL,ybP:flipLevVisible,bbP:setRL,m:20,n:1,code: LOOPHOLE[level[met2]],
	chgC:FALSE,chgB:FALSE,setStr:"",setP:nullST],
[sx:410,sy:bwFeedTop+63,s1:"nWel",prm:NIL,
	s2:"",dspPrm:dspRL,
	tx1:410,tx2:440,ty1:bwFeedTop+51,ty2:bwFeedTop+63,
	rbP:setRL,ybP:flipLevVisible,bbP:setRL,m:20,n:1,code: LOOPHOLE[level[nwel]],
	chgC:FALSE,chgB:FALSE,setStr:"",setP:nullST],
[sx:445,sy:bwFeedTop+63,s1:"pWel",prm:NIL,
	s2:"",dspPrm:dspRL,
	tx1:445,tx2:475,ty1:bwFeedTop+51,ty2:bwFeedTop+63,
	rbP:setRL,ybP:flipLevVisible,bbP:setRL,m:20,n:1,code: LOOPHOLE[level[pwel]],
	chgC:FALSE,chgB:FALSE,setStr:"",setP:nullST],
[sx:480,sy:bwFeedTop+63,s1:"nwc",prm:NIL,
	s2:"",dspPrm:dspRL,
	tx1:480,tx2:510,ty1:bwFeedTop+51,ty2:bwFeedTop+63,
	rbP:setRL,ybP:flipLevVisible,bbP:setRL,m:20,n:1,code: LOOPHOLE[level[nwelCont]],
	chgC:FALSE,chgB:FALSE,setStr:"",setP:nullST],
[sx:515,sy:bwFeedTop+63,s1:"pwc",prm:NIL,
	s2:"",dspPrm:dspRL,
	tx1:515,tx2:545,ty1:bwFeedTop+51,ty2:bwFeedTop+63,
	rbP:setRL,ybP:flipLevVisible,bbP:setRL,m:20,n:1,code: LOOPHOLE[level[pwelCont]],
	chgC:FALSE,chgB:FALSE,setStr:"",setP:nullST],


[sx:200,sy:bwFeedTop+85,s1:"Curs Grid: ",prm:@lambdaGrid,
	s2:" Pnts",dspPrm:dspInt,
	tx1:205,tx2:290,ty1:bwFeedTop+72,ty2:bwFeedTop+85,
	rbP:incInt,ybP:tyInt,bbP:decInt,m:64,n:1,code:0,
	chgC:FALSE,chgB:FALSE,setStr:"crg",setP:setInt],
[sx:285,sy:bwFeedTop+100,s1:"(",prm:@tickOff,
	s2:")",dspPrm:dspInt,
	tx1:285,tx2:308,ty1:bwFeedTop+87,ty2:bwFeedTop+100,
	rbP:incInt,ybP:tyInt,bbP:decInt,m:99,n:1,code:0,
	chgC:FALSE,chgB:FALSE,setStr:"tkof",setP:setInt],
[sx:200,sy:bwFeedTop+100,s1:"Ticks: ",prm:@tickGrid,
	s2:" Lmbd",dspPrm:dspInt,
	tx1:205,tx2:280,ty1:bwFeedTop+87,ty2:bwFeedTop+100,
	rbP:incInt,ybP:tyInt,bbP:decInt,m:1000,n:0,code:0,
	chgC:TRUE,chgB:FALSE,setStr:"tk",setP:setInt],
[sx:200,sy:bwFeedTop+115,s1:"size cutoff B: ",prm:@bwGrain,
	s2:"",dspPrm:dspInt,
	tx1:200,tx2:290,ty1:bwFeedTop+102,ty2:bwFeedTop+115,
	rbP:incInt,ybP:tyInt,bbP:decInt,m:200,n:0,code:0,
	chgC:FALSE,chgB:TRUE,setStr:"szcb",setP:setInt],
[sx:200,sy:bwFeedTop+130,s1:"       Color: ",prm:@colGrain,
	s2:"",dspPrm:dspInt,
	tx1:200,tx2:290,ty1:bwFeedTop+117,ty2:bwFeedTop+130,
	rbP:incInt,ybP:tyInt,bbP:decInt,m:200,n:0,code:0,
	chgC:TRUE,chgB:FALSE,setStr:"szcc",setP:setInt],
[sx:200,sy:bwFeedTop+145,s1:"Leave Rect Mode",prm:@rectangleMode,
	s2:"",dspPrm:nullDP,
	tx1:200,tx2:320,ty1:bwFeedTop+131,ty2:bwFeedTop+146,
	rbP:rmButt,ybP:rmButt,bbP:rmButt,m:2048,n:1,code:1,
	chgC:FALSE,chgB:FALSE,setStr:"",setP:nullST],
[sx:320,sy:bwFeedTop+130,s1:"Generic Cell Name: ",prm:@locCell,
	s2:"",dspPrm:dspName,
	tx1:300,tx2:300,ty1:bwFeedTop+70,ty2:bwFeedTop+70,
	rbP:nullMP,ybP:nullMP,bbP:nullMP,m:3,n:0,code:1,
	chgC:FALSE,chgB:FALSE,setStr:"",setP:nullST],
[sx:320,sy:bwFeedTop+145,s1:"Instance Name: ",prm:@locIName,
	s2:"",dspPrm:dspName,
	tx1:300,tx2:300,ty1:bwFeedTop+70,ty2:bwFeedTop+70,
	rbP:nullMP,ybP:nullMP,bbP:nullMP,m:3,n:0,code:1,
	chgC:FALSE,chgB:FALSE,setStr:"",setP:nullST],
[sx:320,sy:bwFeedTop+160,s1:"Leave Rectangle Mode",prm:@rectangleMode,
	s2:"",dspPrm:nullDP,
	tx1:320,tx2:460,ty1:bwFeedTop+148,ty2:bwFeedTop+160,
	rbP:rmButt,ybP:rmButt,bbP:rmButt,m:2048,n:1,code:1,
	chgC:FALSE,chgB:FALSE,setStr:"",setP:nullST],
[sx:320,sy:bwFeedTop+85,s1:"Core used: ",prm:NIL,
	s2:" words",dspPrm:dspCore,
	tx1:300,tx2:500,ty1:bwFeedTop+85,ty2:bwFeedTop+85,
	rbP:nullMP,ybP:nullMP,bbP:nullMP,m:3,n:0,code:1,
	chgC:FALSE,chgB:FALSE,setStr:"",setP:nullST],
[sx:320,sy:bwFeedTop+100,s1:"Mark X: ",prm:@markPnt.x,
	s2:"",dspPrm:dspLam,
	tx1:300,tx2:300,ty1:bwFeedTop+70,ty2:bwFeedTop+70,
	rbP:nullMP,ybP:nullMP,bbP:nullMP,m:3,n:0,code:1,
	chgC:FALSE,chgB:FALSE,setStr:"",setP:nullST],
[sx:414,sy:bwFeedTop+100,s1:", Y: ",prm:@markPnt.y,
	s2:" lambda",dspPrm:dspLam,
	tx1:300,tx2:300,ty1:bwFeedTop+85,ty2:bwFeedTop+85,
	rbP:nullMP,ybP:nullMP,bbP:nullMP,m:3,n:0,code:1,
	chgC:FALSE,chgB:FALSE,setStr:"",setP:nullST],
[sx:320,sy:bwFeedTop+115,s1:"Mark DX: ",prm:@markDPnt.x,
	s2:"",dspPrm:dspLam,
	tx1:300,tx2:300,ty1:bwFeedTop+70,ty2:bwFeedTop+70,
	rbP:nullMP,ybP:nullMP,bbP:nullMP,m:3,n:0,code:1,
	chgC:FALSE,chgB:FALSE,setStr:"",setP:nullST],
[sx:414,sy:bwFeedTop+115,s1:", DY: ",prm:@markDPnt.y,
	s2:" lambda",dspPrm:dspLam,
	tx1:300,tx2:300,ty1:bwFeedTop+85,ty2:bwFeedTop+85,
	rbP:nullMP,ybP:nullMP,bbP:nullMP,m:3,n:0,code:1,
	chgC:FALSE,chgB:FALSE,setStr:"",setP:nullST],
[sx:15,sy:bwFeedTop+25,s1:"",prm:NIL,s2:"",dspPrm:dspCMix,
	tx1:5,tx2:90,ty1:bwFeedTop+20,ty2:bwFeedTop+140,
	rbP:setCMix,ybP:moveCMix,bbP:resetCMix
	,m:10,n:bwFeedTop+20,code:60,
	chgC:FALSE,chgB:FALSE,setStr:"ctab",setP:setCmx],
[sx:15,sy:bwFeedTop+5,s1:"",prm:NIL,s2:"",dspPrm:dspCPat,
	tx1:5,tx2:90,ty1:bwFeedTop+2,ty2:bwFeedTop+18,
	rbP:setCPat,ybP:moveCPat,bbP:resetCPat
	,m:10,n:bwFeedTop+5,code:60,
	chgC:TRUE,chgB:FALSE,setStr:"",setP:nullST]];--,

codeRLevx:ARRAY level OF CARDINAL = [0,1,2,3,0,1,2,20,3,4,9,5,7,6,8,20];
codeRLevy:ARRAY level OF CARDINAL = [0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1];

dspRL: dProc =
  BEGIN
  l: level = LOOPHOLE[code];
  Surround[p: [parm.sx, parm.sy], s: parm.s1, gray: NOT showColorLevel[l],
    box: l=rectLev];
  RETURN[x];
  END;
setRL:modProc = {rectLev←LOOPHOLE[code]; parm.chgC ← FALSE};


END.