34 , rom(
getName() +
" ROM",
"rom", config)
35 , clock(EmuTime::zero())
36 , irq(getMotherBoard(),
"PioneerLDControl.IRQdisplayoff")
50 ppi = refs.size() >= 1 ?
dynamic_cast<MSXPPI*
>(refs[0]) :
nullptr;
52 throw MSXException(
"Invalid PioneerLDControl configuration: "
53 "need reference to PPI device.");
56 vdp = refs.size() == 2 ?
dynamic_cast<VDP*
>(refs[1]) :
nullptr;
58 throw MSXException(
"Invalid PioneerLDControl configuration: "
59 "need reference to VDP device.");
68 superimposing =
false;
72 if (laserdisc) laserdisc->setMuting(muteL, muteR, time);
78 if (address == 0x7fff) {
89 if (address == 0x7fff) {
96 }
else if (address == 0x7ffe) {
100 if (laserdisc && laserdisc->extAck(time)) {
103 }
else if (0x4000 <= address && address < 0x6000) {
104 val = rom[address & 0x1fff];
113 }
else if (0x4000 <= address && address < 0x6000) {
114 return &rom[address & 0x1fff];
122 if (address == 0x7fff) {
124 superimposing = !(value & 1);
125 irq.
set(superimposing && extint);
130 if (!muteL && !(value & 0x80)) {
131 muteR = !(ppi->
peekIO(2, time) & 0x10);
133 muteL = !(value & 0x80);
134 if (laserdisc) laserdisc->setMuting(muteL, muteR, time);
136 }
else if (address == 0x7ffe) {
137 if (laserdisc) laserdisc->extControl(value & 1, time);
152 if (videoEnabled && !enabled) {
155 if (superimposing) irq.
set();
157 videoEnabled = enabled;
161 void PioneerLDControl::updateVideoSource()
163 const auto* videoSource = (videoEnabled && superimposing && laserdisc)
164 ? laserdisc->getRawFrame()
169 template<
typename Archive>
172 ar.serialize(
"clock", clock,
177 if constexpr (Archive::IS_LOADER) {
178 videoEnabled =
false;
180 ar.serialize(
"superimposing", superimposing,
183 if (laserdisc) ar.serialize(
"laserdisc", *laserdisc);
185 if constexpr (Archive::IS_LOADER) {
constexpr unsigned getTicksTill(EmuTime::param e) const
Calculate the number of ticks for this clock until the given time.
bool getChildDataAsBool(std::string_view name, bool defaultValue=false) const
void set()
Set the interrupt request on the bus.
void reset()
Reset the interrupt request on the bus.
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
const HardwareConfig & getHardwareConfig() const
Returns the hardwareconfig this device belongs to.
static byte unmappedRead[0x10000]
const Devices & getReferences() const
Get the device references that are specified for this device.
EmuTime::param getCurrentTime() const
static byte unmappedWrite[0x10000]
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
void videoIn(bool enabled)
byte * getWriteCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
void serialize(Archive &ar, unsigned version)
~PioneerLDControl() override
const byte * getReadCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
void writeMem(word address, byte value, EmuTime::param time) override
Write a given byte to a given location at a certain time to this device.
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
PioneerLDControl(const DeviceConfig &config)
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
void reset(EmuTime::param time) override
This method is called on reset.
Unified implementation of MSX Video Display Processors (VDPs).
void setExternalVideoSource(const RawFrame *externalSource)
Enable superimposing.
std::string getName(KeyCode keyCode)
Translate key code to key name.
This file implemented 3 utility functions:
REGISTER_MSXDEVICE(ChakkariCopy, "ChakkariCopy")
uint16_t word
16 bit unsigned integer
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)