34 , rom(getName() +
" ROM",
"rom", config)
35 , irq(getMotherBoard(),
"PioneerLDControl.IRQdisplayoff")
48 ppi = refs.size() >= 1 ?
dynamic_cast<MSXPPI*
>(refs[0]) :
nullptr;
50 throw MSXException(
"Invalid PioneerLDControl configuration: "
51 "need reference to PPI device.");
54 vdp = refs.size() == 2 ?
dynamic_cast<VDP*
>(refs[1]) :
nullptr;
56 throw MSXException(
"Invalid PioneerLDControl configuration: "
57 "need reference to VDP device.");
66 superimposing =
false;
70 if (laserdisc) laserdisc->setMuting(muteL, muteR, time);
76 if (address == 0x7fff) {
87 if (address == 0x7fff) {
94 }
else if (address == 0x7ffe) {
98 if (laserdisc && laserdisc->extAck(time)) {
101 }
else if (0x4000 <= address && address < 0x6000) {
102 val = rom[address & 0x1fff];
111 }
else if (0x4000 <= address && address < 0x6000) {
112 return &rom[address & 0x1fff];
120 if (address == 0x7fff) {
122 superimposing = !(value & 1);
123 irq.
set(superimposing && extInt);
128 if (!muteL && !(value & 0x80)) {
129 muteR = !(ppi->
peekIO(2, time) & 0x10);
131 muteL = !(value & 0x80);
132 if (laserdisc) laserdisc->setMuting(muteL, muteR, time);
134 }
else if (address == 0x7ffe) {
135 if (laserdisc) laserdisc->extControl(value & 1, time);
150 if (videoEnabled && !enabled) {
153 if (superimposing) irq.
set();
155 videoEnabled = enabled;
159void PioneerLDControl::updateVideoSource()
161 const auto* videoSource = (videoEnabled && superimposing && laserdisc)
162 ? laserdisc->getRawFrame()
167template<
typename Archive>
170 ar.serialize(
"clock", clock,
175 if constexpr (Archive::IS_LOADER) {
176 videoEnabled =
false;
178 ar.serialize(
"superimposing", superimposing,
181 if (laserdisc) ar.serialize(
"laserdisc", *laserdisc);
183 if constexpr (Archive::IS_LOADER) {
#define REGISTER_MSXDEVICE(CLASS, NAME)
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.
static std::array< byte, 0x10000 > unmappedRead
const HardwareConfig & getHardwareConfig() const
Returns the hardwareconfig this device belongs to.
static std::array< byte, 0x10000 > unmappedWrite
const Devices & getReferences() const
Get the device references that are specified for this device.
EmuTime::param getCurrentTime() const
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
void videoIn(bool enabled)
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.
byte * getWriteCacheLine(word address) override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
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.
This file implemented 3 utility functions:
uint16_t word
16 bit unsigned integer
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)