EightBit/M6502/test/Board.h
Adrian Conlon e40240694f More removal of duplicated code.
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
2018-06-24 22:33:02 +01:00

52 lines
1.1 KiB
C++

#pragma once
#include "Configuration.h"
#include <string>
#include <Ram.h>
#include <Bus.h>
#include <Profiler.h>
#include <Disassembly.h>
#include <mos6502.h>
#include <Symbols.h>
class Board : public EightBit::Bus {
public:
Board(const Configuration& configuration);
EightBit::MOS6502& CPU() { return m_cpu; }
void initialise();
protected:
virtual uint8_t& reference(uint16_t address) {
return m_ram.reference(address);
}
private:
const Configuration& m_configuration;
EightBit::Ram m_ram = 0x10000;
EightBit::MOS6502 m_cpu;
EightBit::Symbols m_symbols;
EightBit::Disassembly m_disassembler;
EightBit::Profiler m_profiler;
uint16_t m_oldPC = 0xffff;
bool m_stopped = false;
uint64_t m_pollCounter = 0UL;
uint64_t m_pollInterval = 0UL;
void pollKeyboard();
void Cpu_ExecutingInstruction_Debug(EightBit::MOS6502& cpu);
void Cpu_ExecutingInstruction_Profile(const EightBit::MOS6502& cpu);
void Cpu_ExecutedInstruction_StopLoop(EightBit::MOS6502& cpu);
void Memory_ReadingByte_Input(EightBit::EventArgs);
void Memory_WrittenByte_Output(EightBit::EventArgs);
void Cpu_ExecutedInstruction_Poll(const EightBit::MOS6502& cpu);
};