mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2025-01-06 13:30:45 +00:00
22506ea56c
Signed-off-by: Adrian Conlon <adrian.conlon@gmail.com>
42 lines
892 B
C++
42 lines
892 B
C++
#include "pch.h"
|
|
#include "Board.h"
|
|
|
|
Board::Board()
|
|
: m_cpu(EightBit::mc6809(*this)),
|
|
m_disassembler(*this, m_cpu) {
|
|
}
|
|
|
|
void Board::raisePOWER() {
|
|
EightBit::Bus::raisePOWER();
|
|
|
|
CPU().raisePOWER();
|
|
|
|
CPU().lowerRESET();
|
|
CPU().raiseINT();
|
|
|
|
CPU().raiseNMI();
|
|
CPU().raiseFIRQ();
|
|
CPU().raiseHALT();
|
|
}
|
|
|
|
void Board::lowerPOWER() {
|
|
CPU().lowerPOWER();
|
|
EightBit::Bus::lowerPOWER();
|
|
}
|
|
|
|
void Board::initialise() {
|
|
CPU().ExecutingInstruction.connect([this](EightBit::mc6809& cpu) {
|
|
m_disassembleAt = CPU().PC();
|
|
m_ignoreDisassembly = m_disassembler.ignore();
|
|
});
|
|
|
|
CPU().ExecutedInstruction.connect([this](EightBit::mc6809& cpu) {
|
|
if (!m_ignoreDisassembly)
|
|
std::cout << m_disassembler.trace(m_disassembleAt) << " " << std::endl;
|
|
});
|
|
}
|
|
|
|
EightBit::MemoryMapping Board::mapping(uint16_t) noexcept {
|
|
return { m_ram, 0x0000, 0xffff, EightBit::MemoryMapping::AccessLevel::ReadWrite };
|
|
}
|