XSharp

Native pause menus: implementation and original-code evidence

The X1, X2 and X3 native equipment menus are implemented and integrated. The delivery audit below links the source and runtime checks. They have runtime equipment displays, source-adapted cursor navigation, weapon preview palettes, reserve handling and menu save-state restoration. Their graphics load from approximately 42/49/43-KiB data packages, without runtime ROMs. Normal-resume opening/closing clocks and mapped-input history are integrated for the measured source paths; native Escape gates/transitions are implemented, including all imported resource contexts for the pinned revisions. The existing custom equipment menu remains available.

Profile and extension policy

XSharpDemo mounts XSharp.Assets.X1.Menus and selects the X1 menu by default in PenguinDemoConfiguration.ConfigurePauseMenu. Press Enter/Start after spawn. The data-only menu assembly contains the committed .xmenu and profile descriptor, without embedding the full X1 audio collection into every demo/test dependency. An explicitly mounted full X1 package is reused. Existing explicit menu/player-profile choices take priority, and physics, buster, player sprites and common-audio profiles retain the demo’s configuration. The LevelSandbox continues to use its independently selected profiles.

Native menus adapt to the window’s client viewport, independently of camera resolution or StageSize. Their 256x224 buffers are source-asset coordinates, not an engine resolution/aspect requirement. NativePauseMenuLayout reflows panels, tiles frame edges and relocates original content without stretching its glyph/sprite blocks. X1 keeps its weapon columns and three lower panels; X2/X3 keep their weapon/page pane and status/reserve/exit/lower panes. Extra height is distributed between the panels. The exact reference viewport takes a direct copy path, preserving every source pixel.

All native profiles default to NativePauseLayoutMode.Responsive. During initial configuration or level loading, select the original centered composition when needed:

engine.PauseMenu = PauseMenuProfile.X3 with
{
    NativeLayout = NativePauseLayoutMode.Original
};

Asset descriptors accept "nativeLayout": "Responsive" or "Original". The policy is saved with the menu snapshot. Host extension pages keep their source canvas and are repositioned as a whole, including an in-progress page slide. The layout model and compositor are portable and have no renderer/audio/ROM dependency. Custom menu implementations can use their own layout policy.

DX9 now reports the actual client area, excluding window borders. Resizing the client recreates the backbuffer and prepares the new menu canvas through the existing device/precache lifecycle. Rendering a paused frame performs no new asset reads or texture allocations. Source graphics, input, menu clocks and stage simulation remain independent of viewport composition.

The responsive GPU verifier captures a completed scene before Present. The test host supplies this hook without changing the production renderer API. Reading afterward is unreliable with SWAPEFFECT_DISCARD, which does not preserve the presented backbuffer’s contents; see Microsoft’s swap-effect contract. It checks every logical texel at its projected center with point sampling, including live widescreen/portrait/native resizing and a saved layout policy.

The responsive validation record contains six viewport images and 245,024 exact logical-texel GPU samples per profile (735,072 total). All three pass 1280x720, 600x900 and native-ratio return checks; X3 also resizes while a host page is sliding. The focused suite passes 1,169 C# tests and 11 capture-tool tests. Example views: X1 widescreen, X2 widescreen, X3 widescreen, X3 portrait.

PauseMenuProfile has separate X1, X2 and X3 descendants and a custom profile. Each native PlayerProfile exposes its matching menu through a computed PauseMenu property. This preserves the existing serialized player-profile field layout. The X1/X2/X3 asset player bundles apply their native menu descriptors. The plain engine.PlayerProfile setter also applies the matching menu. A host can select a menu independently of the stage’s source game.

Zero selection is disabled. The X3 original’s character screen and the availability of its character selector are separate concerns: even the intro state captured here allows opening its second screen, which shows static on the portrait display. Opening that screen is not evidence that Zero can be selected in that stage.

Optional extension pages use stable IDs, not CLR type names. A menu descriptor can declare them with:

{
  "schema": 1,
  "kind": "pause-menu",
  "base": "x3",
  "name": "x3-with-settings",
  "extensionPages": [
    { "id": "input", "title": "Controls" },
    { "id": "graphics", "title": "Graphics" }
  ]
}

PauseMenuPageFlow provides routing, transition updates and validated state restoration without graphics, sound, a ROM or an engine host. The default profiles contain no extension pages. equipment and zero are reserved IDs; registering an ordinary page cannot turn on a character switch. Native X3 transitions use three pixels per update with a 115-pixel displacement, taking 39 updates in either direction. The source is $00:C996..C9EC, including the clamps to $FF8D and zero. Custom menus can switch immediately.

The X3 runtime binds optional pages through IPauseMenuExtension. During the initial configuration or level precache, the host calls:

engine.PauseMenu = PauseMenuProfile.X3 with
{
    ExtensionPages = [new("graphics", "Graphics")]
};
engine.RegisterPauseMenuExtension("graphics", graphicsPage);

graphicsPage is the host’s IPauseMenuExtension implementation. Precache runs inside level loading and on device recreation; make it idempotent. Update receives held/pressed logical keys and the engine, so the host can change its input/display settings or enqueue console commands such as engine.Console.Enqueue("toggle r_drawhitboxes"). Render paints a 115-by-192 ARGB canvas without IO. The engine clips that canvas to the equipment pane, leaving the original frame/status panes in place. Supply the host’s own text, icons and widgets through that canvas. No settings screen is added by default.

RWS opens the next declared page; LWS returns. During the 39-update slide, page/equipment actions are isolated. Start from a settled host page follows the native close path and commits the current equipment selection. Host pages can capture/restore bounded strings through stable IDs; saves never instantiate CLR types from their payload. The v8 save envelope includes page/slide, pending native video and the selected resource clock while retaining readers for v1 through v7. See the fixture page in NativePauseMenuSmoke for a complete minimal implementation. Live panes currently require the X3 layout; X1/X2/custom page flows remain portable model support only.

The muted X3 smoke verifies both directions, save/load in the middle of a slide, restoration of controller state, device recreation, isolated gameplay/RNG and 57,344 exact equipment GPU texels after returning. The six compositor tests also verify clipped forward/backward offsets and unchanged surrounding panes.

Pixel reconstruction

SnesTileRenderer and SnesHdmaTable are device-independent components in XSharpShared. The raster probe reconstructs captured VRAM/CGRAM/OAM using tile attributes, original palette expansion, OBJ geometry and a direct HDMA color window. It does not copy pixels from the reference image into its output.

Three captured menu states reproduce 57,344 of 57,344 pixels each:

Game BG1/BG2 scroll Y OBJ character base OBJ name offset Color math
X1 1 $4000 $8000 BG1, subtract 8 outside the selection window
X2 7 $8000 $6000 BG1, subtract 12 outside the selection window
X3 1 $C000 $2000 BG2, subtract 12 inside the selection window

The text layer uses VRAM map $A000, the background map $B000, and both use character base $2000 with four bitplanes. Addresses are byte offsets. Each observed OBJ configuration uses 8/16-pixel sizes and zero vertical offset. Subtraction clamps in five-bit space before expanding RGB to eight bits. Reusing X2’s color-math settings for X3 is incorrect.

X1 reference, X2 reference, X3 reference. The source record preserves ROM hashes, reviewed spans, capture hashes, geometry and comparison reports. These results cover three static states with minimal inventory. They do not establish the runtime menu, other inventory states, animation or transitions as exact.

X1 runtime display and input

X1PauseMenuRaster adapts $80:CA96..CDB6, using the original data bank $86. The two weapon columns use native label DMA payloads, icon tiles and seven-part meters. HP, the two-tile lives digit and reserve halves use their own X1 glyphs, attributes and positions. Armor and preview projections are assets; their ROM tables are read by the extractor, never by the running engine.

The 72 X1 display fixtures match 4,128,768 pixels exactly. They cover empty/full inventories, all 16 armor masks, intermediate HP/capacity/lives/energy values, preview palettes and cursor states. The native navigation table adds 252 original transitions: every cursor, six direction combinations, and full/sparse/no-reserve inventories. X1 applies horizontal navigation before vertical navigation, gives Up priority over Down, and skips empty reserves in its vertical paths. Horizontal reserve transitions have different rules and can reach an empty owned reserve. These are direct original-code adaptations, not X2 navigation with different coordinates.

After reserve drain, X1 restores the equipped weapon’s cursor while retaining the last preview palette. A subsequent idle menu update must not overwrite that palette; $80:C6B6..C6D1 loads it only when the final cursor actually changes. The menu cursor, preview and weapon bindings persist in xsharp-pause-menu:v8. The former X2 v1 payload remains readable through an explicit adapter.

The activation trace confirms a revision-specific quirk in $80:C6E9..C70C: the healing step reads $1F83 + byte(HP - 10), rather than the selected reserve. At HP 1..9 the unmapped read latches $1F; HP 10..13 reads the reserve slots. Higher HP reaches reviewed zero padding/high bytes, weapon energy bytes, and the buster byte. The low nibble determines a one- or two-HP step, captured once at activation. All 31 non-full HP values were traced in the original with full inventory; each first gain occurred after four updates. Thus a full selected tank does not always imply a two-HP step, and a partial tank does not always imply one.

The native X1 menu uses this scoped activation policy and saves its result in the in-progress reserve transfer. The custom menu retains its existing logical full/partial policy. The alias model uses the reviewed zero padding/high bytes; other native revisions or nonstandard inventory bytes need separate evidence. The empty-reserve investigation now covers 12 complete cases and 828 native updates. $80:C6DF..C70E does not reject empty selected bytes. $80:C76A decrements the entire byte: an owned empty $80 becomes $7F, loses ownership and runs through sixteen decrement steps to $70. HP still clamps while the drain continues. A following nonempty owned slot can be shifted over it; an intervening empty/unowned slot stops that shift. The selected meter remains drawn even after ownership is lost, while reopening the menu stops drawing at the first ownership gap.

X1ReserveBank preserves these raw bytes, display lifetimes, cadence and compaction without engine devices. The optional CampaignContext.NativeX1Reserves stores its state and stable slot IDs; logical inventory reflects the ownership bits, including their loss. The native X1 menu uses this path. Custom menus retain their safe empty-reserve rejection and logical full/partial policy. All 828 state rows and nine original images (516,096 pixels) agree. The muted X1 runtime also reaches the empty slot through normal directional input, verifies underflow save/load, completion, retained tail, reopening and frozen stage state. Run --native-pause-x1 --native-empty-reserve in LevelSmoke.

Canonical X1 weapon IDs, in slots 1..8, are homing_torpedo, chameleon_sting, rolling_shield, fire_wave, storm_tornado, electric_spark, boomerang_cutter, shotgun_ice. Slot zero is the buster and cursor 9 is Escape. The shared host-facing contracts do not merge the game-specific controller rules.

The muted DX9 smoke verifies X1/X2 navigation, deferred selection, menu and in-progress transfer save/load, device recreation, frozen simulation/RNG/player position, and all 57,344 GPU texels of each captured running state. X2 remains covered after the shared host-contract refactor. X1 runtime, original full inventory, and source/runtime evidence preserve the scope.

Use --native-pause-x1 with the X1 asset assembly in the smoke command below, or select the mounted menu through XSHARP_PAUSE_MENU=x1 / engine.PauseMenu = PauseMenuProfile.X1.

Original menu sounds identified in this work are named reproducibly in the audio extractor catalog: X1 $2C/$2D/$74 and X2 $1C/$1D/$5A are cursor move, stage-exit confirmation and unavailable-exit cues. Audio and matching individual manifests were renamed together; encoded/PCM identity and the original filename map remain preserved. Reapplying the naming pass moves zero files.

X2 runtime display and input

The source-adapted X2PauseMenuRaster paints labels, icons, seven-part weapon meters, HP/capacity, the two-tile lives digit, and mirrored reserve halves from the current session view. It uses the native selection HDMA tables and the armor projections and weapon-preview palettes extracted from original captures. The operands in $00:C838..CB04 refer to data bank $06, not code bank $00. The selected reserve pane moves SUB.T between BG1 and BG2 ($00:C96C). The weapon preview changes six colors in X’s portrait, even while the equipped gameplay weapon stays unchanged.

The 66 native display fixtures cover empty/full inventory, all 16 armor masks, weapon-preview and cursor states, and 29 combinations of intermediate weapon/reserve energy, HP, capacity and lives. All 3,784,704 reference pixels match exactly through SHA-256 comparisons of canonical BGRA output. These are original display states, not continuous opening/closing movie equivalence. The fixtures retain original PNG hashes and their native display values. Full WRAM and save states remain local.

X2PauseMenuController follows $00:C183..C32E, skips locked weapons and uses the original 2-by-2 reserve routing and return column. Closing from a weapon row commits its selection; closing from a reserve preserves the prior equipped weapon. Cursor and denied-exit cues use native commands $1C and $5A. Stage exit eligibility/destination are host policy through GameManager.CanExitLevel and OnNativePauseMenuExit, with the native gate and close/exit schedules implemented below. Base test/demo managers deny stage exit.

With an X2 menu selected, reserve transfer follows the X2 cadence even on an X1 stage. An optional xsharp-pause-menu:v8 save extension preserves the cursor, return weapon and configured weapon-slot bindings. Rendering updates an existing texture only when the display view changes. Package IO, decoding, texture creation, initial upload and native menu sound preparation occur during precache.

Mount XSharp.Assets.X2 and either apply Profiles/X2/player.json, set engine.PauseMenu = PauseMenuProfile.X2, or use XSHARP_PAUSE_MENU=x2. Canonical weapon IDs follow the native row order: crystal_hunter, bubble_splash, silk_shot, spin_wheel, sonic_slicer, strike_chain, magnet_mine, speed_burner, giga_crush, item_tracer. Register/unlock gameplay weapon controllers separately. Authored IDs can use BindNativePauseMenuWeapon(slot,id) for slots 1..10 during configuration. Slot zero is always the buster. The native projection uses the originals’ 16..32 HP capacities and 0..9 lives; general custom displays remain a separate profile.

The muted DX9 smoke loaded an imported X1 Penguin stage with this X2 menu. It verified precache, cursor navigation, deferred weapon selection, reserve use, save/load and device recreation while paused, and unchanged simulation frame/RNG/player position. Its GPU capture matched all 57,344 CPU reference pixels at the center of each integer-scaled texel. This verifies one running display state, not all native transitions or all renderer backends.

Runtime capture, original full inventory, original reserve selection. The X2 source/runtime record pins the relevant code/data spans, package hash, fixture hash and validation scope.

dotnet run --project tests/XSharp.LevelSmoke -c Debug -- --penguin 0 --native-pause-x2 --asset-package=<XSharp.Assets.X2.dll> --content-root=<XSharp-source-content-root> --capture=<output.png>

X3 equipment presentation and controller

The X3 implementation adapts $00:C6D6..C995 and $00:D113..D5B8, with actual data bank $06. Unlike X1/X2’s movable color-math cursor windows, X3 changes the tile palettes of the selected weapon, icon, reserve and label. The package keeps the original unavailable-Zero projection ($1F11=4), and shoulder-button inputs cannot activate its character page or select Zero.

The display fixture contains 96 original states: 16 armor masks, 16 Ride Armor inventory masks, intermediate HP/weapon/reserve/life values, weapon previews and cursor panels. All 5,505,024 compared pixels agree. This covers the static equipment page, not every animation or transition. SessionContext.RideArmors records the acquired Chimera, Kangaroo, Hawk and Frog models and survives session saves. It does not implement those vehicles’ gameplay controllers.

The native inventory has nine usable special-weapon slots. Menu setup clears the unused tenth entry at $1FCE; do not treat its label-less display table row as a second HYPER.C weapon. The canonical bindings for slots 1..9 are acid_burst, parasitic_bomb, triad_thunder, spinning_blade, ray_splasher, gravity_well, frost_shield, tornado_fang and hyper_charge.

The 270-transition navigation trace covers full, sparse and absent-reserve layouts. It records the mapped input seen at the native dispatch and the raw SNES word, so emulator handling of opposing directions cannot be mistaken for a game-code priority. In this private configuration, simultaneous Up/Down arrived as Up, and Left/Right as Left. Controller-only source adaptation still preserves Down-before-Up and Right-before-Left in the native weapon pane when both mapped bits are supplied. Start is evaluated before equipment navigation, empty reserves do not activate, and inventory/return-weapon cursor state round-trips through menu saves.

X3 menu sound commands $1C, $1D and $5A are mapped to Menu Cursor Move, Stage Exit Confirmation and Stage Exit Unavailable, with matching clip manifests and regeneration mappings. The source/runtime record pins these spans, asset/fixture checksums and validation boundaries. The muted DX9 smoke also verified menu/transfer save-load, device recreation, frozen simulation and 57,344 exact GPU texels: runtime, original full inventory. Use --native-pause-x3 in tests/XSharp.LevelSmoke or choose XSHARP_PAUSE_MENU=x3 after mounting the X3 data assembly. Native Escape eligibility and delay are implemented below; wider load/lag transition-path coverage remains a separate validation item.

Native input and unpause investigation

Original input sampling stores current/previous/pressed controller words at $A7/$A9/$AB in X1 and $A8/$AA/$AC in X2/X3. Pressed is (current XOR previous) AND current. Hardware input is rejected when the low four controller bits are nonzero. The source spans are revision-pinned in the record, rather than assumed interchangeable between the games.

The X2 pause dispatcher is $00:C0B0, with direct page $1ED8. Its navigation reads the player’s mapped pressed buttons at $0A13, not the raw SNES controller word. $00:C331 closes the menu, $00:C46E restores stage resources, and $00:E52E translates input and computes mapped edges. The unrelated $00:C005 dispatch path must not be treated as this pause initializer.

The X2 experiment records 294 complete cases and 28,224 native video-frame rows. For Jump and Dash held from offsets 43 through 48, their action begins at relative frame 51. Jump first changes position at 52; Dash moves on its entry frame at 51. Holding either from offsets 0 through 42 produces no such action. Single-frame pulses through offset 48 produce no motion. Offset zero is the first Start-close frame; lag frames are retained. Shot cases were captured but are not classified through player motion, since that does not establish whether a projectile was spawned.

The focused write trace distinguishes held Jump beginning at offsets 42 and 43. The mapped player input is sampled before the final brightness ramp and remains unchanged during that ramp, while the NMI’s raw controller word continues updating. The earlier held Jump is already present in the mapped previous word when gameplay resumes; the later one produces a new mapped edge. This is not a general queue of every button pressed during the fade. Wider native load/lag paths remain to be checked. The measured normal-resume history gate is now integrated into XSharp for all three menu profiles.

Native presentation queue

Stage music during pause

The original music attenuation was missing from the first menu integration. The correction applies only to music channel 3 through TransitionGain; effects, menu cues, channel/user volume, source gain and master mute retain their independent policies. Playback continues without restarting the song.

The native APU receipt records 960 original frame samples across the three games. APU $DA targets $80 while paused and $FF on return; $DB/$DC contain step $0200, and $DD/$DE hold the fractional/current music level. The driver initializes timer 0 with $40 and runs this music envelope at 62.5 Hz. Reduction begins at the pause load-input handoff (10 for X1, 11 for X2/X3 in the baseline scenes), rather than following the screen brightness. Normal close queues restoration; the first sampled changes occur around its second frame. The roughly one-second restoration continues after gameplay resumes.

NativePauseMusicEnvelope advances on accepted host/menu frames even while the stage simulation is frozen. It preserves an interrupted fade until the next queued command arrives. Its level, target, command delay and timer phase are saved in the optional Music field of envelope v8. Loading older saves or a new level cannot leave music permanently attenuated. The host uses its deterministic 60-Hz frame clock, not a full SPC emulator: independent sub-frame APU phase is not reproduced. The native frame-sample comparison allows four level units out of 255; endpoints and the driver rate are exact. This is not a claim of sample-for-sample DSP parity.

Use capture_pause_menu.py --probe-music-volume for the muted original experiment and LevelSmoke --penguin 0 --demo-native-music --content-root=... for the muted host integration check, including music-only mixing and saving an in-progress fade.

Native CPU state and the displayed tilemap have separate lifetimes. For example, at the fourth empty-reserve update the original has already set HP to 11, but captured VRAM still contains the bar for 10. Health/reserve commands are queued for the next NMI. A completed X1 transfer changes the logical cursor immediately; its selection-window command comes from the following active-menu update.

NativePauseMenuVideo separates front and queued views/brightness instead of painting new CPU state immediately. Its state is saved in envelope v8, with readers retained for v1 through v6. The X1 display view also separates raw inventory from drawn meters; this permits a visible meter whose ownership was borrowed away. The nine underflow image fixtures exercise the delayed HP, meter and final-compaction states. Wider dynamic and transition-image checks remain part of the full fidelity audit.

The consecutive navigation audit adds 45 original images from five directional commands in all three games, plus six X2 images when closing immediately after moving the cursor. All 2,924,544 pixels match, including serialized front/queued views between updates. The private captures use accurate video rather than fast-forward screenshots. Their CPU cursor/input words are recorded separately from the displayed image.

This uncovered an X2-only timing difference: $00:C65C..C6BF alternates the window tables at $7F:C640/$7F:C740. It copies the previous table into the active HDMA buffer at $00:0952 before rebuilding the alternate table from the new cursor. Thus the highlight window appears two NMIs after navigation, while preview CGRAM and label writes appear after one. $00:C1F6..C207 queues the new preview palette independently. X1 and X3 match their existing single-NMI presentation path in the same experiment.

X2PauseMenuView.HdmaCursor represents this displayed selection independently of Cursor and PreviewWeapon; -1 retains the settled/static projection. The video queue advances it only while the active menu dispatcher runs. $00:C183..C1B3 takes the Start branch before $C65C, and $00:C331..C354 enters a blocking fade, so closing immediately after navigation retains the last published window while palette/brightness updates continue. Both normal closing and Escape preserve that published selection. Save envelope v8 already stores typed views and therefore preserves the extra cursor without changing the envelope version; older payloads default to their original projection.

Capture with --full-inventory --probe-navigation-video --accurate-video and regenerate fixtures with tools/parity/build_pause_menu_video_fixtures.py. The generator checks native WRAM/input-trace hashes, keeps source PNG hashes, and refuses non-accurate video captures or missing consecutive frames.

Native normal-resume clocks

The clock evidence record pins the ROM revisions, native fade/close spans, six WRAM timing traces and test fixture hashes. Each offset is relative to the accepted Start frame (zero). Initial and full inventories gave the same schedules in each measured scene.

Menu Opening fade-in begins Equipment active Last mapped sample while closing First gameplay update
X1 25 33 41 50
X2 32 40 42 51
X3, Zero unavailable 37 45 57 66

NativePauseMenuClock is portable and independent of devices or gameplay. The engine admits a native pause before advancing stage RNG, entities or camera, advances its own menu clock, and keeps the level frozen through both fades. It samples the player’s mapped history at closing frame one and at the listed closing gate. Both blocking fades and the intervening resource restoration preserve that history; gameplay samples it again on resume. Held input starting one update after the gate therefore produces an edge on resume; earlier held input and pulses ending before resume do not. The fixture checks 286 native Jump/Dash pulse/held cases. X1 Dash is excluded because its reference state has no leg armor; shot acceptance is not inferred from motion.

The opening dispatcher samples mapped input at frame 10 (X1) or 11 (X2/X3), then once at the fade-in entry (25/32/37). It blocks further updates throughout the fade. Returning from the fade switches the native equipment phase at 33/40/45, but the first menu command is processed on the next frame: 34/41/46. Active clock frame zero represents that return, and frame one represents the ready dispatcher. All 22,304 captured mapped-history rows match the portable clock across pulse/held Down and Start sweeps. Muted runtime checks exercise Down/Start held at the fade sample and one frame later, transition save/load, command admission and frozen stage simulation in each family. Earlier saves with active frame zero migrate to the ready dispatcher; their field layout remains readable.

The seven native brightness images also verify 401,408 exact menu pixels after five-bit master brightness: round each channel to channel5 * brightness / 15, then expand its bits. Menu pixels use this path during fades. The DX9 stage copy also uses the same five-bit postprocess during native transitions, with point sampling. Its shader is embedded and prepared with the graphics device; opening a menu does not read or compile an asset. The renderer hook preserves the existing alpha projection on backends that have not implemented this postprocess. Other native load/lag contexts still need separate validation.

The muted --native-brightness GPU smoke compares all 32,768 SNES colors plus authored eight-bit RGB at all 16 brightness levels, including identity at 15. It also compares the frozen Penguin stage during opening and closing against the portable calculation: 1,777,664 exact GPU pixels in each tested profile. Zero-brightness frames cover host diagnostics as well as the stage. The normal X1/X2/X3 runtime smoke recreates the graphics device and verifies menu readback, checking the shader/constant-table lifetime alongside the existing resources. Frontend screenshots can lag an unthrottled emulator frame, so brightness/phase timing comes from WRAM traces rather than screenshot filenames.

Save envelope xsharp-pause-menu:v8 stores the clock phase/frame and pending host exit along with inventory selection. Readers retain v1 through v7 adapters; envelopes without a clock resume in the active equipment phase. Older clocks retain their baseline schedule. The muted DX9 smoke passes for X1/X2/X3, including closing-state save/load, early/late held Jump at the native gate, one stage update at resume, device recreation and menu/transfer saves. Each also compares 57,344 GPU texels exactly. Transition input and menu clocks remain independent of stage simulation.

X2 recovered Zero parts

The source and validation record pins $00:C534..C57A, $00:C5AB..C5D9 and the eight-weapon test at $00:A110. CampaignContext.ZeroParts stores X2ZeroParts.Head, Body and Legs, mapped to bit 7 of $1FD6, $1FD7 and $1FD8. Before all eight Maverick weapons are acquired, the menu shows whichever parts were recovered. After all eight, incomplete sets are hidden; the complete set stays visible. This is X2 story inventory and does not enable playable Zero or the X3 character selector.

The asset contains eight original OAM projections. Their OBJ tiles and CGRAM are already present in the base menu, verified by extraction checks. The raster prepares all 128 armor/part combinations during precache and selects the proper projection from the view; it does not load or construct new assets during play. The 32 original fixtures cover eight part masks, zero/all stage weapons and naked/full armor, with 1,835,008 exact pixels. A 128-update native idle trace kept the same visible OBJ layout for the complete recovered set and full armor.

The muted runtime smoke covers partial recovery, the eight-weapon gate, complete recovery, live view invalidation, pending-NMI save/load, graphics-device reset, seven GPU readbacks and frozen stage/RNG. Legacy campaign states omit the new default field and restore with no recovered parts; invalid masks are rejected. Hosts can set campaign progress directly, for example:

campaign.Context.ZeroParts = X2ZeroParts.Head | X2ZeroParts.Legs;

--probe-zero-parts extracts the display states and visible-OBJ idle trace; --x2-zero-parts 7 --probe-timing checks opening/closing with complete recovery: all 192 captured phase/brightness/input rows match the existing full-inventory schedule, despite the additional OBJ load. build_pause_menu_fixtures.py --label-prefix zero-parts- produces just the part display fixtures from the capture directory.

X2/X3 reserve-transfer audit

The transfer record and two CSV traces retain 6,912 native frames with HP, raw reserve bytes, remaining/countdown fields, input history and sound commands. Headless campaign tests compare 1,920 normal-inventory rows directly against the engine: activation denial, two-update cadence, partial/full drain, compaction and one native $15 cue per HP tick. The full reserve continues to drain after reaching full HP. Menu tick audio now uses the menu’s source game independently of the common gameplay audio profile. Muted X2/X3 runtime smokes deliberately use X1 common audio and verify the menu’s 28 native tick requests after transfer save/load.

Ten focused transfer images compare 573,440 exact pixels, including activation, healing, drain, compaction and settled display. The displayed values trail CPU state by one NMI. A cursor-only forced setup was rejected for graphics because it missed native label/palette updates; the retained probe enters the pane with actual Right/Down input. Likewise, an unthrottled X3 screenshot was observed to retain an older meter while same-frame VRAM was correct. --accurate-video uses the private configuration’s clock throttle to capture each dynamic image; all ten throttled image comparisons agree. This is an observed capture limit, not evidence of a different X3 drain algorithm. The BizHawk 2.11 client API separates frame advancement/rendering and frontend screenshot capture.

The raw ownership-gap experiment is retained separately from normal inventory: X2/X3 sum only the contiguous owned prefix, clear all four energy fields and repack from slot zero. Native pickup acquisition uses the first unowned slot, which keeps ordinary ownership contiguous. The engine’s authored inventory maps that acquisition order to contiguous menu slots.

Native stage exit

Exit evidence pins the source gates, weapon-index tables, confirmation/close code and six captured CSV traces. The portable rules pass all 990 controlled stage/variant/inventory cases (300 X1, 360 X2, 330 X3), including each weapon individually. Acquired weapons permit exit even at zero energy; completion flags alone are not the native gate.

Native stage X1 menu weapon slot X2 menu weapon slot X3 menu weapon slot
1 1 3 2
2 2 6 7
3 3 2 6
4 4 8 1
5 5 7 3
6 6 1 4
7 7 5 8
8 8 4 5

Intro (0) and fortress (>=9) are denied. X2/X3 also deny stage 5 with variant 4. The variant byte is $1FAE in X2 and $1FAF in X3. It is distinct from the checkpoint, so CampaignContext.NativeStageVariant represents it separately; the game host supplies it when entering the corresponding native stage context.

Accepted Escape holds the equipment screen for 60 frames, then fades one brightness step every two frames (14 at frame 61, zero at 89). It stays black through resource restoration and the native world-exit wait. Mapped history is sampled at frame 61 and again at 123/124/139 for X1/X2/X3. There is no outgoing player teleport and no stage fade-in. The captured cleanup handoff is at 185/187/202 respectively, relative to accepted Start. The 720 recorded rows retain subsequent native routing, but the menu comparison ends at that handoff; it does not claim that the native Stage Select has finished loading then.

GameManager.OnNativePauseMenuExit receives the black-screen handoff directly. CampaignGameManager.StageSelectionLevelId selects a registered destination; without one, Escape is unavailable. Authored campaigns normally gate on completed level identity. Set NativeExitGame to opt into the original stage/weapon/variant gate instead. The actual level family must match it; a deliberately different pause-menu profile does not change the game’s exit rules. Register/unlock the canonical stage weapon, or bind an authored weapon to its native menu slot when the menu uses the same game family. Demo/sandbox sessions have no implicit Stage Select destination. Custom game managers may override both eligibility and routing. The engine does not fabricate a native campaign/stage-selection UI.

Envelope v8 saves confirmation/fade/terminal exit states, the selected resource clock and the pending callback. A terminal state does not fire its callback again after load. Older pending normal-close/teleport requests migrate to the native confirmation. Muted DX9 smokes pass for all three families: denied exit, confirmation/fade saves, frozen position/RNG/frame counter, no teleport, exactly one callback and direct host destination loading. Portable tests compare brightness and mapped input against the captured traces.

Reproducing captures

Use tools/parity/capture_pause_menu.py with a supported local ROM, an absent output directory and either a matching movie/state or native boot routing. The script creates a private muted, unthrottled BSNESv115+ instance, redirects writable paths, and checks the source ROM/config/movie/state hashes, including on capture failure. A process-local RunAsInvoker compatibility setting avoids the installation’s elevation requirement without changing its registry flags.

For X3 fresh boot, use --boot --wait-frames 4200 --settle-frames 1800 --skip-dialogue-frames 240. Wait through the released-button dialogue interval before opening the menu. Earlier captures of the flight/dialogue sequence are not menu references. Inspect the screenshot before classifying a capture. X1’s --x1-stage 8 uses the existing native Stage Select route. X1 Rev 1 user movies do not match the locally pinned X1 USA ROM used in these references.

The capture writes opened.bgra automatically. Run the raster comparison with:

dotnet run --project tools/PauseMenuRasterProbe -c Release -- <capture-directory> <scroll-y> <matching-ROM>

--probe-empty-reserve opens each controlled X1 inventory through the native menu initializer, then records the full drain and selected PPU snapshots. --probe-reserve-transfer records X2/X3 transfer/cue/input sweeps. --probe-reserve-images --accurate-video captures the focused transfer images. --probe-zero-parts captures X2 part masks before/after acquiring all eight stage weapons. --probe-opening-input sweeps pulse/held Down and Start from each entry offset. --probe-timing records 96 opening and 96 closing video-frame rows with brightness, lag, phases, raw/mapped input and player state. X1 brightness is $B3; X2/X3 use $B4. --trace-control records bounded write callbacks with frame/input labels. --probe-exit-eligibility checks individual weapon ownership across native stages and variants without letting those temporary contexts load scene resources. --probe-exit-timing records 240 frames after accepted Escape. These are controlled-memory probes, not controller-only native stage-exit routes. --probe-pages captures shoulder-button page transitions. --probe-buffering restores the same native state for each pulse/held action and offset; use --buffer-offset-start 42 --buffer-offset-end 43 for a focused run. Raw save states and full PPU/WRAM captures stay local, outside tracked source assets. For reviewed X2 inventory experiments, --full-inventory --probe-armor, --full-inventory --probe-meters and --full-inventory --probe-preview change only the private emulated inventory and capture its native rendering. These are explicitly controlled-memory experiments, not controller-only gameplay. See PauseMenuExtractor for packaging these graphics and bounded original tables into the runtime asset.

Delivery audit

Requirement Current evidence
Separate X1/X2/X3 menus and custom profile Common PauseMenuProfile with three descendants, independent menu selection and data-only assets; profile tests and host runtime checks
Native graphics, inventory, armor and story indicators 72 X1, 66 X2 and 96 X3 original display fixtures, plus 32 X2 recovered-part fixtures and the reserve/NMI image fixtures
Native cursor/action rules Source-adapted controllers; 252 X1, 288 X2 and 270 X3 captured cursor transitions, including sparse/absent reserves and mapped input priorities
Reserve transfers, original quirks and cues Original activation/transfer/underflow traces, image checks, typed reserve banks and muted runtime checks
Opening/closing, fade and unpause input buffering Revision-pinned NMI clocks, pulse/held input sweeps, independent Sponge/Stag/Gator traces, 393 normal resource pairs measured twice, and all 16 X3 scene intensities
Native Escape eligibility, confirmation and return Weapon/variant gates, 242 eligible resource pairs measured twice, all 93,640 per-frame input/brightness/cleanup rows matched; exact overrides cover the three X1 one-frame exceptions
Native temporal presentation 51 consecutive original images matched (2,924,544 pixels); independent X2 HDMA cursor, preserved during close and typed save/load
Resizable windows without stretched source panels Responsive layout and optional original composition; exact GPU texel checks in DX9, Direct3D11 and OpenGL, including live resize and device recreation
X3 Zero policy and menu extensions Zero remains disabled as requested; the original 39-update slide hosts optional stable-ID extension pages, with source/portable/runtime checks
Precache, save/load and frozen gameplay Menu packages prepared while loading; saved clock/front/queued state; muted runtimes preserve paused simulation/frame/RNG/player position
XSharpDemo default X1 support Small built-in menu-only assembly; no manual asset-package argument; unchanged gameplay profiles; native cues, Escape denial, responsive GPU readback, saved layout and resume passed

The current focused suite passes 1,373 C# tests and 16 capture-tool tests. The music correction also passes 24 focused audio mixer/output tests and a muted Penguin runtime check. Extraction rejects changed CSV inputs without overwriting a valid output. The resource receipt, temporal images and backend receipt retain hashes, counts and validation scope. Host-specific settings widgets are extension content. Other ROM revisions, playable Zero, full campaign content and whole stage/movie physics parity are separate from this menu delivery.

X2 resource-dependent normal close

The native workload evidence preserves two repetitions of all 122 stage/object/background resource pairs present in the imported X2 levels. Each private experiment starts from the same opened Sponge menu, changes only the restore selectors, closes through Start, and restores the source state as soon as the stage fade begins, before gameplay. All repetitions agree. These are controlled resource transactions, not traversals or valid scene/palette screenshots of those stages.

Three independent native stage references validate this method: Sponge restores at 41, fades in at 42 and resumes at 51; Stag Final Climb is 49/50/59; post-READY Gator is 32/33/42. Opening remains unchanged. Portable tests compare all 192 opening/closing rows from each Stag/Gator reference, including brightness and the mapped held/previous/pressed words.

The bounded execution traces separate the source costs:

The extractor packages the measured RestoreTimings with the menu graphics; the runtime does not execute ROM code or decompress original graphics. It selects a workload from the current imported stage/object/background context only when the level’s sourceSha1 matches the menu’s pinned ROM revision and the level/menu game families match. Authored levels and mixed-game menu profiles keep their baseline clock unless they supply a matching native context.

The selected clock stays fixed through the transaction and is saved in envelope v8. Reading older saves retains their original baseline clock, including closes already in progress. A later resource trigger selects a new clock at the next pause. The resource workload also shifts Escape timing through the same source restore routine; the separate normal-only override remains available for hosts.

The focused suite passes 1,150 C# tests and ten capture-tool tests. Muted DX9 checks on the imported Stag/Gator levels verify their independent 50/59 and 33/42 fade/resume frames, held-jump buffering on both sides of the input gate, save/load during closing and frozen stage position/frame/RNG. This is menu transition validation, not a claim of full movie or stage-physics parity.

Use --trace-restore-queues for bounded source callbacks and --probe-restore-contexts <contexts.json> for repeated controlled workloads. The JSON is an array of { "stage": 4, "objectTile": 3, "backgroundTile": 0 } records. Derive its valid pairs from the imported resources/index.json files; do not invent selector IDs or use this probe as a shortcut for native traversal.

Wider restore coverage

Native resource evidence adds 140 X1 resource pairs and all 131 X3 pairs, each with two agreeing repetitions. Together with X2, this covers 393 imported resource pairs and 786 completed transactions. X3’s initial intro-based sweep appeared to time out at stage 2/object 0 because the probe omitted the saved scene intensity. At $00:A32A..A335, stage-2 admission saves $B4 & $0F into $1F5B. The return path $00:9CCA..9CDA selects $00:A5A6..A5C4, which fades to that saved value. The intro state left it at zero: graphics restored at frame 61 and gameplay resumed correctly while black. Requiring brightness two mistook this valid black return for a graphics-loading failure. The revised resource probe supplies the full-brightness admission header for this context; it does not modify the original graphics workload. Timeout diagnostics retain queue status, native PC and the failed state for future investigations.

X3 also performs work after the graphics queues: $00:CCD5..CCEC calls $B47A, waits 16 updates and then reads $1F60. The completed resource transactions include this work rather than estimating its duration from bytes.

X1 reads object/background selectors at $1F08/$1F09, with stage $1F7A; its object loader $00:B0A7 reads $86:ACEE. X3 uses $1F18/$1F19, stage $1FAE, and $00:B1FC reads $08:8623. These are different data banks and must not be inferred from the code bank or assumed identical to X2.

The native normal/Escape branches rejoin the same resource restore routine. In the initial two X1, three X2 and two X3 contexts, each repeated twice, Escape’s second mapped-input sample is normal fade-in plus 82. Cleanup then takes 62 frames in X1 or 63 in X2/X3. The committed per-frame traces compare brightness, forced blank, current/previous/pressed input and the terminal pending flag. Thus source-resource work shifts both normal return and the Escape handoff; it does not change the 60-frame confirmation or slow fade. The runtime captures the complete selected timing in its v8 save envelope, preserving older saves.

The completed wider Escape sweep supersedes that estimate for imported contexts: 86 X1, 74 X2 and 82 X3 resource pairs, each repeated twice. It compares 93,640 native frame rows, including forced blank, input history and cleanup. Three X1 pairs take one extra NMI: stage 2/object 3, stage 2/object 10 and stage 3/object 7, all with background 0. Their measured second input samples are 127, 132 and 125 respectively. The .xmenu now stores ExitLoadInputAt and ExitReadyAt alongside normal restoration, so the runtime uses each measured transaction rather than extending the focused offset assumption. Old/custom packages without these optional fields retain their prior fallback; old in-progress saves retain the clock already stored in their envelope.

The first complete X3 attempt hit its 600-second process deadline and is excluded. Its replacement completed with an explicit 1,200-second deadline. X2’s older normal-close CSV predates trace hashes in capture manifests; its existing tracked LF hash and original ROM/script hashes were verified before adding a private receipt for repackaging. This is provenance preservation, not a newly claimed emulator measurement. All graphics payloads remain unchanged.

Saved scene intensity in X3

The scene-intensity evidence contains 3,072 native frame records: 96 opening and 96 closing updates for each target from 0 through 15. The original admission itself saves the target; the experiment does not write $1F5B. All brightness and mapped current, previous and pressed input words agree with the portable clock. The 131-pair resource package selects the stage-2/object-0 restoration at frame 61. Its return-to-game frame is 63 at intensity zero, 67 at seven and 71 at fifteen. Equipment and Escape still use full brightness.

The capture uses the engine’s explicitly disabled Zero policy through the native unavailable branch at $00:CBB2..CC03: it temporarily sets $1F5D bit 7 during this initialization and restores the original condition before gameplay. An available-Zero source capture takes one additional NMI between the opening-load input sample and menu fade. It is not the reference for the user-requested unavailable-Zero implementation.

engine.SceneBrightness exposes optional 0..15 scene lighting independently of physics/audio; 15 remains the default and loading a level resets it before host callbacks. The pause clock captures this value on entry. Closing restores it while retaining the resource-dependent mapped-input gate. A separate optional xsharp-scene-brightness:v1 save extension preserves the scene value; older states default to full intensity. The existing v8 menu snapshot stores the selected clock, including its optional brightness field.

DX9 applies the existing five-bit SNES intensity shader to the scene. SDL’s Direct3D11/OpenGL backends now apply the same calculation as described below. Run LevelSmoke with --native-pause-x3 --native-scene-brightness for muted runtime admission, resume, frozen simulation and paused save/load checks at zero, seven and fifteen. This stage’s focused suite passes 1,171 C# tests and 13 capture-tool tests. The muted DX9 runtime also passes admission/resume and paused save/load at those three intensities, frozen gameplay/frame/RNG, and 644 scene GPU samples against the independent five-bit calculation. Captures occur before Present, away from exact point-sampling texel boundaries. Resource transactions are controlled experiments, not evidence of correct scene traversal, stage palettes or full movie parity.

Direct3D11 and OpenGL presentation

Both SDL renderers now project engine coordinates onto the actual current target, including a window smaller, wider or taller than StageSize. Previously the native equipment quad could be clipped instead of fitted to the client. Changing client size rebuilds the native viewport canvas through the existing device/precache lifecycle and preserves the menu and frozen simulation.

SDL’s portable path reads the completed stage target into existing storage, applies SnesMasterBrightness and updates a preallocated streaming texture. It preserves the unfaded stage and replaces the approximate black alpha layer. Scene buffers, upload textures and conversion arrays are prepared during precache/device creation. Ordinary texture conversion also reuses its scratch buffer rather than allocating an array on each changed menu frame.

The conversion involves GPU readback while scene intensity is below full; it prioritizes exact color arithmetic over the previous alpha approximation. The full-brightness gameplay path still draws the target directly. SDL documents the target-switch state restoration, per-target drawing scale and readback cost and pre-Present capture requirement.

The cross-backend record contains six successful muted runtime checks: all three profiles on each native driver. Each checks all 32,768 five-bit colors plus authored RGB values at all sixteen intensities (917,504 pixels) and every projected menu texel across wide, portrait and native-ratio resizing (245,024 texels). Totals are 5,505,024 intensity comparisons and 1,470,144 menu comparisons. Menu save/load, native scene-fade integration and frozen gameplay/frame/RNG also pass. These compare backend output against the independently verified portable compositor and brightness calculation; native image fixtures separately establish its source graphics. They are not claims of all stage gameplay/rendering parity.

Run LevelSmoke with --native-sdl=direct3d11 or --native-sdl=opengl, a --native-pause-x1, --native-pause-x2 or --native-pause-x3 selector, and the matching --asset-package and --content-root paths.