mirror of
https://github.com/rricharz/Tek4010.git
synced 2026-01-11 23:53:16 +00:00
adding -APL option
This commit is contained in:
parent
86adc87d80
commit
8f62ceb359
25
README.md
25
README.md
@ -244,6 +244,31 @@ tek4010 has the following options:
|
||||
|
||||
-ARDS display ARDS data
|
||||
|
||||
-APL emulate Tektronix 4013/4015 with alternative APL character set.
|
||||
This mode is experimental. Details see below.
|
||||
|
||||
**APL mode**
|
||||
|
||||
If tek4010 is called with the -APL argument, a Tektronix 4013 and Tektronix 4015 is emulated
|
||||
with the alternative APL character set. In this mode, the following control keyboard characters
|
||||
are active:
|
||||
|
||||
<control>n Switch to APL character set
|
||||
<control>o Switch to normal character set
|
||||
|
||||
In this case one can also send "ESC <control>n" and "ESC <control>o" from the computer to switch
|
||||
the character set.
|
||||
|
||||
If you want to use the APL mode, you need to install the Apl385 font. Starting from the Tek4010
|
||||
directory, type
|
||||
|
||||
cd apl
|
||||
sudo install_apl
|
||||
|
||||
While still being in the apl directory, you can test the APL character set using
|
||||
|
||||
../tek4010 -APL -noexit ./apltest
|
||||
|
||||
**Reporting problems**
|
||||
|
||||
If everything works properly for you, but your graphics application produces garbage on the
|
||||
|
||||
BIN
apl/Apl385.ttf
Normal file
BIN
apl/Apl385.ttf
Normal file
Binary file not shown.
BIN
apl/apltest
Executable file
BIN
apl/apltest
Executable file
Binary file not shown.
31
apl/apltest.c
Normal file
31
apl/apltest.c
Normal file
@ -0,0 +1,31 @@
|
||||
// apltest.c
|
||||
// display alternative character set for apl
|
||||
//
|
||||
// usage: tek4010 -noexit ./apltest
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
int ch;
|
||||
|
||||
printf("\nStandard character set:\n");
|
||||
for (ch = 32; ch <= 126; ch++) {
|
||||
if ((ch % 32) == 0) {
|
||||
printf("\n%02X ", ch);
|
||||
}
|
||||
printf("%c", ch);
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
printf("\nAPL character set:\n");
|
||||
putchar(27); putchar(14); // switch to alternative character set
|
||||
for (ch = 32; ch <= 126; ch++) {
|
||||
if ((ch % 32) == 0) {
|
||||
printf("\n%02X ", ch);
|
||||
}
|
||||
printf("%c", ch);
|
||||
}
|
||||
putchar(27); putchar(15); // switch back to standard character set
|
||||
printf("\n");
|
||||
}
|
||||
6
apl/install_apl
Executable file
6
apl/install_apl
Executable file
@ -0,0 +1,6 @@
|
||||
# install_apl - install apl font
|
||||
|
||||
mkdir /usr/share/fonts/truetype/apl385
|
||||
cp Apl385.ttf /usr/share/fonts/truetype/apl385
|
||||
|
||||
fc-cache /usr/share/fonts
|
||||
5
apl/makefile
Normal file
5
apl/makefile
Normal file
@ -0,0 +1,5 @@
|
||||
all: apltest
|
||||
|
||||
apltest: apltest.c
|
||||
gcc -o apltest apltest.c
|
||||
|
||||
2
ards.c
2
ards.c
@ -106,7 +106,7 @@ void ards_draw(cairo_t *cr, cairo_t *cr2, int first)
|
||||
tube_clearPersistent(cr,cr2);
|
||||
}
|
||||
|
||||
tube_setupPainting(cr, cr2, "Monospace");
|
||||
tube_setupPainting(cr, cr2, STANDARD_FONT);
|
||||
|
||||
do {
|
||||
ch = tube_getInputChar();
|
||||
|
||||
14
main.c
14
main.c
@ -179,6 +179,16 @@ static void on_key_press(GtkWidget *widget, GdkEventKey *event, gpointer user_da
|
||||
on_quit_event();
|
||||
return;
|
||||
}
|
||||
else if (argAPL && (event->keyval == 0x006E)) { // "<ctrl>n" switch to alternative character set
|
||||
aplMode = 1;
|
||||
printf("Setting APL mode to 1 from keyboard\n");
|
||||
return;
|
||||
}
|
||||
else if (argAPL && (event->keyval == 0x006F)) { // "<ctrl>o" switch to normalcharacter set
|
||||
aplMode = 0;
|
||||
printf("Setting APL mode to 0 from keyboard\n");
|
||||
return;
|
||||
}
|
||||
else
|
||||
ch = event->keyval & 0x1F;
|
||||
}
|
||||
@ -196,8 +206,10 @@ static void on_key_press(GtkWidget *widget, GdkEventKey *event, gpointer user_da
|
||||
gtk_widget_queue_draw(widget);
|
||||
}
|
||||
|
||||
else if (putKeys)
|
||||
else if (putKeys) {
|
||||
if (aplMode) printf("sending character %d to host\n", ch);
|
||||
putc(ch,putKeys); // pipe key to child process, if stream open
|
||||
}
|
||||
}
|
||||
|
||||
int main (int argc, char *argv[])
|
||||
|
||||
49683
manuals/4015_User_Manual.pdf
Normal file
49683
manuals/4015_User_Manual.pdf
Normal file
File diff suppressed because one or more lines are too long
@ -1,7 +1,9 @@
|
||||
All Tektronix manuals have been obtained from http://bitsavers.org/pdf/tektronix/401x/
|
||||
The ARDS manual has been obtained from http://www.bitsavers.org/pdf/computerDisplaysInc/
|
||||
The Tektronix 4015 manual has been obtained from http://bitsavers.informatik.uni-stuttgart.de/pdf/tektronix/401x/
|
||||
|
||||
Further interesting references:
|
||||
|
||||
ARDS ad: http://www.dvq.com/ads/cdi_dm_4_70.jpg
|
||||
Tektronix T4002 ad: http://www.dvq.com/ads/tek_t4002_dm_4_70.jpg
|
||||
ARDS ad: http://www.dvq.com/ads/cdi_dm_4_70.jpg
|
||||
Tektronix T4002 ad: http://www.dvq.com/ads/tek_t4002_dm_4_70.jpg
|
||||
TekGraphics: Introducing APL: https://vintagetek.org/wp-content/uploads/2019/01/APL_TekGraphics_Feb1973.pdf
|
||||
|
||||
22
tek4010.c
22
tek4010.c
@ -202,8 +202,19 @@ void tek4010_escapeCodeHandler(cairo_t *cr, cairo_t *cr2, int ch)
|
||||
tube_clearPersistent(cr,cr2);
|
||||
mode = 0; break;
|
||||
case 13:mode = 0; break;
|
||||
case 14: // SO activate alternative char set, not implemented
|
||||
case 15: // SI deactivate alternative char set, not implemented
|
||||
case 14: // SO activate alternative char set
|
||||
if (argAPL) { // switch only of argAPL is set
|
||||
aplMode = 1;
|
||||
printf("Setting APL mode to 1 from computer\n");
|
||||
}
|
||||
mode = 0;
|
||||
todo = 0;
|
||||
break;
|
||||
case 15: // SI deactivate alternative char set
|
||||
aplMode = 0;
|
||||
mode = 0;
|
||||
todo = 0;
|
||||
printf("Setting APL mode to 0 from computer\n");
|
||||
break;
|
||||
|
||||
case 23: system("scrot --focussed"); mode= 0; break;
|
||||
@ -321,7 +332,10 @@ void tek4010_draw(cairo_t *cr, cairo_t *cr2, int first)
|
||||
tube_changeCharacterSize(cr, cr2, 74, 35, (int) (18.0 * efactor));
|
||||
}
|
||||
|
||||
tube_setupPainting(cr, cr2, "Monospace");
|
||||
if (aplMode)
|
||||
tube_setupPainting(cr, cr2, APL_FONT);
|
||||
else
|
||||
tube_setupPainting(cr, cr2, STANDARD_FONT);
|
||||
|
||||
if (plotPointMode)
|
||||
todo = 16 * TODO;
|
||||
@ -344,6 +358,8 @@ void tek4010_draw(cairo_t *cr, cairo_t *cr2, int first)
|
||||
if (mode != 60) return; // no char available, need to allow for updates
|
||||
}
|
||||
|
||||
if (aplMode) printf("Receiving character %d from host\n", ch);
|
||||
|
||||
if (DEBUG) {
|
||||
printf("mode=%d, ch code %02X",mode,ch);
|
||||
if ((ch>0x20)&&(ch<=0x7E)) printf(" (%c)",ch);
|
||||
|
||||
154
tube.c
154
tube.c
@ -46,6 +46,7 @@
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <sys/time.h>
|
||||
#include <locale.h>
|
||||
|
||||
#include "main.h"
|
||||
#include "tube.h"
|
||||
@ -61,6 +62,7 @@ int argBaud = 19200;
|
||||
int argTab1 = 0;
|
||||
int argFull = 0;
|
||||
int argARDS = 0;
|
||||
int argAPL = 0;
|
||||
|
||||
int refresh_interval; // after this time in msec next refresh is done
|
||||
|
||||
@ -80,6 +82,7 @@ int tube_doClearPersistent;
|
||||
int specialPlotMode = 0;
|
||||
int defocussed = 0;
|
||||
int intensity = 100;
|
||||
int aplMode = 0;
|
||||
|
||||
int tube_x0, tube_x2,tube_y0, tube_y2;
|
||||
|
||||
@ -180,7 +183,7 @@ void tube_init(int argc, char* argv[])
|
||||
char *argv2[20];
|
||||
size_t bufsize = 127;
|
||||
int firstArg = 1;
|
||||
printf("tek4010 version 1.3.1\n");
|
||||
printf("tek4010 version 1.3.2\n");
|
||||
windowName = "Tektronix 4010/4014 emulator";
|
||||
if ((argc<2) || (argc>19)) {
|
||||
printf("Error:number of arguments\n");
|
||||
@ -214,6 +217,10 @@ void tube_init(int argc, char* argv[])
|
||||
argTab1 = 1;
|
||||
else if (strcmp(argv[firstArg],"-full") == 0)
|
||||
argFull = 1;
|
||||
else if (strcmp(argv[firstArg],"-APL") == 0) {
|
||||
argAPL = 1;
|
||||
windowName = "Tektronix 4013/4015 emulator (APL)";
|
||||
}
|
||||
else if (strcmp(argv[firstArg],"-ARDS") == 0) {
|
||||
argARDS = 1;
|
||||
windowName = "ARDS emulator";
|
||||
@ -471,9 +478,148 @@ void tube_line_type(cairo_t *cr, cairo_t *cr2, enum LineType ln)
|
||||
|
||||
void tube_drawCharacter(cairo_t *cr, cairo_t *cr2, char ch)
|
||||
{
|
||||
char s[2];
|
||||
s[0] = ch;
|
||||
s[1] = 0;
|
||||
char s[8];
|
||||
|
||||
if (ch < 32) return; // non printable control character
|
||||
|
||||
if (aplMode) {
|
||||
switch (ch) {
|
||||
case 32: sprintf(s," ");
|
||||
break;
|
||||
case 33: sprintf(s,"\u00A8");
|
||||
break;
|
||||
case 34: sprintf(s,")");
|
||||
break;
|
||||
case 35: sprintf(s,"<");
|
||||
break;
|
||||
case 36: sprintf(s,"\u2264");
|
||||
break;
|
||||
case 37: sprintf(s,"=");
|
||||
break;
|
||||
case 38: sprintf(s,">");
|
||||
break;
|
||||
case 39: sprintf(s,"]");
|
||||
break;
|
||||
case 40: sprintf(s,"\u2228");
|
||||
break;
|
||||
case 41: sprintf(s,"\u2227");
|
||||
break;
|
||||
case 42: sprintf(s,"\u2260");
|
||||
break;
|
||||
case 43: sprintf(s,"\u00F7");
|
||||
break;
|
||||
case 44: sprintf(s,",");
|
||||
break;
|
||||
case 45: sprintf(s,"+");
|
||||
break;
|
||||
case 46: sprintf(s,".");
|
||||
break;
|
||||
case 47: sprintf(s,"/");
|
||||
break;
|
||||
|
||||
// 48 - 57: Digits
|
||||
|
||||
case 58: sprintf(s,"(");
|
||||
break;
|
||||
case 59: sprintf(s,"[");
|
||||
break;
|
||||
case 60: sprintf(s,";");
|
||||
break;
|
||||
case 61: sprintf(s,"x");
|
||||
break;
|
||||
case 62: sprintf(s,":");
|
||||
break;
|
||||
case 63: sprintf(s,"\\");
|
||||
break;
|
||||
case 64: sprintf(s,"\u2212"); // probably wrong
|
||||
break;
|
||||
case 65: sprintf(s,"\u237A");
|
||||
break;
|
||||
case 66: sprintf(s,"\u22A5");
|
||||
break;
|
||||
case 67: sprintf(s,"\u2229");
|
||||
break;
|
||||
case 68: sprintf(s,"\u230A");
|
||||
break;
|
||||
case 69: sprintf(s,"\u220A");
|
||||
break;
|
||||
case 70: sprintf(s,"_");
|
||||
break;
|
||||
case 71: sprintf(s,"\u2207");
|
||||
break;
|
||||
case 72: sprintf(s,"\u2206");
|
||||
break;
|
||||
case 73: sprintf(s,"\u23B1"); // does not work
|
||||
break;
|
||||
case 74: sprintf(s,"\u2218");
|
||||
break;
|
||||
case 75: sprintf(s,"'");
|
||||
break;
|
||||
case 76: sprintf(s,"\u2395");
|
||||
break;
|
||||
case 77: sprintf(s,"|");
|
||||
break;
|
||||
case 78: sprintf(s,"\u22A4");
|
||||
break;
|
||||
case 79: sprintf(s,"o");
|
||||
break;
|
||||
|
||||
case 80: sprintf(s,"*");
|
||||
break;
|
||||
case 81: sprintf(s,"?");
|
||||
break;
|
||||
case 82: sprintf(s,"\u03C1");
|
||||
break;
|
||||
case 83: sprintf(s,"\u2308");
|
||||
break;
|
||||
case 84: sprintf(s,"~");
|
||||
break;
|
||||
case 85: sprintf(s,"\u2193");
|
||||
break;
|
||||
case 86: sprintf(s,"\u222A");
|
||||
break;
|
||||
case 87: sprintf(s,"\u03C9");
|
||||
break;
|
||||
case 88: sprintf(s,"\u2283");
|
||||
break;
|
||||
case 89: sprintf(s,"\u2191");
|
||||
break;
|
||||
case 90: sprintf(s,"\u2282");
|
||||
break;
|
||||
case 91: sprintf(s,"\u2190");
|
||||
break;
|
||||
case 92: sprintf(s,"\u22A2");
|
||||
break;
|
||||
case 93: sprintf(s,"\u2192");
|
||||
break;
|
||||
case 94: sprintf(s,"\u2265");
|
||||
break;
|
||||
case 95: sprintf(s,"-");
|
||||
break;
|
||||
case 96: sprintf(s,"\u22C4");
|
||||
break;
|
||||
|
||||
// 97 - 122 capital letters
|
||||
|
||||
case 123: sprintf(s,"{");
|
||||
break;
|
||||
case 124: sprintf(s,"\u22A3");
|
||||
break;
|
||||
case 125: sprintf(s,"}");
|
||||
break;
|
||||
case 126: sprintf(s,"$");
|
||||
break;
|
||||
|
||||
default: if ((ch>=48) && (ch<=57)) sprintf(s,"%c", ch); // digits
|
||||
else if ((ch>=97) && (ch<=122)) sprintf(s,"%c", ch - 32); // capital letters
|
||||
else sprintf(s," ");
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
s[0] = ch;
|
||||
s[1] = 0;
|
||||
}
|
||||
|
||||
cairo_set_font_size(cr, currentFontSize);
|
||||
cairo_set_font_size(cr2,currentFontSize);
|
||||
|
||||
6
tube.h
6
tube.h
@ -1,5 +1,9 @@
|
||||
// tube.h
|
||||
|
||||
// fonts
|
||||
#define STANDARD_FONT "Monospace"
|
||||
#define APL_FONT "APL385 Unicode"
|
||||
|
||||
enum LineType {SOLID,DOTTED,DOTDASH,SHORTDASH,LONGDASH};
|
||||
extern enum LineType ltype;
|
||||
|
||||
@ -10,6 +14,7 @@ extern int windowHeight;
|
||||
extern int argFull;
|
||||
extern int argTab1;
|
||||
extern int argRaw;
|
||||
extern int argAPL;
|
||||
|
||||
extern int hDotsPerChar;
|
||||
extern int vDotsPerChar;
|
||||
@ -24,6 +29,7 @@ extern int isGinMode; // set if GIN mode is active
|
||||
extern int specialPlotMode;
|
||||
extern int defocussed;
|
||||
extern int intensity;
|
||||
extern int aplMode;
|
||||
|
||||
extern int plotPointMode;
|
||||
extern int writeThroughMode;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user