summaryrefslogtreecommitdiffhomepage
path: root/Private/Drivers/PS2
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlalelmahrouss@icloud.com>2024-02-24 18:42:41 +0100
committerAmlal El Mahrouss <amlalelmahrouss@icloud.com>2024-02-24 18:43:09 +0100
commit27e0af3ecfe0be226f88837634111299121e5ddb (patch)
treec6db44321fa7af03acd040772f9220c1827ceb25 /Private/Drivers/PS2
parenta481180f3bcb979fecdced3851506bf572327fcf (diff)
Drivers and Rsrc: Adding PS/2 support, add DrawResource macro.
Signed-off-by: Amlal El Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Private/Drivers/PS2')
-rw-r--r--Private/Drivers/PS2/Mouse.hxx49
1 files changed, 49 insertions, 0 deletions
diff --git a/Private/Drivers/PS2/Mouse.hxx b/Private/Drivers/PS2/Mouse.hxx
new file mode 100644
index 00000000..20cac560
--- /dev/null
+++ b/Private/Drivers/PS2/Mouse.hxx
@@ -0,0 +1,49 @@
+/* -------------------------------------------
+
+ Copyright Mahrouss Logic
+
+ File: Mouse.hxx
+ Purpose: PS/2 mouse.
+
+ Revision History:
+
+ 03/02/24: Added file (amlel)
+
+------------------------------------------- */
+
+#pragma once
+
+#include <ArchKit/ArchKit.hpp>
+#include <CompilerKit/CompilerKit.hpp>
+#include <NewKit/Defines.hpp>
+
+namespace HCore {
+
+class PS2Mouse {
+ explicit PS2Mouse() = default;
+ ~PS2Mouse() = default;
+
+ HCORE_COPY_DEFAULT(PS2Mouse);
+
+ struct PS2MouseTraits final {
+ Int16 Status;
+ Int32 X, Y;
+ };
+
+ PS2MouseTraits Read() noexcept {
+ PS2MouseTraits stat;
+
+ return stat;
+ }
+
+ private:
+ UInt8 Wait() {
+ while (!(HAL::In8(0x64) & 1)) {
+ asm("pause");
+ } // wait until we can read
+
+ // return the ack bit.
+ return HAL::In8(0x64);
+ }
+};
+} // namespace HCore