Please, help me, I'm going crazy on this code since 2 weeks!!!
;~@sa1 <-- DO NOT REMOVE THIS LINE!
; Kill sprite
; This block will kill cause every one of one specific NON CUSTOM sprite to disapear in a puff of smoke
; when mario touches it. To choose which sprite, just change !spritenum to the sprites number. Currently
; kills regular boos, but you can make it kill whatever you like.
; It doesn't really matter how it acts, just make it act like whatever you place it as.
; No credit necessary
JMP Mario : JMP Mario : JMP Mario : JMP Return : JMP Return : JMP Return : JMP Return
JMP Mario : JMP Mario : JMP Mario
!spritenum = $37 ;The number of the sprite you want to disapear. You can find this on the wiki or in LM
print "This block will kill all of a certain sprite (0x",hex(!spritenum),") that is on screen when the player touch it."
PHX ;Push the X register
LDX #$00 ;innitiate the counter
LDA $3200,x ;Load the sprite numbers of all the sprites on screen (one at a time)
CMP #!spritenum ;\If it's not the one you specified, don't kill it
BNE notkill ;/
LDA #$04 ;\ Make the sprite dissapear in a puff of smoke
STA $3242,x ;/
INX ;Move on to the next slot
CPX #$0C ;\If they haven't all been checked, go back to the beginning
BCC loop ;/
PLX ;Pull the X register from the stack
I want to use a block that, when touched by Mario, ALL Boos on screen will killed; it works correctly on a normal rom, but when I convert the code to install the block on a SA-1 rom, it kills only one Boo!!! And worse still, when it kills the Boo, touching again the block, nothing happens! It's not an emulator problem, I've tested the block with different emulators with SA-1 support! So where's the error? Maybe, the looping method for SA-1 Mod has something different? Please, help!!!