-
Notifications
You must be signed in to change notification settings - Fork 3
/
serial.h
50 lines (40 loc) · 1.02 KB
/
serial.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
#ifndef _SERIAL_H
#define _SERIAL_H
#include "SDL/SDL.h"
class CSerial {
protected:
static unsigned int NrOfDevicesAttached;
static CSerial *RootDevice;
static CSerial *LastDevice;
CSerial *PrevDevice;
CSerial *NextDevice;
char Name[16];
public:
CSerial();
~CSerial();
CSerial(unsigned int DevNr);
// State of IEC lines (bit 7 - DATA, bit 6 - CLK, bit 4 - ATN)
static Uint8 Line[16];
static void InitPorts();
Uint8 ReadBus();
Uint32 DeviceNr;
virtual void UpdateSerialState(Uint8 ) { };
//virtual void ReadSerialState(Uint8 ) { };
static class CSerial *Devices[16];
friend class TEDMEM;
};
// class for not real devices (printer)
class CRealSerialIEC : public CSerial {
virtual void NewSerialState(Uint8 Clk);
};
class IEC;
// class for not real devices (printer)
class CFakeSerialIEC : public CSerial {
virtual void NewSerialState(Uint8 Clk);
IEC *iec;
};
// class for true serial drive emulation
class CTrueSerialIEC : public CSerial {
virtual void NewSerialState(Uint32 Clk);
};
#endif // _SERIAL_H