2016-01-10 19:56:40 -05:00
|
|
|
#pragma once
|
|
|
|
#include "stdafx.h"
|
2016-02-13 22:19:42 -05:00
|
|
|
|
|
|
|
class DisassemblyInfo;
|
2016-11-19 19:21:28 -05:00
|
|
|
class MemoryManager;
|
2016-02-13 22:19:42 -05:00
|
|
|
struct DebugState;
|
2016-01-10 19:56:40 -05:00
|
|
|
|
|
|
|
struct TraceLoggerOptions
|
|
|
|
{
|
2016-09-03 21:52:59 -04:00
|
|
|
bool ShowByteCode;
|
|
|
|
bool ShowRegisters;
|
|
|
|
bool ShowCpuCycles;
|
|
|
|
bool ShowPpuCycles;
|
|
|
|
bool ShowPpuScanline;
|
|
|
|
bool ShowPpuFrames;
|
|
|
|
bool ShowExtraInfo;
|
|
|
|
bool IndentCode;
|
2016-11-19 19:21:28 -05:00
|
|
|
bool ShowEffectiveAddresses;
|
2016-01-10 19:56:40 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
class TraceLogger
|
|
|
|
{
|
|
|
|
private:
|
2016-02-13 22:19:42 -05:00
|
|
|
static TraceLogger *_instance;
|
2016-01-10 19:56:40 -05:00
|
|
|
TraceLoggerOptions _options;
|
|
|
|
string _outputFilepath;
|
|
|
|
ofstream _outputFile;
|
2016-06-01 21:01:04 -04:00
|
|
|
bool _firstLine;
|
2016-11-19 19:21:28 -05:00
|
|
|
shared_ptr<MemoryManager> _memoryManager;
|
2016-01-10 19:56:40 -05:00
|
|
|
|
|
|
|
public:
|
2016-11-19 19:21:28 -05:00
|
|
|
TraceLogger(string outputFilepath, shared_ptr<MemoryManager> memoryManager, TraceLoggerOptions options);
|
2016-01-10 19:56:40 -05:00
|
|
|
~TraceLogger();
|
|
|
|
|
|
|
|
void Log(DebugState &state, shared_ptr<DisassemblyInfo> disassemblyInfo);
|
2016-02-13 22:19:42 -05:00
|
|
|
|
|
|
|
static void LogStatic(string log);
|
2016-01-10 19:56:40 -05:00
|
|
|
};
|