openMSX
SNPSG.cc
Go to the documentation of this file.
1#include "SNPSG.hh"
2#include "serialize.hh"
3#include <memory>
4
5namespace openmsx {
6
8 : MSXDevice(config)
9 , sn76489(config)
10{
11}
12
13void SNPSG::reset(EmuTime::param time)
14{
15 sn76489.reset(time);
16}
17
18void 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
24template<typename Archive>
25void SNPSG::serialize(Archive& ar, unsigned /*version*/)
26{
27 ar.template serializeBase<MSXDevice>(*this);
28 ar.serialize("sn76489", sn76489);
29}
31REGISTER_MSXDEVICE(SNPSG, "SN76489 PSG");
32
33} // namespace openmsx
#define REGISTER_MSXDEVICE(CLASS, NAME)
Definition MSXDevice.hh:356
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition MSXDevice.hh:36
void reset(EmuTime::param time)
Definition SN76489.cc:144
void write(byte value, EmuTime::param time)
Definition SN76489.cc:150
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:11
uint16_t word
16 bit unsigned integer
Definition openmsx.hh:29
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)