USB and Game Devices - ARCHIVEUpdated: December 4, 2001
Universal Serial Bus (USB) is an external PC bus that provides an exciting way to add high-speed game devices to a PC. USB is a serial protocol that runs at 1 - 12 megabits per second, with complete support for Plug and Play, power management, and "hot plugging" to add or change devices without turning off the PC. USB provides a fast, low-cost solution that is strongly recommended for gaming devices and other input controls: USB can also support more device aspects, such as user programming of control buttons or (because it is a bi-directional bus) the ability to send feedback to the user through the control to lend new levels of realism to game playing. On This Page
DirectInput and USBThe Microsoft DirectInput application programming interface (API) provides an interface that game developers can use to get fast, consistent direct access to game devices, including USB devices and analog and digital joysticks. Game developers can design applications that use DirectInput functions to determine the capabilities of the game devices and their drivers. The greatest benefit that DirectInput provides for game applications is that it gives the data in a format most useful to applications that is, actual scan code values from the keyboard and actual mouse movement positions rather than the position of the cursor. DirectInput provides complete API support for games developers who want to exploit capabilities of new USB devices and Comm-based devices such as joysticks. DirectInput support is available in Windows 98/Me and Windows 2000/Windows XP. The DirectInput API uses Component Object Model (COM) objects and interfaces, and it maintains consistency with the joystick functions of the Microsoft Platform Software Development Kit (SDK), but improves responsiveness and reliability by changing the device driver model. DirectInput device drivers use the registry to store settings for standard and OEM-supplied joysticks, and use calibration information for previously configured joysticks. Extended capabilities include support for rudder pedals, flight yokes, virtual-reality headgear, and other devices. In DirectInput, there is no limit on the numbers of buttons, axes, or devices that a device can use. USB Support in Microsoft Operating SystemsFor the Windows family of operating systems, Microsoft provides full support for USB under the new Windows Driver Model (WDM). For the core USB driver stack components, Microsoft provides USB host controller minidrivers for OpenHCI and Universal HCI, a USB class driver plus a PCI enumerator, and a USB hub driver. For Windows, Human Interface Device (HID) is the new general input device model. A HID-compliant device is self-describing and indicates its type, provides layout and usage information, and so on. HID I/O support in the operating system will be based on WDM and provides both Kernel-mode and User-mode access. New HID drivers are layered using the WDM class driver and minidriver concepts. The HIDUSB minidriver connects HID-compliant input devices using USB. The WDM-based HID support in the operating systems provides complete support for Plug and Play and for power management under the OnNow design initiative. For Windows 98, HID devices use USB to connect to the existing Windows 95 input device infrastructure. VxD-to-HID mappers are being developed for keyboard, mouse, and joystick/gamepad to accomplish this. Windows 98 provides built-in support for system devices (keyboard, mouse), DirectInput support for gaming devices (joysticks, gamepads), and the ability to support arbitrary new HID devices connecting using USB (keyboards, mice, gaming devices, personality modules, remote controls, telephony devices, and so on). For Windows 2000/Windows XP , the architecture is similar except that a different module is used instead of the VxD-to-HID mapper. References and Resources
|
|

