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
7#include <fstream>
8
9namespace openmsx {
10
11class DebugDevice final : public MSXDevice
12{
13public:
14 explicit DebugDevice(const DeviceConfig& config);
15
16 void reset(EmuTime::param time) override;
17 void writeIO(word port, byte value, EmuTime::param time) override;
18
19 template<typename Archive>
20 void serialize(Archive& ar, unsigned version);
21
22 // public for serialization
24
25private:
26 enum DisplayType {HEX, BIN, DEC, ASC};
27
28 void outputSingleByte(byte value, EmuTime::param time);
29 void outputMultiByte(byte value);
30 void displayByte(byte value, DisplayType type);
31 void openOutput(std::string_view name);
32
33private:
34 FilenameSetting fileNameSetting;
35 std::ostream* outputStrm;
36 std::ofstream debugOut;
37 std::string fileNameString;
38 DebugMode mode;
39 byte modeParameter;
40};
41
42} // namespace openmsx
43
44#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