Instead of when getting hurt with any powerup and becoming small mario the powerups go down in order.
Small <- Big <- Fire
Big <- Cape
There's 2 main reasons why this patch is being rejected. The first reason is that this patch already exists, and is included in these twopatches.
The second reason is that there's a lot of issues with this patch from a technical standpoint:
- You're using long addressing on a direct page address; $7E0019 can be shortened to just $19, and the long addressing wastes both bytes and cycles.
- When checking if an address is 0 or not, CMP #$00 is not necessary. You can simply load the address and the flag to indicate if it's 0 or not is set automatically, so you can immediately go to BEQ/BNE Label.
- There's a typo when setting the flashing invincibility, and you're writing to $149 instead of $1497. $149 is interpreted as $0149, and this address lies within the stack, which shouldn't be modified in such a manner. As far as I can tell this doesn't break the game, but I don't trust that there's no situation where this could happen. You also don't need to set $1497 in your code at all, as this gets set by the game code shortly after the patch returns.
- After your JSL to freespace, you NOP out a byte. Why? This byte is part of a CMP #$02 instruction, so when you NOP out only one byte of that, the code gets misaligned and gets interpreted differently. In this case, it has the effect of doubling the Y speed of whatever sprite is in slot 3. You got lucky that this is the only bad consequence, since misaligned code usually results in a total game crash, but it still makes no sense to have a single byte NOP'd out after the JSL. If you want to remove the entire "CMP #$02 : BNE PowerDown", you'll need to NOP out 4 bytes (NOP #4).