2018-10-06 23:52:39 +01:00
|
|
|
#include "pch.h"
|
|
|
|
#include "Board.h"
|
|
|
|
|
|
|
|
Board::Board()
|
2018-11-10 20:29:27 +00:00
|
|
|
: m_cpu(EightBit::mc6809(*this)),
|
|
|
|
m_disassembler(*this, m_cpu) {
|
2018-10-06 23:52:39 +01:00
|
|
|
}
|
|
|
|
|
2019-01-14 02:10:17 +00:00
|
|
|
void Board::raisePOWER() {
|
|
|
|
EightBit::Bus::raisePOWER();
|
|
|
|
|
|
|
|
CPU().raisePOWER();
|
|
|
|
|
|
|
|
CPU().lowerRESET();
|
|
|
|
CPU().raiseINT();
|
|
|
|
|
|
|
|
CPU().raiseNMI();
|
|
|
|
CPU().raiseFIRQ();
|
|
|
|
CPU().raiseHALT();
|
2018-11-11 16:48:44 +00:00
|
|
|
}
|
2018-11-10 20:29:27 +00:00
|
|
|
|
2019-01-14 02:10:17 +00:00
|
|
|
void Board::lowerPOWER() {
|
|
|
|
CPU().lowerPOWER();
|
|
|
|
EightBit::Bus::lowerPOWER();
|
2018-11-11 16:48:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void Board::initialise() {
|
2021-04-07 21:36:09 +01:00
|
|
|
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;
|
|
|
|
});
|
2018-10-06 23:52:39 +01:00
|
|
|
}
|
|
|
|
|
2021-07-18 14:28:40 +01:00
|
|
|
EightBit::MemoryMapping Board::mapping(uint16_t) noexcept {
|
2018-12-01 15:24:29 +00:00
|
|
|
return { m_ram, 0x0000, 0xffff, EightBit::MemoryMapping::AccessLevel::ReadWrite };
|
2018-10-06 23:52:39 +01:00
|
|
|
}
|