the routine works but only 1 time per frame,i need to use this routine 4 times per frame, for some reason it works the first time that i use it in a frame and the others times it doesn't work.
How can i fix it?
The routine doesn't work. i am doing this:
Code
get_act_like:
LDA $06F624
STA $02
LDA $06F625
STA $03
LDA $06F626
STA $04
REP #$30
LDA $00
AND #$3FFF
ASL
TAY
LDA [$02],y
STA $00
SEP #$30
RTS
DestroyX: db $00,$10,$00,$10
DestroyY: db $00,$00,$F0,$F0
romper:
LDA $7F9F0A ;don't consider this
AND #$01
BNE finRomper
LDY #$03 ;load the number of block for break
romperLoop:
LDA $E4,x ;\
CLC
ADC DestroyX,y
AND #$F0 ;| Update the position
STA $9A ;| of the block
LDA $14E0,x ;| so it doesn't shatter
STA $9B ;| where the players at
LDA $D8,x ;|
CLC
ADC DestroyY,y
AND #$F0 ;|
STA $98 ;|
LDA #$01
STA $99 ;/
PHY
JSR get_act_like ;get the act like of the block
PLY
REP #$20
LDA $00
CMP #$0130 ;if the act like is 130 break the block
BNE next
SEP #$20
LDA #$01
STA $9C
PHY
LDY #$01
JSL $00BEB0
PLY
DEY
BPL romperLoop
finRomper:
RTS
next:
SEP #$20
DEY
BPL romperLoop
RTS
Edit: the routine break the blocks if i remove the lines
Code
PHY
JSR get_act_like ;get the act like of the block
PLY
REP #$20
LDA $00
CMP #$0130 ;if the act like is 130 break the block
BNE next
SEP #$20
------------------------------------------------------
Youtube
Twitter
SMWControlLibX GitHub
My Discord Server
Snestorage where you can download my resources