Banner
The Overworld Design Contest ends in
10 DAYS, 10 HOURS, 47 MINUTES AND 5 SECONDS
Views: 904,739,429
Time:
13 users online: BlueToad,  brickblock369, Coockie1173, druu, Ezel, Infinity,  KevinM, Kinkerton, KlonoA13Phill, LouisDoucet,  shovda, Thaipirate,  xHF01x - Guests: 50 - Bots: 77 Users: 50,721 (2,094 active)
Latest: S1eep
Tip: Try playing around with the Horizontal Level Settings in Lunar Magic. You can create some uniquely-designed levels unlike anything seen in the original Super Mario World.
Not logged in.
How can I know the Act Like setting of a block?
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - How can I know the Act Like setting of a block?
Pages: « 1 » Link
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
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
what do $06F624,$06F625 and $06F626?
------------------------------------------------------

Youtube
Twitter
SMWControlLibX GitHub
My Discord Server
just don't edit. They just read the pointer that LM stores in ROM.

--------------------
GitHub - Twitter - YouTube - SnesLab Discord
okz, the position of the block must be in $98, $99, $9A , $9B?
------------------------------------------------------

Youtube
Twitter
SMWControlLibX GitHub
My Discord Server
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
thanks vitor =).
------------------------------------------------------

Youtube
Twitter
SMWControlLibX GitHub
My Discord Server
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
for compare the $00 i must use REP #$30 and SEP #$30?

ex:

REP #$30
LDA $00
CMP #$130
BEQ label

SEP #$30
;Something
RTS

label:
SEP #$30
;other Something
RTS

???
------------------------------------------------------

Youtube
Twitter
SMWControlLibX GitHub
My Discord Server
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*
thanks to all =).
------------------------------------------------------

Youtube
Twitter
SMWControlLibX GitHub
My Discord Server
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
Pages: « 1 » Link
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - How can I know the Act Like setting of a block?

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.

Copyright © 2005 - 2021 - SMW Central
Legal Information - Privacy Policy - Link To Us


Menu

Follow Us On

  • YouTube
  • Twitch
  • Twitter

Affiliates

  • Super Mario Bros. X Community
  • ROMhacking.net
  • Mario Fan Games Galaxy
  • sm64romhacks