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 
8 namespace openmsx {
9 
10 class DebugDevice final : public MSXDevice
11 {
12 public:
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 
24 private:
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 
32 private:
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.
Definition: DebugDevice.cc:23
DebugDevice(const DeviceConfig &config)
Definition: DebugDevice.cc:12
void serialize(Archive &ar, unsigned version)
Definition: DebugDevice.cc:164
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.
Definition: DebugDevice.cc:29
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition: MSXDevice.hh:32
This file implemented 3 utility functions:
Definition: Autofire.cc:5
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29