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
void serialize(Archive &ar, unsigned version)
uint8_t byte
8 bit unsigned integer
Definition: openmsx.hh:26
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 * getWriteCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing...
PioneerLDControl(const DeviceConfig &config)
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
const byte * getReadCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading...
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX...
Definition: MSXDevice.hh:31
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
void videoIn(bool enabled)
Unified implementation of MSX Video Display Processors (VDPs).
Definition: VDP.hh:61
void reset(EmuTime::param time) override
This method is called on reset.