From 9d38907e95dac76a6b9754562752c36e3f65b9ec Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Tue, 24 Jul 2018 12:18:01 +0200 Subject: [PATCH 1/3] Add G_ARROW (for now same look as G_LINE) Signed-off-by: Clifford Wolf --- common/nextpnr.h | 1 + gui/fpgaviewwidget.cc | 4 ++-- ice40/gfx.cc | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/common/nextpnr.h b/common/nextpnr.h index 021772fe..3ba4f3b3 100644 --- a/common/nextpnr.h +++ b/common/nextpnr.h @@ -147,6 +147,7 @@ struct GraphicElement { G_NONE, G_LINE, + G_ARROW, G_BOX, G_CIRCLE, G_LABEL diff --git a/gui/fpgaviewwidget.cc b/gui/fpgaviewwidget.cc index e21af678..cd288deb 100644 --- a/gui/fpgaviewwidget.cc +++ b/gui/fpgaviewwidget.cc @@ -327,7 +327,7 @@ void FPGAViewWidget::drawDecal(LineShaderData &out, const DecalXY &decal) line.build(out); } - if (el.type == GraphicElement::G_LINE) { + if (el.type == GraphicElement::G_LINE || el.type == GraphicElement::G_ARROW) { PolyLine(offsetX + scale * el.x1, offsetY + scale * el.y1, offsetX + scale * el.x2, offsetY + scale * el.y2) .build(out); } @@ -360,7 +360,7 @@ void FPGAViewWidget::drawDecal(LineShaderData out[], const DecalXY &decal) } } - if (el.type == GraphicElement::G_LINE) { + if (el.type == GraphicElement::G_LINE || el.type == GraphicElement::G_ARROW) { auto line = PolyLine(offsetX + scale * el.x1, offsetY + scale * el.y1, offsetX + scale * el.x2, offsetY + scale * el.y2); switch (el.style) { diff --git a/ice40/gfx.cc b/ice40/gfx.cc index f6ed789f..1b01cbd8 100644 --- a/ice40/gfx.cc +++ b/ice40/gfx.cc @@ -647,7 +647,7 @@ void pipGfx(std::vector &g, int x, int y, float x1, float y1, fl float ty = 0.5 * (y1 + y2); GraphicElement el; - el.type = GraphicElement::G_LINE; + el.type = GraphicElement::G_ARROW; el.style = style; if (fabsf(x1 - swx1) < 0.001 && fabsf(x2 - swx1) < 0.001) { From c3cbc274ac6395b083bea465404ed58f62136194 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Tue, 24 Jul 2018 12:24:14 +0200 Subject: [PATCH 2/3] Change G_FRAME color to be significantly darker than G_ACTIVE Signed-off-by: Clifford Wolf --- gui/fpgaviewwidget.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/fpgaviewwidget.cc b/gui/fpgaviewwidget.cc index cd288deb..7ccb3445 100644 --- a/gui/fpgaviewwidget.cc +++ b/gui/fpgaviewwidget.cc @@ -246,7 +246,7 @@ FPGAViewWidget::FPGAViewWidget(QWidget *parent) { colors_.background = QColor("#000000"); colors_.grid = QColor("#333"); - colors_.frame = QColor("#d0d0d0"); + colors_.frame = QColor("#808080"); colors_.hidden = QColor("#606060"); colors_.inactive = QColor("#303030"); colors_.active = QColor("#f0f0f0"); From c06bca07134b8b52733b025d19fd26910cd9a4e3 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Tue, 24 Jul 2018 12:27:41 +0200 Subject: [PATCH 3/3] Add dummy bba main Signed-off-by: Clifford Wolf --- bba/main.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 bba/main.cc diff --git a/bba/main.cc b/bba/main.cc new file mode 100644 index 00000000..42b79504 --- /dev/null +++ b/bba/main.cc @@ -0,0 +1,15 @@ +#include +#include +int main() +{ + char buffer[512]; + int i, j; + while (1) { + i = read(0, buffer, 512); + if (i == 0) break; + assert(i > 0); + j = write(1, buffer, i); + assert(i == j); + } + return 0; +}