11 constexpr
byte ID = 0xFE;
20 sram = std::make_unique<SRAM>(
21 getName() +
" SRAM",
"S1985 Backup RAM",
24 sram = std::make_unique<SRAM>(
25 getName() +
" SRAM",
"S1985 Backup RAM",
30 byte mask = 0b0001'1111;
34 reset(EmuTime::dummy());
44 color1 = color2 = pattern = address = 0;
50 switch (port & 0x0F) {
52 pattern = (pattern << 1) | (pattern >> 7);
60 switch (port & 0x0F) {
64 return (*sram)[address];
66 return (pattern & 0x80) ? color2 : color1;
74 switch (port & 0x0F) {
76 address = value & 0x0F;
79 sram->write(address, value);
93 template<
typename Archive>
96 ar.template serializeBase<MSXDevice>(*
this);
99 if (ar.versionAtLeast(version, 2)) {
101 ar.serialize(
"sram", *sram);
103 assert(Archive::IS_LOADER);
111 ar.serialize_blob(
"ram", tmp,
sizeof(tmp));
114 sram->write(
unsigned(i),
t);
118 ar.serialize(
"address", address,
const XMLElement * findChild(std::string_view name) const
int getChildDataAsInt(std::string_view name, int defaultValue) const
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
MSXMotherBoard & getMotherBoard() const
Get the mother board this device belongs to.
virtual const std::string & getName() const
Returns a human-readable name for this device.
MSXMapperIO & createMapperIO()
All memory mappers in one MSX machine share the same four (logical) memory mapper registers.
byte readSwitchedIO(word port, EmuTime::param time) override
MSXS1985(const DeviceConfig &config)
byte peekSwitchedIO(word port, EmuTime::param time) const override
void reset(EmuTime::param time) override
This method is called on reset.
void serialize(Archive &ar, unsigned version)
void writeSwitchedIO(word port, byte value, EmuTime::param time) override
constexpr auto enumerate(Iterable &&iterable)
Heavily inspired by Nathan Reed's blog post: Python-Like enumerate() In C++17 http://reedbeta....
This file implemented 3 utility functions:
uint8_t byte
8 bit unsigned integer
REGISTER_MSXDEVICE(ChakkariCopy, "ChakkariCopy")
uint16_t word
16 bit unsigned integer
constexpr nibble mask[4][13]
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)