openMSX
SensorKid.hh
Go to the documentation of this file.
1 #ifndef SENSORKID_HH
2 #define SENSORKID_HH
3 
4 #include "MSXDevice.hh"
5 #include "TclCallback.hh"
6 
7 namespace openmsx {
8 
9 class SensorKid final : public MSXDevice
10 {
11 public:
12  explicit SensorKid(const DeviceConfig& config);
13 
14  void reset(EmuTime::param time) override;
15  void writeIO(word port, byte value, EmuTime::param time) override;
16  byte readIO(word port, EmuTime::param time) override;
17 
18  template<typename Archive>
19  void serialize(Archive& ar, unsigned version);
20 
21 private:
22  void putPort(byte data, byte diff);
23  byte getAnalog(byte chi);
24 
25  TclCallback portStatusCallback;
26  TclCallback acquireCallback;
27 
28  byte prev;
29  byte mb4052_ana;
30  byte mb4052_count;
31 };
32 
33 } // namespace openmsx
34 
35 #endif
openmsx::MSXDevice
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition: MSXDevice.hh:31
openmsx::SensorKid
Definition: SensorKid.hh:9
openmsx::DeviceConfig
Definition: DeviceConfig.hh:19
openmsx::SensorKid::writeIO
void writeIO(word port, byte value, EmuTime::param time) override
Write a byte to a given IO port at a certain time to this device.
Definition: SensorKid.cc:31
MSXDevice.hh
openmsx::SensorKid::readIO
byte readIO(word port, EmuTime::param time) override
Read a byte from an IO port at a certain time from this device.
Definition: SensorKid.cc:60
openmsx::SensorKid::serialize
void serialize(Archive &ar, unsigned version)
Definition: SensorKid.cc:131
TclCallback.hh
openmsx::word
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
openmsx::SensorKid::SensorKid
SensorKid(const DeviceConfig &config)
Definition: SensorKid.cc:10
openmsx
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
openmsx::SensorKid::reset
void reset(EmuTime::param time) override
This method is called on reset.
Definition: SensorKid.cc:24
openmsx::TclCallback
Definition: TclCallback.hh:13