' ' ******************************************************** ' * Tektronix 4010(4014,410x) Graphic Terminal Library * ' * [Ver.2] O-Family 2015. 1. 5 * ' ******************************************************** ' $regfile = "m88pdef.dat" '任意のAVRチップ。 $crystal = 16000000 '任意の周波数。 ' $hwstack = 64 $swstack = 32 $framesize = 24 $baud = 9600 'ターミナルのボーレートを設定します。 '--------- 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 <キャラクター画面とグラフ画面を消去します。> ' Tekcolor Color [0 = Black, 1 = Red, 2 = Green, 3 = Yellow, 4 = Blue, 5 = Magenta, 6 = Cyan, 7 = White] <描画の色を設定します。> ' Tekline X(start) , Y(start) , X(end) , Y(end) , Vector-Type [X = 0 - 1023 , Y = 0 - 778 , Vector-Type = 0 - 23] <直線を引きます。> ' [Vector-Type = 0:直線 , 1:点線 , 2:一点鎖線 , 3:短い破線 , 4:長い破線] ' Tekbox X(left corner) , Y(top position) , X(right corner) , Y(bottom position) , Vector-Type <ボックスを描画します。> ' Tekpset X(location) , Y(location) [X = 0 - 1023 , Y = 0 - 778] <1ドットの点を描画します。> ' Teklocate X(location) , Y(location) [X = 0 - 1023 , Y = 0 - 778] <文字の描画位置を指定します。> ' Tekgraph Vector-Type [Vector-Type = 0 - 23] <ターミナルをグラフモードにして、線種を指定します。> ' Tekplot X(location) , Y(location) [X = 0 - 1023 , Y = 0 - 778] <グラフの線分を描画します。> 注:Tekgraph命令を実行して下さい。 ' Tekalpha <ターミナルをキャラクターモードに戻します。> '------------------------------------------------------------- ' ************************ ' * 描画テストプログラム * ' ************************ Dim W1 As Word , W2 As Word , W3 As Word , S1 As Single , S2 As Single , B As Byte Tekcolor 7 '描画色を[白]にする。 Tekcls 'キャラクター画面とグラフ画面を消去します。 Print "Tektronix 4010(4014,410x) graphic terminal (emulator)" Tekcolor 1 '描画色を[赤]にする。 Tekbox 0 , 0 , 1023 , 778 , 1 '外枠の描画。 ' Tekcolor 2 '描画色を[緑]にする。 Tekline 0 , 430 , 1023 , 430 , 0 '線種の表示。 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 '描画色を[白]にする。 Teklocate 900 , 388 '文字の描画位置を指定。 Print "Vector Type" Tekcolor 4 '描画色を[青]にする。 W1 = 448 For B = 1 To 34 '斜線の描画。 Tekline 0 , 448 , 1023 , W1 , 0 W1 = W1 + 10 Next B Tekcolor 3 '描画色を[黄]にする。 Tekbox 80 , 720 , 280 , 580 , 1 'ボックスの描画。 Tekbox 100 , 700 , 200 , 600 , 0 ' Teklocate 134 , 638 '文字の描画位置を指定。 Print "BOX" Tekcolor 7 '描画色を[白]にする。 Tekline 30 , 195 , 390 , 195 , 1 'スケール線。 Tekline 30 , 45 , 30 , 345 , 0 ' Tekcolor 5 '描画色を[マゼンタ]にする。 For W1 = 0 To 360 'サイン波形を描画。 S1 = W1 S1 = Deg2rad(s1) S1 = Sin(s1) S1 = S1 * 150 S1 = S1 + 195 W2 = Int(s1) W3 = W1 + 30 Tekpset W3 , W2 '1ドットの点を描画。 Next W1 ' Teklocate 240 , 270 '文字の描画位置を指定。 Print "Sign Wave" Tekcolor 7 '描画色を[白]にする。 Tekline 450 , 195 , 710 , 195 , 3 'スケール線。 Tekline 580 , 65 , 580 , 325 , 3 ' Tekcolor 6 '描画色を[シアン]にする。 For W1 = 0 To 360 '円の描画。 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 '1ドットの点を描画。 Next W1 ' Teklocate 500 , 230 '文字の描画位置を指定。 Print "Circle" Tekcolor 7 '描画色を[白]にする。 Tekline 770 , 80 , 1000 , 80 , 0 'スケール線。 Tekline 770 , 80 , 770 , 310 , 0 ' Tekcolor 1 '描画色を[赤]にする。 Restore Graphdata 'グラフの描画。 W1 = 770 'X 位置。 Tekgraph 1 'ターミナルをグラフモードにして、線種を指定。 For B = 1 To 5 Read W2 Tekplot W1 , W2 'グラフの線分を描画。 W1 = W1 + 50 Next B Tekalpha 'ターミナルをキャラクターモードに戻す。 ' Teklocate 860 , 280 '文字の描画位置を指定。 Print "Graph" Tekcolor 7 '描画色を[白]にする。 Teklocate 50 , 520 '文字の描画位置を指定。 Print "END" End Graphdata: Data 120% , 220% , 250% , 150% , 180% 'グラフのデータ。