2017-07-05 16:46:02 +00:00
|
|
|
#pragma once
|
|
|
|
|
2017-09-06 23:58:56 +00:00
|
|
|
#include "Configuration.h"
|
|
|
|
|
2017-07-05 16:46:02 +00:00
|
|
|
#include <string>
|
|
|
|
|
2017-09-06 23:58:56 +00:00
|
|
|
#include <Ram.h>
|
|
|
|
#include <Bus.h>
|
|
|
|
#include <Profiler.h>
|
|
|
|
#include <Disassembly.h>
|
|
|
|
#include <mos6502.h>
|
|
|
|
#include <Symbols.h>
|
2017-07-05 16:46:02 +00:00
|
|
|
|
2017-09-06 23:58:56 +00:00
|
|
|
class Board : public EightBit::Bus {
|
2017-07-05 16:46:02 +00:00
|
|
|
public:
|
|
|
|
Board(const Configuration& configuration);
|
|
|
|
|
|
|
|
EightBit::MOS6502& CPU() { return m_cpu; }
|
|
|
|
|
|
|
|
void initialise();
|
|
|
|
|
2017-09-06 23:58:56 +00:00
|
|
|
protected:
|
2018-06-10 21:00:52 +00:00
|
|
|
virtual uint8_t& reference(uint16_t address) {
|
2017-09-06 23:58:56 +00:00
|
|
|
return m_ram.reference(address);
|
|
|
|
}
|
|
|
|
|
2017-07-05 16:46:02 +00:00
|
|
|
private:
|
|
|
|
const Configuration& m_configuration;
|
2018-06-09 23:40:56 +00:00
|
|
|
EightBit::Ram m_ram = 0x10000;
|
2017-07-05 16:46:02 +00:00
|
|
|
EightBit::MOS6502 m_cpu;
|
2018-06-16 08:53:44 +00:00
|
|
|
EightBit::Symbols m_symbols;
|
2017-07-05 16:46:02 +00:00
|
|
|
EightBit::Disassembly m_disassembler;
|
|
|
|
EightBit::Profiler m_profiler;
|
|
|
|
|
2018-06-09 23:40:56 +00:00
|
|
|
uint16_t m_oldPC = 0xffff;
|
|
|
|
bool m_stopped = false;
|
|
|
|
uint64_t m_pollCounter = 0UL;
|
|
|
|
uint64_t m_pollInterval = 0UL;
|
2017-07-08 00:04:20 +00:00
|
|
|
|
|
|
|
void pollKeyboard();
|
2017-07-05 16:46:02 +00:00
|
|
|
|
2018-06-24 21:33:02 +00:00
|
|
|
void Cpu_ExecutingInstruction_Debug(EightBit::MOS6502& cpu);
|
2017-07-05 16:46:02 +00:00
|
|
|
void Cpu_ExecutingInstruction_Profile(const EightBit::MOS6502& cpu);
|
|
|
|
|
2018-06-24 21:33:02 +00:00
|
|
|
void Cpu_ExecutedInstruction_StopLoop(EightBit::MOS6502& cpu);
|
2017-07-08 00:04:20 +00:00
|
|
|
|
2018-06-10 21:00:52 +00:00
|
|
|
void Memory_ReadingByte_Input(EightBit::EventArgs);
|
|
|
|
void Memory_WrittenByte_Output(EightBit::EventArgs);
|
2017-07-08 00:04:20 +00:00
|
|
|
|
|
|
|
void Cpu_ExecutedInstruction_Poll(const EightBit::MOS6502& cpu);
|
2017-07-05 16:46:02 +00:00
|
|
|
};
|