openMSX
MegaSCSI.hh
Go to the documentation of this file.
1#ifndef MEGASCSI_HH
2#define MEGASCSI_HH
3
4#include "MSXDevice.hh"
5#include "MB89352.hh"
6#include "SRAM.hh"
8#include <array>
9
10namespace openmsx {
11
12class MegaSCSI final : public MSXDevice
13{
14public:
15 explicit MegaSCSI(const DeviceConfig& config);
16
17 void reset(EmuTime::param time) override;
18
19 [[nodiscard]] byte readMem(word address, EmuTime::param time) override;
20 [[nodiscard]]byte peekMem(word address, EmuTime::param time) const override;
21 void writeMem(word address, byte value, EmuTime::param time) override;
22 [[nodiscard]]const byte* getReadCacheLine(word address) const override;
23 [[nodiscard]]byte* getWriteCacheLine(word address) override;
24
25 template<typename Archive>
26 void serialize(Archive& ar, unsigned version);
27
28private:
29 [[nodiscard]] size_t getSramSize() const;
30 void setSRAM(unsigned region, byte block);
31
32private:
33 MB89352 mb89352;
34 SRAM sram;
35 RomBlockDebuggable romBlockDebug;
36
37 std::array<bool, 4> isWriteable; // which region is readonly?
38 std::array<byte, 4> mapped; // SPC block mapped in this region?
39 const byte blockMask;
40};
41
42} // namespace openmsx
43
44#endif
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition MSXDevice.hh:36
byte * getWriteCacheLine(word address) override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
Definition MegaSCSI.cc:154
void serialize(Archive &ar, unsigned version)
Definition MegaSCSI.cc:178
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
Definition MegaSCSI.cc:84
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
Definition MegaSCSI.cc:105
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 MegaSCSI.cc:134
void reset(EmuTime::param time) override
This method is called on reset.
Definition MegaSCSI.cc:76
const byte * getReadCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
Definition MegaSCSI.cc:119
This file implemented 3 utility functions:
Definition Autofire.cc:11
uint16_t word
16 bit unsigned integer
Definition openmsx.hh:29