XSharp

Native actor and object sounds

This is an incremental sound integration audit, not a certification of complete enemy AI or frame parity. Sound identity belongs to (original game, SPC bank context, command); a numeric ID alone is insufficient. The source of semantic names is the extractor catalog. Revision-pinned evidence preserves ROM SHA1s, CPU call addresses, neighboring bytes and span SHA256s for future reverse engineering and HunterBaseStudio reuse.

Runtime bridge

Level loading calls BaseEngine.PrecacheNativeSoundContext for the stage’s Common bank and the original games of its actors/dependencies. It reads schema-3 manifests from Assets/Sounds/Native/<game>/Sfx/<context>, decodes WAV/FLAC/MP3 and validates hashes and PCM before gameplay. PlayNativeSound uses the prepared command/name map and cached PCM only; it performs no manifest/file probes, decoding or hashing, and never opens a ROM. NativeSoundRequested exposes action, actor, command, context and simulation frame to headless tools. Enemy content determines its original game independently of the loaded stage. Generic projectiles retain their owner’s game even after the owner is removed. Banks found absent during precache return false; legacy common-hit/explosion sounds remain a fallback where they were already available. Custom SPC contexts must be declared during [Precache] or LevelDefinition.OnLoaded using PrecacheNativeSoundContext(game, context). An undeclared bank after the level is ready produces an explicit precache error, rather than silently loading it in the middle of a frame. The request audit hook remains available without an audio device or assets.

The fixed enemy/spare channels 4, 6 and 7 are allocated by pending physical output, then age. Player, weapon, music and ambient channels remain separate. This does not emulate SPC voice priorities. Queue helpers $80:88A2 (X1), $00:851E (X2), and $01:8000 (X3) compute spatial position; they are not duplicate filters. The neighboring entry points enqueue centered commands. Same-frame deduplication is an explicit optional host policy, disabled by default. Stereo positioning and native SPC voice arbitration are not yet replicated by this PCM bridge.

Reviewed first batch

Additional reviewed cues

python tools/Export-NativeSoundEvidence.py reproduces source spans from the supported local ROM revisions and verifies every recorded address is a call to the correct game’s native sound queue. The catalog currently has 103 command/context identities, 145 unique verified call sites and 156 command/call references; 101 physical clips have semantic names.

Remaining audit

python tools/Build-NativeSoundAudit.py rebuilds the bounded audit worklist. It inventories 119 optional-content/research entries and hash-verifies recorded source spans for 56 of them. Queue byte patterns are candidates for semantic review, not control-flow completeness or proof of silence. Core legacy/boss controllers and indirect helpers are explicitly outside this inventory’s exhaustive coverage. The first added runtime regressions cover elevator boarding/64-then-16-update motor/arrival cues, all three surviving Refleczer contacts versus its silent fourth, all four global phases of Tubamail death and the three distinct X3 generic-shot cues. Nine focused cases pass; body-AI timing still has the limits above.

Own-body calls, child/projectile calls, shared damage/explosion helpers, alternate death effects, context-dependent overlays and stage-object controllers must be reviewed separately. A bounded EnemyExtractor packet without a queue call does not establish silence. The first batch does not complete the requested audit of every implemented enemy/object or boss. Do not assign overlay 70+ commands to the Common bank or infer meanings from a neighboring actor’s calls.

Naming and verification

AudioExtractor --name-assets <native-root> renames identified audible clips and updates every manifest alias and resumable sidecar. Individual manifests are renamed to <audio filename>.clip.json; the tracked filename map records both old/new audio and manifest paths. IDs and PCM/encoded hashes remain stable. The first run renamed 29 physical clips for 30 command/context definitions (one silent command). The expanded catalog now names 94 physical clips and their individual manifests for 95 identities. See name corrections for the corrected $21 interpretation. Playback-only gain is documented in native audio playback. All 555 files and all 11,491 manifest references were decoded/hash-verified afterward. Pure controller tests cover Ride Armor jump cues and both Aclanda expansion branches; headless actor tests cover original-game damage routing across the functional roster. Audio tests verify missing assets, request observation and channel isolation. Live emulator/acoustic comparison of the complete roster is still pending.

The dedicated Penguin regression runs against the standalone imported level and real DX9/audio backend:

dotnet run --project tests/XSharp.LevelSmoke -c Release -- --penguin 0 --penguin-native-audio --content-root=<existing-demo-output>

It checks the three destruction kinds and duplicate Explode calls, slide launch, finite sustained breath, active-breath full-state restoration and death interruption, with the level precache guard sealed and the same 175 sound cache entries. It does not validate all boss AI/animation timings.

Declared legacy enemies must prepare their source-game bank even before their first spawn. Final precache now uses the same fixed/default identity as Enemy.SoundGame; Batton Bone G declares X2 with NativeSoundGameAttribute despite living in the core assembly. Inherited fixed metadata is available to custom content as well. For instance/owner-dependent SoundGame overrides, declare the bank in the source [Precache] callback or owning definition; the dependency pass never constructs actors or runs their instance getters to guess a game. Optional EnemyDefinition content keeps its existing data-owned precache path.

The Cannon Driver functional spread now uses the reviewed heavy projectile’s flight image, assembly 0B/script 05/frame 17 (16x16), rather than provisional flash/impact frames 3/4. All 35 existing atlas geometries and the 456x355 PNG extent were checked against native sprite parts; PNG bytes are unchanged. It requests Common 24 once after a successful primary allocation ($03:8EC1/8F6C), not once per generic spread bullet. The separate light projectile 02 queues 01 at $03:8FB9; that sound is named, but the native light controller is not wired into this functional primary adapter.

Sole Solar’s current 24x8 frame 18 corresponds to primary projectile 07, assembly 15, selector 08. Its native allocation queues 5E at $07:B0B6. The separate secondary projectile 08 queues 13 at $07:B17F and uses selectors 0F/17. The table at $06:DE82 contains the three primary damage/script pairs 5/09, 3/08, 2/07; its data bank is 06, not the handler’s program bank 04. Existing body/trajectory/damage scheduling remains an adapter.

Four allocation/art-role regressions passed, including exhausted allocation and two successive volleys. The real DX9 mixed-game smoke also exercised both primaries inside Sponge and restored its state. This does not certify complete native multiweapon AI.

Penguin snowstorm now queues finite Common 73 once when the visual effect starts, matching the parent signal at $81:B833..B841 and the separate stage-effect controller $87:EFF6..F066. The source writes a 120-update timer, queues centered 73 at $87:F029, and never requests another sound during that storm. The existing 120-update visual adapter remains. No artificial PCM loop or stop command is added to the native clip; its finite tail drains naturally, including when the boss ends the visual effect. The old WAV loop remains only as the missing-native-assets fallback. StartPlaying also requests its prepared sound on spawn. Native source-game metadata is fixed to X1.

The DX9 Penguin regression additionally covers repeated Play/Stop calls, a second storm activation, active-storm state restoration and a finite tail after visual Stop. The existing destruction, slide, breath and death-stop cases still pass with 175 prepared sounds and no runtime cache growth. The source research is retained in penguin snowstorm source; this is not complete boss AI, global SPC voice arbitration or live emulator acoustic certification.

Walk Blaster’s successful enemy-projectile 12 allocation queues centered X3 Common 29 in its body helper ($07:E932..E98F, call at E989). The allocator is $02:D8DE; $02:D859 belongs to a separate common-effect pool. The dispatched projectile at $3A:F980 inherits owner assembly 59 and uses selector 06: frames 29/30, two native updates each. Existing 16x8/14x8 flight art is appropriate and unchanged; its generic six-update animation sequence, burst scheduling and trajectory remain adapters. The cue is emitted once per accepted projectile and not on rejected allocation or child updates. Two focused allocation/art tests pass; mixed-stage DX9 exercises this third primary attack alongside Cannon Driver and Sole Solar in Sponge and restores the non-Common context afterward. See projectile-source.json for spans.

Drimole-W’s primary projectile 07/subtype 0 queues X3 Common 13 at $07:A839 only after allocation succeeds. Its separate subtype 2 queues 42 at $07:A8A9; that identified secondary is not attached to the functional primary attack. The primary native selector 01 uses frames 11/12/13 for four updates each; after its 16-update launch phase, selector 02 uses frames 14/15/16 for two updates each. The existing generic art samples valid frames 12/13/14/15 across these two flight phases and is unchanged. These are not impact frames. Native body, phase/motion, hitbox and six-update animation timing remain outside this audio binding.

Four X3 allocation/art checks cover Walk Blaster and Drimole-W (including rejected allocation and no repeated child cue); DX9 mixed-stage coverage now contains four reviewed primary attacks. Common 42 is shared with Head Gunner Custom and is named Heavy Projectile Launch with its paired individual manifest renamed as well.

Slide Cannon now binds the already identified X1 Common 33 call at $87:B43C to accepted projectile creation. Its helper $87:B3D7 uses enemy-projectile 13, subtype 3, inherited assembly 69/palette and horizontal speed 0200. Shared child $83:A652 selects animation by subtype; selector 3 holds frame 6 for eight native updates. The existing fixed 16x8 flight image is correct. Functional aimed movement, speed, body scheduling and lifetime are retained adapters. Allocation rejection is silent, and child updates do not repeat the cue. Six primary allocation/art cases cover this actor, Cannon Driver and Sole Solar; mixed-stage DX9 covers five primaries.

Earth Commander queues centered X3 Common 13 once after its paired allocation helper returns ($07:9BD5 and 9C71), including rejection of both allocations. Helpers 9CF1/9D04 attempt projectile 04 twice (subtypes 0/1 or 80/81) via 9D19. The functional engine volley remains one projectile per Fire call, with one cue after that attempt rather than a per-child success cue. Child $04:EC0A inherits assembly 09 and selects script 03: flight frames 13/14/15/16 at two native updates each. The provisional 4/5/6/7 recipe was not that script and is corrected in both the asset and regeneration recipe; PNG bytes are unchanged. Generic body, pairing, trajectories, six-update animation and damage/hitbox scheduling remain adapters.

Two dedicated cases verify post-attempt ordering, rejected allocation, three successive attempts, no child cue duplication and flight art across 24 updates. Real DX9 mixed-stage coverage passes with six reviewed primaries and full state restoration. The audio catalog is still 65 identities /64 named audible pairs; only the verified source references increased, to 92 sites /98 command references.

Flame Pillar now requests X1 Common 3F when its 48-update initial wait (90 on subsequent cycles) changes to rising, before its first movement. The standalone FlamePillarControl has no renderer/audio dependency. It preserves the positive-up 0100/0180/0200 speed sequence, two-update first terrain pause, unsigned 128-pixel height/return checks and native six-update animation. The hidden base is placed 126 pixels below the event (native event Y=933, base=1059); custom depth is configurable. Lifetime uses the placed event instead of the temporarily hidden physical origin.

On the matching imported X1 stage-4 revision, the two native four-map floor patches use SetMapLocal/ResolveLevelMap. Their probe and patch both use native map coordinates; the player’s one-pixel WORLD_OFFSET bias must not be added to this script probe. Other levels keep their own tile IDs, and native patching can be disabled. Warning/debris effects, their RNG calls, campaign extinguish flags and complete native combat/culling service parity remain outside this adaptation. See the bounded source record.

The real DX9 Mammoth check –flame-pillar-native-audio passed using the actual placed event: cue ages 48 and 269, finite prepared sound, both original floor rows patched, and 30 identical engine frames after full state restoration (position, velocity, animation and the engine RNG). Its sound cache stayed at 167 entries. This is engine restoration equivalence, not a BizHawk RNG/acoustic parity claim. Twelve pure/actor checks and one local-ROM fact cover the controller; the expanded selected content/map/reader regression checkpoint passed 176 cases. The earlier real-assets/device backend checkpoint passed 70 with one optional extracted MP3-manifest fixture skipped. All 168 X1 files /3641 audible references were decoded and hash-verified after naming the new clip and paired manifest.

Jelly Seeker now uses its native body decision, 20-update movement and 180-update discharge phase instead of the generic swimming brain. The preparation script 04 reaches its end marker after 19 updates; discharge script 02 requests X2 Song-15 command 74 when its advanced flags are nonzero ($2A:C6E7), producing 60 pulses. The one-update 80 loop flag must not be consumed as a low-bit event. Native near/far random thresholds, arithmetic velocity shifts and home bounds are retained in a renderer/audio-independent JellySeekerControl. Its companion and native debris/ combat services remain separate; this is not complete enemy or SPC mixer parity. See the source record.

Thirteen focused control/actor cases passed. Real DX9 –jelly-seeker-native-audio passed with a finite prepared Song-15/74 clip, ten identical cue requests across 30 frames after full engine restoration, and an unchanged 126-entry sound cache. A short source may already have been submitted to the physical device when a frame ends: that check uses OutputPending, not only the provider’s Playing flag. All 211 X2 files /4276 audible references decoded and hash-verified after naming the clip and paired manifest. The catalog now contains 67 identities /66 named audible pairs, 94 queue sites /100 command references. The audit has bounded source spans for 48 of its 116 entries and 35 queue candidates; it remains an incremental worklist, not a full-roster completion claim.

Shared enemy explosions now queue native 23 before attempting their visual, as the X1 $84:A4AB, X2 $08:E0F0 and X3 $04:D6E0 helpers do. The effect’s later spawn cannot delay or duplicate that request. A full visual pool still requests the command. Missing-native installations retain the prepared legacy fallback without retrying a native request on visual initialization. The X2 original-slot Scriver/Aclanda explosion and X1 Armor Soldier final explosion follow the same order; silent scattered bursts remain silent. This change does not convert staged crash/death controllers into the shared explosion path.

Ten focused pool/order cases passed; the expanded selected regression checkpoint passed 239 cases. Real mixed-stage DX9/audio checked all three source games and saved/restored both pending Armor Soldier and original-slot X2 explosion visuals without another cue. Existing six primary attacks, weather branches and declared non-Common bank restoration still passed. See the bounded native helpers.

Mole Borer walking uses native assembly 49/script 00 rather than the generic 0/1 frame cycle. The original $83:C036..C049 queues Common 42 only on the new-frame marker for frame 3: holding that pose for five updates must not emit five cues. The script enters it once per 30 walking updates. The host advances that script on its functional grounded patrol. Generic movement and body/combat parameters remain adapters. Current component destruction requests mechanical breakup 21 ($83:BFBC) instead of appending generic explosion 23; the native 180-update multipart/debris sequence is still unported.

Four focused cases and the expanded 243-case selected checkpoint passed. Real mixed-stage DX9 saved/restored a walking Mole Borer and repeated 30 engine frames with the same next footstep, position/velocity/animation and engine RNG, then checked mechanical breakup without 23 or asset-cache growth. All 168 X1 files / 3641 audible references decoded and hash-verified after renaming the 42 clip and paired manifest. See bounded source and limits.

X1 BossDoor now uses Common 40 for opening and first-door closing, and Common 41 for second-door closing (native subtype bit 80, represented by StartBossBattle). The existing opening-update-44 and closing-entry callbacks retain their timing; native clips use the prepared enemy pool, preserving player/music channels. Missing native assets and the still-unreviewed X2/X3 door commands retain the existing legacy fallback. Both media files and their paired manifests are named. The source record includes original BizHawk observations at frames 119/247 and both ROM revisions. The reusable read-only capture tool avoids a whole-memory/CPU trace.

Two door routing cases and 80 complete audio cases passed (one optional extracted MP3-manifest fixture skipped). Real imported Penguin DX9 entry completed in 296 updates, with its native opening/closing requests and normal boss intro/spawn/ first attack. All 168 X1 files /3641 audible references decoded and hash-verified.

X1 boss health filling queues Common 0C before each alternate-update HP increment, using the existing host fill channel 0. It no longer requests the old life-gain sound on every update when native X1 assets are present. Missing-native and X2/X3 behavior retain the prepared legacy path. The original Penguin Fight movie emitted exactly 32 ticks, at frames 473..535 step two; the DX9 Penguin room smoke and focused audio test check 32 requests before HP 0..31, without changing enemy/music channels. See revision-pinned source and capture. The same capture identified X1 Common 08 as X Jump; naming includes its paired manifest and does not change player jump physics or sound routing.

The current naming catalog contains 72 identities /71 audible named pairs, 100 unique verified native queue sites /106 command references. All 168 X1 files / 3641 audible references decode and hash-check after these two name changes. The full audio checkpoint passes 81 cases, with one optional MP3 fixture skipped.

Health recovery from implemented small/big health drops now uses the loaded game Common bank: X1 0C ($82:E58E), X2 15 ($01:D652), X3 15 ($01:D8EF). The existing four-update freeze callback queues after HP increments on channel 0; Heart Tank’s existing HP-increase callback shares it. Missing native assets retain prepared legacy Life Gain. No cue opens or decodes assets during these callbacks.

The reviewed X2/X3 boss filling paths likewise use 15 every second update, after HP increments, whereas X1 requests 0C before increments. The host retains its current intro/global phase. Those games’ selected-weapon energy increment paths also emit 15, so their named files describe both health and weapon energy. The empty Player.ReloadAmmo behavior and full-health-to-SubTank storage are separate gameplay work; this change does not manufacture an ammo pickup cue.

See bounded source and adapter limits. Seven focused native/legacy cases check all three games, HP/request order, player channel isolation, and playback after deleting all fixture files. The full audio checkpoint passes 87 cases with one optional fixture skipped; all 555 installed files /11491 audible references decode and hash-check after the name changes.

The existing core Snowball also needs its native sound: Common 57 on hard landings (strict downward speed > 3 pixels/update, $87:E135..E160) and once after debris allocation attempts at destruction ($87:E232). A saturated visual pool still queues breakup; partial availability creates only the fitting fragments. It does not append generic explosion 23. The ordinary Break lifecycle already suppresses repeated destruction. The paired clip/manifest now use x1-57-snowball-impact-and-breakup.flac; source media bytes are unchanged.

Eleven focused threshold/pool/lifecycle cases and 254 selected regressions passed. Real standalone Penguin DX9/audio created all ten existing debris actors, queued one native breakup and preserved the prior ice/slide/snowstorm/breath/state tests without cache growth. All 168 X1 files /3641 audible references decode/hash-check. Source and limits keep the existing movement/growth/bounce/debris adapters distinct from native sound coverage.

Mega Tortoise’s bomb uses a different explosion path: enemy-projectile 25 ($83:AD4B) invokes $84:A445, which attempts enemy actor 4A. That actor queues Common 23 during its next initialization ($87:C73B), after checking the native camera margin. The host now retains X1 identity in a stage from X2/X3, keeps the cue deferred, and creates no visual/request when its entity pool is full. The sound margin is opt-in for this effect and uses the original unsigned 16-bit bounds; immediate shared explosion policy remains separate.

Four stage/pool cases and ten margin boundaries pass. Real mixed-stage DX9 checks the X1 clip, replay of the next cue after restoring a pending effect, and silence beyond the margin. Source and limits also distinguish cosmetic effect 10/subtype 28 from enemy-projectile 28. The host visual is still an adapter for actor 4A’s presentation and contact.

Native movie observations preserve the full Stag and initial Penguin movie queue-frame groups, validated callers, ROM/movie/core/tool hashes and the local trace locations. A movie’s lack of a particular actor/cue is not interpreted as proof that its action is silent.

Axe Max queues Common 7D when each log initializes, including its base and regenerated movable logs. The native parent creates three projectile-08 actors with parameters 0402/0403; the queue belongs to their initialization at $81:B201 in USA 1.0 ($81:B20B in the captured USA Rev 1 movie). Throwing an existing log does not replay this cue. The core composite explicitly precaches its X1 context even when placed in an X2/X3 level. A log and its hurtbox are allocated together only when both entity slots fit.

Eight focused lifecycle/pool cases passed. Real mixed-stage DX9 initialized the three log cues, restored initialized logs without replaying them, and performed no additional asset loading. All 168 X1 files /3641 audible references decode and hash-check after naming the paired clip/manifest x1-7D-axe-max-log-formation.flac. Source and movie observations retain the ten captured native queue rows and distinguish verified cue ownership from the existing movement/regeneration adapters.

Buster and shared combat sound selection now have independent load-time profiles; see configuration and scope. The native player allocation selectors use normal/semi/full 01/04/02 in X1 and 01/04/05 in X2/X3. Numeric charge control commands are not equivalent to shot levels: sustained recordings and silent stop commands must not be assigned to firing. Eight newly identified clips and paired manifests have repeatable names; source bytes remain unchanged. The naming index contains 84 identities /83 audible media-and-sidecar pairs.

The common profile also covers HP recovery, weapon-energy recovery, extra lives, Heart Tanks and Sub Tanks. The pickup commands use their independently selected profile bank, with prepared legacy fallback if needed. Moving the collection and combat maps into asset descriptors leaves actor-specific commands owned by their existing controllers. Collection source records 15 queue callsites.

Sub-tank storage has separate cues from the pickup itself. The full-health drop routine queues Common 0D in X1 or 16 in X2/X3 when it adds reserve energy. Reaching the 14-unit cap queues Common 2B in X1 or 17 in X2/X3. The six clips and their sidecars now have semantic names. The Sub-tank source record also pins the delayed large-drop cue and the three pause-menu drain paths. The campaign pickup emits a second fill cue four updates later when a large drop stores two units without filling the tank. Both cues can use separate cached voices when filling and completion occur on the same update. Pause-menu drain uses the health-increment cue. The DX9 smoke validated cached voice selection, transfer timing and save/load on each of the three imported intro stages. Original-game evidence for these reserve paths is based on ROM control flow.

Ground jump and wall kick use Common 06 in X1 and 08 in X2/X3. X1’s state06 controller at $81:8481 queues06 at $81:8495; state10 wall jump queues06 at $81:8725. The earlier interpretation of $81:8918/$81:90B3 as jump was incorrect: state14 is dash. Its command08 and historical Rev1 observation remain valid evidence for the dash sound. See state-dispatch receipt. The X2/X3 USA revision queue calls are X2 $08:983B/$08:9AA3 and X3 $04:8470/$04:8852. The Stag trace confirms 45 ground and 39 wall calls at the X2 sites. X3 has static call-site evidence. The XSharp hook uses the existing ground-launch and wall-kick gates, with the player bundle’s bank and a legacy fallback. The audio change does not alter movement timing. Eight routing fixtures cover the movement channel, X1 boots, missing assets and playback after deleting provider files. Real Direct3D9 tests in the imported Penguin level played one cue from each of the three game bundles and the legacy cue from the custom profile. All 555 installed files decoded and hash-verified after the X2/X3 clip and manifest pairs were renamed.

Beetron now aligns with the target and charges right into terrain. The horizontal sweep emits Common 22 once on impact and switches to recovery. A timed-out charge remains silent. The old generic shot is no longer emitted. Four headless cases check vertical alignment, wall contact at two distances, rebound and timeout. Source and limits record which portions of the encounter remain outside the standalone adapter.

Crag Man waits until the player is strictly within 80 horizontal pixels, then falls with 0x40/256 acceleration. Its first floor contact plays Common 20 and rebounds at a quarter of the incoming vertical speed. The next landing starts the 30-update rock acquisition timer. On a passing RNG roll it requests projectile 17/subtype zero at the top of the camera. Its overlap with the receiver selects throw script 8. The script’s release marker emits one aimed projectile. A destroyed thrown rock emits four visual fragments, with two RNG advances per attempt even if the effect pool is saturated. The reviewed rock acquisition, throw and breakup gates do not request a second native cue. Source and limits record the terrain gate and remaining body-specific effects. Fourteen focused Crag Man cases cover the arrival, reload timer, receiver handoff, frame-gated launch, aimed velocities and fragment allocation.

Trapper now scans across the native 32-direction sectors, with strict 128/96/64-pixel placement ranges and reversed orientation for subtype bit

  1. A matching sector triggers Common 2E once. Its Common alarm is independent of stage effect 2D allocation success in the source. The standalone actor currently exposes the alarm latch and uses the available body sequences. The stage-wide effect, including its timer and presentation, is still open. Source and limits record the dispatcher, supported range table and stage-effect initialization. The headless tests cover eight range/orientation cases and a diagonal pickup as the scan reaches its sector. The Direct3D9 Penguin smoke played the prepared X3 alarm on an enemy channel exactly once. After renaming the clip and paired manifest, all 555 installed files passed checksum and decode validation. The selected core regression run passed 469 with one skipped case. The audio suite passed 101 with one optional fixture skipped.

The actor sound worklist contains 119 entries with semantic or runtime review still open. Its candidates include already reviewed actions, and an empty candidate list cannot establish silence. Core legacy actors, boss actions and indirect sound helpers need additional coverage outside that inventory.

The following source gates were also narrowed during the review. They require actor or stage state before an engine cue can be assigned: