34 , rom(
getName() +
" ROM",
"rom", config)
35 , clock(EmuTime::zero())
36 , irq(getMotherBoard(),
"PioneerLDControl.IRQdisplayoff")
49 ppi = refs.size() >= 1 ?
dynamic_cast<MSXPPI*
>(refs[0]) :
nullptr;
51 throw MSXException(
"Invalid PioneerLDControl configuration: "
52 "need reference to PPI device.");
55 vdp = refs.size() == 2 ?
dynamic_cast<VDP*
>(refs[1]) :
nullptr;
57 throw MSXException(
"Invalid PioneerLDControl configuration: "
58 "need reference to VDP device.");
67 superimposing =
false;
71 if (laserdisc) laserdisc->setMuting(muteL, muteR, time);
77 if (address == 0x7fff) {
88 if (address == 0x7fff) {
95 }
else if (address == 0x7ffe) {
99 if (laserdisc && laserdisc->extAck(time)) {
102 }
else if (0x4000 <= address && address < 0x6000) {
103 val = rom[address & 0x1fff];
112 }
else if (0x4000 <= address && address < 0x6000) {
113 return &rom[address & 0x1fff];
121 if (address == 0x7fff) {
123 superimposing = !(value & 1);
124 irq.
set(superimposing && extInt);
129 if (!muteL && !(value & 0x80)) {
130 muteR = !(ppi->
peekIO(2, time) & 0x10);
132 muteL = !(value & 0x80);
133 if (laserdisc) laserdisc->setMuting(muteL, muteR, time);
135 }
else if (address == 0x7ffe) {
136 if (laserdisc) laserdisc->extControl(value & 1, time);
151 if (videoEnabled && !enabled) {
154 if (superimposing) irq.
set();
156 videoEnabled = enabled;
160void PioneerLDControl::updateVideoSource()
162 const auto* videoSource = (videoEnabled && superimposing && laserdisc)
163 ? laserdisc->getRawFrame()
168template<
typename Archive>
171 ar.serialize(
"clock", clock,
176 if constexpr (Archive::IS_LOADER) {
177 videoEnabled =
false;
179 ar.serialize(
"superimposing", superimposing,
182 if (laserdisc) ar.serialize(
"laserdisc", *laserdisc);
184 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.
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)
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)