proper h06 and v06
This commit is contained in:
parent
afea345cc7
commit
6e349db55b
63
ecp5/gfx.cc
63
ecp5/gfx.cc
@ -198,46 +198,54 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, int w, int h, IdS
|
|||||||
el.x1 = x + switchbox_x1;
|
el.x1 = x + switchbox_x1;
|
||||||
g.push_back(el);
|
g.push_back(el);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wire_type == id_WIRE_TYPE_H06) {
|
if (wire_type == id_WIRE_TYPE_H06) {
|
||||||
GraphicElement el;
|
GraphicElement el;
|
||||||
el.type = GraphicElement::TYPE_LINE;
|
el.type = GraphicElement::TYPE_LINE;
|
||||||
el.style = style;
|
el.style = style;
|
||||||
|
el.x1 = x + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 10 *(x%9));
|
||||||
el.x1 = x + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3));
|
|
||||||
el.x2 = el.x1;
|
el.x2 = el.x1;
|
||||||
el.y1 = y + switchbox_y1;
|
el.y1 = y + switchbox_y1;
|
||||||
el.y2 = y + switchbox_y1 - 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3));
|
el.y2 = y + switchbox_y1 - 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 10 *(x%9));
|
||||||
|
g.push_back(el);
|
||||||
|
|
||||||
|
int x1 = x + 3;
|
||||||
|
if (x1> w - 1) x1 = w - 1;
|
||||||
|
|
||||||
|
el.x2 = x1 + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 10 *(x%9));
|
||||||
|
el.y1 = el.y2;
|
||||||
|
g.push_back(el);
|
||||||
|
|
||||||
|
el.x1 = el.x2;
|
||||||
|
el.y1 = y + switchbox_y1;
|
||||||
g.push_back(el);
|
g.push_back(el);
|
||||||
|
|
||||||
int x2 = x - 3;
|
int x2 = x - 3;
|
||||||
if (x2<0) x2 = 0;
|
if (x2<0) x2 = 0;
|
||||||
|
|
||||||
el.x1 = x2 + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3));
|
el.x1 = x + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 10 *(x%9));
|
||||||
el.x2 = el.x1;
|
el.x2 = x2 + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 10 *(x%9));
|
||||||
g.push_back(el);
|
el.y2 = y + switchbox_y1 - 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 10 *(x%9));
|
||||||
|
|
||||||
el.x1 = x + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3));
|
|
||||||
el.x2 = x2 + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3));
|
|
||||||
el.y2 = y + switchbox_y1 - 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3));
|
|
||||||
el.y1 = el.y2;
|
el.y1 = el.y2;
|
||||||
g.push_back(el);
|
g.push_back(el);
|
||||||
}
|
|
||||||
|
|
||||||
|
el.x1 = el.x2;
|
||||||
|
el.y1 = y + switchbox_y1;
|
||||||
|
g.push_back(el);
|
||||||
|
}
|
||||||
if (wire_type == id_WIRE_TYPE_V06) {
|
if (wire_type == id_WIRE_TYPE_V06) {
|
||||||
GraphicElement el;
|
GraphicElement el;
|
||||||
el.type = GraphicElement::TYPE_LINE;
|
el.type = GraphicElement::TYPE_LINE;
|
||||||
el.style = style;
|
el.style = style;
|
||||||
el.y1 = y + switchbox_y1 + 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 20 *(y%3));
|
el.y1 = y + switchbox_y1 + 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 10 *(y%9));
|
||||||
el.y2 = el.y1;
|
el.y2 = el.y1;
|
||||||
el.x1 = x + switchbox_x1;
|
el.x1 = x + switchbox_x1;
|
||||||
el.x2 = x + switchbox_x1 - 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 20 *(y%3));
|
el.x2 = x + switchbox_x1 - 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 10 *(y%9));
|
||||||
g.push_back(el);
|
g.push_back(el);
|
||||||
|
|
||||||
int y1 = y + 3;
|
int y1 = y + 3;
|
||||||
if (y1> h - 1) y1 = h - 1;
|
if (y1> h - 1) y1 = h - 1;
|
||||||
|
|
||||||
el.y2 = y1 + switchbox_y1 + 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 20 *(y%3));
|
el.y2 = y1 + switchbox_y1 + 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 10 *(y%9));
|
||||||
el.x1 = el.x2;
|
el.x1 = el.x2;
|
||||||
g.push_back(el);
|
g.push_back(el);
|
||||||
|
|
||||||
@ -248,9 +256,9 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, int w, int h, IdS
|
|||||||
int y2 = y - 3;
|
int y2 = y - 3;
|
||||||
if (y2<0) y2 = 0;
|
if (y2<0) y2 = 0;
|
||||||
|
|
||||||
el.y1 = y + switchbox_y1 + 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 20 *(y%3));
|
el.y1 = y + switchbox_y1 + 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 10 *(y%9));
|
||||||
el.y2 = y2 + switchbox_y1 + 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 20 *(y%3));
|
el.y2 = y2 + switchbox_y1 + 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 10 *(y%9));
|
||||||
el.x2 = x + switchbox_x1 - 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 20 *(y%3));
|
el.x2 = x + switchbox_x1 - 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 10 *(y%9));
|
||||||
el.x1 = el.x2;
|
el.x1 = el.x2;
|
||||||
g.push_back(el);
|
g.push_back(el);
|
||||||
|
|
||||||
@ -258,7 +266,6 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, int w, int h, IdS
|
|||||||
el.x1 = x + switchbox_x1;
|
el.x1 = x + switchbox_x1;
|
||||||
g.push_back(el);
|
g.push_back(el);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wire_type == id_WIRE_TYPE_NONE) {
|
if (wire_type == id_WIRE_TYPE_NONE) {
|
||||||
if (tilewire >= TILE_WIRE_NBOUNCE && tilewire <=TILE_WIRE_SBOUNCE)
|
if (tilewire >= TILE_WIRE_NBOUNCE && tilewire <=TILE_WIRE_SBOUNCE)
|
||||||
{
|
{
|
||||||
@ -411,7 +418,7 @@ void setSource(GraphicElement &el, int x, int y, WireId src, IdString src_type,
|
|||||||
el.y1 = y + switchbox_y1;
|
el.y1 = y + switchbox_y1;
|
||||||
}
|
}
|
||||||
if (src_type == id_WIRE_TYPE_H06) {
|
if (src_type == id_WIRE_TYPE_H06) {
|
||||||
el.x1 = x + switchbox_x1 + 0.0017f*(96 + (src_id - TILE_WIRE_H06W0303)+ 20 *(x%3));
|
el.x1 = x + switchbox_x1 + 0.0017f*(96 + (src_id - TILE_WIRE_H06W0303)+ 10 *(src.location.x%9));
|
||||||
el.y1 = y + switchbox_y1;
|
el.y1 = y + switchbox_y1;
|
||||||
}
|
}
|
||||||
if (src_type == id_WIRE_TYPE_V02) {
|
if (src_type == id_WIRE_TYPE_V02) {
|
||||||
@ -420,7 +427,7 @@ void setSource(GraphicElement &el, int x, int y, WireId src, IdString src_type,
|
|||||||
}
|
}
|
||||||
if (src_type == id_WIRE_TYPE_V06) {
|
if (src_type == id_WIRE_TYPE_V06) {
|
||||||
el.x1 = x + switchbox_x1;
|
el.x1 = x + switchbox_x1;
|
||||||
el.y1 = y + switchbox_y1 + 0.0017f*(96 + (src_id - TILE_WIRE_V06N0303)+ 20 *(y%3));
|
el.y1 = y + switchbox_y1 + 0.0017f*(96 + (src_id - TILE_WIRE_V06N0303)+ 10 *(src.location.y%9));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -431,7 +438,7 @@ void setDestination(GraphicElement &el, int x, int y, WireId dst, IdString dst_t
|
|||||||
el.y2 = y + switchbox_y1;
|
el.y2 = y + switchbox_y1;
|
||||||
}
|
}
|
||||||
if (dst_type == id_WIRE_TYPE_H06) {
|
if (dst_type == id_WIRE_TYPE_H06) {
|
||||||
el.x2 = x + switchbox_x1 + 0.0017f*(96 + (dst_id - TILE_WIRE_H06W0303)+ 20 *(x%3));
|
el.x2 = x + switchbox_x1 + 0.0017f*(96 + (dst_id - TILE_WIRE_H06W0303)+ 10 *(dst.location.x%9));
|
||||||
el.y2 = y + switchbox_y1;
|
el.y2 = y + switchbox_y1;
|
||||||
}
|
}
|
||||||
if (dst_type == id_WIRE_TYPE_V02) {
|
if (dst_type == id_WIRE_TYPE_V02) {
|
||||||
@ -440,7 +447,7 @@ void setDestination(GraphicElement &el, int x, int y, WireId dst, IdString dst_t
|
|||||||
}
|
}
|
||||||
if (dst_type == id_WIRE_TYPE_V06) {
|
if (dst_type == id_WIRE_TYPE_V06) {
|
||||||
el.x2 = x + switchbox_x1;
|
el.x2 = x + switchbox_x1;
|
||||||
el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 20 *(y%3));
|
el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 10 *(dst.location.y%9));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -462,19 +469,19 @@ void gfxTilePip(std::vector<GraphicElement> &g, int x, int y, int w, int h, Wire
|
|||||||
el.y1 = y + switchbox_y1 + 0.0017f*16 - 0.0017f * (src_id - TILE_WIRE_H01E0001);
|
el.y1 = y + switchbox_y1 + 0.0017f*16 - 0.0017f * (src_id - TILE_WIRE_H01E0001);
|
||||||
|
|
||||||
el.x2 = x + switchbox_x1 + (switchbox_x2-switchbox_x1)/2;
|
el.x2 = x + switchbox_x1 + (switchbox_x2-switchbox_x1)/2;
|
||||||
el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 20 *(y%3));
|
el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 10 *(dst.location.y%9));
|
||||||
g.push_back(el);
|
g.push_back(el);
|
||||||
|
|
||||||
el.x1 = x + switchbox_x1 + (switchbox_x2-switchbox_x1)/2;
|
el.x1 = x + switchbox_x1 + (switchbox_x2-switchbox_x1)/2;
|
||||||
el.y1 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 20 *(y%3));
|
el.y1 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 10 *(dst.location.y%9));
|
||||||
el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 20 *(y%3));
|
el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 10 *(dst.location.y%9));
|
||||||
el.x2 = x + switchbox_x1;
|
el.x2 = x + switchbox_x1;
|
||||||
g.push_back(el);
|
g.push_back(el);
|
||||||
} else {
|
} else {
|
||||||
el.x1 = x + switchbox_x2;
|
el.x1 = x + switchbox_x2;
|
||||||
el.y1 = y + switchbox_y1 + 0.0017f*16 - 0.0017f * (src_id - TILE_WIRE_H01E0001);
|
el.y1 = y + switchbox_y1 + 0.0017f*16 - 0.0017f * (src_id - TILE_WIRE_H01E0001);
|
||||||
|
|
||||||
el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 20 *(y%3));
|
el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 10 *(dst.location.y%9));
|
||||||
el.x2 = x + switchbox_x1;
|
el.x2 = x + switchbox_x1;
|
||||||
g.push_back(el);
|
g.push_back(el);
|
||||||
}
|
}
|
||||||
@ -576,7 +583,6 @@ void gfxTilePip(std::vector<GraphicElement> &g, int x, int y, int w, int h, Wire
|
|||||||
setDestination(el,x,y,dst,dst_type,dst_id);
|
setDestination(el,x,y,dst,dst_type,dst_id);
|
||||||
g.push_back(el);
|
g.push_back(el);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_H02) {
|
if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_H02) {
|
||||||
setSource(el,x,y,src,src_type,src_id);
|
setSource(el,x,y,src,src_type,src_id);
|
||||||
el.x2 = el.x1;
|
el.x2 = el.x1;
|
||||||
@ -597,7 +603,6 @@ void gfxTilePip(std::vector<GraphicElement> &g, int x, int y, int w, int h, Wire
|
|||||||
el2.y1 = el.y1;
|
el2.y1 = el.y1;
|
||||||
g.push_back(el2);
|
g.push_back(el2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_H06) {
|
if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_H06) {
|
||||||
setSource(el,x,y,src,src_type,src_id);
|
setSource(el,x,y,src,src_type,src_id);
|
||||||
el.x2 = el.x1;
|
el.x2 = el.x1;
|
||||||
|
Loading…
Reference in New Issue
Block a user