2018-08-26 19:09:34 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Configuration.h"
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include <Ram.h>
|
|
|
|
#include <Bus.h>
|
|
|
|
#include <mc6809.h>
|
|
|
|
#include <Disassembly.h>
|
2018-09-23 13:14:10 +01:00
|
|
|
#include <MC6850.h>
|
2018-08-26 19:09:34 +01:00
|
|
|
|
|
|
|
class Board : public EightBit::Bus {
|
|
|
|
public:
|
|
|
|
Board(const Configuration& configuration);
|
|
|
|
|
|
|
|
EightBit::mc6809& CPU() { return m_cpu; }
|
2018-09-23 13:14:10 +01:00
|
|
|
EightBit::mc6850& ACIA() { return m_acia; }
|
2018-08-26 19:09:34 +01:00
|
|
|
|
|
|
|
void initialise();
|
|
|
|
|
|
|
|
protected:
|
2018-09-15 14:35:59 +01:00
|
|
|
virtual EightBit::MemoryMapping mapping(uint16_t address) final;
|
2018-08-26 19:09:34 +01:00
|
|
|
|
|
|
|
private:
|
2018-09-21 00:17:25 +01:00
|
|
|
|
|
|
|
enum {
|
|
|
|
Uart = 0xa000,
|
|
|
|
Ustat = Uart,
|
|
|
|
Uctrl = Uart,
|
|
|
|
Recev = Uart + 1,
|
|
|
|
Trans = Uart + 1,
|
|
|
|
};
|
|
|
|
|
2018-08-26 19:09:34 +01:00
|
|
|
const Configuration& m_configuration;
|
|
|
|
EightBit::Ram m_ram = 0x8000; // 0000 - 7FFF, 32K RAM
|
2018-09-16 19:49:52 +01:00
|
|
|
EightBit::Rom m_unused2000 = 0x2000; // 8000 - 9FFF, 8K unused
|
2018-09-15 14:35:59 +01: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 13:14:10 +01:00
|
|
|
EightBit::mc6850 m_acia;
|
|
|
|
|
2018-08-26 19:09:34 +01:00
|
|
|
EightBit::mc6809 m_cpu;
|
|
|
|
EightBit::Disassembly m_disassembler;
|
|
|
|
|
2018-08-30 01:37:09 +01:00
|
|
|
EightBit::register16_t m_disassembleAt = 0x0000;
|
|
|
|
bool m_ignoreDisassembly = false;
|
|
|
|
|
2018-09-24 08:29:11 +01:00
|
|
|
uint64_t m_pollCounter = 0UL;
|
|
|
|
uint64_t m_pollInterval = 2000000 / 50;
|
2018-08-26 19:09:34 +01:00
|
|
|
|
2018-09-23 20:31:55 +01:00
|
|
|
void Cpu_ExecutingInstruction_Debug(EightBit::mc6809&);
|
|
|
|
void Cpu_ExecutedInstruction_Debug(EightBit::mc6809&);
|
2018-09-21 00:17:25 +01:00
|
|
|
|
2018-09-23 13:14:10 +01:00
|
|
|
void Cpu_ExecutedInstruction_die(EightBit::mc6809&);
|
|
|
|
|
|
|
|
// ACIA handling
|
|
|
|
|
|
|
|
void Bus_WritingByte_Acia(EightBit::EventArgs&);
|
|
|
|
void Bus_ReadingByte_Acia(EightBit::EventArgs&);
|
|
|
|
|
|
|
|
void Cpu_ExecutedInstruction_Acia(EightBit::mc6809&);
|
2018-09-21 00:17:25 +01:00
|
|
|
|
2018-09-24 08:29:11 +01:00
|
|
|
void Acia_Accessing(EightBit::EventArgs&);
|
|
|
|
void Acia_Accessed(EightBit::EventArgs&);
|
|
|
|
|
2018-09-23 20:31:55 +01:00
|
|
|
void updateAciaPins(EightBit::Chip::PinLevel rw);
|
2018-08-26 19:09:34 +01:00
|
|
|
};
|