XSharp

X2 wall-slide timing and airborne input

The resolved-contact and bottom-edge analysis supersedes the adjacency-based contact acquisition used in this earlier milestone and records the latest continuous prefix.

The continuous Gap Jumps.bk2 comparison matches X/Y/VX/VY through frame 158 after these corrections. The next mismatch is ceiling resolution on frame 159. This is a measured prefix, not complete movie parity. parity/gap-jumps-wall-slide.json records the 500-input diagnostic run and a successful 20-update state replay from frame 123.

Original observations

The unmodified X2 USA ROM (637079014421563283CDED6AEAA0604597B2E33C) and the user’s movie were executed in BizHawk 2.11/BSNESv115+. The instrumented capture has the same full frame CSV hash as the reference (935C26EC7EF309376CC3B8248D252C7B21E2820447612F280D523A02B4EBAD0C). No original inputs or memory were changed. parity/gap-first-wall-slide-writes.csv retains the player/contact writes on frames 120–145.

Frame Original movement Stored VX Stored VY, positive upward
121 Ascending against the right wall 885 979
122 Jump released; move, resolve contact, enter wall slide $12/00 885 -64
123–124 Initialize/hold wall slide $12/02; no positional displacement 256 0
125–129 Prepare a new wall kick, retaining the incoming stored speeds 256 0
130 Prepare the wall-kick impulse without displacement -376 1363
131–137 Move away from the wall -376 1299 down to 915
138 Exit-substate pause -376 915
139–140 Release horizontal movement while continuing to rise 0 851, then 787
141 Left input immediately takes effect in midair -376 723
146 Releasing Left immediately clears horizontal motion 0 403

CPU execution confirms that wall-slide initialization at $08:9BAF selects substate 2. $08:9BBC..9BBE loads eight into the hang timer $77; $08:9C64..9C68 decrements it and clears both VY bytes. The original retains a one-pixel-per-update stored speed toward the wall. The longer recorded slide at frames 1434–1443 independently shows eight stationary updates followed by a two-pixel descent. Source write callbacks report the core’s write-time PC, commonly the instruction’s next address.

Engine policy and regression coverage

UseOriginalWallSlideTiming selects the slide from pre-motion contact, preserves entry-frame speeds and gravity, provides an eight-update hang and the one-pixel horizontal slide speed, and pauses the falling transition. It is enabled only in the X2 preset. Sprite’s virtual policy for clearing a blocked horizontal speed defaults to its previous behavior; X2 normal airborne movement preserves its stored speed at the wall. Existing serialized wall-slide/wall-jump counters encode the persistent phases. The exit-motion suppression is consumed within the same tick.

AirMovementInputLatency=0 and PauseOnAirTurn=false give X2 immediate horizontal control in the air. Ground and ladder input timing retain their existing settings. Other presets retain their previous behavior. The fixture gap-first-wall-slide.json asserts all four motion values from the recorded sequence through frame 152, including the following wall kick, direction change and release. Additional left/right wall tests check all eight hang updates, descent and the exit pause. These tests execute production player and collision code without video/audio devices.

Regenerate the write evidence with capture_bizhawk_movie.py --trace-floor 120 145; that existing option observes all player motion/state/contact writes despite its historical name. Run XSharp.MovieParity with --frames 500 --verify-state-at 123 to reproduce this milestone. Neither test fixtures nor the comparison host reposition the player during a continuous run.

Newly acquired contact at the second wall

The first wall was already touching X when Jump was released. A later wall exposes the ordering: on frame 634, the original resolves horizontal collision and sets right contact, but remains falling ($08/02). On 635, it selects slide entry ($12/00), still applies ordinary falling gravity/motion and preserves VX 885 and VY -384 (original sign). Only on 636 does slide initialization select VX 256, VY 0 and the stationary hang. The fractional X changes from 3/256 to 120/256 on 635 while integer X remains 5721. Entering from the newly resolved contact incorrectly suppressed that update in XSharp.

Execution at $08:9938..9946 confirms that the falling controller tests held horizontal input against existing contact $5E before calling the gravity/movement path at $08:995A. The engine samples wall eligibility before its physics sweep, then commits slide state afterward to retain that update’s ordinary gravity and incoming velocity. It adds no serialized state or artificial one-frame timer.

parity/gap-second-wall-slide-source.json pins the revision, relevant original bytes and hashes of the read-only writes/selected instruction trace. gap-second-wall-slide.json tests the original motion on frames 632–643 with extracted Sponge collision cells, including contact acquisition, slide initialization and the next kick. The existing first-wall and left/right hang tests remain covered. The engine’s wall-kick preparation retains its slide animation briefly; its WallJumping flag, rather than numeric state-ID equality, identifies that preparation in the test.

The full 4,186-input continuous run in parity/gap-jumps-previous-wall-contact.json matches player X/Y/VX/VY and camera position/derived motion through 663, with the next position difference at 664, on walking-input release. The first stored-speed/observed-acceleration difference is 715. A save at 634 restores 20 updates of player/camera/RNG and recorded engine entity observables exactly. RNG still first differs at 1, health at 2488, and source/engine entity semantics remain unmapped. This is progress on the measured prefix, not full movie or scene parity.