mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-12 00:30:31 +00:00
Provides full serial input.
This commit is contained in:
parent
4fc25fb798
commit
31e22e4cfb
@ -500,6 +500,11 @@ template <bool stop_on_cpu> Chipset::Changes Chipset::run(HalfCycles length) {
|
||||
assert(line_cycle_ < line_length_ * 4);
|
||||
}
|
||||
|
||||
// Advance the keyboard's serial output, at
|
||||
// close enough to 1,000,000 ticks/second.
|
||||
keyboard_divider_ += changes.duration;
|
||||
keyboard_.run_for(keyboard_divider_.divide(HalfCycles(14)));
|
||||
|
||||
// The CIAs are on the E clock.
|
||||
cia_divider_ += changes.duration;
|
||||
const HalfCycles e_clocks = cia_divider_.divide(HalfCycles(20));
|
||||
|
@ -103,9 +103,10 @@ class Chipset: private ClockingHint::Observer {
|
||||
private:
|
||||
friend class DMADeviceBase;
|
||||
|
||||
// MARK: - E Clock follow along.
|
||||
// MARK: - E Clock and keyboard dividers.
|
||||
|
||||
HalfCycles cia_divider_;
|
||||
HalfCycles keyboard_divider_;
|
||||
|
||||
// MARK: - Interrupts.
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include <cstdint>
|
||||
#include "../KeyboardMachine.hpp"
|
||||
#include "../../Components/Serial/Line.hpp"
|
||||
#include "../../ClockReceiver/ClockReceiver.hpp"
|
||||
|
||||
namespace Amiga {
|
||||
|
||||
@ -89,6 +90,10 @@ class Keyboard {
|
||||
void set_key_state(uint16_t, bool);
|
||||
void clear_all_keys();
|
||||
|
||||
void run_for(HalfCycles duration) {
|
||||
output_.advance_writer(duration);
|
||||
}
|
||||
|
||||
private:
|
||||
enum class ShiftState {
|
||||
Shifting,
|
||||
|
Loading…
x
Reference in New Issue
Block a user