openMSX
Y8950Periphery.hh
Go to the documentation of this file.
1 #ifndef Y8950PERIPHERY_HH
2 #define Y8950PERIPHERY_HH
3 
4 #include "EmuTime.hh"
5 #include "openmsx.hh"
6 #include <memory>
7 #include <string>
8 
9 namespace openmsx {
10 
15 {
16 public:
17  virtual ~Y8950Periphery() = default;
18 
19  virtual void reset();
20 
29  virtual void write(nibble outputs, nibble values, EmuTime::param time) = 0;
30 
37  virtual nibble read(EmuTime::param time) = 0;
38 
40  virtual void setSPOFF(bool value, EmuTime::param time);
41 
42  virtual byte readMem(word address, EmuTime::param time);
43  virtual byte peekMem(word address, EmuTime::param time) const;
44  virtual void writeMem(word address, byte value, EmuTime::param time);
45  virtual const byte* getReadCacheLine(word start) const;
46  virtual byte* getWriteCacheLine(word start) const;
47 };
48 
49 class MSXAudio;
50 class DeviceConfig;
51 
53 {
54 public:
55  static std::unique_ptr<Y8950Periphery> create(
56  MSXAudio& audio, const DeviceConfig& config,
57  const std::string& soundDeviceName);
58 };
59 
60 } // namespace openmsx
61 
62 #endif
openmsx::Y8950Periphery::setSPOFF
virtual void setSPOFF(bool value, EmuTime::param time)
SP-OFF bit (bit 3 in Y8950 register 7)
Definition: Y8950Periphery.cc:102
openmsx.hh
openmsx::Y8950Periphery::getReadCacheLine
virtual const byte * getReadCacheLine(word start) const
Definition: Y8950Periphery.cc:120
openmsx::DeviceConfig
Definition: DeviceConfig.hh:19
openmsx::MSXAudio
Definition: MSXAudio.hh:14
openmsx::Y8950Periphery::read
virtual nibble read(EmuTime::param time)=0
Read from (some of) the pins Some of the pins might be programmed as output, but this method doesn't ...
openmsx::Y8950Periphery::write
virtual void write(nibble outputs, nibble values, EmuTime::param time)=0
Write to (some of) the pins.
openmsx::Y8950Periphery
Models the 4 general purpose I/O pins on the Y8950 (controlled by registers r#18 and r#19)
Definition: Y8950Periphery.hh:14
openmsx::Y8950PeripheryFactory::create
static std::unique_ptr< Y8950Periphery > create(MSXAudio &audio, const DeviceConfig &config, const std::string &soundDeviceName)
Definition: Y8950Periphery.cc:322
openmsx::nibble
uint8_t nibble
4 bit integer
Definition: openmsx.hh:23
openmsx::Y8950Periphery::getWriteCacheLine
virtual byte * getWriteCacheLine(word start) const
Definition: Y8950Periphery.cc:124
view::values
auto values(Map &&map)
Definition: view.hh:317
openmsx::Y8950Periphery::~Y8950Periphery
virtual ~Y8950Periphery()=default
openmsx::Y8950Periphery::reset
virtual void reset()
Definition: Y8950Periphery.cc:97
openmsx::Y8950Periphery::readMem
virtual byte readMem(word address, EmuTime::param time)
Definition: Y8950Periphery.cc:107
EmuTime.hh
openmsx::word
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
openmsx::Y8950Periphery::writeMem
virtual void writeMem(word address, byte value, EmuTime::param time)
Definition: Y8950Periphery.cc:116
openmsx::Y8950PeripheryFactory
Definition: Y8950Periphery.hh:52
openmsx
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
openmsx::Y8950Periphery::peekMem
virtual byte peekMem(word address, EmuTime::param time) const
Definition: Y8950Periphery.cc:112