XSharp

X1 enemy combat audit

The reviewed combat values come from the headerless Mega Man X USA ROM with SHA-1 449A00631208FBCC8D58209E66D0D488674B7FB1. ROM offsets below are file offsets for this revision. The local bank disassembly was checked against the ROM bytes. The FredYeye disassembly used for navigation targets Rockman X Japan and has different addresses.

Enemy HP Contact damage Damage table selector HP write offset
Hoganmer 8 3 3 0x1AE99
Gun Volt 16 3 3 0x15A41
Bomb Been 2 2 3 0x11F8E
Flammingle 8 3 3 0x0C03A
Mega Tortoise 16 4 3 0x3EC63
Metall C-15 2 2 3 while exposed 0x1C3D9
Turn Cannon 5 3 3 0x39991
Rush Roader 6 2 3 0x40F64
Jamminger 2 1 3 0x1DDBD
Dig Labour 8 3 1 0x1CE77
Tombot 1 2 1 0x1E4A6
Snow Shooter 8 3 1 0x3DF0D

The initialization routine sets the default selector to 3. Dig Labour, Tombot and Snow Shooter replace it with 1, while Metall C-15 changes between reflection and the exposed table. The contact routine subtracts object byte 0x26 directly from X’s HP before applying the body armor adjustment. The weapon collision routine uses byte 0x28 to choose the damage table.

Selector 3 uses ordinary buster damage 1, semi-charged damage 2, charged damage 4 and dash-shot damage 2. Selector 1 uses 2, 4, 6 and 4 for the buster variants currently represented by the engine. The lookup at file offset 0x21E1E reads the table base 0xEF37, whose selector-3 entry points to packed data at 0x36FD7.

Several enemy classes previously doubled HP to compensate for the global buster damage constants. That preserved ordinary-shot counts but changed charged-shot results. For example, Gun Volt had 32 HP and received 6 charged damage, requiring six charged hits. Its original 16 HP and 4 charged damage require four hits. Metall C-15 previously had 1 HP and now has the original 2 HP with the exposed damage table. Jamminger’s earlier HP-only correction is completed by applying its original incoming damage table and contact damage. Dig Labour’s body damage changes from 2 to 3, and Tombot’s HP changes from 2 to 1.

The reviewed selector-3 classes opt into a virtual damage hook. Other enemies and weapon classes keep their existing damage contract. Reflection, ignored shots and invincibility continue through the existing damage path. These getters introduce no serialized fields.

New save states identify the combat revision with a source-header marker. Unmarked states from the original b9c977f baseline migrate the reviewed HP scale and the corrected contact values after entity deserialization. Versioned states preserve their HP on subsequent loads. New members are appended so the existing compiler-generated callback identifiers and positional instance-field layout remain stable. States from intermediate development commits which changed HP without writing a revision marker can be ambiguous. In particular, the Jamminger HP-only commit used the same unversioned format as the baseline.

Run the tests with the original ROM available locally to include the source-byte checks.

$env:XSHARP_TEST_ROM_X1 = 'C:\path\to\Megaman X (USA).sfc'
dotnet test XSharp.Tests/XSharp.Tests.csproj

The suite covers combat constants, normal weapon hit entry, all four represented buster modes, reflection, ignored shots, invincibility, preservation of other weapon damage, legacy HP migration and the earlier Jamminger laughing interval. The source-byte test is explicitly skipped when the ROM environment variable is absent.

This milestone verifies the listed combat values. Movement state machines, target quantization, spawn limits, animation timing, projectile behavior, drops and original-runtime frame traces still require auditing. The remaining X1 enemies, X2/X3 enemies and the separate boss implementations have further work pending.

A native Direct3D 11 smoke run used an unmarked state written by the original baseline core. Its Gun Volt, Jamminger, Metall C-15 and Tombot HP values 20,4,1,2 restored as 10,2,2,1. Saving and restoring the versioned state a second time preserved 10,2,2,1, and the engine advanced another frame successfully. The ROM used by that run remains local.