From 8bd6dae7200ac2493cd83188e3d2c44f6a9cf89c Mon Sep 17 00:00:00 2001 From: Jacques Gagnon Date: Mon, 8 Aug 2022 20:37:17 -0400 Subject: [PATCH] [PCE] Fixup mouse support --- main/wired/pce_io.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/main/wired/pce_io.c b/main/wired/pce_io.c index 29ca9caa..0942f952 100644 --- a/main/wired/pce_io.c +++ b/main/wired/pce_io.c @@ -278,9 +278,18 @@ static void pce_mouse_task(void) { } static unsigned pce_mouse_oe_isr(unsigned cause) { + uint32_t cur_in1 = GPIO.in1.val; cycle = 0; ++frame_cnt; ++mouse_cnt; + if (cur_in1 & P1_SEL_MASK) { + if (mouse_cnt) { + GPIO.out = axes[mouse_cnt - 1]; + } + } + else { + GPIO.out = map[0][2]; + } GPIO.status_w1tc = P1_OE_MASK; return 0; }