justin3009 / MMX3-ZeroProject

Mega Man X3 - Base Mod (Zero Project)
53 stars 3 forks source link

Mad Joey's (pilot of REX-2000 miniboss) palette glitches when hit by X's beam saber (v4.2) #5

Closed delta7890 closed 3 years ago

delta7890 commented 3 years ago

Mega Man X3 - Zero Project v4 2000

Don't believe I noticed this in previous commits. Other weapons (including Zero's beam saber) do not seem to produce this effect.

justin3009 commented 3 years ago

Hopefully fixed? It's.. actually an incredible odd bug. It's a natural X3 bug from what I tested.

$81/D3B0 A6 1E LDX $1E [$00:1896] A:1808 X:0002 Y:00AF P:envMxdIzC $81/D3B2 BD 11 00 LDA $0011,x[$86:0D29] A:1808 X:0D18 Y:00AF P:envMxdIzC $81/D3B5 85 11 STA $11 [$00:1889] A:1829 X:0D18 Y:00AF P:envMxdIzC $81/D3B7 AD 54 1F LDA $1F54 [$86:1F54] A:1829 X:0D18 Y:00AF P:envMxdIzC $81/D3BA C9 04 CMP #$04 A:1802 X:0D18 Y:00AF P:envMxdIzC $81/D3BC 10 04 BPL $04 [$D3C2] A:1802 X:0D18 Y:00AF P:eNvMxdIzc $81/D3BE E6 11 INC $11 [$00:1889] A:1802 X:0D18 Y:00AF P:eNvMxdIzc $81/D3C0 E6 11 INC $11 [$00:1889] A:1802 X:0D18 Y:00AF P:envMxdIzc

This is the original code location. What happens is when it checks $86:1F54 (Which is actually $7E:1F54), it's checking for the enemy's current state. If it's anything above the value #$04, it will SKIP the palette increase which are the INC $11's.

The Z-Saber wave ALWAYS sets the enemy state to a value of #$0A.. and since that's above #$04, it breaks the palette. I've altered the code now to SPECIFICALLY check for #$0A, if so, still do palette increase. Otherwise, it'll run the default code. This is actually applied to EVERY enemy in the game so this should fix a plethora of palette issues that may arise.