| 1 |
#ifndef NOWINDINTERFACE_HH |
| 2 |
#define NOWINDINTERFACE_HH |
| 3 |
|
| 4 |
#include "NowindCommand.hh" |
| 5 |
#include "NowindHost.hh" |
| 6 |
|
| 7 |
#include "AmdFlash.hh" |
| 8 |
#include "MSXDevice.hh" |
| 9 |
#include "Rom.hh" |
| 10 |
|
| 11 |
#include <bitset> |
| 12 |
#include <optional> |
| 13 |
#include <string> |
| 14 |
|
| 15 |
namespace openmsx { |
| 16 |
|
| 17 |
class NowindInterface final : public MSXDevice |
| 18 |
{ |
| 19 |
public: |
| 20 |
explicit NowindInterface(DeviceConfig& config); |
| 21 |
~NowindInterface() override; |
| 22 |
|
| 23 |
void reset(EmuTime time) override; |
| 24 |
[[nodiscard]] byte peekMem(uint16_t address, EmuTime time) const override; |
| 25 |
[[nodiscard]] byte readMem(uint16_t address, EmuTime time) override; |
| 26 |
void writeMem(uint16_t address, byte value, EmuTime time) override; |
| 27 |
[[nodiscard]] const byte* getReadCacheLine(uint16_t address) const override; |
| 28 |
[[nodiscard]] byte* getWriteCacheLine(uint16_t address) override; |
| 29 |
|
| 30 |
template<typename Archive> |
| 31 |
void serialize(Archive& ar, unsigned version); |
| 32 |
|
| 33 |
private: |
| 34 |
Rom rom; |
| 35 |
AmdFlash flash; |
| 36 |
NowindHost::Drives drives; |
| 37 |
NowindHost host; |
| 38 |
std::optional<NowindCommand> command; |
| 39 |
std::string basename; |
| 40 |
byte bank; |
| 41 |
|
| 42 |
static constexpr unsigned MAX_NOWINDS = 8; |
| 43 |
using NowindsInUse = std::bitset<MAX_NOWINDS>; |
| 44 |
std::shared_ptr<NowindsInUse> nowindsInUse; |
| 45 |
|
| 46 |
friend class NowindCommand; |
| 47 |
}; |
| 48 |
|
| 49 |
} |
| 50 |
|
| 51 |
#endif |