diff options
Diffstat (limited to 'src/osd/windows/ledutil.c')
-rw-r--r-- | src/osd/windows/ledutil.c | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/src/osd/windows/ledutil.c b/src/osd/windows/ledutil.c index 7630bfc15fe..9931e2f053d 100644 --- a/src/osd/windows/ledutil.c +++ b/src/osd/windows/ledutil.c @@ -85,10 +85,10 @@ typedef int running_machine; // note you need to compile as a console app to have any of // these printfs show up -#define DEBUG_VERSION 0 +#define DEBUG_VERSION 0 #if DEBUG_VERSION -#define DEBUG_PRINTF(x) printf x +#define DEBUG_PRINTF(x) printf x #else #define DEBUG_PRINTF(x) #endif @@ -99,31 +99,31 @@ typedef int running_machine; //============================================================ // unique client ID -#define CLIENT_ID (('M' << 24) | ('L' << 16) | ('E' << 8) | ('D' << 0)) +#define CLIENT_ID (('M' << 24) | ('L' << 16) | ('E' << 8) | ('D' << 0)) // LED methods -#define LED_METHOD_PS2 0 -#define LED_METHOD_USB 1 -#define LED_METHOD_WIN9X 2 +#define LED_METHOD_PS2 0 +#define LED_METHOD_USB 1 +#define LED_METHOD_WIN9X 2 // window parameters -#define WINDOW_CLASS TEXT("LEDSample") -#define WINDOW_NAME TEXT("LEDSample") +#define WINDOW_CLASS TEXT("LEDSample") +#define WINDOW_NAME TEXT("LEDSample") // window styles -#define WINDOW_STYLE WS_OVERLAPPEDWINDOW -#define WINDOW_STYLE_EX 0 +#define WINDOW_STYLE WS_OVERLAPPEDWINDOW +#define WINDOW_STYLE_EX 0 // Define the keyboard indicators. // (Definitions borrowed from ntddkbd.h) -#define IOCTL_KEYBOARD_SET_INDICATORS CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0002, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_KEYBOARD_QUERY_TYPEMATIC CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0008, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_KEYBOARD_QUERY_INDICATORS CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0010, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_KEYBOARD_SET_INDICATORS CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0002, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_KEYBOARD_QUERY_TYPEMATIC CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0008, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_KEYBOARD_QUERY_INDICATORS CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0010, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define KEYBOARD_SCROLL_LOCK_ON 1 -#define KEYBOARD_NUM_LOCK_ON 2 -#define KEYBOARD_CAPS_LOCK_ON 4 +#define KEYBOARD_SCROLL_LOCK_ON 1 +#define KEYBOARD_NUM_LOCK_ON 2 +#define KEYBOARD_CAPS_LOCK_ON 4 @@ -133,16 +133,16 @@ typedef int running_machine; struct KEYBOARD_INDICATOR_PARAMETERS { - USHORT UnitId; // Unit identifier. - USHORT LedFlags; // LED indicator state. + USHORT UnitId; // Unit identifier. + USHORT LedFlags; // LED indicator state. }; struct id_map_entry { - id_map_entry * next; - const char * name; - WPARAM id; + id_map_entry * next; + const char * name; + WPARAM id; }; @@ -151,24 +151,24 @@ struct id_map_entry // GLOBAL VARIABLES //============================================================ -static int ledmethod; -static int original_state; -static int current_state; -static int pause_state; -static HANDLE hKbdDev; +static int ledmethod; +static int original_state; +static int current_state; +static int pause_state; +static HANDLE hKbdDev; -static HWND mame_target; -static HWND listener_hwnd; +static HWND mame_target; +static HWND listener_hwnd; -static id_map_entry * idmaplist; +static id_map_entry * idmaplist; // message IDs -static UINT om_mame_start; -static UINT om_mame_stop; -static UINT om_mame_update_state; -static UINT om_mame_register_client; -static UINT om_mame_unregister_client; -static UINT om_mame_get_id_string; +static UINT om_mame_start; +static UINT om_mame_stop; +static UINT om_mame_update_state; +static UINT om_mame_register_client; +static UINT om_mame_unregister_client; +static UINT om_mame_get_id_string; @@ -306,9 +306,9 @@ static int create_window_class(void) WNDCLASS wc = { 0 }; // initialize the description of the window class - wc.lpszClassName = WINDOW_CLASS; - wc.hInstance = GetModuleHandle(NULL); - wc.lpfnWndProc = listener_window_proc; + wc.lpszClassName = WINDOW_CLASS; + wc.hInstance = GetModuleHandle(NULL); + wc.lpfnWndProc = listener_window_proc; // register the class; fail if we can't if (!RegisterClass(&wc)) @@ -670,9 +670,9 @@ static int led_get_state(void) case LED_METHOD_PS2: { - KEYBOARD_INDICATOR_PARAMETERS OutputBuffer; // Output buffer for DeviceIoControl - ULONG DataLength = sizeof(KEYBOARD_INDICATOR_PARAMETERS); - ULONG ReturnedLength; // Number of bytes returned in output buffer + KEYBOARD_INDICATOR_PARAMETERS OutputBuffer; // Output buffer for DeviceIoControl + ULONG DataLength = sizeof(KEYBOARD_INDICATOR_PARAMETERS); + ULONG ReturnedLength; // Number of bytes returned in output buffer // Address first keyboard OutputBuffer.UnitId = 0; @@ -750,10 +750,10 @@ static void led_set_state(int state) case LED_METHOD_PS2: { - KEYBOARD_INDICATOR_PARAMETERS InputBuffer; // Input buffer for DeviceIoControl - ULONG DataLength = sizeof(KEYBOARD_INDICATOR_PARAMETERS); - ULONG ReturnedLength; // Number of bytes returned in output buffer - UINT LedFlags=0; + KEYBOARD_INDICATOR_PARAMETERS InputBuffer; // Input buffer for DeviceIoControl + ULONG DataLength = sizeof(KEYBOARD_INDICATOR_PARAMETERS); + ULONG ReturnedLength; // Number of bytes returned in output buffer + UINT LedFlags=0; // Demangle lights to match 95/98 if (state & 0x1) LedFlags |= KEYBOARD_NUM_LOCK_ON; |