1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-05 10:28:58 +00:00

Provides full serial input.

This commit is contained in:
Thomas Harte 2021-11-07 05:19:16 -08:00
parent 4fc25fb798
commit 31e22e4cfb
3 changed files with 12 additions and 1 deletions

View File

@ -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));

View File

@ -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.

View File

@ -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,