XSharp

Scriver content and original controller

The optional XSharp.Enemies.X2 module owns Scriver’s event factory, activation, controller, animation cursor and collision adapter. The legacy FSM remains available through UseOriginalControl = false; newly placed X2 content selects the translated controller by default. Player physics selection does not select enemy AI.

X2EventScanner translates USA $00:DC50..DDB4: a horizontal 32-pixel column boundary scans the leading column; vertical motion scans ten columns in a 32-pixel band. Top and bottom scan origins differ. The scanner preserves unsigned 16-bit coordinates, exclusive upper limits and previous camera state across save states. The native allocation happens after camera movement, followed by enemy initialization on the next update. The engine callback is ICameraUpdateObserver.

ScriverControl translates $07:90AF..9327. Its simulation-side animation cursor uses the original sprite-05 scripts. World motion is requested only by jumping and airborne states. X2ActorMotion translates integer-point motion/correction for the ordinary footprint, including fractional-byte retention and stored landing speed. The world adapter applies Consts.WORLD_OFFSET only when querying engine geometry; the controller continues to use native coordinates.

State-specific removal outside the camera

Scriver calls $00:D813 only from proximity-wait $07:90F3 and airborne $07:9177. Jump $10 continues outside the camera window, including the update that requests airborne $16. The following airborne update moves first, then compares integer position with the preceding camera position: X in [cameraX-64, cameraX+320) and Y in [cameraY-64, cameraY+288), using unsigned 16-bit arithmetic. A failed test calls $00:DB4B before common damage handling. The translated controller therefore disables the engine’s generic removal and checks the native window only for those entry states. The legacy FSM keeps its existing lifetime behavior. Aclanda shares the pure camera-window calculation.

The pinned scriver-camera-gap.csv clip covers 93 source states, from native initialization at 3780 through removal at 3872. It compares motion, velocities, controller/animation fields and lifetime against original collision geometry. In this sequence the generic engine rule previously killed Scriver on 3855, 17 frames early. Read-only CPU/WRAM callbacks independently locate the original removal at $00:DB4B/DB5C on 3872. Boundary tests include 16-bit wraparound.

Evidence

The revision and original capture hashes are pinned in XSharp.Tests/Fixtures/X2/x2-enemy-component-source.json.

Destruction and graphics

The hosted actor tests weapon overlap after its controller/motion update, against already updated player/weapon positions. The first two observed deaths now occur on 554 and 608. Class-4 drop selection consumes its real RNG draw and retains the selected native kind; hosted pickups remain pending. The late dispatcher initializes five actual fragment sprites after weather selection, with two RNG draws per launch. X2DebrisMotion matches 1,628 observations from all twenty-five native Scriver fragments, starting at each particle’s observed initial position and incoming seed once. Flight does not draw RNG. Other native small-object producers remain pending; isolated flight matching does not certify hosted slot identity or retained fractions.

The fragment draw audit additionally covers all 2,649 Scriver/Aclanda fragment states. $01:F127..F138 alternates draw requests using the fragment counter and native slot parity. Initialization selects animation without requesting a draw; subsequent selected updates use $00:D859’s tighter camera window after motion. The fixtures now contain the completed camera from each captured update. The previous camera happened to preserve the tested flight positions but incorrectly accepted an offscreen draw at frame 604, slot 1938. Birth fractions, removal and the alternating draw request are audited separately by the hosted replay.

The native body-death adapter now allocates a real small-pool 02 explosion before queueing fragments. $08:E0BF writes integer position and preserves the destination slot fractions. X2ExplosionControl advances the animation before testing its end marker, unlike wall dust; all six 22-update explosions (132 states) match the original fixture, including same-build restoration. The head of Aclanda emits fragments without this body explosion. The existing explosion art is reused as a visual projection; original per-pixel acceptance remains open.

The original extracted 20-frame sprite sheet replaces the compatibility projection for native control. scriver-sprite-source.json pins its hash, palette and every assembly origin; no extracted frame reports missing tiles. Legacy control retains its existing artwork. Native orientation follows the event’s facing bit, not the player’s position at spawn.

Remaining parity work

The 4,186-input controller/fragment milestone retains player and camera agreement through 2001. RNG agrees through 634 (15.1% of the full movie), with its next missing call owned by Aclanda on 635. Player health matches throughout this run. See parity/gap-jumps-scriver-controller.json. The snapshot at 635 reproduces 20 later updates exactly within XSharp; it is not cross-engine whole-scene equivalence.

Projectile origins, complete damage/lifecycle behavior, hosted pickups, retained native object-pool bytes and allocation order still require comparison. Special terrain effects and moving solids also need validation; the ordinary footprint adapter is not a certified port of every native collision side effect. Aclanda’s independently tested body/head controllers await their complete hosted actor adapter. Full-scene parity remains false, and there is no per-frame state correction.

The module registers legacy XSharp assembly aliases for the actor and state enum. The temporary X1 stage-8 fallback that substituted an X2 Scriver was removed.