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