From: John Hodge Date: Mon, 17 Oct 2011 14:57:02 +0000 (+0800) Subject: Modules/PS2KbMouse - Bugfixing (alignment issue) X-Git-Tag: rel0.13~44 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=4ed4bb31a7a12c87169a0e0f638ca8757b3e0e27;p=tpg%2Facess2.git Modules/PS2KbMouse - Bugfixing (alignment issue) --- diff --git a/Kernel/include/api_drv_joystick.h b/Kernel/include/api_drv_joystick.h index 9225c5e4..cebec104 100644 --- a/Kernel/include/api_drv_joystick.h +++ b/Kernel/include/api_drv_joystick.h @@ -111,7 +111,7 @@ struct sJoystick_FileHeader { Uint16 NAxies; //!< Number of Axies Uint16 NButtons; //!< Number of buttons -}; +} PACKED; /** * \brief Axis Definition in file data @@ -128,7 +128,7 @@ struct sJoystick_Axis Sint16 MaxValue; //!< Maximum value for \a CurValue Sint16 CurValue; //!< Current value (joystick position) Uint16 CursorPos; //!< Current state (cursor position) -}; +} PACKED; #define JOY_INFOSTRUCT(_naxies, _nbuttons) struct { \ Uint16 NAxies, NButtons;\ diff --git a/Modules/Input/PS2KbMouse/ps2mouse.c b/Modules/Input/PS2KbMouse/ps2mouse.c index abf2a602..69df8a4e 100644 --- a/Modules/Input/PS2KbMouse/ps2mouse.c +++ b/Modules/Input/PS2KbMouse/ps2mouse.c @@ -53,9 +53,15 @@ 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 @@ -136,6 +142,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); }