2017-06-04 20:38:34 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <array>
|
|
|
|
#include <cstdint>
|
|
|
|
|
2017-06-05 21:39:15 +00:00
|
|
|
namespace EightBit {
|
2017-06-19 16:37:41 +00:00
|
|
|
|
|
|
|
class Disassembler;
|
|
|
|
class Z80;
|
|
|
|
|
2017-06-05 21:39:15 +00:00
|
|
|
class Profiler {
|
|
|
|
public:
|
2017-06-19 16:37:41 +00:00
|
|
|
Profiler(Z80& cpu, Disassembler& disassembler);
|
2017-06-05 21:39:15 +00:00
|
|
|
~Profiler();
|
2017-06-04 20:38:34 +00:00
|
|
|
|
2017-06-05 21:39:15 +00:00
|
|
|
void addInstruction(uint8_t instruction);
|
|
|
|
void addAddress(uint16_t address);
|
2017-06-04 20:38:34 +00:00
|
|
|
|
2017-06-05 21:39:15 +00:00
|
|
|
void dump() const;
|
2017-06-04 20:38:34 +00:00
|
|
|
|
2017-06-05 21:39:15 +00:00
|
|
|
private:
|
|
|
|
std::array<uint64_t, 0x100> m_instructions;
|
|
|
|
std::array<uint64_t, 0x10000> m_addresses;
|
2017-06-19 16:37:41 +00:00
|
|
|
Z80& m_cpu;
|
2017-10-29 20:15:49 +00:00
|
|
|
Disassembler& m_disassembler;
|
2017-06-04 20:38:34 +00:00
|
|
|
|
2017-06-05 21:39:15 +00:00
|
|
|
void dumpInstructionProfiles() const;
|
|
|
|
void dumpAddressProfiles() const;
|
|
|
|
};
|
|
|
|
}
|