39 users online: 7 up, Aeon, AnasMario130, Arcten, ASSATAKKU, Darolac,  Deeke, Dippy, Dispace, DJLocks, edgar, ExONightZ, IAMADINOSAUR, JonnyManjiro,  KevinM, Koop the Koopa, lukeshroomsen2905, Matheus2653, Mirann, Mr Scotsman, Nirv, pat94plus, PokerFace, Rilla Roo, S.U, SF - The Dark Warrior, Slash Chen, smw_andz, Sparkysie, StackDino,  Tahixham,  Telinc1, TheMorganah, Thiago678, TomatoPhalanges, Uhrix,  xHF01x, Yoshin, Zidan3 - Guests: 61 - Bots: 77 Users: 45,750 (3,367 active)
Latest user: kivylama
Not logged in.
How do I make blocks constantly run a code?
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - How do I make blocks constantly run a code?
Pages: « 1 »
Hello, I'm working on a boss fight and I thought it'd just be easier to make a bunch of blocks that run a code to replace the next block on the side of them rather than code a whole new sprite that moves left to right. (To be honest I'm not too worried about space).

The thing I didn't think about is that blocks only run code when Mario's on the side, on top, below, etc. you know all the JMPs.

Is there some sort of code that lets the block run code constantly or am I just gonna have to stick with a sprite?
no, blocks only ever run when triggered.
That's what sprites (or uberASM) are for

--------------------
Anime statistic on MyAnimeList:
400 animes completed ✓
6000 episodes completed ✓
100 Days completed ✓
... what even am I doing with my life?
Aww dang, I better get to learning how to use uberASM then. :P
Thanks a lot!
Originally posted by JackTheSpades
no, blocks only ever run when triggered.
That's what sprites (or uberASM) are for



Thats not entirely true... Of course you should never actually do what I am about to post but its totally viable.

Code
steal_game_loop:
	rep #$10
	lda #$5C
	sta $0111
	ldx #evil
	stx $0112
	lda #evil>>16
	sta $0114
	ldx #$0111
	stx $01FE
	sep #$10
	rtl

evil:
	lda $10	
	beq game_loop
	cli
	inc $13
	phk
	pea.w .return-1
	pea.w $0084CF-1
	jml $009322
	.return
	jsr mycode
	stz $10
	lda !some_flag
	bne +
		jml $00806B
	+
	bra evil

my_code:
	;youcode here
	rts



DON'T actually use this, its an untested proof of concept just for the amusement. You're going to be far better off with uberASM or a sprite -- trust me.
Pages: « 1 »
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - How do I make blocks constantly run a code?