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
9namespace openmsx {
10
15{
16public:
17 virtual ~Y8950Periphery() = default;
18
19 virtual void reset();
20
29 virtual void write(nibble outputs, nibble values, EmuTime::param time) = 0;
30
37 [[nodiscard]] virtual nibble read(EmuTime::param time) = 0;
38
40 virtual void setSPOFF(bool value, EmuTime::param time);
41
42 [[nodiscard]] virtual byte readMem(word address, EmuTime::param time);
43 [[nodiscard]] virtual byte peekMem(word address, EmuTime::param time) const;
44 virtual void writeMem(word address, byte value, EmuTime::param time);
45 [[nodiscard]] virtual const byte* getReadCacheLine(word start) const;
46 [[nodiscard]] virtual byte* getWriteCacheLine(word start);
47};
48
49class MSXAudio;
50class DeviceConfig;
51
53{
54public:
55 [[nodiscard]] 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
static std::unique_ptr< Y8950Periphery > create(MSXAudio &audio, const DeviceConfig &config, const std::string &soundDeviceName)
Models the 4 general purpose I/O pins on the Y8950 (controlled by registers r#18 and r#19)
virtual byte peekMem(word address, EmuTime::param time) const
virtual const byte * getReadCacheLine(word start) const
virtual void write(nibble outputs, nibble values, EmuTime::param time)=0
Write to (some of) the pins.
virtual void writeMem(word address, byte value, EmuTime::param time)
virtual byte * getWriteCacheLine(word start)
virtual byte readMem(word address, EmuTime::param time)
virtual ~Y8950Periphery()=default
virtual void setSPOFF(bool value, EmuTime::param time)
SP-OFF bit (bit 3 in Y8950 register 7)
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 ...
This file implemented 3 utility functions:
Definition Autofire.cc:11
uint8_t nibble
4 bit integer
Definition openmsx.hh:23
uint16_t word
16 bit unsigned integer
Definition openmsx.hh:29