openMSX
I8254.hh
Go to the documentation of this file.
1 // This class implements the Intel 8254 chip (and 8253)
2 //
3 // * Only the 8254 is emulated, no surrounding hardware.
4 // Use the class I8254Interface to do that.
5 
6 #ifndef I8254_HH
7 #define I8254_HH
8 
9 #include "EmuTime.hh"
10 #include "openmsx.hh"
11 #include <memory>
12 
13 namespace openmsx {
14 
15 class Scheduler;
16 class Counter;
17 class ClockPin;
18 class ClockPinListener;
19 
20 class I8254
21 {
22 public:
23  I8254(Scheduler& scheduler, ClockPinListener* output0,
24  ClockPinListener* output1, ClockPinListener* output2,
25  EmuTime::param time);
26  ~I8254();
27 
28  void reset(EmuTime::param time);
29  byte readIO(word port, EmuTime::param time);
30  byte peekIO(word port, EmuTime::param time) const;
31  void writeIO(word port, byte value, EmuTime::param time);
32 
33  void setGate(unsigned cntr, bool status, EmuTime::param time);
34  ClockPin& getClockPin(unsigned cntr);
35  ClockPin& getOutputPin(unsigned cntr);
36 
37  template<typename Archive>
38  void serialize(Archive& ar, unsigned version);
39 
40 private:
41  void readBackHelper(byte value, unsigned cntr, EmuTime::param time);
42 
43  std::unique_ptr<Counter> counter[3];
44 };
45 
46 } // namespace openmsx
47 
48 #endif
openmsx.hh
openmsx::I8254::getOutputPin
ClockPin & getOutputPin(unsigned cntr)
Definition: I8254.cc:174
openmsx::Scheduler
Definition: Scheduler.hh:34
openmsx::ClockPin
Definition: ClockPin.hh:23
openmsx::I8254::reset
void reset(EmuTime::param time)
Definition: I8254.cc:87
openmsx::I8254::setGate
void setGate(unsigned cntr, bool status, EmuTime::param time)
Definition: I8254.cc:162
openmsx::I8254::peekIO
byte peekIO(word port, EmuTime::param time) const
Definition: I8254.cc:107
openmsx::I8254::I8254
I8254(Scheduler &scheduler, ClockPinListener *output0, ClockPinListener *output1, ClockPinListener *output2, EmuTime::param time)
Definition: I8254.cc:76
openmsx::ClockPin
ClockPin
Definition: ClockPin.cc:149
openmsx::I8254::getClockPin
ClockPin & getClockPin(unsigned cntr)
Definition: I8254.cc:168
openmsx::I8254
Definition: I8254.hh:21
openmsx::ClockPinListener
Definition: ClockPin.hh:13
openmsx::I8254::serialize
void serialize(Archive &ar, unsigned version)
Definition: I8254.cc:538
EmuTime.hh
openmsx::word
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
openmsx::I8254::~I8254
~I8254()
openmsx::Scheduler
Scheduler
Definition: Scheduler.cc:132
openmsx::I8254::writeIO
void writeIO(word port, byte value, EmuTime::param time)
Definition: I8254.cc:120
openmsx
This file implemented 3 utility functions:
Definition: Autofire.cc:5
openmsx::I8254::readIO
byte readIO(word port, EmuTime::param time)
Definition: I8254.cc:94