diff --git a/README.md b/README.md index 979430d..380e722 100644 --- a/README.md +++ b/README.md @@ -234,7 +234,7 @@ tek4010 has the following options: -full in this mode the tek4010 emulator creates a full screen window, and uses the full resolution of the 4014 with the enhanced graphics module installed, scaled down to the actual window size. Use control-q to - close the tek4010 window. This option is experimental. + close the tek4010 window. -ARDS display ARDS data diff --git a/tek4010 b/tek4010 index 3cc78df..168a39e 100755 Binary files a/tek4010 and b/tek4010 differ diff --git a/tektests/circles.c b/tektests/circles.c new file mode 100644 index 0000000..415bcc4 --- /dev/null +++ b/tektests/circles.c @@ -0,0 +1,74 @@ +#define MAXX 1024 +#define MAXY 680 + +#include +#include + +int xs,ys; + +void startDraw(int x1,int y1) +{ + if (x1 < 0) x1 = 0; + if (x1 >= MAXX) x1 = MAXX -1; + if (y1 < 0) y1 = 0; + if (y1 >= MAXY) y1 = MAXY - 1; + putchar(29); + putchar((y1 >> 5) + 32); + putchar((y1 & 31) + 96); + putchar((x1 >> 5) + 32); + putchar((x1 & 31) + 64); + xs = x1; + ys = y1; +} + +void draw(int x2,int y2) +{ + int hxchange, lychange; + + if (x2 < 0) x2 = 0; + if (x2 >= MAXX) x2 = MAXX -1; + if (y2 < 0) y2 = 0; + if (y2 >= MAXY) y2 = MAXY - 1; + + if ((y2 >> 5) != (ys >> 5)) /* if high y has changed */ + putchar((y2 >> 5) + 32); + hxchange = (x2 >> 5) != (xs >> 5); + lychange = (y2 & 31) != (ys & 31); + if (hxchange || lychange) putchar((y2 & 31) + 96); + if (hxchange) /* if high order x has changed */ + putchar((x2 >> 5) + 32); + putchar((x2 & 31) + 64); + xs = x2; + ys = y2; +} + +void endDraw() +{ + putchar(31); + fflush(stdout); +} + +int drawCircle(int x,int y,int r) +{ + int i; + double arg; + startDraw(x + r, y); + for (i = 0; i <= r; i++) { + arg = (double)(i) * 6.283185307 / (double) r; + draw(x + (int)((double)r * cos(arg)), y + (int)((double)r * sin(arg))); + } + endDraw(); +} + +int main (int argc, char *argv[]) +{ + drawCircle(512, 340, 200); + drawCircle(612, 340, 100); + drawCircle(412, 340, 100); + drawCircle(512, 240, 100); + drawCircle(512, 440, 100); + startDraw(212,340); draw(812,340); endDraw(); + startDraw(512,040); draw(512,640); endDraw(); + + startDraw(1,1); endDraw(); // move the cursor out of the way +} diff --git a/tektests/circles.plt b/tektests/circles.plt new file mode 100644 index 0000000..4b4412b --- /dev/null +++ b/tektests/circles.plt @@ -0,0 +1 @@ +*t6HHzG+`GfGmFsEyDC,eAk@q5^w\}Y-cWiTnRtOyLH.dEiAn4^sZxV|Q/aMeHjDn3_rZuUyP|K0`Ec@f2ZhUkOmIpCr1]tWuQwKxEy0_zY{RLF|@{/ZTNzGyAx.[wUuOtIrCp-]mWkQhKfFc@`,[/|UyPuKrFnAj+\eXaS.|OxJsFnBi*_d[-XyTtQnNiLcI,}GwDqBk@e)_+]y\s[mZfY`Y*zYtXnYhYbY){Zu[o\i]c_(}*@wBqDkGeI'LzNtQoTiXd[&_z+BuFpJlOgScX%~\z,AvFsKoPlUh[e-@bF`K$}Q{Wx]v.CtIsOqUp[o/AnGmNTZl0@mFLRnYo_p1EqKsQtWv]x2C{I}O%`UbZe3@hElKoPsUvZz_~4D&cHgMlQpVuZz^5A'dEiHoLtOzRT(eWkYq\w^}6@)cAiCoDuE{F*bGhGnGtH*t6HHzG+`GfFlDrCx@~5^,d[iXnTsQxL|H-aCd4^hYkTnNpHsBt3\vVwPJxDw2^XvRtLsFp@n1ZkThOdJaE,|@x0\sWnTiPdM+~JxHrElDfB`A*zAt@nAhAbB)|DvEpHjJdM(PzTuWp\l1@gEdJ`O'}TzZx2@uFtLrRqX^p3DqJPrVt\u4BxHzN}T(`Yd^g5ClHpLuQzTX)d[j^p6@vC|D*bFhGnGtH*t0@@z/_+`_f^l\r[xX~V,dSiPnLsIxD|@-a.[dVhQkLnFp@s-ZtTvNwHBx,\wVPvJtDs+^pXnRkLhGdBa*],|XxTsOnLiHdE+~Bx@r)]l\fZ`Y*zYtXnYhYbZ)|\v]p*@jBdE(HzLuOpTlXg]d+B`G'}LzRxXu^t,DrJqPVp\q-BHrNtTuZx.@zF}L(`QdVg[l/@pDuIzLP)dSjVpXv[|\*b^h_n_t0@'p3DDvC|C(bBh@n2_t\zZ)`WeTjPoMtHxD}1_*`ZdUgPjJlDo0^pXrRsLFt@s/ZTrNpHoBl.\jVgPdK`F)}Ax-\tXoSjPeL`I(zFtDnAh@b,^'|]v]p\j]d]&~^x-@rAlDfF`I%{LvPqSlXh\c.A`F$|KyPvVt\q/BpHnNmTZl0@mFLnRpXq^t1DvJyP|U%`Zc_h2DlHqMvP{T&`WfZl\r_x3@~B'dCjCpD-x3DD~C.dCjBp@v2_|\/bZhWmTrPwM|H0`De1_hZlUoPrJtDw0^xXzR{LF|@{/ZTzNxHwBt.\rVoPlKhFeA`-\/|XwSrPmLhIbF.|DvAp@j,^d]-~]x\r]l]f^`-@,zAtDnFhIcL+~PyStXp\k.AhFdKaP*~V|\y/BxHvNuTZt0@uFLvRxXy^|1D~J+aPdUhZk_p2DtHyM~P,cThWnZt\z_-`3@fBlCrCxD*t&Tt9L!`0@4@ a A \ No newline at end of file diff --git a/tektests/incremental.c b/tektests/incremental.c index bef8ab8..92cfc99 100644 --- a/tektests/incremental.c +++ b/tektests/incremental.c @@ -21,7 +21,7 @@ void startDraw(int x1,int y1) ys = y1; } -extern void endDraw() +void endDraw() { putchar(31); fflush(stdout); diff --git a/tektests/makefile b/tektests/makefile new file mode 100644 index 0000000..60a0b64 --- /dev/null +++ b/tektests/makefile @@ -0,0 +1,7 @@ +all: incremental circles + +incremental: incremental.c + gcc -o incremental incremental.c -lm + +circles: circles.c + gcc -o circles circles.c -lm