Skip to content

Vegasq/Ground-Control-2-wireless-fix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ground Control II - Wireless Fix & Smooth Zoom

A fix for Ground Control II (2004) that:

  1. Prevents crashes on startup with wireless USB devices
  2. Adds smooth mouse wheel zoom with inertia

The Problem

Ground Control II has two issues:

  • Crash on startup when wireless USB devices (keyboards, mice, controllers) are connected
  • Jerky zoom - mouse wheel zoom is choppy with no smooth scrolling

Reference: PCGamingWiki - Ground Control II

The Solution

This fix provides a replacement dinput.dll that:

  • Prevents the wireless device crash
  • Adds smooth inertia-based zoom using mouse wheel

Installation

  1. Download dinput.dll from Releases
  2. Copy it to your Ground Control II game folder (where gcii.exe is located)
  3. (Optional) Copy dinput_inertia.ini to customize zoom behavior
  4. Play the game

To uninstall, simply delete dinput.dll from the game folder.

Mouse Wheel Zoom Configuration

The zoom behavior can be customized via dinput_inertia.ini in the game folder:

[Inertia]
Enabled=1           ; 1 = on, 0 = off
DecayRate=80        ; 1-100: how fast momentum decays (higher = faster stop)
Multiplier=200      ; 1-500: zoom speed per wheel tick (higher = faster)
InjectInterval=4    ; 0-500ms: delay between zoom steps (lower = smoother)
ReverseWheel=1      ; 1 = Starcraft 2 style, 0 = original behavior

If no INI file is present, sensible defaults are used.

Technical Details

Wireless Device Fix

The crash occurs in Windows' DirectInput library during HID device enumeration. This fix:

  • Intercepts EnumDevicesA and returns only keyboard/mouse (avoids HID crash)
  • Intercepts GetDeviceInfo (avoids a secondary crash)
  • Forwards all other DirectInput calls to the real dinput.dll

Smooth Zoom

Ground Control II uses Page Up/Page Down for camera altitude but only checks wheel direction, not magnitude. This fix:

  • Captures mouse wheel input and accumulates velocity with momentum
  • Converts velocity to Page Up/Page Down key presses via DirectInput
  • Injects keys at a configurable rate for smooth zooming

Building from Source

Requires Visual Studio Build Tools with C++ workload.

  1. Open Developer Command Prompt for VS
  2. Navigate to the source directory
  3. Run:
    build.bat           # Debug build (with logging)
    build.bat release   # Release build (no logging)

Source Files

File Description
dinput_impl.c Main implementation
dinput_inertia.ini Zoom configuration template
dinput.def DLL export definitions
version.rc Version resource (metadata)
build.bat Portable build script

Debug Build

The debug build creates dinput_debug.log next to the game executable, useful for troubleshooting. The release build has no logging overhead.

Compatibility

  • Game: Ground Control II (2004)
  • OS: Windows 10/11
  • Architecture: 32-bit (x86) - matches the game
  • Game stores: GOG and Steam versions

License

MIT License - see LICENSE

Credits

  • Mykola Nick Yakovliev
  • Fix developed with assistance from Claude (Anthropic)

About

Ground Control 2 wireless fix

Resources

License

Stars

Watchers

Forks

Packages

No packages published