openMSX
MSXModem.hh
Go to the documentation of this file.
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
19namespace openmsx {
20
21class MSXModem final : public MSXDevice
22{
23public:
24 explicit MSXModem(const DeviceConfig& config);
25
26 void reset(EmuTime::param time) override;
27 void writeMem(word address, byte value, EmuTime::param time) override;
28 [[nodiscard]] byte readMem(word address, EmuTime::param time) override;
29 [[nodiscard]] byte peekMem(word address, EmuTime::param time) const override;
30 [[nodiscard]] byte* getWriteCacheLine(word address) override;
31 [[nodiscard]] const byte* getReadCacheLine(word address) const override;
32
33 template<typename Archive>
34 void serialize(Archive& ar, unsigned version);
35
36private:
37 Rom rom;
38 SRAM sram;
39 uint8_t bank;
40 byte selectedNCUreg;
41};
42
43} // namespace openmsx
44
45#endif
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition MSXDevice.hh:36
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
Definition MSXModem.cc:79
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
Definition MSXModem.cc:84
byte * getWriteCacheLine(word address) override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
Definition MSXModem.cc:68
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 MSXModem.cc:35
const byte * getReadCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
Definition MSXModem.cc:123
void reset(EmuTime::param time) override
This method is called on reset.
Definition MSXModem.cc:29
void serialize(Archive &ar, unsigned version)
Definition MSXModem.cc:137
This file implemented 3 utility functions:
Definition Autofire.cc:11
uint16_t word
16 bit unsigned integer
Definition openmsx.hh:29