openMSX
MSXMoonSound.hh
Go to the documentation of this file.
1 #ifndef MSXMOONSOUND_HH
2 #define MSXMOONSOUND_HH
3 
4 #include "MSXDevice.hh"
5 #include "YMF262.hh"
6 #include "YMF278.hh"
7 #include "serialize_meta.hh"
8 
9 namespace openmsx {
10 
11 class MSXMoonSound final : public MSXDevice
12 {
13 public:
14  explicit MSXMoonSound(const DeviceConfig& config);
15 
16  void powerUp(EmuTime::param time) override;
17  void reset(EmuTime::param time) override;
18  byte readIO(word port, EmuTime::param time) override;
19  byte peekIO(word port, EmuTime::param time) const override;
20  void writeIO(word port, byte value, EmuTime::param time) override;
21 
22  template<typename Archive>
23  void serialize(Archive& ar, unsigned version);
24 
25 private:
26  bool getNew2() const;
27  byte readYMF278Status(EmuTime::param time) const;
28 
29  YMF262 ymf262;
30  YMF278 ymf278;
31 
33  EmuTime ymf278LoadTime;
35  EmuTime ymf278BusyTime;
36 
37  int opl3latch;
38  byte opl4latch;
39 };
41 
42 } // namespace openmsx
43 
44 #endif
openmsx::MSXDevice
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition: MSXDevice.hh:31
openmsx::MSXMoonSound::reset
void reset(EmuTime::param time) override
This method is called on reset.
Definition: MSXMoonSound.cc:67
openmsx::MSXMoonSound::powerUp
void powerUp(EmuTime::param time) override
This method is called when MSX is powered up.
Definition: MSXMoonSound.cc:61
openmsx::DeviceConfig
Definition: DeviceConfig.hh:19
serialize_meta.hh
YMF278.hh
openmsx::SERIALIZE_CLASS_VERSION
SERIALIZE_CLASS_VERSION(CassettePlayer, 2)
openmsx::YMF278
Definition: YMF278.hh:17
openmsx::MSXMoonSound::peekIO
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
Definition: MSXMoonSound.cc:127
openmsx::MSXMoonSound::MSXMoonSound
MSXMoonSound(const DeviceConfig &config)
Definition: MSXMoonSound.cc:49
openmsx::MSXMoonSound::serialize
void serialize(Archive &ar, unsigned version)
Definition: MSXMoonSound.cc:241
MSXDevice.hh
openmsx::MSXMoonSound
Definition: MSXMoonSound.hh:11
openmsx::MSXMoonSound::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: MSXMoonSound.cc:160
openmsx::word
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
openmsx::YMF262
Definition: YMF262.hh:19
YMF262.hh
openmsx::MSXMoonSound::readIO
byte readIO(word port, EmuTime::param time) override
Read a byte from an IO port at a certain time from this device.
Definition: MSXMoonSound.cc:79
openmsx
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5