XSharp

Native ROM audio assets

This optional local collection is rendered by XSharp’s standalone AudioExtractor from supported USA X1/X2/X3 ROMs. The three generated game folders are ignored by Git; only this README and tool source/documentation are versioned.

Native/
  X1/ (and X2/, X3/)
    source-catalog.json
    Music/manifest.json
    Music/x1-music-XX.flac
    Sfx/Common/manifest.json
    Sfx/Song-XX/manifest.json
    Sfx/Overlay-XX/manifest.json (X2/X3)
    Sfx/Clips/<encoding-key>.flac
    Sfx/Clips/<encoding-key>.flac.clip.json

Music filenames use hexadecimal native preset IDs. Each effect context manifest maps its native command IDs to shared lossless PCM16 stereo FLACs. Equal content shares a clip only within the same original game. Source catalogs retain native sequence aliases, ordered banks and non-null effect pointers. Silent commands remain in the manifests with end: no-audio and no invented sound file.

Effects use the canonical-apu-v1 capture profile: every context starts from the same quiet CPU/SPC/DSP state, with only static ROM resources overlaid. Equal effects therefore share an exact clip instead of accumulating differences caused by bank-upload timing. Genuine waveform changes remain separate. Music presets with equal PCM/loop definitions also share one file; use each preset’s manifest mapping.

Music uses canonical-music-v1 and exports its introduction plus one combined native sequence cycle, or its finite ending. Manifest loop coordinates are zero-based decoded sample frames with an exclusive end. FLAC tags retain LOOPSTART/LOOPEND. Native sequence tick/tempo details are retained too. The sample mapping has the 512-native-sample driver grid precision (about 16 ms), not sample-exact DSP-state recurrence. Independent voice cycles can produce a longer combined loop. WAV/MP3 are selectable alternatives in the extractor.

Song contexts preserve their native bank lists. Additional Overlay-XX contexts combine the instrument banks of preset 12 with each stage effect bank; their original level/checkpoint associations are not inferred by this import.

The source ROM and emulator core are needed only for import. Playback uses the normal engine API, for example:

engine.PrecacheSound("X1 native music 1E", @"Native\X1\Music\x1-music-1E.flac");

For an effect, resolve entries[].file relative to the selected context’s manifest folder, then supply the resulting path relative to Assets/Sounds. The existing named sounds/music are not automatically remapped to numeric IDs.

Reproduce with tools/Import-NativeAudio.ps1; verify with tools/Test-NativeAudioAssets.ps1. The importer defaults to FLAC, one music cycle and a 15-second SFX cap. The music safety cap is 1800 seconds; truncations are explicitly marked rather than presented as complete loops. The verifier decodes and checks every unique file and its lossless PCM identity. Catalog coverage does not certify every live gameplay bank combination or sample-for-sample hardware parity. ROMs and the external native core are not included. All original audio remains the property of its respective owners.