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
7namespace openmsx {
8
9class SensorKid final : public MSXDevice
10{
11public:
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 [[nodiscard]] byte readIO(word port, EmuTime::param time) override;
17
18 template<typename Archive>
19 void serialize(Archive& ar, unsigned version);
20
21private:
22 void putPort(byte data, byte diff);
23 [[nodiscard]] byte getAnalog(byte chi);
24
25private:
26 TclCallback portStatusCallback;
27 TclCallback acquireCallback;
28
29 byte prev;
30 byte mb4052_ana;
31 byte mb4052_count;
32};
33
34} // namespace openmsx
35
36#endif
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition MSXDevice.hh:36
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:63
void reset(EmuTime::param time) override
This method is called on reset.
Definition SensorKid.cc:27
void serialize(Archive &ar, unsigned version)
Definition SensorKid.cc:136
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:34
This file implemented 3 utility functions:
Definition Autofire.cc:9
uint16_t word
16 bit unsigned integer
Definition openmsx.hh:29