Name: [BTSD] Disappears when hit
Author & Submitted by: New Hacker
Description: If Mario/Luigi hits this custom block from below, it will disappear in a puff of smoke, like in Yoshi's Island.
Reason of removal:
There are a few things in your code that are just not quite right. One of which, as a matter of fact, crashes the game.
Let me sum them all up.
RTS ;/ Return if no slots open
In BTSD blocks, don't use RTS to end block code. No, really, don't, because the game WILL crash. And it did.
Why do we need this when we're writing block code and there is no sprite interaction involved whatsoever? This code is redundant and might as well be removed.
LDY #$03 ;\ Find a free slot to display effect
LDA $17C0,y ;|
BEQ FOUNDONE ;|
BPL FINDFREE ;|
Even though you preserved the processor bits (though, why? A was 8-bit to begin with, and the SEP #$20 is all you did to the processor bits), you did not preserve the Y index.
In a sprite? No problem. But in a block, that's fatal. If you're going to use the Y index in a block, preserve it first, because at the end of the block code, Y should hold the high byte of the 'acts like' Map16 tile num.
My guess is that you borrowed the code from a sprite. Which is completely fine. But please do fine-tune it so it matches up with a block.
We don't want crashing blocks here on the site. ;)
Don't follow "Find Roy's Dignity", my hack
. Because it's pretty outdated. <--------