Language…
10 users online: Darolac, howardadam1126, isaix, lean4, Maw, obiet,  Segment1Zone2, Shiki_Makiro, SpacePea, underway - Guests: 268 - Bots: 351
Users: 64,795 (2,377 active)
Latest user: mathew

How can I know the Act Like setting of a block?

I know that with the ram directions $98, $99, $9A and $9C I can destroy a block but I would like to idenfity the Act Like setting of that block to tell if it's solid. How can I know this in ASM? Which ram adresses should I use to know this? What I need is that a sprite I'm making only breaks blocks that are solid (act like 130). Thanks in advance.

------------------------------------------------------

Youtube
Twitter
SMWControlLibX GitHub
My Discord Server
Snestorage where you can download my resources
Code
; $00 = map16 tile
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

GitHub - Twitter - YouTube - SnesLab Discord
just don't edit. They just read the pointer that LM stores in ROM.
GitHub - Twitter - YouTube - SnesLab Discord
yeah, get the map16 number using those RAM and run this routine. I don't know how to get the map16 number from it though.
GitHub - Twitter - YouTube - SnesLab Discord
Originally posted by Vitor Vilela
Code
; $00 = map16 tile
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

Slightly more optimized (aka smaller, faster, or both; both in this case):
Code
; $00 = map16 tile
get_act_like:
	LDA $06F624
	STA $02
	REP #$30
	LDA $06F625
	STA $03
	
	LDA $00
	AND #$3FFF
	ASL
	TAY
	LDA [$02],y
	STA $00
	SEP #$30
	RTS

(LM loops until acts like is 01FF or lower, but I guess we don't want that here.)
<blm> zsnes users are the flatearthers of emulation
Yeah, but it's better if you go back into 8-bit mode before branching:

Code
	REP #$20	; #$30 works too but we just need A anyway
	LDA $00
	CMP #$0130
	SEP #$20
	BEQ blah

	*etc*

blah:
	*etc*
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