mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2025-04-05 05:38:50 +00:00
Add (currently disabled) disassembler to the 6809 unit test runner.
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
parent
e688411cb9
commit
8b12ed23e8
@ -2,7 +2,8 @@
|
||||
#include "Board.h"
|
||||
|
||||
Board::Board()
|
||||
: m_cpu(EightBit::mc6809(*this)) {
|
||||
: m_cpu(EightBit::mc6809(*this)),
|
||||
m_disassembler(*this, m_cpu) {
|
||||
}
|
||||
|
||||
void Board::initialise() {
|
||||
@ -10,8 +11,21 @@ void Board::initialise() {
|
||||
CPU().raise(CPU().NMI());
|
||||
CPU().raise(CPU().FIRQ());
|
||||
CPU().reset();
|
||||
|
||||
//CPU().ExecutingInstruction.connect(std::bind(&Board::Cpu_ExecutingInstruction_Debug, this, std::placeholders::_1));
|
||||
//CPU().ExecutedInstruction.connect(std::bind(&Board::Cpu_ExecutedInstruction_Debug, this, std::placeholders::_1));
|
||||
}
|
||||
|
||||
EightBit::MemoryMapping Board::mapping(uint16_t) {
|
||||
return { m_ram, 0x0000, 0xffff, EightBit::MemoryMapping::ReadWrite };
|
||||
}
|
||||
|
||||
void Board::Cpu_ExecutingInstruction_Debug(EightBit::mc6809&) {
|
||||
m_disassembleAt = CPU().PC();
|
||||
m_ignoreDisassembly = m_disassembler.ignore();
|
||||
}
|
||||
|
||||
void Board::Cpu_ExecutedInstruction_Debug(EightBit::mc6809&) {
|
||||
if (!m_ignoreDisassembly)
|
||||
std::cout << m_disassembler.trace(m_disassembleAt) << " " << std::endl;
|
||||
}
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include <Ram.h>
|
||||
#include <Bus.h>
|
||||
#include <mc6809.h>
|
||||
#include <Disassembly.h>
|
||||
|
||||
class Board : public EightBit::Bus {
|
||||
public:
|
||||
@ -18,4 +19,12 @@ protected:
|
||||
private:
|
||||
EightBit::Ram m_ram = 0x10000; // 0000 - FFFF, 64K RAM
|
||||
EightBit::mc6809 m_cpu;
|
||||
EightBit::Disassembly m_disassembler;
|
||||
|
||||
// The m_disassembleAt and m_ignoreDisassembly are used to skip pin events
|
||||
EightBit::register16_t m_disassembleAt = 0x0000;
|
||||
bool m_ignoreDisassembly = false;
|
||||
|
||||
void Cpu_ExecutingInstruction_Debug(EightBit::mc6809&);
|
||||
void Cpu_ExecutedInstruction_Debug(EightBit::mc6809&);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user