"   TERMINAL DEFINITION FILE FOR TeleVideo970 TERMINAL                       "

"   VARIABLES                                                                "
    prefix              = (esc '[')
    native_mode         = (prefix '?21h')
    page_attr           = (prefix '5;0z')       "single-height/single-width"
    set_to_24x80        = (prefix '1;0z' prefix '?3l')
    set_to_72x80        = (prefix '1;2z' prefix '?3l')
    set_to_24x132       = (prefix '1;0z' prefix '?3h')
    contrast_low        = (prefix '7;0z')       "low intensity"
    start_alternate     = (prefix '1m')         "bright"
    stop_alternate      = (prefix '0m')
    start_blank         = (prefix '3m')
    stop_blank          = (prefix '0m')
    start_underline     = (prefix '4m')
    stop_underline      = (prefix '0m')
    start_blink         = (prefix '5m')
    stop_blink          = (prefix '0m')
    start_inverse       = (prefix '7m')
    stop_inverse        = (prefix '0m')
    disable_protect     = (prefix '?0l')
    ignore_break        = (prefix '?16l')
    recognize_break     = (prefix '?16h')
    enable_attr_action  = (prefix '?18l')
    disable_attr_action = (prefix '?18h')
    char_prim_usa       = (esc '(B')            "US primary character set"
    char_sec_graphic    = (esc ')0')            "graphics secondary set"
    select_char_prim    = (si)
    select_char_sec     = (so)
    autopage_single     = (prefix '?20l')
    autowrap_enable     = (prefix '?7h')
    autowrap_disable    = (prefix '?7l')
    lf_enable           = (prefix '20l')
    tab_forwards        = (prefix '1I')
    control_rep_process = (prefix '3l')
"   cr_turnaround       = (esc '\5;13' cr) "
    ansi_arrows         = (prefix '?1l')
    pad_numeric         = (esc '>')
    ctl_disabl          = (prefix '?9l')
    edit_extent_line    = (prefix '1Q')
    edit_boundary_display  = (prefix '19l')
    edit_vertical_below = (prefix '7l')
    edit_horizontal_right = (prefix '10l')
    replace_mode        = (prefix '4l')
    edit_modes          = (replace_mode autopage_single autowrap_enable ..
                           edit_boundary_display edit_extent_line ..
                           edit_horizontal_right edit_vertical_below)
    clear_home          = (prefix '2J')
    convers_mode        = (prefix '?10l')
    select_block        = (prefix '?10h')
    normal_part_1       = (native_mode page_attr contrast_low char_prim_usa ..
 char_sec_graphic select_char_prim enable_attr_action)
    normal_part_2       = (lf_enable ansi_arrows pad_numeric ctl_disabl ..
 edit_modes convers_mode disable_protect)
"edit_modes convers_mode disable_protect control_rep_process)"
    f1f4_std            = (esc '|1;3;27;63;97;13'   cr ..                "f1  "
                           esc '|2;3;27;63;98;13'   cr ..                "f2  "
                           esc '|3;3;27;63;99;13'   cr ..                "f3  "
                           esc '|4;3;27;63;100;13'  cr)                  "f4  "
    f5f8_std            = (esc '|5;3;27;63;101;13'  cr ..                "f5  "
                           esc '|6;3;27;63;102;13'  cr ..                "f6  "
                           esc '|7;3;27;63;103;13'  cr ..                "f7  "
                           esc '|8;3;27;63;104;13'  cr)                  "f8  "
    f9f12_std           = (esc '|9;3;27;63;105;13'  cr ..                "f9  "
                           esc '|10;3;27;63;106;13' cr ..                "f10 "
                           esc '|11;3;27;63;107;13' cr ..                "f11 "
                           esc '|12;3;27;63;108;13' cr)                  "f12 "
    f13f16_std          = (esc '|13;3;27;63;109;13' cr ..                "f13 "
                           esc '|14;3;27;63;110;13' cr ..                "f14 "
                           esc '|15;3;27;63;111;13' cr ..                "f15 "
                           esc '|16;3;27;63;112;13' cr)                  "f16 "
    f1f4s_std           = (esc '|17;3;27;63;65;13'  cr ..                "f1 s"
                           esc '|18;3;27;63;66;13'  cr ..                "f2 s"
                           esc '|19;3;27;63;67;13'  cr ..                "f3 s"
                           esc '|20;3;27;63;68;13'  cr)                  "f4 s"
    f5f8s_std           = (esc '|21;3;27;63;69;13'  cr ..                "f5 s"
                           esc '|22;3;27;63;70;13'  cr ..                "f6 s"
                           esc '|23;3;27;63;71;13'  cr ..                "f7 s"
                           esc '|24;3;27;63;72;13'  cr)                  "f8 s"
    f9f12s_std          = (esc '|25;3;27;63;73;13'  cr ..                "f9 s"
                           esc '|26;3;27;63;74;13'  cr ..                "f10s"
                           esc '|27;3;27;63;75;13'  cr ..                "f11s"
                           esc '|28;3;27;63;76;13'  cr)                  "f12s"
    f13f16s_std         = (esc '|29;3;27;63;77;13'  cr ..                "f13s"
                           esc '|30;3;27;63;78;13'  cr ..                "f14s"
                           esc '|31;3;27;63;79;13'  cr ..                "f15s"
                           esc '|32;3;27;63;80;13'  cr)                  "f16s"
    cdc_keys           = (esc '\18;27;63;114;13' cr esc '\19;27;63;82;13' cr ..
       esc '\42;27;63;113;13' cr esc '\41;27;91;50;74;13' cr ..
       esc '\58;27;63;81;13' cr)
    back_space_std      = (esc '\31;8' cr)                          "bs"
" change BACK SPACE key to send bs,space,bs"
    back_space_x        = (esc '\31;8;32;8' cr)                     "bs ' ' bs"
    clear_space_std     = (esc '\35;27;91;50;74' cr)                "esc '[2J'"
" change CLEAR SPACE key to send bs,then same as CHAR DELETE"
    clear_space_x       = (esc '\35;8;27;91;80' cr)               "bs esc '[P'"
    tab_mains_std       = (esc '\17;27;91;51;103' cr)               "esc '[3g'"
"                             bytes:  1   2   3   4   5   6   7   8"
    repeat_action_std   = (esc '\73;255;255;255;255;255;255;255;255;' ..
.. "  9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24"
   '255;255;255;255;255;255;255;255;249;249;207;031;207;014;255;192;' ..
.. " 25  26  27  28  29  30  31  32"
   '000;000;000;000;000;000;003;032' cr)
"                             bytes:  1   2   3   4   5   6   7   8"
    repeat_action_edit  = (esc '\73;255;255;255;255;255;255;255;255;' ..
.. "  9  10  11  12  13  14  15  16  17  18  19 20  21 22  23  24"
   '255;255;255;255;255;255;255;255;249;249;223;31;207;14;255;192;' ..
.. " 25 6 7"
     '0;0;0' cr)

"   MODEL NAME AND COMMUNICATION TYPE                                         "
    model_name          value = 'TV_970'
    communications      type  = asynch
    application_string name='driver_procedure' out='tup$bootstrap_tv955_driver'

"   END OF INFORMATION SPECIFICATION                                          "
    end_of_information  in    = (0)

"   CURSOR POSITIONING INFORMATION                                            "
    cursor_pos_encoding      bias  = (1)   type = ansi_cursor
    cursor_pos_column_first  value = FALSE
    cursor_pos_column_length value = (0)
    cursor_pos_row_length    value = (0)
    cursor_pos_begin         out   = (prefix)
    cursor_pos_second        out   = (';')
    cursor_pos_third         out   = ('H')

"   CURSOR MOVEMENT INFORMATION                                              "
    cursor_home              inout = (prefix 'H')    label='HOME'
    cursor_up                inout = (prefix 'A')
    cursor_down              inout = (prefix 'B')
    cursor_left              inout = (prefix 'D')
    cursor_right             inout = (prefix 'C')

"   CURSOR BEHAVIOR (for cursor movement keys)                               "
    move_past_right          type  = stop_next
    move_past_left           type  = stop_next
    move_past_top            type  = stop_next
    move_past_bottom         type  = stop_next

"   CURSOR BEHAVIOR (for character keys)                                     "
    char_past_right          type  = stop_next
    char_past_left           type  = stop_next
    char_past_last_position  type  = stop_next

"   TERMINAL ATTRIBUTES                                                       "
    automatic_tabbing        value = TRUE
    clears_when_change_size  value = TRUE
    function_key_leaves_mark value = 1
    has_hidden               value = FALSE
    has_protect              value = FALSE
    home_at_top              value = TRUE
    multiple_sizes           value = TRUE
    tabs_to_home             value = FALSE
    tabs_to_tab_stops        value = TRUE
    tabs_to_unprotected      value = FALSE
    type_ahead               value = TRUE

"   SCREEN SIZES                                                             "
    set_size       rows = 24 columns = 80   out = (set_to_24x80)
    set_size       rows = 24 columns = 132  out = (set_to_24x132)

"   SCREEN AND LINE MODE TRANSITION                                           "
    screen_init         out = (normal_part_1 normal_part_2)
    screen_init         out = (f1f4_std   f5f8_std)
    screen_init         out = (f9f12_std  f13f16_std)
    screen_init         out = (f1f4s_std  f5f8s_std)
    screen_init         out = (f9f12s_std f13f16s_std)
    screen_init         out = (back_space_x clear_space_x)
    screen_init         out = (cdc_keys)
    screen_init         out = (set_to_24x80)
"   screen_init         out = (set_to_24x80 cr_turnaround) "
    line_init           out = (normal_part_1 normal_part_2)
    line_init           out = (back_space_std clear_space_std)
    line_init           out = (set_to_72x80)
    set_screen_mode     out = (autowrap_disable ignore_break ..
                               repeat_action_edit)
    set_line_mode       out = (autowrap_enable recognize_break ..
                               repeat_action_std set_to_24x80)

"   TERMINAL CAPABILITIES                                                   "
    backspace           in    = (bs)
    delete_char         inout = (prefix 'P')    label='DelC'     "CHAR DELETE"
    delete_line_bol     inout = (prefix 'M')    label='DelL'     "LINE DELETE"
    erase_end_of_line   inout = (prefix 'K')    label='EraEOL'   "LINE ERASE"
    erase_line_stay     inout = (prefix '2K')            "shifted CE"
    erase_page_home       out = (clear_home)
    insert_char         inout = (prefix '@')    label='InsC'     "CHAR INSERT"
    insert_line_bol     inout = (prefix 'L')    label='InsL'     "LINE INSERT"
    insert_mode_begin   inout = (prefix '4h')            "shifted CHAR INSERT"
    insert_mode_end     inout = (replace_mode)           "shifted CHAR DELETE"
    tab_backward        inout = (prefix 'Z')                     "BACK TAB"
    tab_clear           inout = (prefix 'g')             "shifted TAB, keypad"
    tab_clear_all         out = (prefix '3g')
    tab_forward         inout = (ht)                             "TAB"
    tab_set             inout = (esc 'H')                "shifted TAB, main"

"   MISCELLANEOUS TERMINAL SEQUENCES                                         "
    bell_nak            out = (bel)
    output_begin        out = (replace_mode)
    output_end          out = ()

"   PROGRAMMABLE FUNCTION KEY INPUT INFORMATION                              "
    f1        in = (esc '?a')     label = 'F1'
    f2        in = (esc '?b')     label = 'F2'
    f3        in = (esc '?c')     label = 'F3'
    f4        in = (esc '?d')     label = 'F4'
    f5        in = (esc '?e')     label = 'F5'
    f6        in = (esc '?f')     label = 'F6'
    f7        in = (esc '?g')     label = 'F7'
    f8        in = (esc '?h')     label = 'F8'
    f9        in = (esc '?i')     label = 'F9'
    f10       in = (esc '?j')     label = '10'
    f11       in = (esc '?k')     label = '11'
    f12       in = (esc '?l')     label = '12'
    f13       in = (esc '?m')     label = '13'
    f14       in = (esc '?n')     label = '14'
    f15       in = (esc '?o')     label = '15'
    f16       in = (esc '?p')     label = '16'
    f1_s      in = (esc '?A')     label = '  SF1'
    f2_s      in = (esc '?B')     label = '  SF2'
    f3_s      in = (esc '?C')     label = '  SF3'
    f4_s      in = (esc '?D')     label = '  SF4'
    f5_s      in = (esc '?E')     label = '  SF5'
    f6_s      in = (esc '?F')     label = '  SF6'
    f7_s      in = (esc '?G')     label = '  SF7'
    f8_s      in = (esc '?H')     label = '  SF8'
    f9_s      in = (esc '?I')     label = '  SF9'
    f10_s     in = (esc '?J')     label = '  SF10'
    f11_s     in = (esc '?K')     label = '  SF11'
    f12_s     in = (esc '?L')     label = '  SF12'
    f13_s     in = (esc '?M')     label = '  SF13'
    f14_s     in = (esc '?N')     label = '  SF14'
    f15_s     in = (esc '?O')     label = '  SF15'
    f16_s     in = (esc '?P')     label = '  SF16'

"   CDC STANDARD FUNCTION KEY INPUT INFORMATION                               "
    next      in = 13                    label='RETURN'
    next_s    in = ()
    back      in = ()
    back_s    in = ()
    help      in = ()
    help_s    in = ()
    stop      in = ()
    stop_s    in = ()
    down      in = (esc '?r')    label = 'DOWN'     "shift-down-arrow"
    up        in = (esc '?R')    label = 'UP'       "shift-up-arrow"
    fwd       in = (esc '?q')    label = 'FWD'      "PAGE"
    bkw       in = (esc '?Q')    label = 'BKW'      "shift-PAGE"

"   TERMINAL VIDEO ATTRIBUTES                                                "
    alt_begin           out = (start_alternate)
    alt_end             out = (stop_alternate)
    blink_begin         out = (start_blink)
    blink_end           out = (stop_blink)
    inverse_begin       out = (start_inverse)
    inverse_end         out = (stop_inverse)
    underline_begin     out = (start_underline)
    underline_end       out = (stop_underline)

"   LOGICAL ATTRIBUTE SPECIFICATIONS                                          "
    error_begin         out = (start_inverse start_alternate)
    error_end           out = (stop_inverse stop_alternate)
    input_text_begin    out = (start_underline)
    input_text_end      out = (stop_underline)
    italic_begin        out = (start_inverse)
    italic_end          out = (stop_inverse)
    message_begin       out = (start_alternate)
    message_end         out = (stop_alternate)
    output_text_begin   out = ()
    output_text_end     out = ()

"   LINE DRAWING CHARACTER SPECIFICATION                                      "
    ld_fine_begin            out = select_char_sec
    ld_fine_end              out = select_char_prim
    ld_fine_horizontal       out = 'q'
    ld_fine_vertical         out = 'x'
    ld_fine_upper_left       out = 'l'
    ld_fine_upper_right      out = 'k'
    ld_fine_lower_left       out = 'm'
    ld_fine_lower_right      out = 'j'
    ld_fine_up_t             out = 'w'
    ld_fine_down_t           out = 'v'
    ld_fine_left_t           out = 't'
    ld_fine_right_t          out = 'u'
    ld_fine_cross            out = 'n'
    ld_medium_begin          out = (select_char_sec start_alternate)
    ld_medium_end            out = (select_char_prim stop_alternate)
    ld_medium_horizontal     out = 'q'
    ld_medium_vertical       out = 'x'
    ld_medium_upper_left     out = 'l'
    ld_medium_upper_right    out = 'k'
    ld_medium_lower_left     out = 'm'
    ld_medium_lower_right    out = 'j'
    ld_medium_up_t           out = 'w'
    ld_medium_down_t         out = 'v'
    ld_medium_left_t         out = 't'
    ld_medium_right_t        out = 'u'
    ld_medium_cross          out = 'n'
    ld_bold_begin            out = (select_char_prim start_inverse)
    ld_bold_end              out = (select_char_prim stop_inverse)
    ld_bold_horizontal       out = (' ')
    ld_bold_vertical         out = (' ')
    ld_bold_upper_left       out = (' ')
    ld_bold_upper_right      out = (' ')
    ld_bold_lower_left       out = (' ')
    ld_bold_lower_right      out = (' ')
    ld_bold_up_t             out = (' ')
    ld_bold_down_t           out = (' ')
    ld_bold_left_t           out = (' ')
    ld_bold_right_t          out = (' ')
    ld_bold_cross            out = (' ')

"   END OF TERMINAL DEFINITION FILE FOR TeleVideo970 TERMINAL                "
