From 382a4f551057a91a92cf5399f04217dd6b5a9ba0 Mon Sep 17 00:00:00 2001 From: peony Date: Fri, 25 Oct 2024 15:57:53 +0200 Subject: [PATCH] Literally 0 mouse driver work --- sysdata/programs/mouse_driver/src/main.hb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sysdata/programs/mouse_driver/src/main.hb b/sysdata/programs/mouse_driver/src/main.hb index 3efa14f..a76d602 100644 --- a/sysdata/programs/mouse_driver/src/main.hb +++ b/sysdata/programs/mouse_driver/src/main.hb @@ -1,5 +1,7 @@ .{memory, buffer, log, string} := @use("../../../libraries/stn/src/lib.hb") +ACK := 250 + wait_for := fn(for: u8): void { loop { if (memory.inb(0x64) & 2 >> for) == for { @@ -21,14 +23,14 @@ send_command := fn(command: u8): void { } get_response := fn(): u8 { - @inline(wait_for, 0) + @inline(wait_for, 1) return memory.inb(0x60) } main := fn(): int { format_page := memory.alloc(u8, 1024) - wait_for(1) + wait_for(0) memory.outb(0x64, 0xA8) log.info("Aux mouse device enabled.\0") @@ -39,16 +41,14 @@ main := fn(): int { get_response() loop { - loop { - if (memory.inb(0x64) & 0x21) == 0x21 break - } + loop if (memory.inb(0x64) & 0x20) == 0x20 break status := memory.inb(0x60) //log.info("NEGATIVE Y MOVEMENT\0\0") - log.info(string.display_int(status, format_page)) + log.info(string.display_int(status, format_page, 10)) d_x := memory.inb(0x60) - log.info(string.display_int(d_x, format_page)) + log.info(string.display_int(d_x, format_page, 10)) d_y := memory.inb(0x60) - log.info(string.display_int(d_y, format_page)) + log.info(string.display_int(d_y, format_page, 10)) } return 0