Combat: AUTHENTIC weapon groups -- streamed per-mech button bindings + the real fire chain (task #5)

The recovered system: fire channels = LBE4ControlsManager buttonGroups
(0x40/0x45/0x46/0x47); default groups = the per-mech type-6 controls-map
resource in BTL4.RES, installed by the T0 CreateStreamedMappings the port
already called -- it needed only the TriggerState attribute (id 0x13 PINNED
to the binary value; fireImpulse@0x31C is the binary's TriggerState) and an
input feed.  Keyboard/harness now push press/release edges into the button
groups; the gBT*Trigger bypasses, per-type keyboard split and 1,0 pulse
hack are retired -- weapons sharing a button fire TOGETHER (madcat Trigger
= 4 weapons).  Myomers @4b9550/@4b95b8 misattribution corrected (they are
MechWeapon ConfigureMappables/ChooseButton).  Verified 2-node: kill through
the authentic chain (12 hits vs ~36 pre-groups).  Config-mode session
(regrouping UI) = the remaining stage, KB-scoped.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
arcattack
2026-07-11 13:06:29 -05:00
co-authored by Claude Fable 5
parent 4554ea543a
commit 8ed6184d65
582 changed files with 6546 additions and 42 deletions
+53 -6
View File
@@ -112,6 +112,17 @@
//
#include <bt.hpp>
// LBE4ControlsManager (the fire buttonGroup push, task #5) -- needs the
// btl4app/btl4mode forward-decl order btl4mppr.cpp uses.
#if !defined(BTL4APP_HPP)
# include <btl4app.hpp>
#endif
#if !defined(BTL4MODE_HPP)
# include <btl4mode.hpp>
#endif
#if !defined(L4CTRL_HPP)
# include <l4ctrl.hpp>
#endif
#pragma hdrstop
#if !defined(MECH_HPP)
@@ -2990,12 +3001,48 @@ void
// (user-reported regression). targetInArc is the explicit BT_FIRE_ARC
// presentation clamp (default true). BT_AUTOFIRE holds all three.
{
const int laserWanted = gBTDrive.fireForced || gBTLaserKey;
const int ppcWanted = gBTDrive.fireForced || gBTPPCKey;
const int missileWanted = gBTDrive.fireForced || gBTMissileKey;
gBTWeaponTrigger = (laserWanted && targetInArc) ? (gBTWeaponTrigger ? 0 : 1) : 0;
gBTPPCTrigger = (ppcWanted && targetInArc) ? (gBTPPCTrigger ? 0 : 1) : 0;
gBTMissileTrigger = (missileWanted && targetInArc) ? (gBTMissileTrigger ? 0 : 1) : 0;
// AUTHENTIC FIRE INPUT (task #5): key states become PRESS/RELEASE
// edges pushed into the LBE4 buttonGroup channels -- the pod's own
// joystick path (L4CTRL Execute: Update(&v, mode) with v =
// +(button+1) press / -(button+1) release). The streamed per-mech
// controls map binds these buttons DIRECTLY onto each grouped
// weapon's TriggerState@0x31C; CheckFireEdge does the rest. This
// retires the gBT*Trigger globals + the 1,0 pulse hack.
// Desktop map: SPACE/'1' -> Trigger(0x40) [the main fire group],
// '2' -> ThumbLow(0x46), '3'/CTRL -> ThumbHigh(0x47) [missiles on
// most mechs]. BT_AUTOFIRE pulses the Trigger (edge per 2 frames).
// targetInArc stays the opt-in BT_FIRE_ARC presentation clamp.
LBE4ControlsManager *cm =
(LBE4ControlsManager *)application->GetControlsManager();
ModeMask modeMask = application->GetModeManager()->GetModeMask();
static int s_prevBtn[4] = {0, 0, 0, 0};
static int s_afPhase = 0;
s_afPhase ^= 1;
const int autofire = (gBTDrive.fireForced && targetInArc) ? s_afPhase : 0;
const int buttons[4] = {
LBE4ControlsManager::ButtonJoystickTrigger, // 0x40
LBE4ControlsManager::ButtonJoystickPinky, // 0x45
LBE4ControlsManager::ButtonJoystickThumbLow, // 0x46
LBE4ControlsManager::ButtonJoystickThumbHigh, // 0x47
};
int want[4];
want[0] = ((gBTLaserKey && targetInArc) || autofire) ? 1 : 0;
want[1] = 0; // pinky: unmapped on desktop
want[2] = (gBTPPCKey && targetInArc) ? 1 : 0;
want[3] = (gBTMissileKey && targetInArc) ? 1 : 0;
if (cm != 0)
{
for (int b = 0; b < 4; ++b)
{
if (want[b] != s_prevBtn[b])
{
s_prevBtn[b] = want[b];
ControlsButton v = (ControlsButton)(want[b]
? (buttons[b] + 1) : -(buttons[b] + 1));
cm->buttonGroup[buttons[b]].Update(&v, modeMask);
}
}
}
}
{