The above was corresponds to 4010 (4014) of monochrome display.
"Tera Term" also corresponds to 410x of color display.
Therefore, I added the "Tekcolor" command for specifying the drawing color.
Computer screen [url=http://www.ne.jp/asahi/shared/o-family/ElecRoom/AVRMCOM/TEK4010/TEK4010gdispj.gif][img:b909ac8d4e]http://www.ne.jp/asahi/shared/o-family/ElecRoom/AVRMCOM/TEK4010/TEK4010gdispjs.jpg[/img:b909ac8d4e][/url]
1.Download and install the latest version of "[url=http://ttssh2.sourceforge.jp/index.html.en]Tera Term[/url]" from "SourceForge.jp".
2.[Setup] -> [Serial port] -> "Serial port setup" dialog box.Set the baud rate.
3.[Setup] -> [Terminal] -> "Terminal setup" dialog box. Enable the "Auto switch (VT<->TEK)".
4.[Control] -> [Open TEK] -> Opens the TEK window.
[Setup] -> [Font] -> "Font" dialog box. Font size is changed into any value. (Example: Size 16)
5.[Setup] -> [Window] -> "Window setup" dialog box. Enable the "Color emulation".
Background color, you can change by "Reverse" button.
6.[VT-window] -> Return to the "VT-window".
[Setup] -> [Save setup] -> "Save setup" dialog box. Save the settings.
[code:1:b909ac8d4e]
'
' ********************************************************
' * Tektronix 4010(4014,410x) Graphic Terminal Library *
' * [Ver.2] O-Family 2015. 1. 5 *
' ********************************************************
'
$regfile = "m88pdef.dat" 'Any chip.
$crystal = 16000000 'Any frequency.
'
$hwstack = 64
$swstack = 32
$framesize = 24
$baud = 9600 'Set the baud rate.
'--------- Include a control instruction of TEK4010. ---------
Dim _temptx As Byte 'Internal variables of the library.
_temptx = &H1F : Printbin _temptx '[US] Changes Terminal to Alpha Mode.
$lib "TEK4010emu.lib" 'Tektronix 4010(4014,410x) graphic terminal (emulator) library.
$external Tekcls , Tekline , Tekbox , Tekpset , Teklocate , Tekgraph , Tekalpha , Tekplot , Tekcolor
Declare Sub Tekcls : Declare Sub Tekalpha : Declare Sub Teklocate(byval _tekx0 As Word , Byval _teky0 As Word)
Declare Sub Tekline(byval _tekx0 As Word , Byval _teky0 As Word , Byval _tekx1 As Word , Byval _teky1 As Word , Byval _tekvt As Byte)
Declare Sub Tekbox(byval _tekx0 As Word , Byval _teky0 As Word , Byval _tekx1 As Word , Byval _teky1 As Word , Byval _tekvt As Byte)
Declare Sub Tekpset(byval _tekx0 As Word , Byval _teky0 As Word) : Declare Sub Tekcolor(byval _tekcol As Byte)
Declare Sub Tekgraph(byval _tekvt As Byte) : Declare Sub Tekplot(byval _tekx0 As Word , Byval _teky0 As Word)
'
' Tekcls <Clear the Vector and Alpha Screen.>
' Tekcolor Color [0 = Black, 1 = Red, 2 = Green, 3 = Yellow, 4 = Blue, 5 = Magenta, 6 = Cyan, 7 = White] <Set a color of the drawing.>
' Tekline X(start) , Y(start) , X(end) , Y(end) , Vector-Type [X = 0 - 1023 , Y = 0 - 778 , Vector-Type = 0 - 23] <Draws a line.>
' [Vector-Type = 0:normal line , 1:dotted line , 2:dot-dashed , 3:short-dashed , 4:long-dashed]
' Tekbox X(left corner) , Y(top position) , X(right corner) , Y(bottom position) , Vector-Type <Write a box.>
' Tekpset X(location) , Y(location) [X = 0 - 1023 , Y = 0 - 778] <Set a single pixel.>
' Teklocate X(location) , Y(location) [X = 0 - 1023 , Y = 0 - 778] <Moves the Alpha cursor to the specified position.>
' Tekgraph Vector-Type [Vector-Type = 0 - 23] <Sets Terminal to Graph Mode , Select the vector type.>
' Tekplot X(location) , Y(location) [X = 0 - 1023 , Y = 0 - 778] <Plot the graph line.> Note: Perform Tekgraph.
' Tekalpha <Terminal is returned to alpha mode.>
'-------------------------------------------------------------
' ************************
' * Drawing test program *
' ************************
Dim W1 As Word , W2 As Word , W3 As Word , S1 As Single , S2 As Single , B As Byte
Tekcolor 7 'Drawing color [white].
Tekcls 'Clear the Vector and Alpha Screen.
Print "Tektronix 4010(4014,410x) graphic terminal (emulator)"
Tekcolor 1 'Drawing color [Red].
Tekbox 0 , 0 , 1023 , 778 , 1 'Outer frame.
'
Tekcolor 2 'Drawing color [Green].
Tekline 0 , 430 , 1023 , 430 , 0 'Vector Type.
Tekline 0 , 420 , 1023 , 420 , 1
Tekline 0 , 410 , 1023 , 410 , 2
Tekline 0 , 400 , 1023 , 400 , 3
Tekline 0 , 390 , 1023 , 390 , 5
'
Tekcolor 7 'Drawing color [White].
Teklocate 900 , 388 'Moves the Alpha cursor.
Print "Vector Type"
Tekcolor 4 'Drawing color [Blue].
W1 = 448
For B = 1 To 34 'Slanting line.
Tekline 0 , 448 , 1023 , W1 , 0
W1 = W1 + 10
Next B
Tekcolor 3 'Drawing color [Yellow].
Tekbox 80 , 720 , 280 , 580 , 1 'Write a box.
Tekbox 100 , 700 , 200 , 600 , 0
'
Teklocate 134 , 638 'Moves the Alpha cursor.
Print "BOX"
Tekcolor 7 'Drawing color [White].
Tekline 30 , 195 , 390 , 195 , 1 'Scale line.
Tekline 30 , 45 , 30 , 345 , 0
'
Tekcolor 5 'Drawing color [Magenta].
For W1 = 0 To 360 'Sign waveform.
S1 = W1
S1 = Deg2rad(s1)
S1 = Sin(s1)
S1 = S1 * 150
S1 = S1 + 195
W2 = Int(s1)
W3 = W1 + 30
Tekpset W3 , W2 'Set a single pixel.
Next W1
'
Teklocate 240 , 270 'Moves the Alpha cursor.
Print "Sign Wave"
Tekcolor 7 'Drawing color [White].
Tekline 450 , 195 , 710 , 195 , 3 'Scale line.
Tekline 580 , 65 , 580 , 325 , 3
'
Tekcolor 6 'Drawing color [Cyan].
For W1 = 0 To 360 'Circle.
S1 = W1
S1 = Deg2rad(s1)
S2 = Cos(s1)
S1 = Sin(s1)
S1 = S1 * 120
S1 = S1 + 195
W2 = Int(s1)
S2 = S2 * 120
S2 = S2 + 580
W3 = Int(s2)
Tekpset W3 , W2 'Set a single pixel.
Next W1
'
Teklocate 500 , 230 'Moves the Alpha cursor.
Print "Circle"
Tekcolor 7 'Drawing color [White].
Tekline 770 , 80 , 1000 , 80 , 0 'Scale line.
Tekline 770 , 80 , 770 , 310 , 0
'
Tekcolor 1 'Drawing color [Red].
Restore Graphdata 'Drawing a graph.
W1 = 770 'X position.
Tekgraph 1 'Sets Terminal to Graph Mode , Select the vector type.
For B = 1 To 5
Read W2
Tekplot W1 , W2 'Plot the graph line.
W1 = W1 + 50
Next B
Tekalpha 'Terminal is returned to alpha mode.
'
Teklocate 860 , 280 'Moves the Alpha cursor.
Print "Graph"
Tekcolor 7 'Drawing color [White].
Teklocate 50 , 520 'Moves the Alpha cursor.
Print "END"
End
Graphdata:
Data 120% , 220% , 250% , 150% , 180% 'Graph data.[/code:1:b909ac8d4e]
↧