X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Modules%2FInput%2FPS2KbMouse%2Fps2mouse.c;h=e80a14131d489b2c7113eae31a201487ddac7901;hb=ec0a3c65da8c3d47895ab2e5b4cec8cf2070f6eb;hp=7c831f76910df1ce8e5d84c678796d330c59f0e0;hpb=f31fce99ba695db4d5b4509bfcf5d0c568d02af9;p=tpg%2Facess2.git diff --git a/Modules/Input/PS2KbMouse/ps2mouse.c b/Modules/Input/PS2KbMouse/ps2mouse.c index 7c831f76..e80a1413 100644 --- a/Modules/Input/PS2KbMouse/ps2mouse.c +++ b/Modules/Input/PS2KbMouse/ps2mouse.c @@ -10,9 +10,6 @@ #include #include "common.h" -static inline int MIN(int a, int b) { return (a < b) ? a : b; } -static inline int MAX(int a, int b) { return (a > b) ? a : b; } - // == CONSTANTS == #define NUM_AXIES 2 // X+Y #define NUM_BUTTONS 5 // Left, Right, Scroll Click, Scroll Up, Scroll Down @@ -26,6 +23,7 @@ Uint64 PS2Mouse_Read(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer int PS2Mouse_IOCtl(tVFS_Node *Node, int ID, void *Data); // == GLOBALS == +void (*gpMouse_EnableFcn)(void); // - Settings int giMouse_Sensitivity = 1; int giMouse_MaxX = 640, giMouse_MaxY = 480; @@ -52,13 +50,19 @@ tDevFS_Driver gMouse_DriverStruct = { // == CODE == int PS2Mouse_Install(char **Arguments) { + + // Set up variables - gMouse_Axies = (void*)&gMouse_FileData[1]; + gMouse_Axies = (void*)&gMouse_FileData[4]; gMouse_Buttons = (void*)&gMouse_Axies[NUM_AXIES]; + + gMouse_FileHeader->NAxies = 2; gMouse_FileHeader->NButtons = 3; + gMouse_Axies[0].MinValue = -10; gMouse_Axies[0].MaxValue = 10; + gMouse_Axies[1].MinValue = -10; gMouse_Axies[1].MaxValue = 10; // Initialise Mouse Controller giMouse_Cycle = 0; // Set Current Cycle position - KBC8042_EnableMouse(); + gpMouse_EnableFcn(); DevFS_AddDevice(&gMouse_DriverStruct); @@ -135,6 +139,7 @@ void PS2Mouse_HandleInterrupt(Uint8 InputByte) gMouse_Axies[i].CursorPos = newCursor; } +// Log("Mouse at %ix%i", gMouse_Axies[0].CursorPos, gMouse_Axies[1].CursorPos); VFS_MarkAvaliable(&gMouse_DriverStruct.RootNode, 1); }