forked from tschak909/platoterm-plan9
-
Notifications
You must be signed in to change notification settings - Fork 0
/
protocol.h
96 lines (85 loc) · 2.05 KB
/
protocol.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
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/**
* PLATOTERM for Plan 9
*
* A PLATO terminal for services such as
* CYBER1.ORG and IRATA.ONLINE
*
* Author: Thomas Cherryhomes
*
* License: GPL 3.0
*
* protocol.h - The PAD protocol state machine
*/
/* Copyright (c) 1990 by Steve Peltz */
#ifndef PROTOCOL_H
#define PROTOCOL_H
#define ACCESS 0x3c
typedef unsigned char padByte;
typedef enum {padF, padT} padBool;
typedef unsigned char padChar;
typedef short padWord;
typedef padWord charData[8];
typedef struct {
padByte red,
green,
blue;
} padRGB;
typedef struct {
padWord x,
y;
} padPt;
typedef enum {ModeWrite, ModeErase, ModeRewrite, ModeInverse} DispMode;
typedef enum {M0, M1, M2, M3} CharMem;
typedef enum { mBlock, mPoint, mLine, mAlpha, mLoadCoord, mLoadChar, mSSF,
mExternal, mLoadMem, mMode5, mMode6, mMode7, mLoadAddr,
mLoadEcho, mFore, mBack, mPaint } Mode;
typedef enum { tByte, tWord, tCoord, tColor, tPaint } DataType;
extern padPt PLATOSize;
extern CharMem CurMem;
extern padBool TTY,
FlowControl,
ModeBold,
Rotate,
Reverse;
extern DispMode CurMode;
void InitPAD(void);
void InitTTY(void);
void InitPLATO(void);
void InitPLATOx(void);
void Key(padWord theKey);
void Touch(padPt* where);
void Ext(padWord theKey);
void Echo(padWord theKey);
void SetCommand(Mode theMode, DataType theType);
void SetMode(Mode theMode, DataType theType);
void FixXY(short DX, short DY);
void Superx(void);
void Subx(void);
void Marginx(void);
void BSx(void);
void HTx(void);
void LFx(void);
void VTx(void);
void FFx(void);
void CRx(void);
void LoadCoordx(padPt* SetCoord);
void Blockx(void);
void Pointx(void);
void Linex(void);
void Alphax(void);
void LoadEchox(void);
void LoadAddrx(void);
void LoadCharx(void);
void LoadMemx(void);
void SSFx(void);
void Externalx(void);
void GoMode(void);
void GoWord(void);
void GoCoord(void);
void GoColor(void);
void GoPaint(void);
void DataChar(void);
void ShowPLATO(padByte* buff, unsigned short count);
void SetFast(void);
#endif