mirror of
https://github.com/TomHarte/CLK.git
synced 2025-11-29 02:17:57 +00:00
Implement MediaChangeObserver for the consoles.
This commit is contained in:
@@ -75,10 +75,11 @@ using Target = Analyser::Static::Atari2600::Target;
|
||||
|
||||
class ConcreteMachine:
|
||||
public Machine,
|
||||
public MachineTypes::TimedMachine,
|
||||
public MachineTypes::AudioProducer,
|
||||
public MachineTypes::JoystickMachine,
|
||||
public MachineTypes::MediaChangeObserver,
|
||||
public MachineTypes::ScanProducer,
|
||||
public MachineTypes::JoystickMachine {
|
||||
public MachineTypes::TimedMachine {
|
||||
public:
|
||||
ConcreteMachine(const Target &target) : frequency_mismatch_warner_(*this) {
|
||||
const std::vector<uint8_t> &rom = target.media.cartridges.front()->get_segments().front().data;
|
||||
@@ -187,6 +188,10 @@ public:
|
||||
return confidence_counter_.get_confidence();
|
||||
}
|
||||
|
||||
ChangeEffect effect_for_file_did_change(const std::string &) const final {
|
||||
return ChangeEffect::RestartMachine;
|
||||
}
|
||||
|
||||
private:
|
||||
// The bus.
|
||||
std::unique_ptr<Bus> bus_;
|
||||
|
||||
@@ -109,10 +109,11 @@ class ConcreteMachine:
|
||||
public Machine,
|
||||
public CPU::Z80::BusHandler,
|
||||
public Configurable::Device,
|
||||
public MachineTypes::TimedMachine,
|
||||
public MachineTypes::ScanProducer,
|
||||
public MachineTypes::AudioProducer,
|
||||
public MachineTypes::JoystickMachine {
|
||||
public MachineTypes::JoystickMachine,
|
||||
public MachineTypes::MediaChangeObserver,
|
||||
public MachineTypes::ScanProducer,
|
||||
public MachineTypes::TimedMachine {
|
||||
|
||||
public:
|
||||
ConcreteMachine(const Analyser::Static::Target &target, const ROMMachine::ROMFetcher &rom_fetcher) :
|
||||
@@ -356,6 +357,10 @@ public:
|
||||
return confidence_counter_.get_confidence();
|
||||
}
|
||||
|
||||
ChangeEffect effect_for_file_did_change(const std::string &) const final {
|
||||
return ChangeEffect::RestartMachine;
|
||||
}
|
||||
|
||||
// MARK: - Configuration options.
|
||||
std::unique_ptr<Reflection::Struct> get_options() const final {
|
||||
auto options = std::make_unique<Options>(Configurable::OptionsType::UserFriendly);
|
||||
|
||||
@@ -80,14 +80,15 @@ class Joystick: public Inputs::ConcreteJoystick {
|
||||
|
||||
template <Analyser::Static::Sega::Target::Model model> class ConcreteMachine:
|
||||
public Machine,
|
||||
public CPU::Z80::BusHandler,
|
||||
public MachineTypes::TimedMachine,
|
||||
public MachineTypes::ScanProducer,
|
||||
public MachineTypes::AudioProducer,
|
||||
public MachineTypes::KeyboardMachine,
|
||||
public MachineTypes::JoystickMachine,
|
||||
public Configurable::Device,
|
||||
public Inputs::Keyboard::Delegate {
|
||||
public CPU::Z80::BusHandler,
|
||||
public Inputs::Keyboard::Delegate,
|
||||
public MachineTypes::AudioProducer,
|
||||
public MachineTypes::JoystickMachine,
|
||||
public MachineTypes::KeyboardMachine,
|
||||
public MachineTypes::MediaChangeObserver,
|
||||
public MachineTypes::ScanProducer,
|
||||
public MachineTypes::TimedMachine {
|
||||
|
||||
public:
|
||||
ConcreteMachine(const Analyser::Static::Sega::Target &target, const ROMMachine::ROMFetcher &rom_fetcher) :
|
||||
@@ -180,6 +181,10 @@ template <Analyser::Static::Sega::Target::Model model> class ConcreteMachine:
|
||||
audio_queue_.flush();
|
||||
}
|
||||
|
||||
ChangeEffect effect_for_file_did_change(const std::string &) const final {
|
||||
return ChangeEffect::RestartMachine;
|
||||
}
|
||||
|
||||
void set_scan_target(Outputs::Display::ScanTarget *scan_target) final {
|
||||
vdp_.last_valid()->set_tv_standard(
|
||||
(region_ == Target::Region::Europe) ?
|
||||
|
||||
Reference in New Issue
Block a user