mirror of
https://github.com/TomHarte/CLK.git
synced 2024-10-04 17:56:29 +00:00
Adds activity lights for Macintosh disk activity.
Prompting a quick fix to drives not spinning down.
This commit is contained in:
parent
c8177af45a
commit
96005261c7
@ -399,3 +399,8 @@ void IWM::set_component_prefers_clocking(ClockingHint::Source *component, Clocki
|
|||||||
drive_is_rotating_[1] = is_rotating;
|
drive_is_rotating_[1] = is_rotating;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void IWM::set_activity_observer(Activity::Observer *observer) {
|
||||||
|
if(drives_[0]) drives_[0]->set_activity_observer(observer, "Internal Drive", true);
|
||||||
|
if(drives_[1]) drives_[1]->set_activity_observer(observer, "External Drive", true);
|
||||||
|
}
|
||||||
|
@ -9,8 +9,11 @@
|
|||||||
#ifndef IWM_hpp
|
#ifndef IWM_hpp
|
||||||
#define IWM_hpp
|
#define IWM_hpp
|
||||||
|
|
||||||
|
#include "../../Activity/Observer.hpp"
|
||||||
|
|
||||||
#include "../../ClockReceiver/ClockReceiver.hpp"
|
#include "../../ClockReceiver/ClockReceiver.hpp"
|
||||||
#include "../../ClockReceiver/ClockingHintSource.hpp"
|
#include "../../ClockReceiver/ClockingHintSource.hpp"
|
||||||
|
|
||||||
#include "../../Storage/Disk/Drive.hpp"
|
#include "../../Storage/Disk/Drive.hpp"
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
@ -67,6 +70,10 @@ class IWM:
|
|||||||
/// Connects a drive to the IWM.
|
/// Connects a drive to the IWM.
|
||||||
void set_drive(int slot, IWMDrive *drive);
|
void set_drive(int slot, IWMDrive *drive);
|
||||||
|
|
||||||
|
/// Registers the currently-connected drives as @c Activity::Sources ;
|
||||||
|
/// the first will be declared 'Internal', the second 'External'.
|
||||||
|
void set_activity_observer(Activity::Observer *observer);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Storage::Disk::Drive::EventDelegate.
|
// Storage::Disk::Drive::EventDelegate.
|
||||||
void process_event(const Storage::Disk::Drive::Event &event) override;
|
void process_event(const Storage::Disk::Drive::Event &event) override;
|
||||||
|
@ -71,7 +71,9 @@ void DoubleDensityDrive::set_rotation_speed(float revolutions_per_minute) {
|
|||||||
|
|
||||||
// MARK: - Control input/output.
|
// MARK: - Control input/output.
|
||||||
|
|
||||||
void DoubleDensityDrive::set_enabled(bool) {
|
void DoubleDensityDrive::set_enabled(bool enabled) {
|
||||||
|
// Disabling a drive also stops its motor.
|
||||||
|
if(!enabled) set_motor_on(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoubleDensityDrive::set_control_lines(int lines) {
|
void DoubleDensityDrive::set_control_lines(int lines) {
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
#include "RealTimeClock.hpp"
|
#include "RealTimeClock.hpp"
|
||||||
#include "Video.hpp"
|
#include "Video.hpp"
|
||||||
|
|
||||||
|
#include "../../../Activity/Source.hpp"
|
||||||
#include "../../CRTMachine.hpp"
|
#include "../../CRTMachine.hpp"
|
||||||
#include "../../KeyboardMachine.hpp"
|
#include "../../KeyboardMachine.hpp"
|
||||||
#include "../../MediaTarget.hpp"
|
#include "../../MediaTarget.hpp"
|
||||||
@ -55,7 +56,8 @@ template <Analyser::Static::Macintosh::Target::Model model> class ConcreteMachin
|
|||||||
public MouseMachine::Machine,
|
public MouseMachine::Machine,
|
||||||
public CPU::MC68000::BusHandler,
|
public CPU::MC68000::BusHandler,
|
||||||
public KeyboardMachine::MappedMachine,
|
public KeyboardMachine::MappedMachine,
|
||||||
public Zilog::SCC::z8530::Delegate {
|
public Zilog::SCC::z8530::Delegate,
|
||||||
|
public Activity::Source {
|
||||||
public:
|
public:
|
||||||
using Target = Analyser::Static::Macintosh::Target;
|
using Target = Analyser::Static::Macintosh::Target;
|
||||||
|
|
||||||
@ -460,6 +462,11 @@ template <Analyser::Static::Macintosh::Target::Model model> class ConcreteMachin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MARK: - Activity Source
|
||||||
|
void set_activity_observer(Activity::Observer *observer) override {
|
||||||
|
iwm_.iwm.set_activity_observer(observer);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void update_video() {
|
void update_video() {
|
||||||
video_.run_for(time_since_video_update_.flush<HalfCycles>());
|
video_.run_for(time_since_video_update_.flush<HalfCycles>());
|
||||||
|
Loading…
Reference in New Issue
Block a user