FireControl Mod v1.1 - Patch Instructions
==========================================

To apply this patch to an existing FireControl 21.1.5 installation:

1. Locate your FireControl.app (usually in /Applications)

2. Right-click FireControl.app → "Show Package Contents"

3. Navigate to Contents/app/

4. BACKUP the original file:
   cp app-firecontrol-21.1.5.jar app-firecontrol-21.1.5.jar.original

5. Replace app-firecontrol-21.1.5.jar with the one from this zip

6. Launch FireControl — the version label should show "V21.1.5 [MOD v1.1]"


Mod Features
-------------------
- Simulation mode: UI works without a machine connected
- Light theme
- Anti-aliased visualizer (4x MSAA)
- No annoying modal dialog on program finish/cancel
- Gamepad/joypad support (see below)


Gamepad Support (new in v1.1)
-------------------
Joypad/gamepad support for jogging and machine control. No extra
software needed — works out of the box.

Supported platforms:
- macOS: IOKit HID (tested with Logitech F310)
- Windows: XInput (for Xbox-compatible controllers)

When a gamepad is connected, a reference popup shows the button
layout. [GAMEPAD] appears in the version bar.

Hot-plug supported: connect or disconnect the gamepad at any time.

CONTROLLER SETUP (Logitech F310):
- Set the switch on the BACK of the controller to "D" (DirectInput).
  The "X" position does NOT work on macOS.
- The Mode button (center, with LED) swaps the left stick and D-pad.
  When the LED is OFF, the left stick acts as the D-pad (recommended).

macOS SYSTEM SETTINGS:
  The Guide/Home button may trigger Apple's Game Center service.
  To disable: System Settings → search "Game Controller" → disable
  "Press Home Button to open..." or set to "Do nothing".

BUTTON MAPPING:

  Precise Jogging (D-pad):
    D-pad Up/Down/Left/Right ... Jog Y+/Y-/X-/X+ at selected speed
    LB (left bumper) ........... Jog Z-
    RB (right bumper) .......... Jog Z+
    LT (left trigger) .......... Speed preset DOWN (clamped at min)
    RT (right trigger) ......... Speed preset UP (clamped at max)

  Fast Jogging (Analog Stick):
    Left analog stick .......... Full-speed jog in stick direction
                                 Supports diagonal (XY simultaneous)
                                 Direction changes detected automatically
                                 50% deadzone for safety

  Actions:
    Y (yellow) ................ Zero All Axes
    X (blue) .................. Go to Work Zero
    A (green) ................. Program Pause
    B (red) ................... Program Stop
    Start ..................... Program Start/Resume
    Back ...................... Toggle Dry Run

  Unassigned:
    L3 (left stick click), R3 (right stick click)

TWO JOG MODES:
  The D-pad and analog stick serve different purposes:
  - D-pad = PRECISE jogging at the speed shown in the UI.
    Use LT/RT to step through speed presets. Good for alignment,
    zeroing, and fine positioning.
  - Analog stick = FAST jogging at maximum speed for quickly
    repositioning the gantry. Push past the 50% deadzone in any
    direction (including diagonal) to move. Release to stop.
    Changing direction while jogging will briefly stop and restart.

SAFETY:
- Gamepad disconnect immediately stops any active jog.
- [GAMEPAD] appears in the version bar when a controller is connected.
- Program Start/Stop/Pause require a real machine connection
  (they do nothing in simulation mode).
- Analog stick has a large 50% deadzone to prevent accidental movement.


Changelog
-------------------
v1.1 (2026-03-24):
  - Gamepad/joypad support with digital and analog jogging
  - D-pad for precise speed-controlled jog, analog stick for fast
    repositioning with diagonal support
  - Button mapping: Zero, Go to Work Zero, Start/Stop/Pause, Dry Run
  - Speed presets via LT/RT triggers (clamped, not cycling)
  - Hot-plug detection (connect/disconnect at any time)
  - Reference popup with labeled controller image on connect
  - Simulation mode: continuous jog with held buttons

v1.0:
  - Simulation mode
  - Light theme
  - Anti-aliased visualizer (4x MSAA)
  - No modal dialog on program finish/cancel
