OXYGENHUB
◆ main openmsx / src / sound / SNPSG.cc
647 B · C++ · last changed chore(): initial commit 1 month ago source blame history raw
1
#include "SNPSG.hh"
2
3
#include "serialize.hh"
4
5
namespace openmsx {
6
7
SNPSG::SNPSG(const DeviceConfig& config)
8
	: MSXDevice(config)
9
	, sn76489(config)
10
{
11
	reset(getCurrentTime());
12
}
13
14
void SNPSG::reset(EmuTime time)
15
{
16
	sn76489.reset(time);
17
}
18
19
void SNPSG::writeIO(uint16_t /*port*/, byte value, EmuTime time)
20
{
21
	// The chip has only a single port.
22
	sn76489.write(value, time);
23
}
24
25
template<typename Archive>
26
void SNPSG::serialize(Archive& ar, unsigned /*version*/)
27
{
28
	ar.template serializeBase<MSXDevice>(*this);
29
	ar.serialize("sn76489", sn76489);
30
}
31
INSTANTIATE_SERIALIZE_METHODS(SNPSG);
32
REGISTER_MSXDEVICE(SNPSG, "SN76489 PSG");
33
34
} // namespace openmsx