openMSX
Yamanooto.hh
Go to the documentation of this file.
1#ifndef YAMANOOTO_HH
2#define YAMANOOTO_HH
3
4#include "AY8910.hh"
5#include "AmdFlash.hh"
6#include "MSXRom.hh"
7#include "SCC.hh"
8
9#include <array>
10
11namespace openmsx {
12
13class Yamanooto final : public MSXRom
14{
15public:
16 Yamanooto(const DeviceConfig& config, Rom&& rom);
17 ~Yamanooto() override;
18
19 void powerUp(EmuTime::param time) override;
20 void reset(EmuTime::param time) override;
21 [[nodiscard]] byte peekMem(word address, EmuTime::param time) const override;
22 [[nodiscard]] byte readMem(word address, EmuTime::param time) override;
23 [[nodiscard]] const byte* getReadCacheLine(word address) const override;
24 void writeMem(word address, byte value, EmuTime::param time) override;
25 [[nodiscard]] byte* getWriteCacheLine(word address) override;
26
27 byte peekIO(word port, EmuTime::param time) const override;
28 byte readIO(word port, EmuTime::param time) override;
29 void writeIO(word port, byte value, EmuTime::param time) override;
30
31 template<typename Archive>
32 void serialize(Archive& ar, unsigned version);
33
34private:
35 void writeConfigReg(byte value);
36 [[nodiscard]] bool isSCCAccess(word addr) const;
37 [[nodiscard]] unsigned getFlashAddr(unsigned addr) const;
38
39private:
40 AmdFlash flash;
41 SCC scc;
42 AY8910 psg;
43 std::array<uint16_t, 4> bankRegs = {}; // need 10 bits per entry (not 8)
44 byte enableReg = 0;
45 byte offsetReg = 0;
46 byte configReg = 0;
47 byte sccMode = 0;
48 byte psgLatch = 0;
49 byte fpgaFsm = 0; // hack, just enough to read ID
50};
51
52} // namespace openmsx
53
54#endif
This class implements the AY-3-8910 sound chip.
Definition AY8910.hh:22
const byte * getReadCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
Definition Yamanooto.cc:165
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
Definition Yamanooto.cc:148
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 Yamanooto.cc:176
void reset(EmuTime::param time) override
This method is called on reset.
Definition Yamanooto.cc:54
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
Definition Yamanooto.cc:122
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
Definition Yamanooto.cc:269
void serialize(Archive &ar, unsigned version)
Definition Yamanooto.cc:290
void powerUp(EmuTime::param time) override
This method is called when MSX is powered up.
Definition Yamanooto.cc:48
void writeIO(word port, byte value, EmuTime::param time) override
Write a byte to a given IO port at a certain time to this device.
Definition Yamanooto.cc:280
byte * getWriteCacheLine(word address) override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
Definition Yamanooto.cc:264
~Yamanooto() override
Definition Yamanooto.cc:42
byte readIO(word port, EmuTime::param time) override
Read a byte from an IO port at a certain time from this device.
Definition Yamanooto.cc:274
This file implemented 3 utility functions:
Definition Autofire.cc:11
uint16_t word
16 bit unsigned integer
Definition openmsx.hh:29