openMSX
SNPSG.cc
Go to the documentation of this file.
1 #include "SNPSG.hh"
2 #include "serialize.hh"
3 #include <memory>
4 
5 namespace openmsx {
6 
7 SNPSG::SNPSG(const DeviceConfig& config)
8  : MSXDevice(config)
9  , sn76489(config)
10 {
11 }
12 
13 void SNPSG::reset(EmuTime::param time)
14 {
15  sn76489.reset(time);
16 }
17 
18 void SNPSG::writeIO(word /*port*/, byte value, EmuTime::param time)
19 {
20  // The chip has only a single port.
21  sn76489.write(value, time);
22 }
23 
24 template<typename Archive>
25 void SNPSG::serialize(Archive& ar, unsigned /*version*/)
26 {
27  ar.template serializeBase<MSXDevice>(*this);
28  ar.serialize("sn76489", sn76489);
29 }
31 REGISTER_MSXDEVICE(SNPSG, "SN76489 PSG");
32 
33 } // namespace openmsx
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition: MSXDevice.hh:33
void reset(EmuTime::param time)
Definition: SN76489.cc:140
void write(byte value, EmuTime::param time)
Definition: SN76489.cc:146
Device that puts the Texas Instruments SN76489 sound chip at a fixed I/O address.
Definition: SNPSG.hh:13
void serialize(Archive &ar, unsigned version)
Definition: SNPSG.cc:25
SNPSG(const DeviceConfig &config)
Definition: SNPSG.cc:7
void reset(EmuTime::param time) override
This method is called on reset.
Definition: SNPSG.cc:13
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: SNPSG.cc:18
This file implemented 3 utility functions:
Definition: Autofire.cc:9
REGISTER_MSXDEVICE(ChakkariCopy, "ChakkariCopy")
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)
Definition: serialize.hh:998