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"
8#include "SCC.hh"
9
10#include <array>
11
12namespace openmsx {
13
14class Yamanooto final : public MSXRom
15{
16public:
17 Yamanooto(const DeviceConfig& config, Rom&& rom);
18 ~Yamanooto() override;
19
20 void powerUp(EmuTime::param time) override;
21 void reset(EmuTime::param time) override;
22 [[nodiscard]] byte peekMem(word address, EmuTime::param time) const override;
23 [[nodiscard]] byte readMem(word address, EmuTime::param time) override;
24 [[nodiscard]] const byte* getReadCacheLine(word address) const override;
25 void writeMem(word address, byte value, EmuTime::param time) override;
26 [[nodiscard]] byte* getWriteCacheLine(word address) override;
27
28 byte peekIO(word port, EmuTime::param time) const override;
29 byte readIO(word port, EmuTime::param time) override;
30 void writeIO(word port, byte value, EmuTime::param time) override;
31
32 template<typename Archive>
33 void serialize(Archive& ar, unsigned version);
34
35private:
36 void writeConfigReg(byte value);
37 [[nodiscard]] bool isSCCAccess(word addr) const;
38 [[nodiscard]] unsigned getFlashAddr(unsigned addr) const;
39
40private:
41 struct Blocks final : RomBlockDebuggableBase {
42 explicit Blocks(const Yamanooto& device)
43 : RomBlockDebuggableBase(device) {}
44 [[nodiscard]] unsigned readExt(unsigned address) override;
45 } romBlockDebug;
46
47 AmdFlash flash;
48 SCC scc;
49 AY8910 psg;
50 std::array<uint16_t, 4> bankRegs = {}; // need 10 bits per entry (not 8)
51 byte enableReg = 0;
52 byte offsetReg = 0;
53 byte configReg = 0;
54 byte sccMode = 0;
55 byte psgLatch = 0;
56 byte fpgaFsm = 0; // hack, just enough to read ID
57};
58
59} // namespace openmsx
60
61#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:179
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
Definition Yamanooto.cc:163
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:190
void reset(EmuTime::param time) override
This method is called on reset.
Definition Yamanooto.cc:69
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
Definition Yamanooto.cc:137
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
Definition Yamanooto.cc:282
void serialize(Archive &ar, unsigned version)
Definition Yamanooto.cc:303
void powerUp(EmuTime::param time) override
This method is called when MSX is powered up.
Definition Yamanooto.cc:63
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:293
byte * getWriteCacheLine(word address) override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
Definition Yamanooto.cc:277
~Yamanooto() override
Definition Yamanooto.cc:57
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:287
This file implemented 3 utility functions:
Definition Autofire.cc:11
uint16_t word
16 bit unsigned integer
Definition openmsx.hh:29