forked from aap/pdp11
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtv.h
More file actions
82 lines (71 loc) · 1.58 KB
/
Copy pathtv.h
File metadata and controls
82 lines (71 loc) · 1.58 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/* The 10-11 interface */
typedef struct Ten11 Ten11;
struct Ten11
{
int cycle;
int fd;
};
/* Some of these numbers are also hardcoded! */
enum {
NUMFBUFFERS = 16,
NUMCONNECTIONS = 32,
NUMOUTPUTS = 32,
NUMINPUTS = 16,
NUMSECTIONS = 2,
};
/* Mask to get buffer number from CREG. */
#define BUFMASK 037
/* A remote TV connection */
typedef struct TVcon TVcon;
struct TVcon
{
int fd;
int dpy; /* output number */
int kbd;
};
typedef struct FBuffer FBuffer;
struct FBuffer
{
word fb[16*1024 - 1];
word csa;
word mask; /* 0 or ~0 for bw flip */
/* list of all outputs that are driven
* by this buffer. */
int osw[NUMOUTPUTS];
int nosw;
};
/* The whole TV system */
typedef struct TV TV;
struct TV
{
/* need this to tell 11 from 10 cycles */
Ten11 *ten11;
FBuffer buffers[NUMFBUFFERS]; /* 256 is the theoretical maximum */
/* two different variables for 10 and 11 */
word creg11;
word creg10;
/* Two sections.
* Each has 32 outputs that can have one of 16 inputs.
* Input 0 is null on both,
* that leaves 30 different actual inputs in total. */
uint8 vswsect[NUMSECTIONS][NUMOUTPUTS];
word kms;
uint32 kma_hi;
uint32 kma_lo;
int km_haskey;
word km_kbd;
word km_key;
TVcon cons[NUMCONNECTIONS];
int omap[NUMOUTPUTS]; /* map of outputs to connections */
};
void inittv(TV *tv);
void closetv(TV *tv);
int dato_tv(Bus *bus, void *dev);
int datob_tv(Bus *bus, void *dev);
int dati_tv(Bus *bus, void *dev);
int svc_tv(Bus *bus, void *dev);
int bg_tv(void *dev);
void reset_tv(void *dev);
void handletvs(TV *tv);
void accepttv(int fd, void *arg);
void servetv(TV *tv, int port);