Banner
Views: 794,822,539
Time:
7 users online: Bak Sangwoo, CapitanFrio09, faloppa,  KevinM, mdg32, Nint3ndoleggend, patcdr - Guests: 26 - Bots: 164 Users: 41,483 (1,492 active)
Latest: GBSDYP
Tip: Try running your hack on various SNES emulators to see if anything is incompatible. 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?

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

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


Total queries: 7

Menu

Follow Us On

  • YouTube
  • Twitch
  • Twitter

Affiliates

  • SMBX Community
  • ROMhacking.net
  • MFGG