openMSX
I8255.hh
Go to the documentation of this file.
1 // This class implements the Intel 8255 chip
2 //
3 // * Only the 8255 is emulated, no surrounding hardware.
4 // Use the class I8255Interface to do that.
5 // * Only mode 0 (basic input/output) is implemented
6 
7 #ifndef I8255_HH
8 #define I8255_HH
9 
10 #include "EmuTime.hh"
11 #include "TclCallback.hh"
12 #include "openmsx.hh"
13 
14 namespace openmsx {
15 
16 class I8255Interface;
17 class StringSetting;
18 
19 class I8255
20 {
21 public:
22  I8255(I8255Interface& interf, EmuTime::param time,
23  StringSetting& invalidPpiModeSetting);
24 
25  void reset(EmuTime::param time);
26 
27  byte read(byte port, EmuTime::param time);
28  byte peek(byte port, EmuTime::param time) const;
29  void write(byte port, byte value, EmuTime::param time);
30 
31  template<typename Archive>
32  void serialize(Archive& ar, unsigned version);
33 
34 private:
35  byte readPortA(EmuTime::param time);
36  byte readPortB(EmuTime::param time);
37  byte readPortC(EmuTime::param time);
38  byte readControlPort(EmuTime::param time) const;
39  byte peekPortA(EmuTime::param time) const;
40  byte peekPortB(EmuTime::param time) const;
41  byte peekPortC(EmuTime::param time) const;
42  void writePortA(byte value, EmuTime::param time);
43  void writePortB(byte value, EmuTime::param time);
44  void writePortC(byte value, EmuTime::param time);
45  void writeControlPort(byte value, EmuTime::param time);
46 
47  byte readC0(EmuTime::param time);
48  byte readC1(EmuTime::param time);
49  byte peekC0(EmuTime::param time) const;
50  byte peekC1(EmuTime::param time) const;
51  void outputPortA(byte value, EmuTime::param time);
52  void outputPortB(byte value, EmuTime::param time);
53  void outputPortC(byte value, EmuTime::param time);
54 
55  I8255Interface& interface;
56 
57  byte control;
58  byte latchPortA;
59  byte latchPortB;
60  byte latchPortC;
61 
62  TclCallback ppiModeCallback;
63 };
64 
65 } // namespace openmsx
66 
67 #endif
openmsx.hh
openmsx::I8255::write
void write(byte port, byte value, EmuTime::param time)
Definition: I8255.cc:76
openmsx::I8255::peek
byte peek(byte port, EmuTime::param time) const
Definition: I8255.cc:59
openmsx::StringSetting
Definition: StringSetting.hh:8
openmsx::I8255::reset
void reset(EmuTime::param time)
Definition: I8255.cc:33
openmsx::I8255::read
byte read(byte port, EmuTime::param time)
Definition: I8255.cc:42
openmsx::I8255::I8255
I8255(I8255Interface &interf, EmuTime::param time, StringSetting &invalidPpiModeSetting)
Definition: I8255.cc:25
TclCallback.hh
openmsx::I8255::serialize
void serialize(Archive &ar, unsigned version)
Definition: I8255.cc:360
openmsx::I8255
Definition: I8255.hh:19
EmuTime.hh
openmsx::I8255Interface
Definition: I8255Interface.hh:9
openmsx
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
openmsx::TclCallback
Definition: TclCallback.hh:13