mirror of
https://github.com/TomHarte/CLK.git
synced 2024-07-09 06:29:33 +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);
|
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.
|
// The CIAs are on the E clock.
|
||||||
cia_divider_ += changes.duration;
|
cia_divider_ += changes.duration;
|
||||||
const HalfCycles e_clocks = cia_divider_.divide(HalfCycles(20));
|
const HalfCycles e_clocks = cia_divider_.divide(HalfCycles(20));
|
||||||
|
@ -103,9 +103,10 @@ class Chipset: private ClockingHint::Observer {
|
|||||||
private:
|
private:
|
||||||
friend class DMADeviceBase;
|
friend class DMADeviceBase;
|
||||||
|
|
||||||
// MARK: - E Clock follow along.
|
// MARK: - E Clock and keyboard dividers.
|
||||||
|
|
||||||
HalfCycles cia_divider_;
|
HalfCycles cia_divider_;
|
||||||
|
HalfCycles keyboard_divider_;
|
||||||
|
|
||||||
// MARK: - Interrupts.
|
// MARK: - Interrupts.
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include "../KeyboardMachine.hpp"
|
#include "../KeyboardMachine.hpp"
|
||||||
#include "../../Components/Serial/Line.hpp"
|
#include "../../Components/Serial/Line.hpp"
|
||||||
|
#include "../../ClockReceiver/ClockReceiver.hpp"
|
||||||
|
|
||||||
namespace Amiga {
|
namespace Amiga {
|
||||||
|
|
||||||
@ -89,6 +90,10 @@ class Keyboard {
|
|||||||
void set_key_state(uint16_t, bool);
|
void set_key_state(uint16_t, bool);
|
||||||
void clear_all_keys();
|
void clear_all_keys();
|
||||||
|
|
||||||
|
void run_for(HalfCycles duration) {
|
||||||
|
output_.advance_writer(duration);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum class ShiftState {
|
enum class ShiftState {
|
||||||
Shifting,
|
Shifting,
|
||||||
|
Loading…
Reference in New Issue
Block a user