XSharp

X2 landing animation and stored fall speed

The X2 preset preserves the incoming fall speed while its landing animation holds ordinary player motion. The final landing update enters idle without clearing that stored speed. The next normal idle update clears it. This separates stored velocity from actual displacement, as the original controller does.

Original instructions and observations

The unmodified X2 USA ROM and Gap Jumps.bk2 were executed with read-only instruction/write callbacks in BizHawk 2.11/BSNESv115+. parity/gap-landing-hold-source.json records revision/movie identity, relevant original bytes and hashes of the native writes and selected control-flow CSV.

Movie frame Original state/substate Stored VY, positive upward Motion
714 Falling 08/02 -1472 Floor pushout retains the new fraction
715–717 Landing 0A/02 -1472 No ordinary fall displacement
718 Idle entry 00/00 -1472 Landing controller returns without motion
719 Idle 00/02 0 Idle clears stored speed

$08:9982..998B initializes substate 2 and a four-update timer. $08:99AA..99B0 consumes it and returns to idle through $08:B9B4 without clearing the old velocity. The actual VY zeroing occurs in the idle controller’s helper at $08:BE91 on 719. Native write callbacks commonly report the instruction’s following PC.

The controller can also leave landing before the timer expires. $08:99BC..99C5 tests current horizontal input and dispatches the walking controller immediately. The movie has a natural example at 3353: X was facing left during landing, then Right moves him by 376/256 on that same update. A one-update input delay or the engine’s normal ground-turn pause would both be incorrect here.

Implementation and tests

UseOriginalLandingTiming is enabled only in the X2 preset. During supported landing it suppresses ordinary velocity integration without zeroing the stored fall speed, reads current directional input, and allows immediate walking, including a direction change. Jump preparation can still replace landing. The landing-animation callback retains speeds when entering idle, sharing a transient idle-transition motion suppression with walking release. The idle update then performs the normal velocity clear. No persistent field is added to the save-state stream.

Floor acquisition is not notified repeatedly while the already-consumed fall speed is being held in landing or its idle transition. Other presets and custom profiles with this policy disabled retain immediate velocity clearing. External pushes remain supplied by the ordinary sprite physics path; stationary landing does not erase ExternalVelocity.

The device-free production-player tests check frames 712–721 and 3348–3355 against original motion and extracted Sponge collision cells. The later case is an isolated component test; it does not imply continuous parity through 3355. Further tests cover both directions, jump interruption, the one-time floor event, the old behavior when disabled, and preset selection. Fractional floor-pushout tests now assert the correctly preserved landing speed rather than the former premature clear.

parity/gap-jumps-landing-hold.json records the latest complete input-only run. It supersedes the intermediate walking-stop result. Original/engine entity identity and behavior correspondence and RNG scheduling are still incomplete; the report is not a full-scene pass.

The final source passed 393 core/content/replay tests and 35 physics-library tests. Restoring the continuous comparison at frame 717 reproduced 20 subsequent updates of observed player/camera/RNG and engine entities. A separate native Direct3D 9 probe recorded 360 ticks and replayed the observed physics/state/RNG trace exactly twice, including frame-hold and EOF checks. The original BK2 import/export retained all 4,186 inputs and core/settings template entries.

Next observed contact difference

At the landing-calibration milestone, player X/Y/VX/VY agreed through 1433 and camera position/derived motion through 1442. The subsequent resolved-contact correction addresses that next difference. At 1432 the engine’s adjacent-wall query was already true while the native contact mask remained zero. The original recorded left contact on 1433 and selected slide entry on 1434; the engine selected entry on 1433. The correction retains resolved contact and also handles the wall’s bottom edge, without introducing a fixed extra delay.