Go to the documentation of this file.
36 , rom(
getName() +
" ROM",
"rom", config)
37 , clock(EmuTime::zero())
38 , irq(getMotherBoard(),
"PioneerLDControl.IRQdisplayoff")
42 laserdisc = std::make_unique<LaserdiscPlayer>(
53 ppi = refs.size() >= 1 ?
dynamic_cast<MSXPPI*
>(refs[0]) :
nullptr;
55 throw MSXException(
"Invalid PioneerLDControl configuration: "
56 "need reference to PPI device.");
59 vdp = refs.size() == 2 ?
dynamic_cast<VDP*
>(refs[1]) :
nullptr;
61 throw MSXException(
"Invalid PioneerLDControl configuration: "
62 "need reference to VDP device.");
71 superimposing =
false;
75 if (laserdisc) laserdisc->setMuting(muteL, muteR, time);
81 if (address == 0x7fff) {
92 if (address == 0x7fff) {
99 }
else if (address == 0x7ffe) {
103 if (laserdisc && laserdisc->extAck(time)) {
106 }
else if (0x4000 <= address && address < 0x6000) {
107 val = rom[address & 0x1fff];
116 }
else if (0x4000 <= address && address < 0x6000) {
117 return &rom[address & 0x1fff];
125 if (address == 0x7fff) {
127 superimposing = !(value & 1);
128 irq.
set(superimposing && extint);
133 if (!muteL && !(value & 0x80)) {
134 muteR = !(ppi->
peekIO(2, time) & 0x10);
136 muteL = !(value & 0x80);
137 if (laserdisc) laserdisc->setMuting(muteL, muteR, time);
139 }
else if (address == 0x7ffe) {
140 if (laserdisc) laserdisc->extControl(value & 1, time);
155 if (videoEnabled && !enabled) {
158 if (superimposing) irq.
set();
160 videoEnabled = enabled;
164 void PioneerLDControl::updateVideoSource()
166 const auto* videoSource = (videoEnabled && superimposing && laserdisc)
167 ? laserdisc->getRawFrame()
172 template<
typename Archive>
175 ar.serialize(
"clock", clock,
181 videoEnabled =
false;
183 ar.serialize(
"superimposing", superimposing,
186 if (laserdisc) ar.serialize(
"laserdisc", *laserdisc);
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
constexpr unsigned getTicksTill(EmuTime::param e) const
Calculate the number of ticks for this clock until the given time.
~PioneerLDControl() override
Unified implementation of MSX Video Display Processors (VDPs).
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.
static byte unmappedWrite[0x10000]
const byte * getReadCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
PioneerLDControl(const DeviceConfig &config)
void reset(EmuTime::param time) override
This method is called on reset.
REGISTER_MSXDEVICE(ChakkariCopy, "ChakkariCopy")
byte * getWriteCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
string getName(KeyCode keyCode)
Translate key code to key name.
EmuTime::param getCurrentTime() const
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)
void reset()
Reset the interrupt request on the bus.
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
const Devices & getReferences() const
Get the device references that are specified for this device.
static byte unmappedRead[0x10000]
void serialize(Archive &ar, unsigned version)
void set()
Set the interrupt request on the bus.
uint16_t word
16 bit unsigned integer
const HardwareConfig & getHardwareConfig() const
Returns the hardwareconfig this device belongs to.
void setExternalVideoSource(const RawFrame *externalSource)
Enable superimposing.
This file implemented 3 utility functions:
void videoIn(bool enabled)
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
bool getChildDataAsBool(std::string_view name, bool defaultValue=false) const