openMSX
DebugDevice.hh
Go to the documentation of this file.
1#ifndef DEBUGDEVICE_HH
2#define DEBUGDEVICE_HH
3
4#include "MSXDevice.hh"
5#include "FilenameSetting.hh"
6#include <fstream>
7
8namespace openmsx {
9
10class DebugDevice final : public MSXDevice
11{
12public:
13 explicit DebugDevice(const DeviceConfig& config);
14
15 void reset(EmuTime::param time) override;
16 void writeIO(word port, byte value, EmuTime::param time) override;
17
18 template<typename Archive>
19 void serialize(Archive& ar, unsigned version);
20
21 // public for serialization
23
24private:
25 enum DisplayType {HEX, BIN, DEC, ASC};
26
27 void outputSingleByte(byte value, EmuTime::param time);
28 void outputMultiByte(byte value);
29 void displayByte(byte value, DisplayType type);
30 void openOutput(std::string_view name);
31
32private:
33 FilenameSetting fileNameSetting;
34 std::ostream* outputStrm;
35 std::ofstream debugOut;
36 std::string fileNameString;
37 DebugMode mode;
38 byte modeParameter;
39};
40
41} // namespace openmsx
42
43#endif
void reset(EmuTime::param time) override
This method is called on reset.
void serialize(Archive &ar, unsigned version)
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.
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition MSXDevice.hh:36
This file implemented 3 utility functions:
Definition Autofire.cc:11
uint16_t word
16 bit unsigned integer
Definition openmsx.hh:29