mirror of
https://github.com/TomHarte/CLK.git
synced 2024-08-15 09:29:02 +00:00
49 lines
1.0 KiB
C++
49 lines
1.0 KiB
C++
|
//
|
||
|
// Macintosh.cpp
|
||
|
// Clock Signal
|
||
|
//
|
||
|
// Created by Thomas Harte on 03/05/2019.
|
||
|
// Copyright © 2019 Thomas Harte. All rights reserved.
|
||
|
//
|
||
|
|
||
|
#include "Macintosh.hpp"
|
||
|
|
||
|
#include "../../../Processors/68000/68000.hpp"
|
||
|
#include "../../../Components/6522/6522.hpp"
|
||
|
|
||
|
namespace Apple {
|
||
|
namespace Macintosh {
|
||
|
|
||
|
class ConcreteMachine:
|
||
|
public Machine,
|
||
|
public CPU::MC68000::BusHandler {
|
||
|
public:
|
||
|
ConcreteMachine(const ROMMachine::ROMFetcher &rom_fetcher) :
|
||
|
mc68000_(*this) {
|
||
|
|
||
|
const auto roms = rom_fetcher("Macintosh", { "mac128k.rom" });
|
||
|
if(!roms[0]) {
|
||
|
throw ROMMachine::Error::MissingROMs;
|
||
|
}
|
||
|
|
||
|
roms[0]->resize(64*1024);
|
||
|
memcpy(rom_, roms[0]->data(), roms[0]->size());
|
||
|
}
|
||
|
|
||
|
private:
|
||
|
CPU::MC68000::Processor<ConcreteMachine, true> mc68000_;
|
||
|
uint8_t rom_[64*1024];
|
||
|
uint8_t ram_[128*1024];
|
||
|
};
|
||
|
|
||
|
}
|
||
|
}
|
||
|
|
||
|
using namespace Apple::Macintosh;
|
||
|
|
||
|
Machine *Machine::Macintosh(const Analyser::Static::Target *target, const ROMMachine::ROMFetcher &rom_fetcher) {
|
||
|
return new ConcreteMachine(rom_fetcher);
|
||
|
}
|
||
|
|
||
|
Machine::~Machine() {}
|