-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvt52_states.cpp
42 lines (33 loc) · 1.42 KB
/
vt52_states.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright Timothy Miller, 1999
#include "gterm.hpp"
// I'm certain that this set is incomplete, but I got these from reverse-
// engineering a VT100 verification test program.
// state machine transition tables
StateOption GTerm::vt52_normal_state[] = {
{13, >erm::cr, vt52_normal_state},
{10, >erm::lf, vt52_normal_state},
{12, >erm::ff, vt52_normal_state},
{9, >erm::tab, vt52_normal_state},
{8, >erm::bs, vt52_normal_state},
{7, >erm::bell, vt52_normal_state},
{27, >erm::clear_param, vt52_esc_state},
{-1, >erm::normal_input, vt52_normal_state}};
StateOption GTerm::vt52_esc_state[] = {
{'D', >erm::cursor_left, vt52_normal_state},
{'B', >erm::cursor_down, vt52_normal_state},
{'C', >erm::cursor_right, vt52_normal_state},
{'A', >erm::cursor_up, vt52_normal_state},
{'Y', 0, vt52_cursory_state},
{'J', >erm::erase_display, vt52_normal_state},
{'K', >erm::erase_line, vt52_normal_state},
{'H', >erm::cursor_position, vt52_normal_state},
{'I', >erm::index_up, vt52_normal_state},
{'F', 0, vt52_normal_state}, // graphics mode
{'G', 0, vt52_normal_state}, // ASCII mode
{'Z', >erm::vt52_ident, vt52_normal_state}, // identify
{'<', 0, normal_state},
{-1, 0, vt52_normal_state}};
StateOption GTerm::vt52_cursory_state[] = {
{-1, >erm::vt52_cursory, vt52_cursorx_state}};
StateOption GTerm::vt52_cursorx_state[] = {
{-1, >erm::vt52_cursorx, vt52_normal_state}};