LoginSignup
1

posted at

updated at

Turbo Pascal 3.0.x のスクリーン設定

はじめに

Turbo Pascal 3.0.x でのスクリーン設定を調べてみました。
image.png
なんとなく調べたくなったのです。

See also:

スクリーン設定

この記事のスクリーン設定は Turbo Pascal のマニュアルを参考にしています。スクリーン設定は TINST で行います。

TINST.COM を実行すると次のような画面になりますので、〔S〕を押してスクリーン設定に入ります。

                 TURBO Pascal installation menu.
          Choose installation item from the following:

[S]creen installation   |   [C]ommand installation   |   [Q]uit


                       Enter S, C, or Q:

普通は〔6〕〔Enter〕を押して ANSI を選びます。

Choose one of the following terminals:

  1) ADDS 20/25/30          17) Osborne 1
  2) ADDS 40/60             18) Otrona Attache
  3) ADDS Viewpoint-1A      19) Qume
  4) ADM 3A                 20) RC-855 (ITT)
  5) Ampex D80              21) Soroc 120/Apple CP/M
  6) ANSI                   22) Soroc new models
  7) DEC Rainbow, 8 bit     23) SSM-UB3
  8) Hazeltine 1500         24) Tandberg TDV 2215
  9) Hazeltine Esprit       25) Teleray series 10
 10) Kaypro with hilite     26) Teletex 3000
 11) Kaypro, no hilite      27) Texas Instruments
 12) Lear-Siegler ADM-20    28) Visual 200
 13) Lear-Siegler ADM-31    29) Wyse WY-100/200/300
 14) Liberty                30) Zenith
 15) Microbee VDU           31) None of the above
 16) Morrow MDT-20          32) Delete a definition

Which terminal? (Enter no. or ^Q to exit): 6

この設定をカスタマイズするか聞いてくるので〔6〕を押してスキップします。

Do you want to modify this definition before installation?  (Y/N)? N

ハードウェア依存情報を入力します。とりあえず〔Enter〕を押してスキップしてください。

                    Hardware dependent information

Operating frequency of your microprocessor in MHz (for delays): 20 Change to:

なお、何かしらの理由ですべての設定が飛んでいると、設定を番号で選択する事が出来ず、いきなりスクリーンのカスタマイズ画面が表示されます。

                 TURBO Pascal installation menu.
          Choose installation item from the following:

[S]creen installation   |   [C]ommand installation   |   [Q]uit


                       Enter S, C, or Q:
Terminal type:____________________

スクリーンのカスタマイズ

TINST を起動し、〔S〕〔6〕〔Enter〕〔Y〕と押すと ANSI の設定をカスタマイズできます。スクリーンメニューで〔3〕〔1〕〔Enter〕を押し、全くの新規に設定を作ることもできます。

31) None of the above

Terminal Settings

項目 デフォルト値 設定値 ルーチン
Terminal type: ANSI
Send an initialization string to the terminal? Y
Command: CrtInit() 手続きで実行される
Send a reset string to the terminal (Y/N)? Y
Command: <ESC> [ 0 m CrtExit() 手続きで実行される
CURSOR LEAD-IN command: <ESC> [ GoToXY() 手続きで実行される
CURSOR POSITIONING COMMAND to send between line and column: ; GoToXY() 手続きで実行される
CURSOR POSITIONING COMMAND to send after both line and column: H GoToXY() 手続きで実行される
Column first (Y/N)? N
OFFSET to add to LINE: 1
OFFSET to add to COLUMN: 1
Binary address (Y/N)? N
Number of ASCII digits (2 or 3): 2
CLEAR SCREEN command: <ESC> [ 2 J ClrScr() 手続きで実行される
Does CLEAR SCREEN also HOME cursor (Y/N)? N
HOME command: <ESC> [ f
DELETE LINE command: <ESC> [ 1 M DelLine() 手続きで実行される
INSERT LINE command: <ESC> [ 1 L InsLine() 手続きで実行される
ERASE TO END OF LINE command: <ESC> [ K ClrEol() 手続きで実行される
START HIGHLIGHTING command: <ESC> [ 1 m 強調
表示
LowVideo() 手続きで実行される
END HIGHLIGHTING command: <ESC> [ 0 m 通常
表示
NormVideo() 手続きで実行される
Number of rows (lines) on your screen: 24 行数
Number of columns on your screen: 80 桁数
Delay after CURSOR ADDRESS (0-255 ms): 0
Delay after CLEAR, DELETE and INSERT (0-255 ms): 0
Delay after ERASE TO END OF LINE and HIGHLIGHT (0-255 ms): 0

最後に設定が正しければ〔Y〕を、正しくなければ〔N〕を押します。

Is this definition correct? (Y/N)?

CP/M は基本的に 80x24 文字を前提としていますが、小型スクリーンで動作させる事も可能です。最低限、行数と桁数を設定すればいいでしょう。
image.png
また、Turbo Pascal をカラー化するには START HIGHLIGHTING の値を変更します。

シーケンス 意味
<ESC> [ 0 m 文字色と属性のリセット
<ESC> [ 1 m ボールド (太字)
<ESC> [ 30 m
<ESC> [ 31 m
<ESC> [ 32 m
<ESC> [ 33 m イエロー
<ESC> [ 34 m
<ESC> [ 35 m マゼンタ
<ESC> [ 36 m シアン
<ESC> [ 37 m

See also:

Hardware dependent information

項目 デフォルト値 設定値 ルーチン
Operating frequency of your microprocessor in MHz (for delays): 20 Delay() 手続きで使われる

プロセッサの速度を聞いてきますが、最大でも 20 MHz までしか指定できません。CP/M エミュレータを使っている場合で 20 以外の値になっている場合には 20 を入力してください。既に 20 になっているのであれば〔Enter〕を押してスキップできます。

この制限により Delay() 関数が機種依存します。つまり、Delay() のパラメータに 1000 を指定しても 1 秒であるとは限らないという事です。

MSX-DOS 用の設定

MSX-DOS 用 Turbo Pascal の設定です。MODE 40 で動作する設定例です。デフォルトで MODE 80 用の設定になっているので、まずは 80 桁モードに変更してから TINST を実行します。

A> MODE 80
A> TINST
項目 設定値
Terminal type: MSX (40)
Send an initialization string to the terminal? Y
Command:
Send a reset string to the terminal (Y/N)? Y
Command:
CURSOR LEAD-IN command: <ESC> Y
CURSOR POSITIONING COMMAND to send between line and column:
CURSOR POSITIONING COMMAND to send after both line and column:
Column first (Y/N)? N
OFFSET to add to LINE: 32
OFFSET to add to COLUMN: 32
Binary address (Y/N)? Y
CLEAR SCREEN command: <ESC> J
Does CLEAR SCREEN also HOME cursor (Y/N)? N
HOME command: <ESC> H
DELETE LINE command: <ESC> M
INSERT LINE command: <ESC> L
ERASE TO END OF LINE command: <ESC> K
START HIGHLIGHTING command:
Number of rows (lines) on your screen: 24
Number of columns on your screen: 40
Delay after CURSOR ADDRESS (0-255 ms): 0
Delay after CLEAR, DELETE and INSERT (0-255 ms): 0
Delay after ERASE TO END OF LINE and HIGHLIGHT (0-255 ms): 0

空白の箇所は設定なしなので、〔Enter〕キーを押してスキップしてください。

Is this definition correct? (Y/N)?

設定が正しければ〔Y〕を、正しくなければ〔N〕を押します。

項目 設定値
Operating frequency of your microprocessor in MHz (for delays): 4

image.png
image.png
これで MODE 40 でもエディタ画面が破綻しなくなりました。
image.png
同様に 80 桁用の設定も追加しておくとよいでしょう。

設定が終わってメニューに戻ったら一度〔Q〕を押してください。何故か MSX-DOS のプロンプトに戻らない (TINST を終了できない) ので、ディスクアクセスがない事を確認してリセットを行ってください。

See also:

おわりに

もうお解りかと思いますが、Turbo Pascal 3.0.x のスクリーン関係のルーチンはエスケープシーケンスを発行しているにすぎません。

See also:

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up
1