Views: 794,557,250
15 users online: Ambureon, Bernardo, blgmadresh0000,  Falconpunch, FerpyMcFrosting, Flippn'Fences, GiraffeKiller, Infinity, Jaekelopterus, Mad Lad, mdg32, nintendesi, Ruberjig,  Thomas, Yuzu - Guests: 51 - Bots: 191 Users: 41,470 (1,499 active)
Latest: Tomas SMW
Tip: Verify that your hack's BPS patch is functioning correctly before submitting it.Not logged in.
Help fixing a sprite please?
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - Help fixing a sprite please?
Pages: « 1 »
Hi there. I put together something a bit specific, and knowing how much I suck at ASM it didn't work.
My sprite has the basic function down, but spawns the wrong thing. I inserted it as 00 and it does this when I insert it with the extra byte set to 2. I'll just show you a video of it.

The code:
	dcb "INIT"	;initial code, doesn't do anything
	dcb "MAIN"	;main code
	LDA $14		;run every 256 frames
	LDA $186C,x	;code to spawn turn block at sprite's position
	BNE EndSpawn
	JSL $02A9DE
	BMI EndSpawn
	LDA #$01
	STA $14C8,y
	LDA #53		;spawn turn block
	STA $009E,y
	LDA $E4,x
	STA $00E4,y
	LDA $14E0,x
	STA $14E0,y
	LDA $D8,x
	STA $00D8,y
	LDA $14D4,x
	STA $14D4,y
	JSL $07F7D2
	LDA #$FF	;amount of frames before turn block disappears
	STA $1540,x

The .cfg file:
01 06 33 01 01 24
00 00

So uhh, can someone help me, please? I know somehow I messed up the sprite number because it spawns Yoshis instead of turn blocks. Thanks.

Originally posted by ThePat545
LDA #53

There's your issue. A "#" on its own in ASM refers to a decimal number (so 53 becomes 35 in hex); you want to use "#$", which refers to a hexadecimal number.

Also, the reason the sprite is hitting Yoshi might be because of your last line, STA $1540,x. Because of the way sprite codes work, that's setting the address for the generator, rather than the throw block. Change the ",x" to ",y" instead.

Professional frame-by-frame time wizard. YouTube - Twitter - SMW Glitch List - SMW Randomizer
Originally posted by ThePat545
LDA #$01
STA $14C8,y

Also, don't forget to change #$01 to #$09 since sprite 53 can only be spawned in stunned status.
Thank you both very much! I finally worked it out with your solutions. I also realized I needed to add a label as well. Thanks a lot!
Pages: « 1 »
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - Help fixing a sprite please?

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


Follow Us On

  • YouTube
  • Twitch
  • Twitter


  • SMBX Community
  • MFGG