X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Fcom%2Fatmel%2Ffpslic%2FFpslic.java;h=5056ba2dd61fcb5e116cbeee8e4fa4167ae5f4b5;hb=05bfa73d5415e19943cf36c094dbdb50304a341c;hp=0daf3779ba856248013f8bb237538f97a9cf5a82;hpb=ce3e555b762e4c39e7eacbea061c114ce1f1bbc1;p=slipway.git diff --git a/src/com/atmel/fpslic/Fpslic.java b/src/com/atmel/fpslic/Fpslic.java index 0daf377..5056ba2 100644 --- a/src/com/atmel/fpslic/Fpslic.java +++ b/src/com/atmel/fpslic/Fpslic.java @@ -176,6 +176,8 @@ public abstract class Fpslic { this.col = col; } + public Fpslic fpslic() { return Fpslic.this; } + // Accessors for Neighbors ////////////////////////////////////////////////////////////////////////////// public SectorWire hwire(int plane) { return new SectorWire(true, plane, col, row); } @@ -598,6 +600,30 @@ public abstract class Fpslic { } } + public Cell dir(int i) { + switch(i) { + case NORTH: return north(); + case SOUTH: return south(); + case EAST: return east(); + case WEST: return west(); + case NW: return nw(); + case SW: return sw(); + case SE: return se(); + case NE: return ne(); + } + return null; + } + public int dir(Cell c) { + if (c.row==row-1 && c.col==col-1) return SW; + else if (c.row==row+1 && c.col==col-1) return NW; + else if (c.row==row-1 && c.col==col+1) return SE; + else if (c.row==row+1 && c.col==col+1) return NE; + else if (c.row==row-1 && c.col==col) return SOUTH; + else if (c.row==row+1 && c.col==col) return NORTH; + else if (c.row==row && c.col==col-1) return WEST; + else if (c.row==row && c.col==col+1) return EAST; + return -1; + } public void generalized_c_element() { @@ -703,7 +729,9 @@ public abstract class Fpslic { } return out && connect; } + public boolean fb_relevant() { + /* if (!(zi_to_xlut_relevant()) || !(zi_to_ylut_relevant())) return false; switch(ti()) { @@ -713,6 +741,8 @@ public abstract class Fpslic { case 0x30: return true; } return false; + */ + return true; }