XSharp

Assembly-based common-enemy conversion

The current scope is the 104 actors added by commits 0cdc047, d2901fd and b2c3311, including child actors, variants and hostile devices. They were built with approximate functional controllers, not transpiled native AI. The retained legacy actors and the earlier Scriver/Aclanda controllers are outside this batch.

conversion-progress.json tracks every actor in this scope, its original entry when recovered, packet, pinned ROM revision and review state. A shared handler does not mean its subtypes have identical behavior. CompleteNativeConversions remains zero: generated procedures with controlled service tests do not establish full native integration or gameplay parity.

Current workflow: direct adaptation

The extractor’s role is to extract graphics, assembly, tables and provenance. Following the user’s updated direction, new controls are adapted directly into C# from those original routines; extending the bounded transpiler is not required. Broad behavior and original-runtime comparisons remain deferred while implementation is prioritized. Projectile defects now also have named focused headless regressions in the presentation review; their scope must not be generalized to full controller or native parity.

Mad Pecker and Metal Wing adaptations were followed by direct control batches across X1/X2/X3. Twenty-four actors now have at least part of their control derived from original code: one generated earlier and twenty-three adapted directly. Seventy-nine retain generic control; the historical RayTrapper entry is excluded after event 10 was identified as a fixed screen/palette controller. All 104 original batch entries remain in the ledger so the invalid association is recorded rather than silently counted as complete. These counts do not certify complete ports, complete helper coverage or native parity.

Pararoid S-38 opening

The source record pins the Morph Moth subtype-0 placement and the 338-update comparison. For new captures, use a save state made in the original USA Stage Select menu and an existing output directory. The directions depend on the initial cursor. With Bubble Crab highlighted, Up selects Morph Moth when the script presses Start.

local capture = assert(loadfile("C:/path/to/XSharp/tools/bizhawk/MMX2_PararoidS38_Capture.lua"))
capture("C:/path/to/output", 1, "combat", "C:/path/to/stage-select.State", {"Up"})

The capture confirms the stage with gamepad input, waits through the original preview and stage startup, then reloads the checkpoint within the same stage. Normal gamepad input takes X beneath the hanging barrier into the encounter. boot.txt records the background CGRAM hash for Stage Select, stage entry, checkpoint and the first actor update. Each marker also writes a PNG. This follows the Capcom manual’s Stage Select controls.

The prior controller fixtures used a forced approach and are evidence for logic and audio requests. Their source record pins the historical script revision. For the 338-update fixture, use ID 18 decimal, subtype zero and frames 2198 through 2535 from the historical frames.csv. Join the accumulator at 01C866, 01C870 and 01C8AD in trace.csv.

Pass "arena-exit" as the third argument to record the arena bounds and effect requests. That mode enters the native defeat state directly 240 updates after the opening handoff. It isolates the teardown from weapon damage and allows the 180-update cleanup to be measured independently.

The imported-stage smoke test checks the cue timings, decoded voices from the stage precache, landing on the imported map, the first attachment poses, and the bounds before and after defeat. It restores save states in the opening and the defeat sequence.

Use "combat" as the third argument for the linked type 14/00 chassis. The headless comparison runs the emergence and the four jumps over 1,336 updates from combat.csv. It supplies the recorded player position and RNG word at decision time, and uses a collision window taken from the imported stage. It compares the chassis position, velocity, facing, action, pose request and sound commands. The shot branch has separate tests for a free and full projectile pool. The component actors inside the chassis, full projectile presentation, defeat debris motion and final pickup remain open.

Reproducible translation

EnemyExtractor --transpile translates an explicitly reviewed procedure graph into C#. It is a bounded backend, not a complete 65C816 decompiler. A recipe declares the exact ROM hash, native M=8/X=8/binary-arithmetic entry contract, data bank, entry points, code/data spans and external service addresses.

dotnet run --project EnemyExtractor -- `
  --rom 'C:\path\to\Megaman X (USA).sfc' `
  --transpile docs/enemies/native/x1-creeper.json `
  --output XSharp.Enemies.X1/Enemies/Functional/CreeperCode.g.cs

The generator rejects unknown instructions/services, computed calls, ambiguous widths, overlapping instruction boundaries and flow outside reviewed spans. It emits original addresses/bytes, ROM/instruction hashes, bounded execution and explicit calls to INativeObjectHost. Calls must preserve M/X and the private stack; violations throw. Data reads outside the reviewed ROM constants reach the host, which must reject unmapped addresses. No whole ROM is embedded or required when playing the generated controller.

NativeObjectCpu retains 8/16-bit accumulator behavior, the hidden high byte, N/Z/C/V, index width and a bounded private stack. SEP/REP preserve N/Z. Only the initial reviewed subset is implemented. New enemies require reviewed extensions for their actual instructions and services, rather than generic AI fallbacks. Procedures returning through native RTS become C# returns; no emulated CPU call stack, scheduler, PPU, APU, DMA or memory bus is implied.

Creeper: first integrated procedure translation

Source is X1 USA SHA-1 449A00631208FBCC8D58209E66D0D488674B7FB1:

Native address Meaning
$82:A989 Object 1F handler and common damage/render wrapper
$82:A9C9 Dispatch: $A9D1, $AA22, $AA23, $AA89
$82:A9D1..AA22 Generated initialization; native state 2 waits for parent release
$82:AA23..AA88 Generated airborne state 4, wall reversal and landing
$82:AA89..AACF Generated ground state 6 and loss of floor support
$86:CB64..CB69 Subtype 0/1/2 speed words: $0200, $0100, $0080
$86:CB5A..CB63 Native contact/hurt box records; center (0,1), half-size (6,6)
$AF:B915..B918 Animation selectors 3/4, relative to $AF:B90F
$AF:B965..B98B Ground/air frame scripts, including shared backward loop

The data bank is 86, not the code bank 82. X1 reset sets DBR=86 with A9 86 48 AB at $80:801B..801E; the object runtime uses this data context. The historical external disassembly has revision-offset differences (for example CB67/CB5D), so the pinned ROM bytes determine all addresses here.

The generated landing sequence retains the native carry through SEP, ROR and ASL: player X equal to object X selects right and $0080; a player to the left selects $FF80. Ground movement therefore uses 0.5 pixel/frame, replacing the previous generic 0.75. Airborne horizontal speed comes from the subtype table. Leaving the floor clears native vertical velocity and selects state 4; wall contact negates the 16-bit horizontal velocity and toggles facing.

The adapter executes movement at the generated call site and suppresses the later Sprite integration to avoid moving twice. It uses original animation durations, frames and loop pointers, with ordinary XSharp collision maps and content resources. Direct spawns default to released state 4; Mad Pecker now creates held state 2 and releases it from its original animation flag. The parent’s new direct adaptation still needs runtime verification. A generic ballistic launch is not used to replace Creeper’s native horizontal-speed table or vertical fall. The ballistic API remains available to actors whose original behavior needs it.

The following boundaries are not transpiled: the common damage/render wrapper, resource initialization, world sweeps/surface-following, activation, damage, drops and actor scheduling. Animation service semantics are adapted from $84:8EEA/8F07; motion and contacts use XSharp services. Consequently this is an integrated native-control milestone, not completed 1:1 enemy parity.

Validation evidence

Remaining work per actor is to close its actual native code/data graph, define and verify shared services, adapt it to the content module, and compare recorded original behavior. Passing functional arena tests is not a substitute for those steps. Preserve this distinction in editor integrations and progress reporting.

Armor Soldier and its on-foot variant now use the original boarding/occupied/gunner states. Their direct adaptation does not change the zero count of complete native runtime parity certifications.

Ball de Voux now runs a direct source-derived live controller: gravity/bounce, ground deceleration, script-entry unfolding/contact, ball displacement/turning and alternate damage/terrain shapes. Five native selectors and movement/probe tables are embedded data. Its own bounded control has no sound queues; shared hit11/punch3C and destruction23 are covered by the existing X1 audio profile. Lethal damage drops before explosion, while embedded self-destruction skips drops. Functional delivery precedes paired native-stage fine tuning; the complete-parity count remains unchanged.

Compressor now runs its original proximity/pressure activation, twenty-update tremor, gravity80 descent, command3D impact, hold44 and fixed upward return. Logical origin (placementY-17) and draw offset(+48) remain separate. The wide plate is solid; the tall column has its own bounded contact/weapon pass. Native shake, pressure/support object2A and exact native contact/carry timing remain explicit integration/calibration work.

Crusher now owns a shared carrier/head state model with independent HP, source scripts, seven midpoint links, a silent cosmetic burst, drilling/recovery signals and detached-head behavior. Its auxiliary enemy09 and small effects10/11 belong to different native pools; enemy-projectile10/11 are unrelated. The terrain helper queues26 before debris allocation, now named Crusher Terrain Break with reversible audio/manifest mappings. Optional source map writes use prepared level maps and local placement patches. Exact native slots, lag, resource priority, debris, shake and terrain-edge cases remain later calibration; no complete original-runtime parity certification is added.

Ground Sine Faller now runs the nonzero-subtype object10 pursuit, escape, terrain fall and landing/settling states. Resource11, group13 and paletteC6 supply its 25 frames; the preceding generic export wrongly used the five-frame airborne sheet. The checked-in scoped art recipe regenerates the corrected assets. All nonzero native subtype bytes select this ground variant; zero retains the existing airborne actor. Both variants share the source two-instance count. Source acceleration64, deceleration32, move-before-clamp, escape4px, gravity64, ground wait48, native damage/drop0 and silent state actions are implemented. Paired original runtime/camera/pool fine tuning remains distinct from this functional source conversion. Imported Penguin DX9 smoke verifies floor/settling, terminal frame24, source one-HP buster death, explosion23, prepared audio and save/RNG continuation. The ten-byte descriptor keeps combat geometry (0,-2;11,11) separate from terrain geometry (0,3;11,7;inset0) at descriptor+5. The live terrain adapter is checked directly against those five ROM bytes; it does not reuse the damage box.

Gulpfer has a preparatory source review only. Its eight group2A scripts and the suction vectors, sectors, independent combat/terrain boxes and weapon row are retained with pinned spans. It still uses generic idle. The pending adapter must cover the player-state suspend, suction/capture, swallowed shooting and struggle inputs, 180-update damage cycle, own script6/7 death and small-pool17 effects together. Both source death paths queue23; neither calls the generic pickup-drop helper. This extraction is not an enabled AI or proof of original-game runtime parity.

Flamer now runs its source facing/proximity body and four separate object38 flame links using group5A scripts0..3. The body waits3, attacks for80 and reloads60; each link extends in turn, holds its own offset, follows a separate Y-history slot and fades silently when expired or orphaned. Body HP6, contact3, selector3 weapon damage and drop0-before-explosion are connected; flames have contact2 and ignore shots. No direct firing sound exists in the reviewed path; common11/3C/23 use prepared native assets. The 230 selected checks and a DX9 imported-stage5 smoke pass, including all four own-art links, silent attack, hit/destruction cues, no added audio loads and save/RNG continuation. Native pool pressure, detailed global scheduling and original-stage frame parity remain deferred. The data-only source record is mirrored into HunterBaseStudio.

Death Rogumer Cannon now uses source spawn facing, script-controlled preparation, contact-cone/turn gating, reload90 and a separate two-pixel hostile-pool13 projectile with countdown96. The projectile uses group28/script2 frames6..9, ignores weapons and has no world sweep. Timeout or player overlap explode; draw culling removes silently. Source firing paths have no direct action queue; common damage/explosion cues apply. Generic drops are disabled. Muzzle/death cosmetics and allocation-dependent debris RNG remain explicit deferred integration, distinct from functional control delivery.