2018-08-26 18:09:34 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Configuration.h"
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include <Ram.h>
|
|
|
|
#include <Bus.h>
|
|
|
|
#include <mc6809.h>
|
|
|
|
#include <Disassembly.h>
|
2018-09-23 12:14:10 +00:00
|
|
|
#include <MC6850.h>
|
2018-08-26 18:09:34 +00:00
|
|
|
|
|
|
|
class Board : public EightBit::Bus {
|
|
|
|
public:
|
|
|
|
Board(const Configuration& configuration);
|
|
|
|
|
|
|
|
EightBit::mc6809& CPU() { return m_cpu; }
|
2018-09-23 12:14:10 +00:00
|
|
|
EightBit::mc6850& ACIA() { return m_acia; }
|
2018-08-26 18:09:34 +00:00
|
|
|
|
|
|
|
void initialise();
|
|
|
|
|
|
|
|
protected:
|
2018-09-15 13:35:59 +00:00
|
|
|
virtual EightBit::MemoryMapping mapping(uint16_t address) final;
|
2018-08-26 18:09:34 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
const Configuration& m_configuration;
|
|
|
|
EightBit::Ram m_ram = 0x8000; // 0000 - 7FFF, 32K RAM
|
2018-09-16 18:49:52 +00:00
|
|
|
EightBit::Rom m_unused2000 = 0x2000; // 8000 - 9FFF, 8K unused
|
2018-09-15 13:35:59 +00:00
|
|
|
EightBit::Ram m_io = 0x2000; // A000 - BFFF, 8K serial interface, minimally decoded
|
|
|
|
EightBit::Rom m_rom = 0x4000; // C000 - FFFF, 16K ROM
|
|
|
|
|
2018-09-23 12:14:10 +00:00
|
|
|
EightBit::mc6850 m_acia;
|
|
|
|
|
2018-08-26 18:09:34 +00:00
|
|
|
EightBit::mc6809 m_cpu;
|
|
|
|
EightBit::Disassembly m_disassembler;
|
|
|
|
|
2018-10-20 15:57:32 +00:00
|
|
|
uint64_t m_totalCycleCount = 0UL;
|
|
|
|
int64_t m_frameCycleCount = 0UL;
|
|
|
|
|
|
|
|
// The m_disassembleAt and m_ignoreDisassembly are used to skip pin events
|
2018-08-30 00:37:09 +00:00
|
|
|
EightBit::register16_t m_disassembleAt = 0x0000;
|
|
|
|
bool m_ignoreDisassembly = false;
|
|
|
|
|
2018-09-30 22:10:03 +00:00
|
|
|
// CPU events
|
|
|
|
|
2018-09-23 19:31:55 +00:00
|
|
|
void Cpu_ExecutingInstruction_Debug(EightBit::mc6809&);
|
|
|
|
void Cpu_ExecutedInstruction_Debug(EightBit::mc6809&);
|
2018-09-20 23:17:25 +00:00
|
|
|
|
2018-10-21 09:28:33 +00:00
|
|
|
void Cpu_ExecutedInstruction_Terminator(EightBit::mc6809&);
|
2018-09-30 22:10:03 +00:00
|
|
|
void Cpu_ExecutedInstruction_Acia(EightBit::mc6809&);
|
2018-09-23 12:14:10 +00:00
|
|
|
|
2018-09-30 22:10:03 +00:00
|
|
|
// Bus events
|
2018-09-23 12:14:10 +00:00
|
|
|
|
2018-09-30 22:10:03 +00:00
|
|
|
// Allows us to marshal data from memory -> ACIA
|
2018-09-29 13:31:50 +00:00
|
|
|
void Bus_WrittenByte_Acia(EightBit::EventArgs&);
|
2018-09-30 22:10:03 +00:00
|
|
|
|
|
|
|
// Allows us to marshal data from ACIA -> memory
|
2018-09-23 12:14:10 +00:00
|
|
|
void Bus_ReadingByte_Acia(EightBit::EventArgs&);
|
|
|
|
|
2018-09-30 22:10:03 +00:00
|
|
|
// ACIA events
|
2018-09-20 23:17:25 +00:00
|
|
|
|
2018-10-20 15:57:32 +00:00
|
|
|
// Allows us to catch a byte being transmitted
|
2018-09-25 22:57:20 +00:00
|
|
|
void Acia_Transmitting(EightBit::EventArgs&);
|
|
|
|
|
2018-09-30 22:10:03 +00:00
|
|
|
// Use the bus data to update the ACIA access/address pins
|
2018-09-23 19:31:55 +00:00
|
|
|
void updateAciaPins(EightBit::Chip::PinLevel rw);
|
2018-08-26 18:09:34 +00:00
|
|
|
};
|