From 1345bf7290340c29721e3269d64b0d2783a50bb0 Mon Sep 17 00:00:00 2001 From: "Nabeel S." <99736+nabeelio@users.noreply.github.com> Date: Mon, 16 Nov 2026 13:08:17 -0600 Subject: [PATCH] fix(pmdg): read FSUIPC light switches as bytes Same fix as releases/2.0 (#30). PMDG SDK switch fields are one byte each, packed back to back; an int read is four bytes, so each light picked up its neighbours and `equal 1` failed as soon as any of them was on. Landing lights are three (777) or four (747) adjacent switch bytes, so they become an "any" over the individual bytes. 777 nav was 0x650B, the 747's address; on the 777 that is the chronograph selector. The 777 nav switch is 0x6489. --- src/aircraft/pmdg-747-fsuipc.json | 22 +++++++++++++++------- src/aircraft/pmdg-777-fsuipc.json | 17 ++++++++++++----- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/src/aircraft/pmdg-747-fsuipc.json b/src/aircraft/pmdg-747-fsuipc.json index 2d86baf..70e6c6f 100644 --- a/src/aircraft/pmdg-747-fsuipc.json +++ b/src/aircraft/pmdg-747-fsuipc.json @@ -11,15 +11,23 @@ "BeaconLights": [ { "if": { "any": [ - { "kind": "offset", "address": "0x650A", "valueType": "int", "operator": "equal", "value": 0 }, - { "kind": "offset", "address": "0x650A", "valueType": "int", "operator": "equal", "value": 2 } + { "kind": "offset", "address": "0x650A", "valueType": "byte", "operator": "equal", "value": 0 }, + { "kind": "offset", "address": "0x650A", "valueType": "byte", "operator": "equal", "value": 2 } ] }, "action": { "value": true } }, { "action": { "value": false } } ], "LandingLights": [ - { "if": { "all": [{ "kind": "offset", "address": "0x6506", "valueType": "int", "operator": "equal", "value": 1 }] }, "action": { "value": true } }, + { + "if": { "any": [ + { "kind": "offset", "address": "0x6506", "valueType": "byte", "operator": "equal", "value": 1 }, + { "kind": "offset", "address": "0x6507", "valueType": "byte", "operator": "equal", "value": 1 }, + { "kind": "offset", "address": "0x6508", "valueType": "byte", "operator": "equal", "value": 1 }, + { "kind": "offset", "address": "0x6509", "valueType": "byte", "operator": "equal", "value": 1 } + ] }, + "action": { "value": true } + }, { "action": { "value": false } } ], "LogoLights": [ @@ -28,19 +36,19 @@ "NavigationLights": [ { "if": { "any": [ - { "kind": "offset", "address": "0x650B", "valueType": "int", "operator": "equal", "value": 0 }, - { "kind": "offset", "address": "0x650B", "valueType": "int", "operator": "equal", "value": 2 } + { "kind": "offset", "address": "0x650B", "valueType": "byte", "operator": "equal", "value": 0 }, + { "kind": "offset", "address": "0x650B", "valueType": "byte", "operator": "equal", "value": 2 } ] }, "action": { "value": true } }, { "action": { "value": false } } ], "StrobeLights": [ - { "if": { "all": [{ "kind": "offset", "address": "0x6511", "valueType": "int", "operator": "equal", "value": 1 }] }, "action": { "value": true } }, + { "if": { "all": [{ "kind": "offset", "address": "0x6511", "valueType": "byte", "operator": "equal", "value": 1 }] }, "action": { "value": true } }, { "action": { "value": false } } ], "TaxiLights": [ - { "if": { "all": [{ "kind": "offset", "address": "0x6510", "valueType": "int", "operator": "equal", "value": 1 }] }, "action": { "value": true } }, + { "if": { "all": [{ "kind": "offset", "address": "0x6510", "valueType": "byte", "operator": "equal", "value": 1 }] }, "action": { "value": true } }, { "action": { "value": false } } ], "WingLights": [ diff --git a/src/aircraft/pmdg-777-fsuipc.json b/src/aircraft/pmdg-777-fsuipc.json index 47e61ca..0b62377 100644 --- a/src/aircraft/pmdg-777-fsuipc.json +++ b/src/aircraft/pmdg-777-fsuipc.json @@ -9,26 +9,33 @@ "disabled": { "LogoLights": true, "WingLights": true }, "features": { "BeaconLights": [ - { "if": { "all": [{ "kind": "offset", "address": "0x6488", "valueType": "int", "operator": "equal", "value": 1 }] }, "action": { "value": true } }, + { "if": { "all": [{ "kind": "offset", "address": "0x6488", "valueType": "byte", "operator": "equal", "value": 1 }] }, "action": { "value": true } }, { "action": { "value": false } } ], "LandingLights": [ - { "if": { "all": [{ "kind": "offset", "address": "0x6485", "valueType": "int", "operator": "equal", "value": 1 }] }, "action": { "value": true } }, + { + "if": { "any": [ + { "kind": "offset", "address": "0x6485", "valueType": "byte", "operator": "equal", "value": 1 }, + { "kind": "offset", "address": "0x6486", "valueType": "byte", "operator": "equal", "value": 1 }, + { "kind": "offset", "address": "0x6487", "valueType": "byte", "operator": "equal", "value": 1 } + ] }, + "action": { "value": true } + }, { "action": { "value": false } } ], "LogoLights": [ { "action": { "value": false } } ], "NavigationLights": [ - { "if": { "all": [{ "kind": "offset", "address": "0x650B", "valueType": "int", "operator": "equal", "value": 1 }] }, "action": { "value": true } }, + { "if": { "all": [{ "kind": "offset", "address": "0x6489", "valueType": "byte", "operator": "equal", "value": 1 }] }, "action": { "value": true } }, { "action": { "value": false } } ], "StrobeLights": [ - { "if": { "all": [{ "kind": "offset", "address": "0x648F", "valueType": "int", "operator": "equal", "value": 1 }] }, "action": { "value": true } }, + { "if": { "all": [{ "kind": "offset", "address": "0x648F", "valueType": "byte", "operator": "equal", "value": 1 }] }, "action": { "value": true } }, { "action": { "value": false } } ], "TaxiLights": [ - { "if": { "all": [{ "kind": "offset", "address": "0x648E", "valueType": "int", "operator": "equal", "value": 1 }] }, "action": { "value": true } }, + { "if": { "all": [{ "kind": "offset", "address": "0x648E", "valueType": "byte", "operator": "equal", "value": 1 }] }, "action": { "value": true } }, { "action": { "value": false } } ], "WingLights": [