-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathterm.h
54 lines (42 loc) · 883 Bytes
/
term.h
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
42
43
44
45
46
47
48
49
50
51
52
53
54
//
//
// term.h
//
// (C) R.P.Bellis 1994
//
#pragma once
#include <cstdio>
#include "usim.h"
#include "mc6850.h"
#ifdef _POSIX_SOURCE
#include <termios.h>
#endif
class Terminal : virtual public mc6850_impl {
protected:
USim& sys;
Byte read_data;
bool read_data_available = false;
int tilde_escape_phase = 0;
void tilde_escape_help();
virtual void tilde_escape_help_other();
virtual void tilde_escape_do_other(char ch);
bool real_poll_read();
Byte real_read();
#ifdef _POSIX_SOURCE
FILE* input;
FILE* output;
int input_fd;
struct termios oattr, nattr;
#endif // _POSIX_SOURCE
public:
virtual bool poll_read();
virtual void write(Byte);
virtual Byte read();
public:
virtual void setup();
virtual void reset();
// Public constructor and destructor
public:
Terminal(USim& sys);
virtual ~Terminal();
};