mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-11 08:30:55 +00:00
Hit and hope appears to have fixed mouse input.
This commit is contained in:
parent
ae56da2b0d
commit
17f1f05064
@ -76,11 +76,15 @@ uint8_t GLU::get_mouse_data() {
|
||||
// b5–b0: mouse delta.
|
||||
|
||||
const uint8_t result = registers_[visible_mouse_register_];
|
||||
if(visible_mouse_register_ == 2) {
|
||||
++visible_mouse_register_;
|
||||
} else {
|
||||
if(visible_mouse_register_ == 3) {
|
||||
status_ &= ~uint8_t(CPUFlags::MouseDataFull);
|
||||
}
|
||||
|
||||
// Spelt out at tedious length because Clang has trust issues.
|
||||
static constexpr int first_register = 2;
|
||||
static constexpr int second_register = 3;
|
||||
static constexpr int flip_mask = first_register ^ second_register;
|
||||
visible_mouse_register_ ^= flip_mask;
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -116,7 +120,7 @@ uint8_t GLU::get_status() {
|
||||
// b2: 1 = keyboard data interrupt is enabled.
|
||||
// b1: 1 = mouse x-data is available; 0 = y.
|
||||
// b0: 1 = command register is full (set when command is written); 0 = empty (cleared when data is read).
|
||||
return status_ | ((visible_mouse_register_ == 2) ? uint8_t(CPUFlags::MouseXIsAvailable) : 0);
|
||||
return status_ | ((visible_mouse_register_ == 2) ? 0 : uint8_t(CPUFlags::MouseXIsAvailable));
|
||||
}
|
||||
|
||||
void GLU::set_status(uint8_t status) {
|
||||
|
@ -752,7 +752,7 @@ class ConcreteMachine:
|
||||
is_1Mhz = true;
|
||||
break;
|
||||
case Read(0xc045):
|
||||
// MMDELTAX byte.
|
||||
// MMDELTAY byte.
|
||||
*value = 0;
|
||||
is_1Mhz = true;
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user