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  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
openmsx::DebugDevice
Definition: DebugDevice.hh:10
openmsx::MSXDevice
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition: MSXDevice.hh:31
openmsx::DeviceConfig
Definition: DeviceConfig.hh:19
openmsx::DebugDevice::DebugDevice
DebugDevice(const DeviceConfig &config)
Definition: DebugDevice.cc:12
openmsx::DebugDevice::DebugMode
DebugMode
Definition: DebugDevice.hh:22
openmsx::DebugDevice::reset
void reset(EmuTime::param time) override
This method is called on reset.
Definition: DebugDevice.cc:23
FilenameSetting.hh
MSXDevice.hh
openmsx::DebugDevice::ASCII
@ ASCII
Definition: DebugDevice.hh:22
openmsx::word
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
openmsx::DebugDevice::serialize
void serialize(Archive &ar, unsigned version)
Definition: DebugDevice.cc:171
openmsx::DebugDevice::writeIO
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
openmsx::DebugDevice::MULTIBYTE
@ MULTIBYTE
Definition: DebugDevice.hh:22
openmsx
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
openmsx::DebugDevice::SINGLEBYTE
@ SINGLEBYTE
Definition: DebugDevice.hh:22
openmsx::DebugDevice::OFF
@ OFF
Definition: DebugDevice.hh:22