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(string_view name);
31 
32  FilenameSetting fileNameSetting;
33  std::ostream* outputstrm;
34  std::ofstream debugOut;
35  std::string fileNameString;
36  DebugMode mode;
37  byte modeParameter;
38 };
39 
40 } // namespace openmsx
41 
42 #endif
uint8_t byte
8 bit unsigned integer
Definition: openmsx.hh:26
void reset(EmuTime::param time) override
This method is called on reset.
Definition: DebugDevice.cc:23
void serialize(Archive &ar, unsigned version)
Definition: DebugDevice.cc:171
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX...
Definition: MSXDevice.hh:31
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
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
This class implements a (close approximation) of the std::string_view class.
Definition: string_view.hh:16
DebugDevice(const DeviceConfig &config)
Definition: DebugDevice.cc:12