XSharp

Ladder acquisition after a gap jump

The user’s 845-input XSharp demo reproduced climbing through empty air on Wire Sponge. It was recorded with the legacy profile, source build 9a7be23b-b0d0-40dc-8686-3d6315ac6ac3, and X2 USA ROM SHA-1 637079014421563283CDED6AEAA0604597B2E33C. The original BK2 and matching executable/assets were preserved privately before changing the engine. parity/ladder-air-source.json records its hash and validation boundaries; ladder-air-before.csv and ladder-air-after.csv retain complete observed timelines.

At movie frame 140, X is at (5542.7109375, 311.5859375), still moving upward after a wall kick. His lower hitbox overlaps the ladder top at Y 320, while his anchor is above the ladder. The former Up-acquisition query accepted TOP_LADDER through its generic ladder flag. It then zeroed movement and allowed floor adjustment to move X eight pixels upward, to Y 303.5859375, while entering PRE_LADDER_CLIMB at frame 141. The ladder controller never rechecked whether an actual ladder remained at the anchor. Mount/climb states continued without support through frame 212.

Original-code reference

X2 USA routine $08:C418..C43D clears the Y offset, then tests the actor’s integer position at X, X+8 and X-8, in that priority. It accepts collision type $12 (ladder body), rather than $13 (top), and retains the successful horizontal offset for alignment. $08:B362..B380 checks the anchor again during ladder control and returns to the falling controller when it is empty. Top-entry and top-exit have their own transitions.

The earlier X1 disassembly was also revisited: bank81.asm/_819FB1 contains the same three-probe body-only test. Its complete instruction sequence was confirmed against the X1 USA ROM at $81:9FB1..9FD6 (SHA-1 449A00631208FBCC8D58209E66D0D488674B7FB1). The player routine mega_man.asm/.8E2E..8E4E separately checks center collision for loss of support and treats the top transition separately. Cross-game instruction addresses are verified per ROM revision, rather than inferred from matching labels.

OriginalLadderRomTests checks the exact acquisition instructions in both supplied USA ROMs. Set XSHARP_TEST_ROM_X1 and XSHARP_TEST_ROM_X2 to enable those source checks; they explicitly skip when their ROM is unavailable.

Engine adaptation

Player.TryGetLadderMountOrigin uses the existing world placement query and only accepts a ladder-body cell at the three original probe positions. It aligns X to that placement’s column, preserving the incoming X fraction for the X2 timing profile. Acquiring the ladder clears the outgoing jump/wall-kick flags while retaining the profile’s existing mount timing and stored-speed rules.

ReleaseUnsupportedLadder rechecks the anchor while mounting or in ordinary ladder control. Missing support releases the player into falling, including when no directional key is held. Deliberate top-climb and top-descend animation states are exempt because they intentionally cross the ladder boundary. No serialized player fields or renderer/audio dependencies were added.

Validation

This resolves the reported air-climbing defect. Remaining original-movie collision differences, complete entity correspondence and RNG call scheduling are separate pending parity work.

Native X2 ladder-bottom exit

The Gap Jumps interval 3537..3555 provides a separate regression for descending off the final ladder. Native $08:B362..B380 probes the integer center before movement: 3541 still moves down at 0178; 3542 selects $08/00 without displacement while retaining that speed; 3543 initializes falling and applies gravity 40. The original controller does not use the engine’s legacy lower-hitbox strip test to detach early.

For the X2 timing profile, center/acquisition probes now convert original level pixels into terrain coordinates using WORLD_OFFSET. The unsupported ordinary-ladder transition retains its prior VY, returns immediately, then initializes falling on the following update. The legacy strip test remains in other profiles. Unsupported mounting still leaves ladder control, and the device-free regressions for the reported air-climbing defect remain enabled across all four earlier presets. gap-ladder-bottom-exit.json pins the original movie/ROM and geometry and compares all four motion values across the entire exit sequence. This does not certify unrelated ladder behaviors or all-scene replay.

Native X2 top-climb phases

The original $08:B36B..B375 selects top climbing from the integer center’s top-ladder tile while Up is held. The legacy hitbox strip tested a different vertical point and entered too late at 3628. gap-ladder-top-climb.json compares original 3623..3647 with the actual Up/Down inputs.

$08:B282..B2BE then aligns integer Y to (Y & FFF0) - 7 while retaining its fraction, and executes four upward two-pixel updates. Animation stays stopped during those updates; after stopping VY, the two four-update animation frames run, followed by the idle transition. Native observations are: request 3628 with retained VY 0178, motion 3629..3632 at 0200, stationary animation through 3641, idle selection and floor pushout at 3642. The X2 adapter stores the phases and remaining motion updates as simulation state. Automatic floor pushout is deferred while this top-climb phase is active, then applies on completion; the ordinary public floor-adjustment setting remains unchanged. Other profiles keep their existing top-climb controller.