From e80bed76ce3cc1161e8a581a24ed0b5a802fdc02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C2=A8Rene=20Richarz?= <¨rene.richarz@bluewin.ch¨> Date: Wed, 27 Mar 2019 16:44:45 +0100 Subject: [PATCH] fixed a few bugs related to BSD plotlib --- README.md | 12 ++++++------ tek4010 | Bin 19960 -> 20036 bytes tek4010.c | 51 ++++++++++++++++++++++++++++++++++++++------------- 3 files changed, 44 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 58e05a7..b7fdd71 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,11 @@ There is a file "captured_data" in the repo, which you can use to test the tek40 ./tek4010 /bin/cat captured_data -noexit -Don't forget the absolute path to "cat" and the LAST argument "-noexit", which tells +If you want to test text output, type for example + + ./tek4010 /usr/bin/head -n 32 tek4010.c -noexit + +Don't forget the absolute path to "cat" or "head" and the LAST argument "-noexit", which tells tek4010 to stay alive after cat has finished so that you have a chance to look at the output. By the way, the "-noexit" as the LAST argument might also be helpful if you want to experiment with other commands. Let me know if you find anything which works and makes sense. @@ -60,11 +64,7 @@ If this works properly, you can use the tek4010 emulator. Call it as follows: It the current alpha-testing version, there are very few useful hints if this does not work. If the terminal window is closed right away, there is a problem with your rsh call or you -forgot to use the absolute path for rsh. If it does not work, you might want to try - - ./tek4010 /usr/bin/rsh -l user_name system -noexit - -If you are lucky, rsh will produce an output which might tell you something. +forgot to use the absolute path for rsh. The following keys are not transmitted to the Unix system, but are executed locally in the terminal emulator and clear the persistent screen: diff --git a/tek4010 b/tek4010 index 73077c704313c0d3de0a70241c7bfecb33acd1fb..fe72f317ccac0d2fba94b8054a524b2b01874a29 100755 GIT binary patch delta 4984 zcmb_gYiv}<6`r|k8{6Qpw%6FO_U^SYc)`2N^&03xNo~L)G`1@fNJSc_pkPs#IBjTY zV$@2Phfz>Mh~1$nNuj%yNQ)34$XY200%4MiWp|xa)+EcXz%2 zspsMEZT;DzwNEW6xUnKwQuBV%%Ct+piEe&C)AW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!q0Vxca zFI+0%BDxCPoJ<3R8&O1m)%0V)5d;)c{u99CY6bF4M&p0`h5F6t>|2d@QqJUa{wZ`P*e$4mN6nt-ul6051X?IK{=u zfLwG)(;wIHo4{7Ud@EwWo3NrB3~%A@fGesU=EE6WhQUeX=1) && (mode <=9) && - ((ch==31) || (ch==13))) { - mode = 0; // leave graphics mode + ((ch==31) || (ch==13))) { + mode = 0; // exit from graphics mode showCursor = 0; ch = -1; } @@ -252,15 +252,40 @@ void tek4010_draw(cairo_t *cr, cairo_t *cr2, int width, int height, int first) if ((ch>='0') && (ch<='9')) mode = 30; } - switch (mode) { - case 1: y0 = 32 * (ch - 32); mode++; break; - case 2: y0 = y0 + ch - 96; mode++; break; - case 3: x0 = 32 * (ch - 32); mode++; break; - case 4: x0 = x0 + ch - 64; mode++; break; - case 5: y2 = 32 * (ch - 32); mode++; break; - case 6: y2 = y2 + ch - 96; mode++; break; - case 7: x2 = 32 * (ch - 32); mode++; break; - case 8: x2 = x2 + ch - 64; + if ((mode>=1)&&(mode<=8)) { + if ((mode == 5) && (ch == 29)) { + mode = 1; return; + } + int tag = ch >> 5; + if (tag == 0) { + return; + } + // if (mode & 1) + // printf("H%d-%d,",tag, 32 * (ch & 31)); + // else + // printf("L%d-%d,",tag, ch & 31); + if (tag > 0) { // bytes identified by tag, some can be skipped + if ((mode == 5) && (tag != 1)) mode = 6; + if ((mode == 6) && (tag != 3)) mode = 7; + if ((mode == 7) && (tag != 1)) mode = 8; + } + } + + switch (mode) { + case 1: yh = 32 * (ch & 31); mode++; break; + case 2: yl = (ch & 31); y0 = yh + yl; mode++; break; + case 3: xh = 32 * (ch & 31); mode++; break; + case 4: xl = (ch & 31); x0= xh + xl; mode++; + // printf("\nMoving to (%d,%d)\n",x0,y0); + break; + case 5: yh = 32 * (ch & 31); mode++; break; + case 6: yl = (ch & 31); mode++; break; + case 7: xh = 32 * (ch & 31); mode++; break; + case 8: xl = (ch & 31); + x2 = xh + xl; + y2 = yh + yl; + + // printf("\nDrawing vector to (%d,%d)\n",x2,y2); cairo_move_to(cr, x0, WINDOW_HEIGHT - y0); cairo_line_to(cr, x2, WINDOW_HEIGHT - y2); cairo_stroke (cr);