1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-08-15 14:27:29 +00:00

Merge pull request #1158 from TomHarte/FasterMouse

Switch to maximal signalling rate.
This commit is contained in:
Thomas Harte
2023-08-21 22:13:39 -04:00
committed by GitHub

View File

@@ -15,9 +15,9 @@ using namespace Apple::ADB;
Mouse::Mouse(Bus &bus) : ReactiveDevice(bus, 3) {} Mouse::Mouse(Bus &bus) : ReactiveDevice(bus, 3) {}
void Mouse::perform_command(const Command &command) { void Mouse::perform_command(const Command &command) {
// This was picked empirically based on experimentation with the IIgs. // Mouse deltas are confined to a seven-bit signed field; this implementation keeps things symmetrical by
// Possible TODO: consider whether this is appropriate for other machines. // limiting them to a maximum absolute value of 63 in any direction.
static constexpr int16_t max_delta = 30; static constexpr int16_t max_delta = 63;
if(command.type == Command::Type::Talk && command.reg == 0) { if(command.type == Command::Type::Talk && command.reg == 0) {
// Read and clamp current deltas and buttons. // Read and clamp current deltas and buttons.