Skip to content

fix(pmdg): read FSUIPC light switches as bytes - #30

Merged
nabeelio merged 1 commit into
releases/2.0from
fix/pmdg-fsuipc-light-offsets
Nov 16, 2026
Merged

nabeelio merged 1 commit into
releases/2.0from
fix/pmdg-fsuipc-light-offsets

Conversation

@nabeelio

Copy link
Copy Markdown
Member

Summary

PMDG SDK switch fields are one byte each, packed back to back. The 2.x client reads FeatureType.Int as four bytes, so each light picked up its neighbours and == 1 failed whenever any neighbour was on.

777 exterior lights (PMDG SDK)
6485  LandingLights[3]  ──┐ one Int read at 0x6485 = L | R<<8 | Nose<<16 | Beacon<<24
6488  Beacon             ──┘
6489  NAV
648A  Logo
648B  Wing
648C  RunwayTurnoff[2]
648E  Taxi              ── Int read also swallows Strobe
648F  Strobe
 PMDG_777_FSUIPC
-  beacon  0x6488 Int
-  landing 0x6485 Int   value == 1
-  nav     0x650B Int   (747 address; 777 chronograph)
-  strobe  0x648F Int
-  taxi    0x648E Int
+  beacon  0x6488 Byte
+  landing 0x6485 Int   (value & 0xffffff) != 0
+  nav     0x6489 Byte
+  strobe  0x648F Byte
+  taxi    0x648E Byte

 PMDG_747_FSUIPC
-  beacon/nav/strobe/taxi  Int
-  landing 0x6506 Int   value == 1
+  beacon/nav/strobe/taxi  Byte
+  landing 0x6506 Int   value != 0   (four switch bytes, exactly one Int)

Taxi only "worked" because strobes are off while taxiing. No client change: release/2.2 already maps Byte to a one-byte offset read.

Evidence

  • Before: P3D + PMDG 777 report, 2.2: taxi detected, landing/strobes never. Live scripts/stable.zip and a rebuild of the Aug 10 tree differ only in SynapticA220.js, so the config publish on 11-09 did not change this; the read width has been 4 bytes since 2.2.65.
    After: npm run build clean; dist/aircraft/PMDG_777_FSUIPC.js and PMDG_747_FSUIPC.js carry the Byte types, 0x6489, and the masked landing checks. Not flown; needs a PMDG 777 / 747 P3D pass.

Merge Danger

Door: two-way

Merge publishes scripts/stable.zip and purges the CDN; a revert republishes the previous configs the same way.

Blast Radius: PMDG-FSUIPC

Only pilots on P3D/FSX with the PMDG 777 or 747 via FSUIPC. The 747 beacon/nav == 0 || == 2 checks are untouched.

PMDG SDK switch fields are one byte each, packed back to back. The
client reads FeatureType.Int as four bytes, so each light picked up its
neighbours and `== 1` failed as soon as any of them was on: landing
swallowed the other two landing lights and the beacon, beacon swallowed
nav/logo/wing, taxi swallowed strobe. Taxi only "worked" because strobes
are off while taxiing.

777 nav was also 0x650B, the 747's address; on the 777 that byte is the
chronograph selector. The 777 nav switch is 0x6489.

Landing lights stay Int: the 777 has three switch bytes and the 747 four,
so one Int read covers them and the method masks to "any on".
@nabeelio
nabeelio merged commit 8a10037 into releases/2.0 Nov 16, 2026
3 checks passed
@nabeelio
nabeelio deleted the fix/pmdg-fsuipc-light-offsets branch November 16, 2026 19:01
nabeelio added a commit that referenced this pull request Nov 16, 2026
## Summary

Same model `main` got in #28: branch pushes publish a preview zip, only
a release writes the file clients download.

```diff
 push to releases/2.0
   artifacts
   publish
-    scripts/stable.zip          # every 2.x client, on every merge
+    scripts/releases-2.0.zip    # preview; point a Replane 2.x channel at it
     purge acars.cdn.vmslabs.net/*

 workflow_dispatch (bump: patch|minor|major)
   release
     bump src/package.json, tag vX.Y.Z, push
+    scripts/stable.zip          # the only writer now
     purge
     GitHub release
```

`src/package.json` goes `1.0.1` → `2.0.0`, so the first dispatch with
`patch` tags `v2.0.1`.

## Evidence

- **Before:** merging #22 on 11-09 pushed straight to
`scripts/stable.zip`, which is how the A220 fix shipped unannounced.
**After:** YAML parses (`js-yaml`). Tag pushes made by the release job
use `GITHUB_TOKEN`, so they do not retrigger the push workflow;
`stable.zip` is written once per release. Not exercised; first real run
is the PMDG release after #30.

## Merge Danger

**Door:** two-way

Revert restores publish-on-push.

**Blast Radius:** release-process

Merging #30 after this no longer ships the PMDG fix by itself; you must
run the Build workflow on `releases/2.0` with a bump. Nothing changes
for clients until then.
nabeelio added a commit that referenced this pull request Nov 16, 2026
## Summary

Port of #30 to the 3.x JSON configs. PMDG SDK switch fields are one byte
each, packed back to back; `valueType: int` reads four bytes, so each
light swallowed its neighbours and `equal 1` failed whenever any of them
was on.

```diff
 pmdg-777-fsuipc.json
-  BeaconLights   0x6488 int == 1
-  LandingLights  0x6485 int == 1
-  NavigationLights 0x650B int == 1     # 747 address; 777 chronograph
-  StrobeLights   0x648F int == 1
-  TaxiLights     0x648E int == 1
+  BeaconLights   0x6488 byte == 1
+  LandingLights  any(0x6485, 0x6486, 0x6487 byte == 1)   # L / R / nose
+  NavigationLights 0x6489 byte == 1
+  StrobeLights   0x648F byte == 1
+  TaxiLights     0x648E byte == 1

 pmdg-747-fsuipc.json
-  beacon/nav/strobe/taxi  int
-  LandingLights  0x6506 int == 1
+  beacon/nav/strobe/taxi  byte (same values)
+  LandingLights  any(0x6506..0x6509 byte == 1)
```

The 2.x TS configs could mask one int read; the JSON engine has no mask
operator, so landing lights become an `any` over the individual switch
bytes.

## Evidence

- **Before:** P3D + PMDG 777 on 2.2: taxi detected, landing/strobes
never. Same offsets and widths here.
**After:** `npm run build` clean; `artifacts/aircraft.json` carries 3
landing conditions + nav `0x6489` for the 777, 4 landing conditions for
the 747. Not flown.

## Merge Danger

**Door:** two-way

Merge publishes `v8/main.zip` and the `-main` aliases only; released 3.x
clients see it after the next release dispatch.

**Blast Radius:** PMDG-FSUIPC

P3D/FSX pilots on the PMDG 777 or 747 via FSUIPC.
nabeelio added a commit that referenced this pull request Nov 16, 2026
## Summary

The `2.1.0` release made in the GitHub UI published nothing: the
workflow only fired on `v*` tags and only wrote `stable.zip` for
`refs/tags/v*`. One release path now, the UI tag.

```diff
 on.push.tags
   'v*'
+  '[0-9]*'                       # 2.1.0, what the UI release made

 publish (tag)
-  if ref == refs/tags/v*  → scripts/stable.zip
+  if ref == refs/tags/*   → scripts/stable.zip
   purge
+  attach stable.zip to the GitHub release

-release (workflow_dispatch, bump: patch|minor|major)
-  npm version → commit → tag v<ver> → upload → GH release
```

`artifacts` no longer carries the `workflow_dispatch` guard.

## Evidence

- **Before:** release `2.1.0` at 19:30 → zero workflow runs.
`scripts/stable.zip` on the CDN is from the #30 merge push at 19:02, not
the release.
**After:** YAML parses. Not exercised; the first run is the next UI
release on `releases/2.0`.

## Merge Danger

**Door:** two-way

**Blast Radius:** release-process

Removes the Run-workflow button flow. A UI release on this branch now
writes `scripts/stable.zip` for every 2.x client.
nabeelio added a commit that referenced this pull request Nov 16, 2026
## Summary

Follow-up to #30. The PMDG 737 FSUIPC config read only the left fixed
landing switch (0x64F6), so flights flown on the retractable lights, or
with only the right fixed light on, logged landing lights off. Logo
(0x64FF) and wing (0x6502) switches exist in the NGX offset map but were
disabled.

- Landing: one 4-byte read at 0x64F4 covers
`LTS_LandingLtRetractableSw[2]` (on when 2) and
`LTS_LandingLtFixedSw[2]` (boolean); any of the four lit counts as on.
- Logo and wing: 1-byte reads, on when 1.

## Evidence

Addresses and widths from `Offset Mapping for PMDG 737NGX.pdf` (bottom
overhead block: 64F4 retractable[2], 64F6 fixed[2], 64FF logo, 6500
position, 6501 anticollision, 6502 wing). `npm run build` passes; the
compiled `dist/aircraft/PMDG_737_FSUIPC.js` carries the new offsets.

## Merge Danger

Low. Only the 737 FSUIPC config changes. Pilots who previously got
landing lights "off" with the retractable lights on will now get "on";
no other feature changes. Ships to 2.x clients on the next release tag.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant