mirror of
https://github.com/TomHarte/CLK.git
synced 2024-06-29 00:29:34 +00:00
Wire mouse events to the relevant class.
This commit is contained in:
parent
cfaea7a90c
commit
543b1c644a
|
@ -18,6 +18,7 @@
|
||||||
#include "../../AudioProducer.hpp"
|
#include "../../AudioProducer.hpp"
|
||||||
#include "../../KeyboardMachine.hpp"
|
#include "../../KeyboardMachine.hpp"
|
||||||
#include "../../MediaTarget.hpp"
|
#include "../../MediaTarget.hpp"
|
||||||
|
#include "../../MouseMachine.hpp"
|
||||||
#include "../../ScanProducer.hpp"
|
#include "../../ScanProducer.hpp"
|
||||||
#include "../../TimedMachine.hpp"
|
#include "../../TimedMachine.hpp"
|
||||||
|
|
||||||
|
@ -322,6 +323,7 @@ class ConcreteMachine:
|
||||||
public Machine,
|
public Machine,
|
||||||
public MachineTypes::MappedKeyboardMachine,
|
public MachineTypes::MappedKeyboardMachine,
|
||||||
public MachineTypes::MediaTarget,
|
public MachineTypes::MediaTarget,
|
||||||
|
public MachineTypes::MouseMachine,
|
||||||
public MachineTypes::TimedMachine,
|
public MachineTypes::TimedMachine,
|
||||||
public MachineTypes::ScanProducer,
|
public MachineTypes::ScanProducer,
|
||||||
public Activity::Source
|
public Activity::Source
|
||||||
|
@ -485,6 +487,11 @@ class ConcreteMachine:
|
||||||
executor_.bus.keyboard().set_key_state(row, column, is_pressed);
|
executor_.bus.keyboard().set_key_state(row, column, is_pressed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MARK: - MouseMachine.
|
||||||
|
Inputs::Mouse &get_mouse() override {
|
||||||
|
return executor_.bus.keyboard().mouse();
|
||||||
|
}
|
||||||
|
|
||||||
// MARK: - ARM execution
|
// MARK: - ARM execution
|
||||||
static constexpr auto arm_model = InstructionSet::ARM::Model::ARMv2;
|
static constexpr auto arm_model = InstructionSet::ARM::Model::ARMv2;
|
||||||
using Executor = InstructionSet::ARM::Executor<arm_model, MemoryController<ConcreteMachine, ConcreteMachine>>;
|
using Executor = InstructionSet::ARM::Executor<arm_model, MemoryController<ConcreteMachine, ConcreteMachine>>;
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include "HalfDuplexSerial.hpp"
|
#include "HalfDuplexSerial.hpp"
|
||||||
|
|
||||||
#include "../../../Outputs/Log.hpp"
|
#include "../../../Outputs/Log.hpp"
|
||||||
|
#include "../../../Inputs/Mouse.hpp"
|
||||||
|
|
||||||
namespace Archimedes {
|
namespace Archimedes {
|
||||||
|
|
||||||
|
@ -144,6 +145,10 @@ struct Keyboard {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Inputs::Mouse &mouse() {
|
||||||
|
return mouse_;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
HalfDuplexSerial &serial_;
|
HalfDuplexSerial &serial_;
|
||||||
Log::Logger<Log::Source::Keyboard> logger_;
|
Log::Logger<Log::Source::Keyboard> logger_;
|
||||||
|
@ -190,6 +195,12 @@ private:
|
||||||
static constexpr uint8_t MACK = 0b0011'0010; // Last data byte acknowledge, disabling scanning but enabling mouse.
|
static constexpr uint8_t MACK = 0b0011'0010; // Last data byte acknowledge, disabling scanning but enabling mouse.
|
||||||
static constexpr uint8_t SMAK = 0b0011'0011; // Last data byte acknowledge, enabling scanning and mouse.
|
static constexpr uint8_t SMAK = 0b0011'0011; // Last data byte acknowledge, enabling scanning and mouse.
|
||||||
static constexpr uint8_t PRST = 0b0010'0001; // Does nothing.
|
static constexpr uint8_t PRST = 0b0010'0001; // Does nothing.
|
||||||
|
|
||||||
|
|
||||||
|
struct Mouse: public Inputs::Mouse {
|
||||||
|
|
||||||
|
};
|
||||||
|
Mouse mouse_;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user