Banner
Views: 865,152,849
Time:
20 users online: Alex_X8, Anko, anonimzwx, blgmadresh0000, Dark Prince, DesvaroNicky, IcyFruit, Infinity,  JamesD28, juhlyoh, KitikuSa, RaymanFan1995, singlepat, Snessy The Duck, Spy,  Stivi, SuperMarioDs64, Swaguy14256, Y.Y., Yoshioshi5959 - Guests: 41 - Bots: 64 Users: 47,907 (2,072 active)
Latest: DesvaroNicky
Tip: If you use custom music, make sure your ROM has been expanded to at least 1MB.Not logged in.
Generating a sprite from the L/R Hook patch
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - Generating a sprite from the L/R Hook patch
Pages: « 1 » Link
Is there a way to do this without crashing the game? I tried adapting some code from a shooter and it just turns the screen black...

EDIT: wait what? how is this my first post?

--------------------
Yes, it's possible.

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

Then some example code would be nice ^^;

--------------------
Originally posted by Ixtab
Yes, it's possible.


Don't make useless posts if you're not going to attempt to help.

JVyrn: I have some code (made by Ersanio I believe) which seems to generate a sprite just fine upon the death of another one. I can't guarantee it will work with the patch, but you can give it a shot anyway.

Code
GENERATION		JSL $02A9DE		; \ get an index to an unused sprite slot, return if all slots full
			BMI RETURN		; / after: Y has index of sprite being generated

			LDA #$2D		; \ sound effect
			STA $1DFC		; /

			LDA #$08		; \ set sprite status for new sprite
			STA $14C8,y		; /
			LDA #$1D		; \ set sprite number for new sprite
			STA $009E,y		; /

			LDA $E4,x		; \ set x position for new sprite
			STA $00E4,y		;  |
			LDA $14E0,x		;  |Xpos is the same as the muncher's
			STA $14E0,y		; /

			LDA $D8,x		; \ set y position for new sprite
			SEC			;  |
			SBC #$0F		;  |
			STA $00D8,y		;  |16 pixels above the munchers
			LDA $14D4,x		;  |
			SBC #$00		;  |
			STA $14D4,y		; /

			PHX                     ; \ before: X must have index of sprite being generated
			TYX                     ;  | routine clears *all* old sprite values...
			JSL $07F7D2             ;  | ...and loads in new values for the 6 main sprite tables
			PLX                     ; /

RETURN              RTS                     ; return
Pages: « 1 » Link
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - Generating a sprite from the L/R Hook patch

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

Copyright © 2005 - 2020 - 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