OXYGENHUB
◆ main openmsx / src / serial / MSXModem.hh
1.2 KiB · C++ · last changed chore(): initial commit 1 month ago source blame history raw
1
#ifndef MSXMODEM_HH
2
#define MSXMODEM_HH
3
4
#include "MSXDevice.hh"
5
#include "Rom.hh"
6
#include "SRAM.hh"
7
#include <array>
8
9
// PLEASE NOTE!
10
//
11
// This device is work in progress. It's just a guess based on some reverse
12
// engineering of the ROM by Zeilemaker54. It even contains some debug prints :)
13
//
14
// Perhaps this can be used for hardware like the modem in the Sony HB-T600,
15
// HBI-1200 and maybe even Mitsubishi ML-TS2(H).
16
//
17
// The actual modem part isn't implemented at all!
18
19
namespace openmsx {
20
21
class MSXModem final : public MSXDevice
22
{
23
public:
24
	explicit MSXModem(DeviceConfig& config);
25
26
	void reset(EmuTime time) override;
27
	void writeMem(uint16_t address, uint8_t value, EmuTime time) override;
28
	[[nodiscard]] uint8_t readMem(uint16_t address, EmuTime time) override;
29
	[[nodiscard]] uint8_t peekMem(uint16_t address, EmuTime time) const override;
30
	[[nodiscard]] uint8_t* getWriteCacheLine(uint16_t address) override;
31
	[[nodiscard]] const uint8_t* getReadCacheLine(uint16_t address) const override;
32
33
	template<typename Archive>
34
	void serialize(Archive& ar, unsigned version);
35
36
private:
37
	Rom rom;
38
	SRAM sram;
39
	uint8_t bank;
40
	uint8_t selectedNCUreg;
41
};
42
43
} // namespace openmsx
44
45
#endif