Repository navigation
Boss Rush: add Wire Sponge (X2) - #128
KamiSquadX wants to merge 22 commits into
Conversation
Static trace of the X3 USA controller, drill projectiles, shared helpers, art, palette and sound sources for porting Rhino into Boss Rush. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Define NOMINMAX before windows.h, supply S_ISDIR for MSVC, and rename a test parameter that collides with the Windows 'small' macro. No behavior change on MinGW, Linux or macOS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Roster ids cover X1, X2 and X3 Mavericks by native weapon order. A new roster state holds the shuffle queue and the run's available set, saved in game chunk v23; v18-v22 snapshots import their X1 queue unchanged and the original Rush state layout is untouched. Add the experimental megaman-x.boss-rush.x3-bosses package. Its plugin validates the user's X3 ROM and keeps it in memory only; a boss is offered only once its body is implemented, so runs stay X1-only for now. Netplay refuses to start if an enabled Maverick pack failed to load. Document the foundation and the relocated-code plan for X2/X3 bodies, and update the snapshot-format fixture for v22/v23. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Grow X1's padded 2 MB LoROM image to 4 MB at runtime, mirroring the original so every existing read is unchanged, and allow built code in banks $F0-$FD. A pre-opcode hook at the enemy class dispatch ($80:D544) enters a registered controller for a non-X1 roster seat with a JSL frame returning to a native RTS, matching the stock JSL/RTS stubs. The MMX_BOSS_RUSH_FOREIGN_SPIKE_TEST fixture runs a bank-$F0 controller in seat 1 beside a native Penguin: once per frame, native X1 helper calls return correctly, and snapshot replay is byte-exact. The full 28-pair Rush suite still passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tools/relocate_boss.py traces Rhino's body, drill projectile and the X3 helpers they need, and emits an address-only descriptor: X3 helpers map to X1 equivalents, relocated copies or shims; X3 RAM maps to X1 RAM or a zero/sink area. Unclassified calls or RAM fail generation. src/mmx_boss_rush_relocate.c rebuilds Rhino from the user's X3 ROM when the pack loads: code banks go to X1's unused $30-$3F padding, his $86 tables and shims to the $FF tail of X1's bank $86 (X1's enemy loop uses the same data bank), and every rewritten operand is verified first. Hooks at the enemy and enemy-projectile class dispatches run registered controllers for a foreign seat; foreign bodies report their own combat and death states. The ROM-backed Rhino fixture covers his intro, charges, drill volley, replay determinism, defeat and cleanup beside a native Penguin. He stays out of normal runs (MMX_BOSS_RUSH_PREVIEW=1 opts in) until his art, sound and weaknesses are done. The full 28-pair suite still passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Decode a relocated body's compressed OBJ resource, palette and pose layouts from the in-memory source ROM and rasterize poses once. The renderer replaces the pieces X1's sprite builder makes for foreign-owned objects and draws each body and projectile whole from its +$16 set and +$17 pose, with +$11 facing, priority and palette-zero hit flash. Fix the projectile redirect: X1's enemy-projectile actor dispatches at $80:D4E7 (not $D48A) and has a compiled body, so route $D4D3/$D4DD through the interpreter during Rush. Rhino's drills previously ran X1's own class $26. The Rhino fixture checks his body and drills draw in his own palette, that drills run the relocated controller, and saves private captures. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
X3's SPC driver shares X1's upload table and boot protocol, so the isolated Rush SPC renderer now takes a per-game bank list. Relocated bodies load their source ROM's banks 0-2 plus their own sound bank ($5D for Rhino) and pre-render the effects their code requests. The relocation tool finds both from the traced code, and turns the X3 sound routines into hooked shims that queue the boss's cached clip, panned like X3's positional call. Cues name the roster id in their spare field, so the snapshot layout is unchanged. The Rhino fixture checks all six effects render audibly and that his fill, wall crash, spread, stop and drill grind cues fire. The X1 native audio, 28-pair, spike and state-format fixtures still pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Map Rhino's X3 damage profiles to X1 rows during relocation: normal to Kuwanger's row, drill charge to the deflect row, flinch to the no-damage row. His weakness test reads X1's reaction class ($1F1D) and compares against the Torpedo reaction classes. Boss Rush hooks X1's damage helper for relocated bodies: X3 Acid Burst takes the row's weakness column and reaction, so his own code flinches; X1 Homing Torpedo is moved to an ordinary column. The X2/X3 weapon pack no longer applies its X1-class table to relocated bodies and defers to their native row. Extra X1/X2 weaknesses are left for the owner to assign once all 24 bosses exist. The Rhino fixture fires the buster, Homing Torpedo and a real X3 Acid Burst from the pack built from the same ROM, and checks the deflect row. Full, native hit, audio, spike and format fixtures pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pinning: X1 shares X3's player-state numbers (hurt $0E, death $0C, scripted lock $1E). Rhino's X3 lock/release become shims around X1's entrance lock ($84:9FEB) and release ($84:A003, only from $1E); Rush still skips the lock during entrances. X3's caught state $12 has no X1 counterpart, so his pin test compares the hurt state the drill leaves. Palette: his relocated rotate/fade helpers run on the seat's private colors (shared with Chameleon's snapshotted state); the fade reports carry while colors differ, and the renderer draws foreign bodies with them. Frame counters: X3's $09CB/$09CC have the same NMI and scene-loop increment sites as X1's $0B9B/$0B9C, confirming the mapping. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tunnel Rhino now appears in normal Boss Rush runs once the X3 Mavericks pack has loaded the X3 ROM. - Move the relocated zero/sink area to $86:FD80-$FF7F and stop the $86 patch window at $FF7F. The old $FE00-$FFFF area overlapped the weapon, Zero and saber collision tables at $86:FF80-$FFFF: Saber Zero's slash did 0 damage, and as X the weapon code's $FF fill froze Rhino. - Register mod plugins in MSVC builds (mmx_mod_constructor.h keeps the .CRT$XCU pointer), so the launcher can commit plans. - Launcher-driven character matrix for X, Zero, Modern Zero and Saber Zero. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Zero's air and dash slashes: the relocated zero/sink area overlapped the air-saber collision window at $86:FF40, so the saber disabled it. The sink moves to $86:FD40-$FF3F and the patch window ends at $FF3F. - Rhino stopped taking damage after his first hit flash: the flash restores his profile from X3 $1F57, which read 0 (X1's deflect row) from the sink. It now maps to X1 $1FD5, swapped per Rush seat. - Rhino slid through the right wall: X3 rooms start on 256-pixel boundaries and his stop-and-fire charge stops at that midline without a wall check. His four midline reads are answered relative to the arena. - Rhino stopped firing drills and never did his stop-and-fire spread: the delete shim cleared only byte 0, so dead drills kept their projectile slots; and spawns that fail when the other boss fills the shared pool are now taken back out of his live-drill count. - The player became invulnerable after a native boss died: its death scene sets the hurt latches $0BD8/$0C32. A boss killed during its own update now leaves them as it found them. - Regression checks: a long Rhino fight (damage, volleys, spreads, arena bounds, slot reuse, saber windows) and MMX_BOSS_RUSH_DEATH_LATCH_TEST. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found by replaying the playtest capture frame by frame. - Stuck invulnerability: X3's caught state $12 maps to X1's ordinary hurt, so Rhino's pin locked the player after any hit during his recoil. The lock skipped the end of X1's hurt state, which starts the countdown ($0C13) that clears the hurt latches $0BD8/$0C32, so nothing could hurt the player again. The pin now requires his live pin carrier, and the release shim starts that countdown when it frees a latched player. - Leftover drill graphics: his drill charge spawned a pin carrier on every frame it overlapped the player (X3's caught player stops overlapping), filling the projectile pool. It now spawns one while none is alive. - Spread drills: their start offsets ($86:EFE7 + 4*index) ran past the copied table, so the shoulder drills started in the wrong places or off screen. The copy now covers $86:EFB8-$EFF6. - Developer aids: MMX_REPLAY_WATCH prints chosen WRAM bytes during replay playback; MMX_REPLAY_SCAN prints the state at each segment's checkpoint. - Checks: one carrier per catch, no pin without it, latches clear after a pin, and the spread's hand and shoulder drills at X3's offsets. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mmx_renderer.c draws relocated Boss Rush bodies through MmxBossRushForeignPose/MmxBossRushForeignColors, which this test target does not link, so it failed to build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Wire Sponge's original X2 code is relocated from the user's own X2 ROM into X1's padding banks, like Tunnel Rhino's X3 code. A new X2 Mavericks pack (Game Modes, off by default) loads the X2 ROM and offers him to Boss Rush runs. - relocate_boss.py takes a per-game config; X2 helpers map onto the same X1 routines as X3's, and the X3 config still reproduces Rhino. - New relocation rules: hardware registers, MVN block moves, hitbox pointers, windowed data tables, conditional profile loads and per-set animation directory banks. - New per-boss runtime hooks: effect-list children, room-origin reads (his entrance starts below the arena ceiling), per-seat scratch RAM (save chunk v24), saber kills and a boss's own death sequence. - Sonic Slicer (X2 weapon pack) is his weakness; a Sonic Slicer kill splits him in two as in X2, and so does a kill with any Zero's saber. - The fixture passes for X, Zero, Modern Zero and Saber Zero. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Playtest: Wire Sponge and his attacks were invisible. X2's class init copies a graphics slot's OBJ attributes from $7F:8300 into +$11, which Rush sinks to zero; priority 0 put him behind the arena and palette 0 read as a permanent hit flash. The init shim now writes $29 (priority 2, palette 4, as Rhino's own init does) and his children inherit it. The renderer also draws a relocated boss's own effect-list classes (his whip segments and split halves) from the source art. X1-native effects a boss spawns keep their native art. The Wire Sponge fixture renders combat and his halves and checks both draw with his X2 art; halves count only after he starts dying. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Playtest (Saber Zero): after collecting a health drop, a hit during the refill left the player unhittable for the rest of the run. The refill took the player out of the hurt reaction ($0E) before it started the invulnerability countdown $0C13, which is what clears the hurt latches $0BD8/$0C32. X1 freezes enemies while refilling; Rush's bosses keep fighting. Rush now starts the native countdown when the latches are set outside a hurt reaction with no countdown running. - The death latch fixture covers the stuck-latch case. - The hit-visual fixture keeps its shooter in post-hit protection on purpose; it had relied on a stuck latch against Mammoth's stomp. - MMX_REPLAY_PLAY plays a captured segment's inputs on the current code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Playtest: his body drew but his vine, seeds, lightning and whip did not. They build +$11 from X2's per-slot OBJ attributes ($7F:8345/$8346), which relocation sank to zero (priority 0, palette 0). The relocator now supports constant long reads (Game.long_const): those two bytes read $29 from bytes after his $86 tables, matching his body. The fixture renders his shots and whip and checks both draw with his X2 art. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Playtest: Saber Zero combos played the hurt sound only on the first hit (and a last hit after the flash ended). Follow-up hits land inside the boss's damage flash, where X1 only queues the impact sound, re-queued every frame the saber overlaps. Rush now queues the native boss-hurt sound $13 for a fighting boss that lost HP in a frame without one. MMX_BOSS_RUSH_COMBO_SOUND_TEST (MMX_COMBO_BOSS picks the boss) checks every landed hit queues it; it passes for X, Zero, Modern Zero and Saber Zero on Flame Mammoth and Wire Sponge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Playtest: Wire Sponge sometimes never left his entrance. While falling he lowers his 11 whip segments, one every 6 frames ($7F:CD90 counts them down), and his vine waits for 0 before it climbs to him. X2 drops him from far above; Rush's arena fall takes 62-66 frames, and a 62-frame fall landed him with one segment left, so the vine waited forever. A new per-boss poke (MmxBossRushPoke) writes a work-RAM byte before a relocated instruction; his landing ($04:9BD5) lowers the remaining segments. Lowering them faster instead brings the vine during his landing pose, whose $0F flag its store overwrites. The fixture shortens his fall by 24 pixels to cover this. Also: MMX_REPLAY_SCAN lists projectile owners, and MMX_REPLAY_PLAY_WATCH prints chosen WRAM bytes during MMX_REPLAY_PLAY. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Playtest: his vine, seeds and lightning drew wrong and the vine stayed full length below him while he climbed. - Slot tables: X2 builds +$18/+$11 from the stage's slot tables $7F:8200/$7F:8300. Relocation copies both whole to padding bank $3C with his room's values (slot $45 body at tile $100, attribute $29; slot $46 vine/lightning at tile $48, attribute $28; 0 elsewhere). - Renderer: relocated objects draw from a model of the source game's sprite VRAM (each resource at its tile, all palettes of the list) using each object's own tile base and palette. - Draw requests: only objects whose +$0E bit 7 says they asked to draw this frame are drawn; X2 hides the vine below him that way. - Effect ownership: X1's terrain helper spawns X1 rubble (class $2B like his halves) in his seat when the vine hits the ceiling. An effect of his classes is his own only with his set $3E or his spawn variants; Rush frees the rest, which X2 never shows in his room. The fixture renders his shots, whip and halves, keeps renders for review (MMX_SPONGE_FRAMES) and can force a behavior (MMX_SPONGE_FORCE). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts: - Boss Rush globals: keep this branch's $1FD5/$0C32 slots and upstream's new rule; $0BD8, $0C32 and $0C16 (ice/grab lock) are never swapped. - After-frame loop: keep the per-seat hurt-sound bookkeeping and upstream's Flame Mammoth arena clamp. - Generated-code hook targets: both lists. - Runtime test: both the replay tools and upstream's report mstan#124 checks. Rhino fixture: the post-pin latch check accepts $0BD8 dropping (its $0C32 follows a frame later and contact can hit X again first), and the spread check verifies drill positions rather than an exact count, since a spread fires only into free projectile slots. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent review of combined head The original-code relocation approach is useful. Both generated relocation descriptors reproduce byte for byte from the supplied USA ROMs. I also built the exact pinned framework/UI on Windows with MinGW/SDL3 and ran the launcher and native collision paths. The shared source-ROM keys are already the right reusable mechanism. Confirmed source-fidelity defects
The same row-substitution issue causes other differences in the direct source-projectile matrix. Please don't resolve this by changing only the three expected numbers in the current tests. Suggested implementation and next-boss workflow
For the requested packaging, I have locally moved both default-off import features into The original Sponge fixture passes for X, X3 Zero, Modern Zero and Saber Zero, which demonstrates why passing the existing suite alone does not establish source parity. Both imports together pass the tested pause freeze, native pause-menu pixel comparison, unpause and byte-exact post-unpause replay checks in both seat orders. Full visual review is still being completed; the declared missing lightning darkening remains a fidelity gap. No merge or final QA approval yet. Final review artifacts and implementation are available in commit ab6aa9f, on "integrate/boss-rush-x2-x3". See the full review and reproduction commands and independent fixture. Completed checks additionally confirm a real buster killing one-HP Rhino with one defeat/replacement, and natural fatal contact with each import reaching Game Over. All 28 native X1 boss pairs and the separate pause, state-format, audio, death-latch, hit-visual and drop regressions pass. The initially skipped Saber render/wave checks also pass when supplied their private source fixtures. The independent source-fidelity fixture still reports 21 failing assertions (including overlapping live/focused reproductions); these are retained as regressions for the fixes. Other-game contacts without an assigned source expectation are explicitly recorded as unverified, not passes. Lightning-controller captures confirm the missing Sponge background darkening; natural anger entry, the reported intermittent Rhino visual remnant, and two-peer netplay remain unverified. Final owner QA handoff is withheld pending corrections; neither PR has been merged or approved. |
…ap-triage-80 Add SD3 interpreter-cap diagnostic tooling
Adds the first X2 Maverick, Wire Sponge, to Boss Rush, alongside X3's Tunnel Rhino from #123. This branch builds on #123 and merges current
main(2.2.8), so it contains #123's commits as well. It can replace #123, or be reviewed after it.Everything is read from the player's own ROMs at runtime. No ROM data or ROM-derived assets are committed.
Wire Sponge (X2)
Shared relocation and Boss Rush work
tools/relocate_boss.pytakes a per-game config (X2 and X3). New rules cover:$3C)Fixes found in playtests (all bosses)
Tests
mmx_reset_rebootsalso fails on unmodified upstreammainhere.docs/x2-bosses/wire-sponge.md,docs/x3-bosses/foundation.md,docs/boss-rush.md.Known gaps
🤖 Generated with Claude Code