openMSX
PioneerLDControl.hh
Go to the documentation of this file.
1 #ifndef PIONEERLDCONTROL_HH
2 #define PIONEERLDCONTROL_HH
3 
4 #include "MSXDevice.hh"
5 #include "Clock.hh"
6 #include "IRQHelper.hh"
7 #include "Rom.hh"
8 #include <memory>
9 
10 namespace openmsx {
11 
12 class LaserdiscPlayer;
13 class MSXPPI;
14 class VDP;
15 
16 class PioneerLDControl final : public MSXDevice
17 {
18 public:
19  explicit PioneerLDControl(const DeviceConfig& config);
20  ~PioneerLDControl() override;
21 
22  void reset(EmuTime::param time) override;
23  byte readMem(word address, EmuTime::param time) override;
24  byte peekMem(word address, EmuTime::param time) const override;
25  void writeMem(word address, byte value, EmuTime::param time) override;
26  const byte* getReadCacheLine(word address) const override;
27  byte* getWriteCacheLine(word address) const override;
28  void init() override;
29 
30  void videoIn(bool enabled);
31 
32  template<typename Archive>
33  void serialize(Archive& ar, unsigned version);
34 
35 private:
36  void updateVideoSource();
37 
38  Rom rom;
39  std::unique_ptr<LaserdiscPlayer> laserdisc; // can be nullptr
40  MSXPPI* ppi;
41  VDP* vdp;
42 
50  Clock<2 * 500000, 128> clock; // 2*500kHz / 128 = 7812.5Hz
51 
55  IRQHelper irq;
56 
57  bool extint;
58  bool mutel, muter;
59  bool videoEnabled;
60  bool superimposing;
61 };
62 
63 } // namespace openmsx
64 
65 #endif
openmsx::PioneerLDControl::init
void init() override
Definition: PioneerLDControl.cc:48
openmsx::MSXDevice
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition: MSXDevice.hh:31
Clock.hh
openmsx::PioneerLDControl::~PioneerLDControl
~PioneerLDControl() override
openmsx::VDP
Unified implementation of MSX Video Display Processors (VDPs).
Definition: VDP.hh:61
Rom.hh
openmsx::PioneerLDControl::writeMem
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.
Definition: PioneerLDControl.cc:123
openmsx::PioneerLDControl::readMem
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
Definition: PioneerLDControl.cc:78
openmsx::DeviceConfig
Definition: DeviceConfig.hh:19
openmsx::PioneerLDControl
Definition: PioneerLDControl.hh:16
openmsx::MSXPPI
Definition: MSXPPI.hh:39
openmsx::IntHelper< IRQSource >
openmsx::PioneerLDControl::getReadCacheLine
const byte * getReadCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
Definition: PioneerLDControl.cc:112
openmsx::PioneerLDControl::PioneerLDControl
PioneerLDControl(const DeviceConfig &config)
Definition: PioneerLDControl.cc:34
openmsx::PioneerLDControl::reset
void reset(EmuTime::param time) override
This method is called on reset.
Definition: PioneerLDControl.cc:68
openmsx::PioneerLDControl::getWriteCacheLine
byte * getWriteCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
Definition: PioneerLDControl.cc:144
openmsx::LaserdiscPlayer
LaserdiscPlayer
Definition: LaserdiscPlayer.cc:1133
MSXDevice.hh
openmsx::Rom
Definition: Rom.hh:20
openmsx::PioneerLDControl::peekMem
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
Definition: PioneerLDControl.cc:88
openmsx::VDP
VDP
Definition: VDP.cc:1918
openmsx::PioneerLDControl::serialize
void serialize(Archive &ar, unsigned version)
Definition: PioneerLDControl.cc:173
openmsx::word
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
openmsx::MSXPPI
MSXPPI
Definition: MSXPPI.cc:158
IRQHelper.hh
openmsx::Clock< 2 *500000, 128 >
openmsx
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
openmsx::PioneerLDControl::videoIn
void videoIn(bool enabled)
Definition: PioneerLDControl.cc:153