Modules/PS2KbMouse - Bugfixing (alignment issue)
authorJohn Hodge <[email protected]>
Mon, 17 Oct 2011 14:57:02 +0000 (22:57 +0800)
committerJohn Hodge <[email protected]>
Mon, 17 Oct 2011 14:57:02 +0000 (22:57 +0800)
Kernel/include/api_drv_joystick.h
Modules/Input/PS2KbMouse/ps2mouse.c

index 9225c5e..cebec10 100644 (file)
@@ -111,7 +111,7 @@ struct sJoystick_FileHeader
 {\r
        Uint16  NAxies; //!< Number of Axies\r
        Uint16  NButtons;       //!< Number of buttons\r
-};\r
+} PACKED;\r
 \r
 /**\r
  * \brief Axis Definition in file data\r
@@ -128,7 +128,7 @@ struct sJoystick_Axis
        Sint16  MaxValue;       //!< Maximum value for \a CurValue\r
        Sint16  CurValue;       //!< Current value (joystick position)\r
        Uint16  CursorPos;      //!< Current state (cursor position)\r
-};\r
+} PACKED;\r
 \r
 #define JOY_INFOSTRUCT(_naxies, _nbuttons) struct { \\r
        Uint16  NAxies, NButtons;\\r
index abf2a60..69df8a4 100644 (file)
@@ -53,9 +53,15 @@ tDevFS_Driver        gMouse_DriverStruct = {
 // == CODE ==\r
 int PS2Mouse_Install(char **Arguments)\r
 {\r
+       \r
+\r
        // Set up variables\r
-       gMouse_Axies = (void*)&gMouse_FileData[1];\r
+       gMouse_Axies = (void*)&gMouse_FileData[4];\r
        gMouse_Buttons = (void*)&gMouse_Axies[NUM_AXIES];\r
+\r
+       gMouse_FileHeader->NAxies = 2;  gMouse_FileHeader->NButtons = 3;\r
+       gMouse_Axies[0].MinValue = -10; gMouse_Axies[0].MaxValue = 10;\r
+       gMouse_Axies[1].MinValue = -10; gMouse_Axies[1].MaxValue = 10;\r
        \r
        // Initialise Mouse Controller\r
        giMouse_Cycle = 0;      // Set Current Cycle position\r
@@ -136,6 +142,7 @@ void PS2Mouse_HandleInterrupt(Uint8 InputByte)
                gMouse_Axies[i].CursorPos = newCursor;\r
        }\r
 \r
+//     Log("Mouse at %ix%i", gMouse_Axies[0].CursorPos, gMouse_Axies[1].CursorPos);\r
                \r
        VFS_MarkAvaliable(&gMouse_DriverStruct.RootNode, 1);\r
 }\r

UCC git Repository :: git.ucc.asn.au